[OpenSIPS-Users] Changing Reply Response Code
Ben Newlin
Ben.Newlin at genesys.com
Thu Sep 14 17:07:33 EDT 2017
One thing that was unclear is whether this is currently working and you are just concerned about the error or whether it doesn’t work at all.
I believe it should work and the key to why you are getting errors is in the error message itself:
“provisional or positive final replies”
Are you validating prior to attempting to change the reply status that it is a 302 reply? Most servers will send at least a 100 Trying response and sometimes other responses. When you arm the reply route, all replies will be delivered to it, not just the final reply. Although I’m not sure if that is the case for 100 Trying responses.
At any rate, I would do a trace to see if the server is only returning a 302, or if it is also returning some other provisional or final reply when the errors occur. If so, you should add code to only attempt to change the reply status when it is the expected reply (302).
Ben Newlin
From: Users <users-bounces at lists.opensips.org> on behalf of mwb via Users <users at lists.opensips.org>
Reply-To: mwb <mwbazdarich at yahoo.com>, OpenSIPS users mailling list <users at lists.opensips.org>
Date: Thursday, September 14, 2017 at 3:02 PM
To: "users at lists.opensips.org" <users at lists.opensips.org>
Subject: [OpenSIPS-Users] Changing Reply Response Code
Hello and thanks in advance for the help.
I have an OpenSIPS process that is set up to send routing responses back to a few SBCs we have. When the SBC sends an INVITE w/o RN or NPDI in the RURI, OpenSIPS passes the INVITE along to another server which returns a 302 response with the RN and NPDI information in a contact header. The RN/NPDI info is then incorporated into the response sent back to the SBC. We have a few different SBCs that expect different response codes, some 300 and some 302. (we are adding steering digits into the contact header).
If the SBC expects a 300 and the call comes through without RN/NPDI we use the below code in the "reply" route for the INVITE that OpenSIPS sends to the other server in order to accomodate the 300 (the $avp is filled when the SBC initiating the call is recognized).
switch($avp(sip_response_code)){
case "300":
change_reply_status("300","Multiple Choices");
break;
case "302":
change_reply_status("302","Moved Temporarily");
break;
default:
change_reply_status("302","Moved Temporarily");
}
We am receiving the following error message from OpenSIPS when the above is executed:
"ERROR:sipmsgops:change_reply_status_f: the class of provisional or positive final replies cannot be changed"
If the INVITE we receive from the SBC has the RN/NPDI information in it then we DO NOT need to send the call on to another server and thus, after building our response we can use the following code:
switch($avp(sip_response_code)){
case "300":
sl_send_reply("300","Multiple Choices");
break;
case "302":
sl_send_reply("302","Moved Temporarily");
break;
default:
sl_send_reply("302","Moved Temporarily");
}
This works without issue, I assume because we are generating a fresh reply rather than proxying the reply from the RN/NPDI server.
Is there a way to avoid the "the class of provisional or positive final replies cannot be changed" error?
Are we going about this in the wrong way when we need to send an INVITE to the other server in order to get the RN/NPDI information?
thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170914/0bf6a9e7/attachment-0001.html>
More information about the Users
mailing list