Geoff Manning
2005-Jun-07 05:01 UTC
[Asterisk-Users] Call Routing based on number dialed (using S IP)
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@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@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 >
Mirko Marghitola
2005-Jun-07 05:29 UTC
[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@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@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@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
Geoff Manning
2005-Jun-07 09:16 UTC
[Asterisk-Users] Call Routing based on number dialed (using S IP)
> > sipgetheader(or_To=To) > Cut(or_To,or_To,:,2) > Cut(or_To,or_To,@,1)That works! Thanks! Correction to the cut command below, replaced , with = :> sipgetheader(or_To=To) > Cut(or_To=or_To,:,2) > Cut(or_To=or_To,@,1)