[asterisk-users] Understanding Incoming sip DID handling

Sherwood McGowan sherwood.mcgowan at gmail.com
Mon May 19 15:14:47 CDT 2008


Joseph L. Casale wrote:
>> Yes, in your dialplan you should have one extension set up for the first
>> number and where to send it, and a second for the other.
>>     
>
> So, if the sip.conf config sends the did into the [incoming] context
> and its phone number is 555-1212, would this be the right way:
>
> exten => 5551212,1,`Do Something`   ?
>
> How do I elegantly write something to catch the area code, if the number dialed was
> 1-xxx-555-1212? Or does the incoming number from my sip provider always show up to me
> as an 11 digit number:
>
> exten => 19495551212,1,`Do Something` for example?
>
>   
It depends on how you receive the called number, it should be as either 
a 10 or 11 digit number from your SIP provider. Match accordingly. Most 
probably it's a 10 digit number.

> If that sip account turfed the call into a custom context, [incoming_1] and nothing else
> entered it (the other line went its own, [incoming_2], I suppose I could just write:
>
> exten => s,1,`Do Something` which eliminates this question?
>
> Thanks for all the guidance!
> jlc
>
>   
That's probably the easiest thing to do, catch the number and direct 
each one to their own context. You could direct them with 
Goto(context1,${EXTEN},1) and then do
[context1]
exten => _X.,1,DoSomething

or you could use your idea, Goto(context1,s,1) with the definition as such:
[context1]
exten => s,1,DoSomething

However, I like to keep the extension connected with the number that was 
requested for as long as possible.



More information about the asterisk-users mailing list