[SR-Users] Changing METHOD
Andreas Granig
agranig at sipwise.com
Wed Dec 19 19:20:33 CET 2012
Hi Olle,
On 12/19/2012 02:43 PM, Olle E. Johansson wrote:
> Yeah, I already have Kamailio sending all kinds of crazy stuff while
> testing a new platform,
> using the UAC module. But I wanted to be lazy and change on the fly...
>
> Evil stuff happening here. Kamailio is a good test-tool.
>
> Now I fail to change Contact: headers. The docs for textops say that
> remove_hf can remove
> contact and Remove_hf(Contact) returns true - but the old contact is
> still there!
You could try using msg_apply_changes() from
http://kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.msg_apply_changes
after remove_hf and before actually building your new request with
$uac_req, but this is really dangerous.
One thing I know for sure is that you better not call record_route()
anywhere before msg_apply_changes(), as record_route() only adds a hint
to the message and the value is filled in once the sending socket is
known (manually setting $fs doesn't seem to help). If you call
msg_apply_changes() after record_route(), you'll get errors and will end
up with a broken Record-Route header.
Hope this helps,
Andreas
More information about the sr-users
mailing list