Search code examples
sipvoipasteriskasteriskami

asterisk entry point to a SIP dialplan


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:[email protected]

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 a channel
  • 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!!!


Solution

  • 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.