[OpenSER-Users] appending into Via header

Jayesh Nambiar voip_freak at yahoo.co.in
Mon Jun 16 15:22:06 CEST 2008


Hi,
Ok this is what I am planning to do.
I am using Cisco 5350 as SBC after my Openser proxy to relay calls. In cisco there is a good option of matching carrier-ids and relay calls to appropriate carriers.
Cisco looks at the x-route-tag parameter or tsp parameter which is appended to the Via header to match the carrier-id. So basically Cisco searches for it in the Via header.
Thus I need to put this x-route-tag or tsp parameter in the Via header so that Cisco will parse the carrier-id and process calls according to the carrier-id defined.
The x-route-tag= or tsp= values will be fetched from the database which will depend on the called number.
Now I tried the following and it works but it gets messed up somewhere near the rport parameter in the Via header and the return responses goes to improper ports.
subst('/^Via: .*/Via: $(hdr(Via));tsp=1234\r\n/');
The initial INVITE that I get from the UA is similar to the following (i have pasted only the first two lines as the relevant Via headers are present there):
INVITE sip:7050 at 192.168.2.125 SIP/2.0..Via: SIP/2.0/UDP 192.168.2.21:6221;branch=z9hG4bK-d87543-b9072d1e713a491a-1--d87543-;rport..Max-Forwards: 70..Contact: <sip:1234 at 192.168.2.21:6221>..To: <sip:7050 at 192.168.2.125>..
When this INVITE is forwarded to my Cisco it goes as follows:
INVITE sip:7050 at 192.168.2.252 SIP/2.0..Record-Route: <sip:192.168.2.125;lr=on;ftag=cc40082e>..Via: SIP/2.0/UDP 192.168.2.21:6221;branch=z9hG4bK-d87543-b9072d1e713a491a-1--d87543-;rport;tsp=1111..Via: SIP/2.0/UDP 192.168.2.125;branch=z9hG4bKd909.4996e851.0..;rport=6221.Max-Forwards: 69..Contact: <sip:1234 at 192.168.2.21:6221>..To: <sip:7050 at 192.168.2.125>..
Now if you take a look at the rport parameter above it is completely messed up. The rport becomes a new header. 
Can someone help me to overcome this problem.
Thanks in advance.
-- Jayesh


----- Original Message ----
From: Henning Westerholt <henning.westerholt at 1und1.de>
To: Jayesh Nambiar <voip_freak at yahoo.co.in>
Cc: users at lists.openser.org
Sent: Monday, 16 June, 2008 5:38:23 PM
Subject: Re: [OpenSER-Users] appending into Via header

On Monday 16 June 2008, Jayesh Nambiar wrote:
> I do not want it to add two times. I have explained as to where I want to
> add it in the Via header. I dont want to add it twice in the message. I
> know I can easily add a new header but that does not meet my requirement. I
> want it to be appended to the Via header that Openser creates while sending
> the call to the PSTN gateway. To be precise, the format has to be like:
> Via:
> SIP/2.0/UDP 192.168.2.125;branch=z9hG4bK7e7c.877b4352;x-route-tag="cid:1234
>" where 192.168.2..125 is my openser and x-route-tag is what I want to
> append in the Via header. Thanks again for your help.

Hi Jayesh,

i don't know anything about your configuration, so i can't help you that much 
with regards to your requirements, sorry. Please read the documentation for 
the textops module. Perhaps the "subst" function is something you could use? 
Its possible to alter existing header content with it.

Henning



      Bring your gang together. Do your thing. Find your favourite Yahoo! group at http://in.promos.yahoo.com/groups/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20080616/22884106/attachment.htm 


More information about the Users mailing list