[OpenSIPS-Users] replace_all not working on CANCEL messages

Stian Øvrevåge sovrevage at gmail.com
Sat Feb 16 15:24:33 CET 2013


Hi list,

Our upstream SIP provider recently started sending a new field that
makes our UAs ignore most SIP packets. To mediate this I added a
replace_all to remove this field:

replace_all(";phone-context=national", "");

I have moved this to the top of my main route{} block to be as wide as
possible while troubleshooting.

It works great for INVITEs:

Incomming request from upstream:
Request-URI: sip:UserB;phone-context=national at knett.no;user=phone
From: <sip:UserA;phone-context=national at knett.no;user=phone>;tag=8322
To: <sip:UserB;phone-context=national at knett.no;user=phone>

Message routed to UA:
Request-URI: sip:UserB at u.a.i.p:5060
From: <sip:UserA at knett.no;user=phone>;tag=8322
To: <sip:UserB at knett.no;user=phone>

And all is good.

However, if a CANCEL message is either relayed from upstream or
generated in OpenSIPS, the fields are still present, causing the UA to
not recognize the dialog and continue ringing.

Request-URI: sip:UserB;phone-context=national at knett.no;user=phone
From: <sip:UserA;phone-context=national at knett.no;user=phone>;tag=8322
To: <sip:UserB;phone-context=national at knett.no;user=phone>

Request-URI: sip:UserB at u.a.i.p:5060
From: <sip:UserA;phone-context=national at knett.no;user=phone>;tag=8322
To: <sip:UserB;phone-context=national at knett.no;user=phone>

I have also added the replace_all to onreply_route[2]{} and failure_route[1]{}.

In my main block I have a section for CANCEL processing, I started by
adding the replacement there and writing to the log $hdr(From) etc.
But no matter what I did it logged the original values.

How do I fix my CANCEL messages?

And what would be the correct way to log the value of some fields in
an outgoing packet after modification?

Using opensips 1.8.0-notls (x86_64/linux).

Brgds,
Stian Øvrevåge



More information about the Users mailing list