Where to place custom/ tricky extension??

Discussion in 'General' started by voipdog, Dec 5, 2008.

  1. voipdog

    Joined:
    May 2, 2008
    Messages:
    30
    Likes Received:
    0
    All,

    I am converting an "old" plain asterisk installation to Elastix 1.3 stable.

    I have a special [paging] context that I need to work in Elastix. What is does is to record the page and wait till the person is off the phone before playing the page.

    Question: In what file should I place this extension content?

    Question: Do I still have to use the GUI to make the 699 extension?

    Here is the context:

    [paging]
    exten => 699,1,Wait(0.2)
    exten => 699,n,Playback(beep)
    exten => 699,n,Set(PAGE_FILE=/tmp/page-${EPOCH})
    exten => 699,n,Record(${PAGE_FILE}.gsm)
    exten => 699,n,Hangup()

    exten => h,1,System(echo channel: Zap/4 >> ${PAGE_FILE})
    exten => h,n,System(echo MaxRetries: 10 >> ${PAGE_FILE})
    exten => h,n,System(echo RetryTime: 20 >> ${PAGE_FILE})
    exten => h,n,System(echo WaitTime: 0 >> ${PAGE_FILE})
    exten => h,n,System(echo Application: Macro >> ${PAGE_FILE})
    exten => h,n,System(echo Set: page=${PAGE_FILE} >> ${PAGE_FILE})
    exten => h,n,System(echo Data: page >> ${PAGE_FILE})
    exten => h,n,System(chmod 775 ${PAGE_FILE})
    exten => h,n,System(cp -p ${PAGE_FILE} /var/spool/asterisk/outgoing)
    exten => h,n,Hangup()


    Thanks for the help!!

    voipdog
     
  2. Chilling_Silence

    Joined:
    Sep 23, 2008
    Messages:
    488
    Likes Received:
    0
    Hi voipdog,

    Without having terribly much experience in this area myself, I believe you can modify /etc/asterisk/extensions_custom.conf
    Have a look in the extensions.conf and extensions_custom.conf for information on which files FreePBX "controls" and doesnt control.
     
  3. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    Chilling_silence is correct, this would go into the etc/asterisk/extensions_custom.conf file. But, I would suggest NOT putting the extension number in this context - for example, instead of exten => 699,n,Playback(beep) use exten => _.,n,Playback(beep) (change the 699 to _. on all lines). Also change the context name to [custom-paging]. Then in Elastix, go into Unembedded FreePBX, select the Tools tab, and select Custom Destinations. Add a new Custom Destination and in the Custom Destination text box, put this:

    custom-paging,${EXTEN},1

    In the Description, put whatever you like, such as Paging. Submit the changes, go back to the Setup tab, and go to Misc. Applications. Add a new Misc Application, make the description Paging, the feature code should be 699 (or whatever extension you want to use), and the destination should be Custom Applications | Paging (or whatever description you used in the last step). Submit changes, and then click the orange bar when it appears.

    The reason for doing it this way is so that FreePBX properly registers your custom application. Should you then attempt to assign the same extension number to something else, FreePBX will warn you, also it makes it much easier to change the feature code if you ever need to do so. Also, you can make your paging application a destination from the IVR or anyplace else in FreePBX, should you have a need to do that.
     
  4. voipdog

    Joined:
    May 2, 2008
    Messages:
    30
    Likes Received:
    0
    All

    Thanks for the help.

    I will try the setup you suggested old wise owl!!!

    John J. Senay
     

Share This Page