<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px"><div id="yui_3_16_0_ym19_1_1505337780799_47730"><font size="2">Hello and thanks in advance for the help.</font></div><div id="yui_3_16_0_ym19_1_1505337780799_47730"><font size="2"><br></font></div><div id="yui_3_16_0_ym19_1_1505337780799_47730" dir="ltr"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47831">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).</font></div><div id="yui_3_16_0_ym19_1_1505337780799_47730" dir="ltr"><font size="2"><br></font></div><div id="yui_3_16_0_ym19_1_1505337780799_47730" dir="ltr"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48018">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).</font></div><div id="yui_3_16_0_ym19_1_1505337780799_47730" dir="ltr"><font size="2"><br></font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47961"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47962">switch($avp(sip_response_code)){</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47964"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47965"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_47966"> </span>case "300":</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47967"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47968"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_47969"> </span>change_reply_status("300","Multiple Choices");</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47970"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47971"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_47972"> </span>break;</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47973"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47974"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_47975"> </span>case "302":</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47976"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47977"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_47978"> </span>change_reply_status("302","Moved Temporarily");</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47979"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47980"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_47981"> </span>break;</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47982"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47983"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_47984"> </span>default:</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47985"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47986"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_47987"> </span>change_reply_status("302","Moved Temporarily");</font></div><div id="yui_3_16_0_ym19_1_1505337780799_47730" dir="ltr"><font size="2"></font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47988"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47989">}</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47991"><font size="2"><br id="yui_3_16_0_ym19_1_1505337780799_47992"></font></div><div id="yui_3_16_0_ym19_1_1505337780799_47730" dir="ltr"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48126">We am receiving the following error message from OpenSIPS when the above is executed:</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47736"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_47735">"ERROR:sipmsgops:change_reply_status_f: the class of provisional or positive final replies cannot be changed"</font><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47736"><font size="2"><br></font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47736"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48185">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:</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48261"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48262">switch($avp(sip_response_code)){</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48264"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48265"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_48266"> </span>case "300":</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48267"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48268"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_48269"> </span>sl_send_reply("300","Multiple Choices");</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48270"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48271"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_48272"> </span>break;</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48273"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48274"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_48275"> </span>case "302":</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48276"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48277"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_48278"> </span>sl_send_reply("302","Moved Temporarily");</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48279"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48280"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_48281"> </span>break;</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48282"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48283"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_48284"> </span>default:</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48285"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48286"><span style="white-space:pre-wrap;" id="yui_3_16_0_ym19_1_1505337780799_48287"> </span>sl_send_reply("302","Moved Temporarily");</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_47736"><font size="2"></font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48288"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48289">}</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48291"><br id="yui_3_16_0_ym19_1_1505337780799_48292"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48291"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48375">This works without issue, I assume because we are generating a fresh reply rather than proxying the reply from the RN/NPDI server.</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48291"><font size="2"><br></font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48291"><font size="2" id="yui_3_16_0_ym19_1_1505337780799_48357">Is there a way to avoid the "the class of provisional or positive final replies cannot be changed" error? </font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48291"><font size="2"><br></font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48291"><font size="2">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?</font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48291"><font size="2"><br></font></div><div dir="ltr" id="yui_3_16_0_ym19_1_1505337780799_48291"><font size="2">thanks!</font></div></div></body></html>