<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I have to use local cache to workaround.</div><div><br></div><div><u>In INVITE statement:</u></div><div><span style="font-family:monospace,monospace">$avp(setid) = 1; # group of rtp engine servers / Ex: 1 for FR / 2 for USA<br>if(cache_store("local","$ci","$avp(setid)",1200)) { xlog("L_INFO","$ci -- Cache Store Name: $ci with port: $avp(setid)\n"); </span><br></div><div><br></div><div><u>in CANCEL statement:</u></div><div><span style="font-family:monospace,monospace">if(cache_fetch("local","$ci",$avp(setid)))<br>{<br> xlog("L_INFO","$ci -- Cache fetch Name: $ci with port: $avp(setid)\n");<br> cache_remove("local","$ci");<br>}<br>$avp(setid) = $(avp(setid){<a href="http://s.int">s.int</a>});</span></div><div><br></div><div>And it's not clean but works like a charm.</div><div><br></div><div>@Răzvan if you have an idea about the CANCEL issue with $dlg_val is not populate, I'm interesting ;)</div><div><br></div><div>thanks<br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">Le mar. 20 nov. 2018 à 13:58, Mickael Hubert <<a href="mailto:mickael@winlux.fr">mickael@winlux.fr</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>OK thanks, I will write something about that ;)</div><div><br></div><div>I tested your solution, it works for BYE but not force CANCEL.</div><div>Indeed, for BYE from my SBC enters in loose_route statement, but not for a CANCEL.</div><div><br></div><div>is there a simplest way to choose the good rtpengine ? I want use a group of rtpengine (like id:1) for Europe and other group (like id:2) for USA.</div><div><br></div><div>++<br></div></div></div><br><div class="gmail_quote"><div dir="ltr">Le mar. 20 nov. 2018 à 13:45, Răzvan Crainea <<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No, it only survives until the end of transaction :).<br>
I agree it would be nice to have it persistent throughout the dialog, <br>
but that's not in there yet. But you can always open a feature request <br>
for this :):<br>
<br>
<a href="https://github.com/OpenSIPS/opensips/issues" rel="noreferrer" target="_blank">https://github.com/OpenSIPS/opensips/issues</a><br>
<br>
Best regards,<br>
Răzvan<br>
<br>
On 11/20/18 12:15 PM, Mickael Hubert wrote:<br>
> Hi Răzvan,<br>
> thanks a lot for your answer !<br>
> <br>
> Ok I will try this workaround<br>
> But I don't understand the rtpengine module documentation <br>
> (<a href="http://www.opensips.org/html/docs/modules/2.4.x/rtpengine.html" rel="noreferrer" target="_blank">http://www.opensips.org/html/docs/modules/2.4.x/rtpengine.html</a>)<br>
> <br>
> If I have -> modparam("rtpengine", "setid_avp", "$avp(setid)") and I set <br>
> setid_avp to 1 (for my example) just once, before rtpengine_manage, this <br>
> variable should survives until the end no ?<br>
> <br>
> <br>
> ++<br>
> <br>
> <br>
> <br>
> Le mar. 20 nov. 2018 à 09:43, Răzvan Crainea <<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a> <br>
> <mailto:<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>>> a écrit :<br>
> <br>
> Hi, Mickael!<br>
> <br>
> AVPs are only available during transaction - initial request and its<br>
> replies, but it is not avaialble to sequential requests (such as CANCEL<br>
> or BYE). If you want to store a value throughout the entire dialog, you<br>
> should save the variable in a dialog variable[1], something like this:<br>
> <br>
> # initial INVITE<br>
> $avp(setid) = 1;<br>
> create_dialog();<br>
> $dlg_val(setid) = $avp(setid);<br>
> <br>
> # CANCEL or BYE, *after* loose_route() is called<br>
> # so that the dialog is matched/found<br>
> loose_route();<br>
> $avp(setid) = $dlg_val(setid);<br>
> <br>
> Hope this helps.<br>
> <br>
> [1] <a href="https://opensips.org/html/docs/modules/2.4.x/dialog#pv_dlg_val" rel="noreferrer" target="_blank">https://opensips.org/html/docs/modules/2.4.x/dialog#pv_dlg_val</a><br>
> <br>
> Best regards,<br>
> Răzvan<br>
> <br>
> On 11/19/18 6:01 PM, Mickael Hubert wrote:<br>
> > Hi all,<br>
> > I have a rtpengine with opensips, when I use rtpengine without<br>
> setid_avp<br>
> > all works like a charm<br>
> ><br>
> > modparam("rtpengine", "rtpengine_sock", "udp:<a href="http://10.13.0.129:12221" rel="noreferrer" target="_blank">10.13.0.129:12221</a><br>
> <<a href="http://10.13.0.129:12221" rel="noreferrer" target="_blank">http://10.13.0.129:12221</a>><br>
> > <<a href="http://10.13.0.129:12221" rel="noreferrer" target="_blank">http://10.13.0.129:12221</a>>")<br>
> ><br>
> > _When I want use setid_avp:_<br>
> ><br>
> > modparam("rtpengine", "setid_avp", "$avp(setid)")<br>
> > modparam("rtpengine", "rtpengine_sock", "1 ==<br>
> udp:<a href="http://10.13.0.129:12221" rel="noreferrer" target="_blank">10.13.0.129:12221</a> <<a href="http://10.13.0.129:12221" rel="noreferrer" target="_blank">http://10.13.0.129:12221</a>><br>
> > <<a href="http://10.13.0.129:12221" rel="noreferrer" target="_blank">http://10.13.0.129:12221</a>>")<br>
> ><br>
> > _I call manage function in initial INVITE:_<br>
> ><br>
> > $avp(setid) = 1;<br>
> > create_dialog();<br>
> > xlog("L_INFO","setid: $avp(setid)\n");<br>
> > if(rtpengine_manage("ICE=remove"))<br>
> > {<br>
> > xlog("L_INFO","SDP Offer: $ci for INVITE\n");<br>
> > }<br>
> ><br>
> > for an reply $avp(setid) is populate, and rtpengine works.<br>
> ><br>
> > _but for BYE and CANCEL I have an issue:_<br>
> > _<br>
> > _<br>
> > you can see the setid variable isn't populate for this CANCEL,<br>
> but it is<br>
> > populate for 487 reply !<br>
> > I have this error log: ERROR:rtpengine:select_rtpe_node: script<br>
> error<br>
> > -no valid set selected / ERROR:rtpengine:rtpe_function_call: no<br>
> > available proxies<br>
> ><br>
> > When I force the setid to 1 for BYE and CANCEL, there isn't issue.<br>
> ><br>
> > However, the module documentation explains :<br>
> > /IMPORTANT: if you use multiple sets, take care and use the same<br>
> set for<br>
> > both rtpengine_offer()/rtpengine_answer() and rtpengine_delete()!!<br>
> > /<br>
> > /If the set was selected using setid_avp, the avp needs to be set<br>
> only<br>
> > once before rtpengine_offer() or rtpengine_manage() call. /<br>
> ><br>
> > Can you help me please ?<br>
> ><br>
> > thanks in advance<br>
> ><br>
> > PS: same issue with BYE method<br>
> > __<br>
> ><br>
> > __<br>
> ><br>
> > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:<br>
> ><br>
> ################################################################################<br>
> > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:<br>
> CANCEL END<br>
> > OF CALL : call-id 1def6e7f-66b6-1237-7b9d-0050569229dc<br>
> > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:<br>
> ><br>
> ################################################################################<br>
> > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:<br>
> setid: <null><br>
> > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:<br>
> > *ERROR:rtpengine:select_rtpe_node: script error -no valid set<br>
> selected*<br>
> > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:<br>
> > *ERROR:rtpengine:rtpe_function_call: no available proxies*<br>
> > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:<br>
> > 1def6e7f-66b6-1237-7b9d-0050569229dc In ONREPLY ROUTE 2 - fu :<br>
> > sip:+******@am-isbc1-******** , ru : <null> , si : 10.13.0.80,<br>
> status : 487<br>
> > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:<br>
> setid: 1<br>
> ><br>
> > if (is_method("CANCEL"))<br>
> > {<br>
> ><br>
> ><br>
> xlog("L_INFO","################################################################################<br>
> <br>
> > \n");<br>
> > xlog("L_INFO","CANCEL END OF CALL : call-id $ci \n");<br>
> ><br>
> ><br>
> xlog("L_INFO","################################################################################<br>
> <br>
> > \n");<br>
> > xlog("L_INFO","setid: $avp(setid)\n");<br>
> > if(rtpengine_manage("ICE=remove"))<br>
> > {<br>
> > xlog("L_INFO","SDP Offer: $ci for CANCEL\n");<br>
> > }<br>
> > .............<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Users mailing list<br>
> > <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<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>
> ><br>
> <br>
> -- <br>
> Răzvan Crainea<br>
> OpenSIPS Core Developer<br>
> <a href="http://www.opensips-solutions.com" rel="noreferrer" target="_blank">http://www.opensips-solutions.com</a><br>
> <br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<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>
> <br>
> <br>
> _______________________________________________<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>
> <br>
<br>
-- <br>
Răzvan Crainea<br>
OpenSIPS Core Developer<br>
<a href="http://www.opensips-solutions.com" rel="noreferrer" target="_blank">http://www.opensips-solutions.com</a><br>
<br>
_______________________________________________<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>
</blockquote></div>