<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Below is a short config example.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>route {<br>
</span>
<div>...<br>
</div>
<div>setflag(CallFWD);<br>
</div>
<div>rtpengine_manage();  #say the first call attempt need rtpengine<br>
</div>
<div>t_on_failure("handle_failure");<br>
</div>
<div>r_relay();<br>
</div>
<div>...<br>
</div>
<div>}<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>failure_route[handle_failure] {<br>
</div>
<div>...<br>
</div>
<div>if (isflagset(CallFWD)){route(handle_callfwd);}<br>
</div>
<div>...<br>
</div>
<div>}<br>
</div>
<div><br>
</div>
<div>route[handle_callfwd]{<br>
</div>
<div>...<br>
</div>
<div>xlog("L_INFO","RB=$rb(application/sdp)");<br>
</div>
<div>if (t_relay()){<br>
</div>
<div>xlog("L_INFO","Stateful relay done. RB=$rb(application/sdp)");<br>
</div>
<div>}<br>
</div>
<div>...<br>
</div>
<span>}</span><br>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Looks like the t_relay in the handle_callfwd will inherit the SDP info that rtpengine_manage entered in the first attempt.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Also, another interesting fact is that the SDP info is added while the t_relay is called. Looks like the t_relay is using its data in memory and re-write the SDP. the  <span style="font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important">$rb(application/sdp)
 is not changed until the t_relay is called.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
How can I, for example, remove the rtpengine related SDP for the second INVITE generated by the failure_route? </div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
I tried rtpengine_delete() in handle_callfwd or rtpengine_manage() in the failure_route which suppose to do rtpengine_delete also, but they don't work as expected.</div>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks in advance.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
--</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Regards,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
William Jin<br>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Users <users-bounces@lists.opensips.org> on behalf of William Jin <williamj@exetel.com.au><br>
<b>Sent:</b> Tuesday, 9 June 2020 9:09 AM<br>
<b>To:</b> OpenSIPS users mailling list <users@lists.opensips.org><br>
<b>Subject:</b> [OpenSIPS-Users] question about rtpengine_manage() in failure_route</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi All</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
May I know how can I rewrite the SDP (rtpengine) in the failure route?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
The scenario is we use rtpengine_manage() in the first call attempt, if it fails, it uses failure_route, however, we want to change the SDP info.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
For example, the call's first attempt is to an ipv6 UAC, when failed, we try ipv4 UAC. We need to change the rtpengine address-family to IP4 so the c= line can follow with an IPv4 address.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
We tried to use rtpengine_manage("address-family=IP4"), but looks like the SDP still not changed.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Does anyone have any idea about this? Or is there any other way to achieve this?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div id="x_Signature">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
--</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Regards,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
William Jin<br>
</div>
</div>
</div>
</div>
</body>
</html>