[OpenSIPS-Users] Changing Reply Response Code

mwb mwbazdarich at yahoo.com
Thu Sep 14 14:56:04 EDT 2017


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/946b1d19/attachment.html>


More information about the Users mailing list