asterisk entry point to a SIP dialplan
-
28-06-2021 - |
質問
I understand this should be really easy but I can't find my way around the asterisk configuration files to do this.
What I need in an entry point
for a external SIP call
to execute an asterisk script. To keep things simple let's say I want to execute something like this:
[my888app]
exten => 888,1,Answer()
exten => 888,2,SayDigits(1234)
exten => 888,3,Hangup
The user will dial this particular 888 SIP extension in the form:
sip:888@mydomain.com
This is not an internal
call, the call comes from another server, to test I'm using this Phono sample and the call is getting onto the asterisk server ok, the problem is that I have no idea how to route it to my888app
. Already tried /etc/asterisk/sip_general_custom.conf
without luck, guess the problem is the context [my888app] is not right. I already have the asterisk CLI in front of me
So, to recap:
- No DID funny business, just SIP
- In which
.conf
file do I put the[my888appp]
- I dont understand if 888 is an
entension
or achannel
- Multiple calls will be made at the same time to [my888app], is that a problem?
- Right now when I dial from the Phono app I get
please enter the channel number follow by the # sign
, I dont know if that is helpful or not
Thanks!!!
解決
You need check the context attributes in your sip.conf. You can have a context in general section and you can have another in your peer definition, if you dont define any specific context in you peer then the general context attribute is assumed.
For simplicity I advice you change context in general section of sip.conf and put your my888app in extensions.conf.
Example of sip.conf general section:
[general]
context=my888app
...
About 888: it is a extension, an extension is a end point to your call. A channel is a object created dynamically when setting up a call to retain the session information and to exchange data (voice) between two points.
他のヒント
Well, after a lot of searching turns out the routing is as follows (default FreePBX installation):
- The SIP calls goes into a context called
from-sip-external
- from there, it goes to the context
from-trunk
- from there it goes to
from-pstn
- from there it goes to
ext-did-catchall
And there, in ext-did-catchall
, is where I can put my888app
and it will execute ok
I'm 100% positive this is not the correct place to put the app, but as I'm not an Asterisk expert I will settle for it.
Hope this help someone else. Thanks.-
Answer is very simple, Any external call first land on the context which is defined under general section in sip.conf file. There you can define your own dial plan. if you want to redirect to your own context from there then you can use GoSub.