<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">George,<div><br></div><div>I understand. Have you considered begrudgingly adding a lightweight B2BUA such as SEMS in the middle? </div><div><br></div><div>I understand it greatly increases the operational complexity and moving parts of your setup, to say nothing of infrastructural costs. I am all for using Kamailio alone to solve problems that the disinformation/spam of the SBC industry tells us we need a conventional SBC to solve. I gave a presentation at the last Kamailio World[1] whose general tenor was that all one needs is a little Kamailio, and which could be interpreted as a winding, circumlocutory middle finger to the SBC industry. :-)</div><div><br></div><div>But this really does strike me as a valid use-case for an “SBC” type setup as we’ve been made to understand the term — that is, in what Oracle/Metaswitch/Sansay/Sonus/etc would like to have you think of as “the ordinary sense”. </div><div><br></div><div>RTPEngine is minimally invasive and, outside of its mandate to change the media endpoint addresses, is designed for additive capabilities, not to fix problems or maladaptive behaviours. Meanwhile, tweaking the SDP body, despite the existence of extensive technical capability on the part of Kamailio, is not something a proxy should be doing; it’s just not faithful to the endpoints’ tacit assumption that the SDP offer/answer they send is the one being operated upon by the other party. And, as you’ve noted, it is problematic to both tweak the SDP body and press RTPEngine into service simultaneously.</div><div><br></div><div>There may be — in fact, it’s likely — a solution to your most immediate technical problem, though I’m not sure offhand. But for the sake of manageability and conceptual integrity to your voice architecture going forward, I would urge you to reconsider whether this is the best way of doing things overall.</div><div><br></div><div>... unless you’re already well past that point, to which I think your references to the size and complexity of your config allude. :-) In that case, a nihilistic attitude may better suit the dark, ghastly hue of the situation.</div><div><br></div><div>— Alex</div><div><br></div><div>[1] <a href="https://youtu.be/j-0C6eHfocI">https://youtu.be/j-0C6eHfocI</a></div><div><br><div dir="ltr">—<div>Sent from mobile, with due apologies for brevity and errors.</div></div><div dir="ltr"><br><blockquote type="cite">On Jun 1, 2020, at 8:15 AM, George Diamantopoulos <georgediam@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div>Hello Alex,</div><div><br></div><div>Thank you for your reply. Well, I'm interfacing with several PSTN operators, and some of their networks' SIP endpoints (or other obscure IMS entity there) are very picky in that if they don't like the capabilities you serve for telephone-event (which is if they don't match theirs), then the transaction is rejected with "488 SDP Parameter Error In SIP Request" (or if it's a reply I'm sending, they will send a BYE immediately).<br></div><div><br></div><div>Trying to reason with them (the operators) has failed, my SIP UA provides no way to choose these values when the SDP is created (and since it apparently has to match the other side some static configuration wouldn't do much here), so all I'm left with is the option of growing my config file by yet another 50 lines... :-\</div><div><br></div><div>BR,</div><div>George<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 1 Jun 2020 at 14:41, Alex Balashov <<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.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="auto">George,<div><br></div><div>It may be orthogonal to the answer that you seek, but I’m going to ask anyway: what is the overall motive underlying your SDP manipulation?</div><div><br></div><div>It seems to me that one should reason backward from that root cause. The kind of SDP manipulation you are doing is seldom necessary in ordinarily imaginable contexts...</div><div><br></div><div>— Alex<br><br><div dir="ltr">—<div>Sent from mobile, with due apologies for brevity and errors.</div></div><div dir="ltr"><br><blockquote type="cite">On Jun 1, 2020, at 7:35 AM, George Diamantopoulos <<a href="mailto:georgediam@gmail.com" target="_blank">georgediam@gmail.com</a>> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div>Hello all,</div><div><br></div><div>I'm facing one of those cases where I need to edit the body of a SIP message, which is then to be fed to rtpengine for processing. Although I've taken every precaution I've read about on this list and elsewhere, I can't prevent the edited line from appearing twice in the outgoing message.</div><div><br></div><div>The configuration file used is huge, so I'm going to try to provide a high-level overview here. But first, the things (I think) I know to be requirements, and which I have striven to meet:</div><div><ul><li>If SDP is to be edited, then all such processing is to be carried out in such a way in the script, so that msg_apply_changes() is run as many times as needed before rtpengine offer/answer/manage is called.</li><li>rtpengine offer/answer/manage is to be called only once per script iteration</li><li>msg_apply_changes can only be called in a request route, or in the core reply_route (i.e. <b>not</b> in tm-managed on_reply_route[XXX] blocks)</li></ul><div>In my case, additionally the following are true:</div><div><ul><li>SDP processing (other than the one performed by rtpengine) takes place in one common route for all cases where it needs to happen. These are two at the moment in my scenario:<br></li><ul><li>Early in the WITHINDLG route (of the example config file)</li><li>After the sanity checks in the reply_route (of the example config file)</li></ul><li>msg_apply changes() is called once, for each script iteration:</li><ul><li>right before rtpengine_manage() is called, provided that t_is_request_route() returns true (so that I don't accidentally call it from a branch route or anything)</li><ul><li>rtpengine_manage() is called in its own route, which is very similar to the example config file's "NATMANAGE" route. Since NATMANAGE is called in all branch and on_reply_routes, I employ t_is_request_route() here to make sure it won't execute in those cases.</li></ul><li>at the end of the "core" reply_route</li></ul></ul><div>Now regarding the actual config-file-controlled SDP manipulation, it only consists of a single call to replace_body_str(). The purpose is to edit a line in the message body from something like:</div><div><ul><li>a=fmtp:101 0-16</li></ul></div><div>to something along the lines of:</div><div><ul><li>a=fmtp:101 0-15</li></ul><div>For replies, this works as expected.</div><div><br></div><div>For in-dialog requests, however, I end up with both the original and the edited lines:</div><div style="margin-left:40px"><span style="font-family:monospace">a=fmtp:101 0-16 (the original line)<br></span></div><div style="margin-left:40px"><span style="font-family:monospace">... other SDP stuff ...<br></span></div><div style="margin-left:40px"><span style="font-family:monospace">a=fmtp:101 0-15 (the edited line)</span></div><br></div><div>If anyone could point out any misconceptions I have about msg_apply_changes, SDP rewriting from the script and rtp_engine_X() interoperability, I would be more than grateful.</div><div><br></div><div>Thank you in advance and I apologize for the long read.</div><div><br></div><div>Best regards,</div><div>George Diamantopoulos<br></div></div></div></div>
<span>_______________________________________________</span><br><span>Kamailio (SER) - Users Mailing List</span><br><span><a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a></span><br><span><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a></span><br></div></blockquote></div></div>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
<span>_______________________________________________</span><br><span>Kamailio (SER) - Users Mailing List</span><br><span>sr-users@lists.kamailio.org</span><br><span>https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</span><br></div></blockquote></div></body></html>