[OpenSIPS-Users] Changing Reply Response Code

mwb mwbazdarich at yahoo.com
Thu Sep 14 17:20:53 EDT 2017


Sorry, I was not clear, Ben. Yes, the messages are properly being sent with the "chosen" response code. I was just looking to clean up or suppress the error messages since I have been seeing it in the logs. I was also concerned it might cause other issues or that I was going about it in the wrong way. 

    On Thursday, September 14, 2017 2:07 PM, Ben Newlin <Ben.Newlin at genesys.com> wrote:
 

 #yiv8647560959 #yiv8647560959 -- _filtered #yiv8647560959 {panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv8647560959 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv8647560959 {panose-1:2 0 5 3 0 0 0 2 0 4;}#yiv8647560959 #yiv8647560959 p.yiv8647560959MsoNormal, #yiv8647560959 li.yiv8647560959MsoNormal, #yiv8647560959 div.yiv8647560959MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv8647560959 a:link, #yiv8647560959 span.yiv8647560959MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv8647560959 a:visited, #yiv8647560959 span.yiv8647560959MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv8647560959 span.yiv8647560959EmailStyle17 {color:windowtext;}#yiv8647560959 span.yiv8647560959msoIns {text-decoration:underline;color:teal;}#yiv8647560959 .yiv8647560959MsoChpDefault {font-size:10.0pt;} _filtered #yiv8647560959 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv8647560959 div.yiv8647560959WordSection1 {}#yiv8647560959 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/458e2c36/attachment.html>


More information about the Users mailing list