[cisco-voip] SIP: route incoming INVITE on To header?

Sinisa Djokic sdjokic at mds.rs
Tue Mar 22 16:01:55 EDT 2011


hi mark..

 

actually, i still think tcl script is the best way to do it at this moment..and it definetely works like a charm..

:-)..

although, i’m rather sad that i was forced to do such a thing since now i need to perform any kind of digit manipulation in tcl ( you’ll find why after you start to play with it - :-) )..

as much as i like tcl and it’s power, i’m not feeling happy to do any kind of “programming” for basic-call-flow to work..

:-)..

i hope cisco would implement feature in IOS so we could route based on TO header ( although RFC defines based on request-uri ) so we could easily integrate with non-RFC providers..

anyway, sip profiles are fine, maybe you can even do something with them as wes suggested..

but the fact is that sip profiles are functioning only in outgoing direction..

so, since i need this kind of setup for SRST or CME scenarios, it doesn’t do the trick for me..that’s the reason i didn’t even try that..

 

here’s one version of the script..doing basic stuff..you could adopt it and make all kind of digit manipulation..so, you should apply the service associated with this tcl script to your incoming sip dial-peer..

 

************************************

 

proc setup { } {

leg proceeding leg_incoming

set To [infotag get leg_proto_headers "To"]

set somevariablename $To

regexp {sip:([0-9]+)@} $To w somevariablename

leg setup $ somevariablename callInfo leg_incoming

}

 

 

proc setup_done { } {

#

#       Handle SETUP DONE.

#

}

 

 

proc cleanup { } {

   call close

}

 

 

requiredversion 2.0

 

 

#----------------------------------

# State Machine

#----------------------------------

 

set fsm(any_state,ev_disconnected) "cleanup same_state"

set fsm(CALL_INIT,ev_setup_indication) "setup GETDEST"

set fsm(GETDEST,ev_setup_done) "setup_done CALLACTIVE"

set fsm(CALLACTIVE,ev_disconnected) "cleanup CALLDISCONNECT"

set fsm(CALLDISCONNECT,ev_disconnected) "cleanup same_state"

set fsm(CALLDISCONNECT,ev_disconnect_done) "cleanup same_state"

 

fsm define fsm CALL_INIT

 

*****************************************

 

regards.. 

 

Sinisa Djokic 

System Engineer

CCIE #25996 Voice

 

  

MDS Informaticki inzenjering

Bul. Milutina Milankovica 7d

11070 Novi Beograd, Serbia

Tel:  +381 11 2015 200  +381 11 2015 200 , 2015 273

Fax: +381 11 3194 954

www.mds.rs

sdjokic at mds.rs

Please kindly consider the environment before printing this e-mail and any attachments

Ova e-mail poruka i bilo koji njeni dodaci namenjeni su isključivo imenovanom primaocu. Može sadržati poverljive informacije koje mogu biti zaštićene čuvanjem poslovne tajne. Ukoliko niste imenovani primaoc (ili ovlašćeni u ime primaoca), ne smete kopirati ili koristiti ovu poruku ili bilo koji dodatak poruci te otkriti sadržaj poruke bilo kome drugome. U slučaju da Vam je ovaj e-mail poslan greškom, molimo da odmah obavestite pošiljaoca i izbrišete ovaj e-mail. 

This e-mail message and any attachment are intended exclusively for the named addressee. They may contain confidential information which may also be protected by professional secrecy. Unless you are the named addressee (or authorised to receive for the addressee) you may not copy or use this message or any attachment or disclose the contents to anyone else. If this e-mail was sent to you by mistake please notify the sender immediately and delete this e-mail.

 

-----Original Message-----
From: Mark Holloway [mailto:mh at markholloway.com] 
Sent: Tuesday, March 22, 2011 6:48 PM
To: Wes Sisk
Cc: Sinisa Djokic; 'Cisco VOIP'
Subject: Re: [cisco-voip] SIP: route incoming INVITE on To header?

 

 

