[SR-Users] Changing the text of reason header in CANCEL messages

Klaus Feichtinger klaus.lists at inode.at
Thu Dec 16 12:41:36 CET 2010


Hello,

I want to ask if you know any possibility in changing the text of the SIP
reason header in CANCEL requests. Is the limitation still the same as
described in the mail below from May 2010?

For my scenario I have to use the TM module, because incoming requests
from the PSTN gateway are parallelly forked to two destinations. Whenever
the pending call is cancelled by the PSTN gateway the CANCEL request is
still containing a reason header (Q.850;cause=16). But I would like to
adapt the text of this header according RFC3326 (e.g. 'Reason: SIP
;cause=487 ;text="Request Terminated"'). The feature "e2e-cancel-reason"
is working fine - the original text is copied, but no textops function can
make any change.....

Is there any trick possible to change the text of this header before it is
handled by the proxy (e.g. in creating a spirale - change the text and
forward it to the same proxy again)?

Or in worst case if this is currently absolutely impossible - would this
be an acceptable request for a new feature in any upcoming release of
Kamailio 3.1.x? In the release 3.1.x it is still possible to store the
text of an incoming reason header, so I guess it could be no problem in
overwriting this text with any function...... Is anybody else interested
in this feature?

regards,
Klaus

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Am 21.05.2010 09:26, schrieb François BERGANZ:

    When I use forward, it doesnt work!
    I don't know how to do

It works fine for me:

route{

       if (is_method("CANCEL")) {
               if (!is_present_hf("Reason")) {
                       xlog("L_ERR", "reason missing");
                       append_hf("Reason: Q.850; cause=31\r\n");
                       xlog("L_ERR", "Reason added");
               }
               forward();
               exit;
       }




Note: above code snippet only works if the proxy does not do any parallel
forking of the INVITE. It may also be necessary to change the request-URI
to forward the request to the same destination as the INVITE.

in:
U 2010/05/21 10:29:38.372934 83.136.33.3:16534 -> 88.198.53.113:5060
CANCEL sip:01505641... at 83.123.45.165 SIP/2.0

Via: SIP/2.0/UDP
10.10.0.51:16534;branch=z9hG4bK-d8754z-7b591160b17cfc57-1---d8754z-;rport

To: "01505641636"<sip:01505641... at 83.123.45.165>
From: <sip:kl... at 83.123.45.165>;tag=7c681960
Call-ID: MzcxYTgzZmIwMGYyMTA4YzVkN2IzZDhjYjhjYjYwNTk.
CSeq: 2 CANCEL
User-Agent: eyeBeam release 1102q stamp 51814
Content-Length: 0


out:
U 2010/05/21 10:29:38.373331 88.198.53.113:5060 -> 83.123.45.165:5060
CANCEL sip:01505641... at 83.123.45.165 SIP/2.0

Via: SIP/2.0/UDP
88.198.53.113;branch=z9hG4bK-d8754z-7b591160b17cfc57-1---d8754z- Via:
SIP/2.0/UDP
10.10.0.51:16534;received=83.136.33.3;branch=z9hG4bK-d8754z-7b591160b17cfc57-1---d8754z-;rport=16534

To: "01505641636"<sip:01505641... at 83.123.45.165>
From: <sip:kl... at 83.123.45.165>;tag=7c681960
Call-ID: MzcxYTgzZmIwMGYyMTA4YzVkN2IzZDhjYjhjYjYwNTk.
CSeq: 2 CANCEL
User-Agent: eyeBeam release 1102q stamp 51814
Content-Length: 0
Reason: Q.850; cause=31



regards
Klaus






More information about the sr-users mailing list