<div dir="ltr">Thank you for your ideas! I considered doing the perl solution but I wondered if there is a more "native" solution to try first. the idea to patch t_reply seems legitimate, but you are right about whether it may need additional changes too, and which leg the reply goes back to in a reply route, does it go to the one who sent 200? I guess that needs to be checked but since my system is under load I am a little hesitant about making big changes, maybe one of Opensips people can comment too....</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 20, 2024 at 10:28 PM mayamatakeshi <<a href="mailto:mayamatakeshi@gmail.com">mayamatakeshi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 20, 2024 at 11:38 PM M S <<a href="mailto:medeanwz@gmail.com" target="_blank">medeanwz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi list,<div>I am having a problem that my upstream provider disconnects the call if my client does not send 180/183 before 200 OK.</div><div>At the time of receiving 200 OK (in reply_route) I can check to see if previously a 180/183 was also sent or not. </div><div>My solution is: as soon as I receive a 200 OK from the client, if 180/183 was not received before, I create a 180 ringing message and send it to upstream, before passing on 200. Now I realized that none of the usual methods (send_reply, sl_send_reply, t_send_reply) work from reply_route, and I have no idea how to use dlg_send_sequential to send a "180 ringing".</div><div>Any ideas would be appreciated.</div><div><br></div></div></blockquote><div><br></div><div>dlg_send_sequential would not work as it is used to generate a request.</div><div><br></div><div>I think opensips should allow t_reply to work from within ONREPLY_ROUTE. </div><div>Currently it, doesn't:</div><div><br></div><div>opensips tm.c:<br>    {"t_reply", (cmd_function)w_pv_t_reply, {<br>        {CMD_PARAM_INT, fixup_reply_code, 0},<br>        {CMD_PARAM_STR, 0, 0}, {0,0,0}},<br>        REQUEST_ROUTE | FAILURE_ROUTE},<br></div><div><br></div><div>But kamailio which, as opensips, inherited the tm foundation from openser allows it:</div>    {"t_reply", w_t_reply, 2, fixup_t_reply, 0,<br>            REQUEST_ROUTE | ONREPLY_ROUTE | FAILURE_ROUTE},</div><div class="gmail_quote"><br></div><div class="gmail_quote">So you could try patching opensips t_reply by adding the ONREPLY_ROUTE flag till this is allowed in opensips (I'm not sure if it will work as extra changes in code might be needed).</div><div class="gmail_quote"><br></div><div class="gmail_quote">Alternatively, you could call a function in a perl/lua/python module to change the "200 OK" with "180 Ringing", remove the top Via Header (beware that the Via headers might be coalesced into a single one), remove the body and use a raw socket to send the packet:</div><div class="gmail_quote">(ref: <a href="https://opensips.org/html/docs/modules/3.5.x/perl.html#func_perl_exec" target="_blank">https://opensips.org/html/docs/modules/3.5.x/perl.html#func_perl_exec</a>)</div><div class="gmail_quote"><br></div><div class="gmail_quote">Obs: I assume the language module inherits the limitations from the route it is being executed on, so I would not expect:</div><div class="gmail_quote">  $m->sl_send_reply("180", "Trying");</div><div class="gmail_quote">to work, but you could try to see what happens.</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>