[Asterisk-Users] Call Routing based on number dialed (using S IP)

Joshua Colp joshnet at nbnet.nb.ca
Tue Jun 7 19:16:42 MST 2005


The thing with this is what he said: "forward to ONE Voip telephone number
by the telco". Asterisk will not know which number was dialed, because to it
- it's just another call going to that single telephone number... Just call
forwarding! NOW in an extreme case depending on the hardware and agreements,
you could get the original number that was dialed sent as another SIP header
along with other information... But that's likely not going to happen.

- Joshua Colp.
(file in #asterisk on Freenode) 

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Mirko
Marghitola
Sent: Tuesday, June 07, 2005 9:30 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] Call Routing based on number dialed (using S
IP)

Geoff Manning wrote:

>Is this even possible or am I better off getting a voip number for each 
>of the existing numbers I want to forward.
>
>Thanks!
>
>  
>
>>-----Original Message-----
>>From: Geoff Manning [mailto:gmanning at zoom.com]
>>Sent: Friday, June 03, 2005 4:53 PM
>>To: Asterisk Users (E-mail)
>>Subject: [Asterisk-Users] Call Routing based on number dialed (using
>>SIP)
>>
>>
>>Is it possible to route calls based on the number called when the 
>>inbound call is SIP based?
>>
>>Here is what we are trying to do:
>>
>>1) Someone dials one of the companies 5 long standing, published phone 
>>numbers which have been forwarded to ONE Voip telephone number by the 
>>telco.
>>
>>2) The SER server where that Voip number terminates is passing it to 
>>our Asterisk server
>>
>>3) Is there a way to determine what the original number dialed was?
>>
>>We want to avoid needing a Voip number for every forwarded number.
>>
>>
>>Thanks in advance.
>>_______________________________________________
>>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
>
>
>  
>
You can use the sipgetheader() application. If you pass a call to asterisk,
the field "To" in the SIP header stay as originally dialed. 
So, with

sipgetheader(or_To=To)
Cut(or_To,or_To,:,2)
Cut(or_To,or_To,@,1)

in your dialplan, you can get the original dialed number.

with the cut function you can cut the "sip:" and the "@domain.asd" 
substrings.

 Mirko

_______________________________________________
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