Question : Custom Context not working, How to setup

Hi,

I have an asterisk server with a PRI connected, I also have a SIP GSM gateway attached - everything is working great.
I have a quick question about a context im trying to fix.

My setup

Centos 5.2
Frepbx - 2.5.2.2
Asterisk - Asterisk 1.4.21.2
Zaptel - 1.4.12.1
Libpri - 1.4.10
Addons - 1.4.7

Ok so the problem is when I make a change in Freepbx and reload it removes these two custom lines from-zaptel context in extensions_additional.conf

exten=> _X.,1,Dial(SIP/MY Sip Trunk Name/${EXTEN})
exten=> _X.,2,hangup

So i changed it to

[from-zaptel]
#include extensions_custom.conf
include => from-zaptel-custom

and in extensions_custom.conf I added a new context from-zaptel-custom

[from-zaptel-custom]
exten=> _X.,1,Dial(SIP/My SIP Provider/${EXTEN})
exten=> _X.,2,hangup

but this doesnt seem to work, it bypasses the include => from-zaptel-custom
Is there anyway to force it to use the from-zaptel-custom context.

Thanks, Joe

Answer : Custom Context not working, How to setup

You should not manually edit the extensions_additional.conf file, only extensions_custom.conf:
http://www.freepbx.org/configuration_files

You may find this article useful, although it is more relevant to creating custom dialplans for numbers dialled on extensions than for calls arriving on a trunk:
http://mbrevda.blogspot.com/2008/10/miscellaneouscustom-applicationextensio.html
http://mbrevda.blogspot.com/2008/10/miscellaneouscustom-applicationextensio_16.html

What are you trying to do? It looks like you want every call arriving on the PRI to be sent out immediately on the SIP trunk - i.e. a simple gateway. Is that correct.

The simplest solution might be to edit zapata.conf (or chan_dahdi.conf if using Dahdi) and change the context= parameter so it sends calls to a custom context. For example:
  context=fromzap-tosip

Then you can add this custom context to extensions_custom.conf:
  [fromzap-tosip]
  exten=> _X.,1,Dial(SIP/My SIP Provider/${EXTEN})
  exten=> _X.,2,hangup

This way you are completely bypassing the built-in context called "from-zaptel" (the one defined in extensions_additional.conf) and just using your custom one which is defined in extensions_custom.conf. This method of custom handling has the added advantage that you can send the call back to the original context for default handling if you want to, simply using Goto(from-zaptel,,p>).
Random Solutions  
 
programming4us programming4us