Unfortunately I can't find a way to extract the information from the To header and add it to the Request URI.  It looks like SIP Profiles allows you to add or modify an existing header, but I do not see a way to use a variable of one header to assign to another.   

 

On Mar 21, 2011, at 12:03 PM, Wes Sisk wrote:

 

> Would SIP normalization also work for this?

> http://www.cisco.com/en/US/products/sw/voicesw/ps5640/products_configuration_example09186a0080982499.shtml

> 

> Regards,

> Wes

> 

> On 3/21/2011 1:23 PM, Sinisa Djokic wrote:

>> yup..

>> 

>> you could use tcl script on incoming dial-peer to pull content of TO header and based on that create an outgoing call leg to whatever you need ( CUCM or something else )..

>> 

>> 

>> regards..

>> 

>> Sinisa Djokic

>> System Engineer

>> CCIE #25996 Voice

>> 

>> 

>> 

>> MDS Informaticki inzenjering

>> Bul. Milutina Milankovica 7d

>> 11070 Novi Beograd, Serbia

>> Tel:  +381 11 2015 200  +381 11 2015 200 , 2015 273

>> Fax: +381 11 3194 954

>> www.mds.rs

>> sdjokic at mds.rs

>> Please kindly consider the environment before printing this e-mail and any attachments

>> Ova e-mail poruka i bilo koji njeni dodaci namenjeni su isključivo imenovanom primaocu. Može sadržati poverljive informacije koje mogu biti zaštićene čuvanjem poslovne tajne. Ukoliko niste imenovani primaoc (ili ovlašćeni u ime primaoca), ne smete kopirati ili koristiti ovu poruku ili bilo koji dodatak poruci te otkriti sadržaj poruke bilo kome drugome. U slučaju da Vam je ovaj e-mail poslan greškom, molimo da odmah obavestite pošiljaoca i izbrišete ovaj e-mail.

>> This e-mail message and any attachment are intended exclusively for the named addressee. They may contain confidential information which may also be protected by professional secrecy. Unless you are the named addressee (or authorised to receive for the addressee) you may not copy or use this message or any attachment or disclose the contents to anyone else. If this e-mail was sent to you by mistake please notify the sender immediately and delete this e-mail.

>> 

>> 

>> -----Original Message-----

>> From: cisco-voip-bounces at puck.nether.net [mailto:cisco-voip-bounces at puck.nether.net] On Behalf Of Mark Holloway

>> Sent: Monday, March 21, 2011 6:04 PM

>> To: Cisco VOIP

>> Subject: [cisco-voip] SIP: route incoming INVITE on To header?

>> 

>> 

>> I've got CUBE registered via a SIP Trunk to a SIP registrar.  When a call (INVITE) comes from the SIP registrar towards CUBE, the request URI from the registrar is the main trunking number which is different than the number in the To header.   For example, if my main Pilot number is 4805551000 (same number used in sip-ua credentials and authentication) but CUCM's DN block is 4805551000 - 1099, and a call comes in from the registrar destined for 4805551009, the INVITE request-uri from the registrar contain 4805551000 but the To header contains 4805551009.  Is there a way to force CUBE to route incoming INVITES based on the To header instead of the request-uri?  Normally on the Service Provider side the SBC would re-write to request-uri to match the To header (for sip connect) but in my case I don't have an SBC in the network.

>> 

>> 

>> _______________________________________________

>> cisco-voip mailing list

>> cisco-voip at puck.nether.net

>> https://puck.nether.net/mailman/listinfo/cisco-voip

>> 

>> 

>> 

>> _______________________________________________

>> cisco-voip mailing list

>> cisco-voip at puck.nether.net

>> https://puck.nether.net/mailman/listinfo/cisco-voip

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20110322/12b4384e/attachment.html>


More information about the cisco-voip mailing list