[Asterisk-Users] sip.conf match

Tim Pushor timp at crossthread.com
Thu Mar 31 14:33:22 MST 2005


FWIW My ITSP sends all calls to *any* of my numbers to the extention of 
the first registered one.

So even though I have:

register => xxxxxxxxxx:pass at my.itsp.com/exten1
register => yyyyyyyyyy:pass at my.itsp.com/exten2
register => zzzzzzzzzz:pass at my.itsp.com/exten3

calls to any of the numbers go to exten1.

I checked (with ethereal) and saw that I was getting the numbers in the 
sip to header, so I setup a context just for these calls, and did 
something like :

exten => in,1,SIPGetHeader(sip-to=To)
exten => in,2,NoOp,${sip-to}
exten => in,3,NoOp
exten => in,4,NoOp,${sip-to:5:10}
exten => in,5,gotoIf($[${sip-to:5:10} = xxxxxxxxxx]?10)
exten => in,6,gotoIf($[${sip-to:5:10} = yyyyyyyyyy]?11)
exten => in,7,gotoIf($[${sip-to:5:10} = xxxxxxxxxx]?12)
exten => in,8,AGI(festival-script.pl|i am confused)
exten => in,9,Hangup

exten => in,10,Goto(context3,s,1)
exten => in,11,Goto(context3,s,1)
exten => in,12,Goto(context3,s,1);


Register MF Hulber wrote:

>
> The way it works with my provider is that although both numbers enter 
> the same context, each number will match its own extension.  If I have 
> two numbers: 1111111111 and 2222222222 it works as follows:
>
> [sip-in]
>
> exten => 1111111111,1,Noop(First number dialed)
>
> exten => 2222222222,1,Noop(Second number dialed)
>
> ---------------
>
> MARK.
>
> Pepe Aracil wrote:
>
>> Hello.
>>
>> I have two hired pstn numbers with the same voip provider. I want to 
>> distingish in the sip.conf file, what of two phone numbers was 
>> dialed, but i don't know how to do the match, because the sip client 
>> and the sip host are the same for both numbers.
>> How can i match in sip.conf by the (TO: ) header in sip negotiation?
>>
>> Sorry for my poor english :)
>>
>> Thanks.
>>
>> _______________________________________________
>> Asterisk-Users mailing list
>> Asterisk-Users at lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>  
>>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users





More information about the asterisk-users mailing list