[SR-Users] modify To header, prefix + ip, using dispacher module.

Daniel Tryba daniel at pocos.nl
Wed Feb 12 18:29:53 CET 2014


On Wednesday 12 February 2014 17:37:46 Helena Garcia-Nieto wrote:
> I tried modifying again the TO header with:
> subst_hf("To", "/(.*)@(.*)$/\1@$rd>/", "a")
> 
> before the route(relay) on the failure routine, but it does not work
> properly, I am getting strange TO header like:
> 
> To: <sip:0199XXXX at 10.X.X.39> <sip:XXXXXX at 10.X.X.38>
> 
> It looks like it is not parsing the to header it has before but adding a
> parsed version of the original header at the end of the other one....
> I tried with subst as well but the result is more or less the same.
> 
> Probably there is a better way to set the prefix and the correct IP on the
> to header... I'll appreciate any help with this issue.

How about just using uac_replace_to()?

http://kamailio.org/docs/modules/stable/modules/uac.html#uac.f.uac_replace_to%28display,uri%29

4.4.  uac_replace_to(display,uri)

Replace in TO header the display name and the URI part.

display and URI parameters can include pseudo-variables.

This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE. 

-- 

POCOS B.V. - Croy 9c - 5653 LC Eindhoven
Telefoon: 040 293 8661 - Fax: 040 293 8658
http://www.pocos.nl/   - http://www.sipo.nl/
K.v.K. Eindhoven 17097024



More information about the sr-users mailing list