rtpengine (setid_avp) issue with BYE and CANCEL

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

rtpengine (setid_avp) issue with BYE and CANCEL

Mickael HUBERT
Hi all,
I have a rtpengine with opensips, when I use rtpengine without setid_avp all works like a charm

modparam("rtpengine", "rtpengine_sock", "udp:10.13.0.129:12221")

When I want use setid_avp:

modparam("rtpengine", "setid_avp", "$avp(setid)")
modparam("rtpengine", "rtpengine_sock", "1 == udp:10.13.0.129:12221")

I call manage function in initial INVITE:

$avp(setid) =  1;
create_dialog();
xlog("L_INFO","setid: $avp(setid)\n");
if(rtpengine_manage("ICE=remove"))
{
  xlog("L_INFO","SDP Offer: $ci for INVITE\n");

}

for an reply $avp(setid) is populate, and rtpengine works.

but for BYE and CANCEL I have an issue:

you can see the setid variable isn't populate for this CANCEL, but it is populate for 487 reply !
I have this error log: ERROR:rtpengine:select_rtpe_node: script error -no valid set selected / ERROR:rtpengine:rtpe_function_call: no available proxies

When I force the setid to 1 for BYE and CANCEL, there isn't issue.

However, the module documentation explains :
IMPORTANT: if you use multiple sets, take care and use the same set for both rtpengine_offer()/rtpengine_answer() and rtpengine_delete()!!
If the set was selected using setid_avp, the avp needs to be set only once before rtpengine_offer() or rtpengine_manage() call.

Can you help me please ?

thanks in advance

PS: same issue with BYE method


Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: ################################################################################
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: CANCEL END OF CALL : call-id 1def6e7f-66b6-1237-7b9d-0050569229dc
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: ################################################################################
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: setid: <null>
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: ERROR:rtpengine:select_rtpe_node: script error -no valid set selected
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: ERROR:rtpengine:rtpe_function_call: no available proxies
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]: 1def6e7f-66b6-1237-7b9d-0050569229dc In ONREPLY ROUTE 2 - fu : sip:+******@am-isbc1-******** , ru : <null> , si : 10.13.0.80, status : 487
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]: setid: 1

if (is_method("CANCEL"))
  {
    xlog("L_INFO","################################################################################ \n");
    xlog("L_INFO","CANCEL END OF CALL : call-id $ci \n");
    xlog("L_INFO","################################################################################ \n");
    xlog("L_INFO","setid: $avp(setid)\n");
    if(rtpengine_manage("ICE=remove"))
    {
      xlog("L_INFO","SDP Offer: $ci for CANCEL\n");
    }
.............






_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rtpengine (setid_avp) issue with BYE and CANCEL

Răzvan Crainea-2
Hi, Mickael!

AVPs are only available during transaction - initial request and its
replies, but it is not avaialble to sequential requests (such as CANCEL
or BYE). If you want to store a value throughout the entire dialog, you
should save the variable in a dialog variable[1], something like this:

# initial INVITE
$avp(setid) = 1;
create_dialog();
$dlg_val(setid) = $avp(setid);

# CANCEL or BYE, *after* loose_route() is called
# so that the dialog is matched/found
loose_route();
$avp(setid) = $dlg_val(setid);

Hope this helps.

[1] https://opensips.org/html/docs/modules/2.4.x/dialog#pv_dlg_val

Best regards,
Răzvan

On 11/19/18 6:01 PM, Mickael Hubert wrote:

> Hi all,
> I have a rtpengine with opensips, when I use rtpengine without setid_avp
> all works like a charm
>
> modparam("rtpengine", "rtpengine_sock", "udp:10.13.0.129:12221
> <http://10.13.0.129:12221>")
>
> _When I want use setid_avp:_
>
> modparam("rtpengine", "setid_avp", "$avp(setid)")
> modparam("rtpengine", "rtpengine_sock", "1 == udp:10.13.0.129:12221
> <http://10.13.0.129:12221>")
>
> _I call manage function in initial INVITE:_
>
> $avp(setid) =  1;
> create_dialog();
> xlog("L_INFO","setid: $avp(setid)\n");
> if(rtpengine_manage("ICE=remove"))
> {
>    xlog("L_INFO","SDP Offer: $ci for INVITE\n");
> }
>
> for an reply $avp(setid) is populate, and rtpengine works.
>
> _but for BYE and CANCEL I have an issue:_
> _
> _
> you can see the setid variable isn't populate for this CANCEL, but it is
> populate for 487 reply !
> I have this error log: ERROR:rtpengine:select_rtpe_node: script error
> -no valid set selected / ERROR:rtpengine:rtpe_function_call: no
> available proxies
>
> When I force the setid to 1 for BYE and CANCEL, there isn't issue.
>
> However, the module documentation explains :
> /IMPORTANT: if you use multiple sets, take care and use the same set for
> both rtpengine_offer()/rtpengine_answer() and rtpengine_delete()!!
> /
> /If the set was selected using setid_avp, the avp needs to be set only
> once before rtpengine_offer() or rtpengine_manage() call. /
>
> Can you help me please ?
>
> thanks in advance
>
> PS: same issue with BYE method
> __
>
> __
>
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
> ################################################################################
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: CANCEL END
> OF CALL : call-id 1def6e7f-66b6-1237-7b9d-0050569229dc
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
> ################################################################################
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: setid: <null>
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
> *ERROR:rtpengine:select_rtpe_node: script error -no valid set selected*
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
> *ERROR:rtpengine:rtpe_function_call: no available proxies*
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:
> 1def6e7f-66b6-1237-7b9d-0050569229dc In ONREPLY ROUTE 2 - fu :
> sip:+******@am-isbc1-******** , ru : <null> , si : 10.13.0.80, status : 487
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]: setid: 1
>
> if (is_method("CANCEL"))
>    {
>      
> xlog("L_INFO","################################################################################
> \n");
>      xlog("L_INFO","CANCEL END OF CALL : call-id $ci \n");
>      
> xlog("L_INFO","################################################################################
> \n");
>      xlog("L_INFO","setid: $avp(setid)\n");
>      if(rtpengine_manage("ICE=remove"))
>      {
>        xlog("L_INFO","SDP Offer: $ci for CANCEL\n");
>      }
> .............
>
>
>
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rtpengine (setid_avp) issue with BYE and CANCEL

Mickael HUBERT
Hi Răzvan,
thanks a lot for your answer !

Ok I will try this workaround
But I don't understand the rtpengine module documentation (http://www.opensips.org/html/docs/modules/2.4.x/rtpengine.html)

If I have -> modparam("rtpengine", "setid_avp", "$avp(setid)") and I set setid_avp to 1 (for my example) just once, before rtpengine_manage, this variable should survives until the end no ?

++


Le mar. 20 nov. 2018 à 09:43, Răzvan Crainea <[hidden email]> a écrit :
Hi, Mickael!

AVPs are only available during transaction - initial request and its
replies, but it is not avaialble to sequential requests (such as CANCEL
or BYE). If you want to store a value throughout the entire dialog, you
should save the variable in a dialog variable[1], something like this:

# initial INVITE
$avp(setid) = 1;
create_dialog();
$dlg_val(setid) = $avp(setid);

# CANCEL or BYE, *after* loose_route() is called
# so that the dialog is matched/found
loose_route();
$avp(setid) = $dlg_val(setid);

Hope this helps.

[1] https://opensips.org/html/docs/modules/2.4.x/dialog#pv_dlg_val

Best regards,
Răzvan

On 11/19/18 6:01 PM, Mickael Hubert wrote:
> Hi all,
> I have a rtpengine with opensips, when I use rtpengine without setid_avp
> all works like a charm
>
> modparam("rtpengine", "rtpengine_sock", "udp:10.13.0.129:12221
> <http://10.13.0.129:12221>")
>
> _When I want use setid_avp:_
>
> modparam("rtpengine", "setid_avp", "$avp(setid)")
> modparam("rtpengine", "rtpengine_sock", "1 == udp:10.13.0.129:12221
> <http://10.13.0.129:12221>")
>
> _I call manage function in initial INVITE:_
>
> $avp(setid) =  1;
> create_dialog();
> xlog("L_INFO","setid: $avp(setid)\n");
> if(rtpengine_manage("ICE=remove"))
> {
>    xlog("L_INFO","SDP Offer: $ci for INVITE\n");
> }
>
> for an reply $avp(setid) is populate, and rtpengine works.
>
> _but for BYE and CANCEL I have an issue:_
> _
> _
> you can see the setid variable isn't populate for this CANCEL, but it is
> populate for 487 reply !
> I have this error log: ERROR:rtpengine:select_rtpe_node: script error
> -no valid set selected / ERROR:rtpengine:rtpe_function_call: no
> available proxies
>
> When I force the setid to 1 for BYE and CANCEL, there isn't issue.
>
> However, the module documentation explains :
> /IMPORTANT: if you use multiple sets, take care and use the same set for
> both rtpengine_offer()/rtpengine_answer() and rtpengine_delete()!!
> /
> /If the set was selected using setid_avp, the avp needs to be set only
> once before rtpengine_offer() or rtpengine_manage() call. /
>
> Can you help me please ?
>
> thanks in advance
>
> PS: same issue with BYE method
> __
>
> __
>
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
> ################################################################################
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: CANCEL END
> OF CALL : call-id 1def6e7f-66b6-1237-7b9d-0050569229dc
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
> ################################################################################
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: setid: <null>
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
> *ERROR:rtpengine:select_rtpe_node: script error -no valid set selected*
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
> *ERROR:rtpengine:rtpe_function_call: no available proxies*
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:
> 1def6e7f-66b6-1237-7b9d-0050569229dc In ONREPLY ROUTE 2 - fu :
> sip:+******@am-isbc1-******** , ru : <null> , si : 10.13.0.80, status : 487
> Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]: setid: 1
>
> if (is_method("CANCEL"))
>    {
>     
> xlog("L_INFO","################################################################################
> \n");
>      xlog("L_INFO","CANCEL END OF CALL : call-id $ci \n");
>     
> xlog("L_INFO","################################################################################
> \n");
>      xlog("L_INFO","setid: $avp(setid)\n");
>      if(rtpengine_manage("ICE=remove"))
>      {
>        xlog("L_INFO","SDP Offer: $ci for CANCEL\n");
>      }
> .............
>
>
>
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rtpengine (setid_avp) issue with BYE and CANCEL

Răzvan Crainea-2
No, it only survives until the end of transaction :).
I agree it would be nice to have it persistent throughout the dialog,
but that's not in there yet. But you can always open a feature request
for this :):

https://github.com/OpenSIPS/opensips/issues

Best regards,
Răzvan

On 11/20/18 12:15 PM, Mickael Hubert wrote:

> Hi Răzvan,
> thanks a lot for your answer !
>
> Ok I will try this workaround
> But I don't understand the rtpengine module documentation
> (http://www.opensips.org/html/docs/modules/2.4.x/rtpengine.html)
>
> If I have -> modparam("rtpengine", "setid_avp", "$avp(setid)") and I set
> setid_avp to 1 (for my example) just once, before rtpengine_manage, this
> variable should survives until the end no ?
>
>
> ++
>
>
>
> Le mar. 20 nov. 2018 à 09:43, Răzvan Crainea <[hidden email]
> <mailto:[hidden email]>> a écrit :
>
>     Hi, Mickael!
>
>     AVPs are only available during transaction - initial request and its
>     replies, but it is not avaialble to sequential requests (such as CANCEL
>     or BYE). If you want to store a value throughout the entire dialog, you
>     should save the variable in a dialog variable[1], something like this:
>
>     # initial INVITE
>     $avp(setid) = 1;
>     create_dialog();
>     $dlg_val(setid) = $avp(setid);
>
>     # CANCEL or BYE, *after* loose_route() is called
>     # so that the dialog is matched/found
>     loose_route();
>     $avp(setid) = $dlg_val(setid);
>
>     Hope this helps.
>
>     [1] https://opensips.org/html/docs/modules/2.4.x/dialog#pv_dlg_val
>
>     Best regards,
>     Răzvan
>
>     On 11/19/18 6:01 PM, Mickael Hubert wrote:
>      > Hi all,
>      > I have a rtpengine with opensips, when I use rtpengine without
>     setid_avp
>      > all works like a charm
>      >
>      > modparam("rtpengine", "rtpengine_sock", "udp:10.13.0.129:12221
>     <http://10.13.0.129:12221>
>      > <http://10.13.0.129:12221>")
>      >
>      > _When I want use setid_avp:_
>      >
>      > modparam("rtpengine", "setid_avp", "$avp(setid)")
>      > modparam("rtpengine", "rtpengine_sock", "1 ==
>     udp:10.13.0.129:12221 <http://10.13.0.129:12221>
>      > <http://10.13.0.129:12221>")
>      >
>      > _I call manage function in initial INVITE:_
>      >
>      > $avp(setid) =  1;
>      > create_dialog();
>      > xlog("L_INFO","setid: $avp(setid)\n");
>      > if(rtpengine_manage("ICE=remove"))
>      > {
>      >    xlog("L_INFO","SDP Offer: $ci for INVITE\n");
>      > }
>      >
>      > for an reply $avp(setid) is populate, and rtpengine works.
>      >
>      > _but for BYE and CANCEL I have an issue:_
>      > _
>      > _
>      > you can see the setid variable isn't populate for this CANCEL,
>     but it is
>      > populate for 487 reply !
>      > I have this error log: ERROR:rtpengine:select_rtpe_node: script
>     error
>      > -no valid set selected / ERROR:rtpengine:rtpe_function_call: no
>      > available proxies
>      >
>      > When I force the setid to 1 for BYE and CANCEL, there isn't issue.
>      >
>      > However, the module documentation explains :
>      > /IMPORTANT: if you use multiple sets, take care and use the same
>     set for
>      > both rtpengine_offer()/rtpengine_answer() and rtpengine_delete()!!
>      > /
>      > /If the set was selected using setid_avp, the avp needs to be set
>     only
>      > once before rtpengine_offer() or rtpengine_manage() call. /
>      >
>      > Can you help me please ?
>      >
>      > thanks in advance
>      >
>      > PS: same issue with BYE method
>      > __
>      >
>      > __
>      >
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      >
>     ################################################################################
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>     CANCEL END
>      > OF CALL : call-id 1def6e7f-66b6-1237-7b9d-0050569229dc
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      >
>     ################################################################################
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>     setid: <null>
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      > *ERROR:rtpengine:select_rtpe_node: script error -no valid set
>     selected*
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      > *ERROR:rtpengine:rtpe_function_call: no available proxies*
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:
>      > 1def6e7f-66b6-1237-7b9d-0050569229dc In ONREPLY ROUTE 2 - fu :
>      > sip:+******@am-isbc1-******** , ru : <null> , si : 10.13.0.80,
>     status : 487
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:
>     setid: 1
>      >
>      > if (is_method("CANCEL"))
>      >    {
>      >
>      >
>     xlog("L_INFO","################################################################################
>
>      > \n");
>      >      xlog("L_INFO","CANCEL END OF CALL : call-id $ci \n");
>      >
>      >
>     xlog("L_INFO","################################################################################
>
>      > \n");
>      >      xlog("L_INFO","setid: $avp(setid)\n");
>      >      if(rtpengine_manage("ICE=remove"))
>      >      {
>      >        xlog("L_INFO","SDP Offer: $ci for CANCEL\n");
>      >      }
>      > .............
>      >
>      >
>      >
>      >
>      >
>      >
>      > _______________________________________________
>      > Users mailing list
>      > [hidden email] <mailto:[hidden email]>
>      > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>      >
>
>     --
>     Răzvan Crainea
>     OpenSIPS Core Developer
>     http://www.opensips-solutions.com
>
>     _______________________________________________
>     Users mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rtpengine (setid_avp) issue with BYE and CANCEL

Mickael HUBERT
OK thanks, I will write something about that ;)

I tested your solution, it works for BYE but not force CANCEL.
Indeed, for BYE from my SBC enters in loose_route statement, but not for a CANCEL.

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.

++

Le mar. 20 nov. 2018 à 13:45, Răzvan Crainea <[hidden email]> a écrit :
No, it only survives until the end of transaction :).
I agree it would be nice to have it persistent throughout the dialog,
but that's not in there yet. But you can always open a feature request
for this :):

https://github.com/OpenSIPS/opensips/issues

Best regards,
Răzvan

On 11/20/18 12:15 PM, Mickael Hubert wrote:
> Hi Răzvan,
> thanks a lot for your answer !
>
> Ok I will try this workaround
> But I don't understand the rtpengine module documentation
> (http://www.opensips.org/html/docs/modules/2.4.x/rtpengine.html)
>
> If I have -> modparam("rtpengine", "setid_avp", "$avp(setid)") and I set
> setid_avp to 1 (for my example) just once, before rtpengine_manage, this
> variable should survives until the end no ?
>
>
> ++
>
>
>
> Le mar. 20 nov. 2018 à 09:43, Răzvan Crainea <[hidden email]
> <mailto:[hidden email]>> a écrit :
>
>     Hi, Mickael!
>
>     AVPs are only available during transaction - initial request and its
>     replies, but it is not avaialble to sequential requests (such as CANCEL
>     or BYE). If you want to store a value throughout the entire dialog, you
>     should save the variable in a dialog variable[1], something like this:
>
>     # initial INVITE
>     $avp(setid) = 1;
>     create_dialog();
>     $dlg_val(setid) = $avp(setid);
>
>     # CANCEL or BYE, *after* loose_route() is called
>     # so that the dialog is matched/found
>     loose_route();
>     $avp(setid) = $dlg_val(setid);
>
>     Hope this helps.
>
>     [1] https://opensips.org/html/docs/modules/2.4.x/dialog#pv_dlg_val
>
>     Best regards,
>     Răzvan
>
>     On 11/19/18 6:01 PM, Mickael Hubert wrote:
>      > Hi all,
>      > I have a rtpengine with opensips, when I use rtpengine without
>     setid_avp
>      > all works like a charm
>      >
>      > modparam("rtpengine", "rtpengine_sock", "udp:10.13.0.129:12221
>     <http://10.13.0.129:12221>
>      > <http://10.13.0.129:12221>")
>      >
>      > _When I want use setid_avp:_
>      >
>      > modparam("rtpengine", "setid_avp", "$avp(setid)")
>      > modparam("rtpengine", "rtpengine_sock", "1 ==
>     udp:10.13.0.129:12221 <http://10.13.0.129:12221>
>      > <http://10.13.0.129:12221>")
>      >
>      > _I call manage function in initial INVITE:_
>      >
>      > $avp(setid) =  1;
>      > create_dialog();
>      > xlog("L_INFO","setid: $avp(setid)\n");
>      > if(rtpengine_manage("ICE=remove"))
>      > {
>      >    xlog("L_INFO","SDP Offer: $ci for INVITE\n");
>      > }
>      >
>      > for an reply $avp(setid) is populate, and rtpengine works.
>      >
>      > _but for BYE and CANCEL I have an issue:_
>      > _
>      > _
>      > you can see the setid variable isn't populate for this CANCEL,
>     but it is
>      > populate for 487 reply !
>      > I have this error log: ERROR:rtpengine:select_rtpe_node: script
>     error
>      > -no valid set selected / ERROR:rtpengine:rtpe_function_call: no
>      > available proxies
>      >
>      > When I force the setid to 1 for BYE and CANCEL, there isn't issue.
>      >
>      > However, the module documentation explains :
>      > /IMPORTANT: if you use multiple sets, take care and use the same
>     set for
>      > both rtpengine_offer()/rtpengine_answer() and rtpengine_delete()!!
>      > /
>      > /If the set was selected using setid_avp, the avp needs to be set
>     only
>      > once before rtpengine_offer() or rtpengine_manage() call. /
>      >
>      > Can you help me please ?
>      >
>      > thanks in advance
>      >
>      > PS: same issue with BYE method
>      > __
>      >
>      > __
>      >
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      >
>     ################################################################################
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>     CANCEL END
>      > OF CALL : call-id 1def6e7f-66b6-1237-7b9d-0050569229dc
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      >
>     ################################################################################
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>     setid: <null>
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      > *ERROR:rtpengine:select_rtpe_node: script error -no valid set
>     selected*
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      > *ERROR:rtpengine:rtpe_function_call: no available proxies*
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:
>      > 1def6e7f-66b6-1237-7b9d-0050569229dc In ONREPLY ROUTE 2 - fu :
>      > sip:+******@am-isbc1-******** , ru : <null> , si : 10.13.0.80,
>     status : 487
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:
>     setid: 1
>      >
>      > if (is_method("CANCEL"))
>      >    {
>      >
>      >
>     xlog("L_INFO","################################################################################
>
>      > \n");
>      >      xlog("L_INFO","CANCEL END OF CALL : call-id $ci \n");
>      >
>      >
>     xlog("L_INFO","################################################################################
>
>      > \n");
>      >      xlog("L_INFO","setid: $avp(setid)\n");
>      >      if(rtpengine_manage("ICE=remove"))
>      >      {
>      >        xlog("L_INFO","SDP Offer: $ci for CANCEL\n");
>      >      }
>      > .............
>      >
>      >
>      >
>      >
>      >
>      >
>      > _______________________________________________
>      > Users mailing list
>      > [hidden email] <mailto:[hidden email]>
>      > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>      >
>
>     --
>     Răzvan Crainea
>     OpenSIPS Core Developer
>     http://www.opensips-solutions.com
>
>     _______________________________________________
>     Users mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rtpengine (setid_avp) issue with BYE and CANCEL

Mickael HUBERT
I have to use local cache to workaround.

In INVITE statement:
$avp(setid) =  1; # group of rtp engine servers / Ex: 1 for FR / 2 for USA
if(cache_store("local","$ci","$avp(setid)",1200)) { xlog("L_INFO","$ci -- Cache Store Name: $ci with port: $avp(setid)\n");


in CANCEL statement:
if(cache_fetch("local","$ci",$avp(setid)))
{
      xlog("L_INFO","$ci -- Cache fetch Name: $ci with port: $avp(setid)\n");
      cache_remove("local","$ci");
}
$avp(setid) = $(avp(setid){s.int});

And it's not clean but works like a charm.

@Răzvan if you have an idea about the CANCEL issue with $dlg_val is not populate, I'm interesting ;)

thanks

Le mar. 20 nov. 2018 à 13:58, Mickael Hubert <[hidden email]> a écrit :
OK thanks, I will write something about that ;)

I tested your solution, it works for BYE but not force CANCEL.
Indeed, for BYE from my SBC enters in loose_route statement, but not for a CANCEL.

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.

++

Le mar. 20 nov. 2018 à 13:45, Răzvan Crainea <[hidden email]> a écrit :
No, it only survives until the end of transaction :).
I agree it would be nice to have it persistent throughout the dialog,
but that's not in there yet. But you can always open a feature request
for this :):

https://github.com/OpenSIPS/opensips/issues

Best regards,
Răzvan

On 11/20/18 12:15 PM, Mickael Hubert wrote:
> Hi Răzvan,
> thanks a lot for your answer !
>
> Ok I will try this workaround
> But I don't understand the rtpengine module documentation
> (http://www.opensips.org/html/docs/modules/2.4.x/rtpengine.html)
>
> If I have -> modparam("rtpengine", "setid_avp", "$avp(setid)") and I set
> setid_avp to 1 (for my example) just once, before rtpengine_manage, this
> variable should survives until the end no ?
>
>
> ++
>
>
>
> Le mar. 20 nov. 2018 à 09:43, Răzvan Crainea <[hidden email]
> <mailto:[hidden email]>> a écrit :
>
>     Hi, Mickael!
>
>     AVPs are only available during transaction - initial request and its
>     replies, but it is not avaialble to sequential requests (such as CANCEL
>     or BYE). If you want to store a value throughout the entire dialog, you
>     should save the variable in a dialog variable[1], something like this:
>
>     # initial INVITE
>     $avp(setid) = 1;
>     create_dialog();
>     $dlg_val(setid) = $avp(setid);
>
>     # CANCEL or BYE, *after* loose_route() is called
>     # so that the dialog is matched/found
>     loose_route();
>     $avp(setid) = $dlg_val(setid);
>
>     Hope this helps.
>
>     [1] https://opensips.org/html/docs/modules/2.4.x/dialog#pv_dlg_val
>
>     Best regards,
>     Răzvan
>
>     On 11/19/18 6:01 PM, Mickael Hubert wrote:
>      > Hi all,
>      > I have a rtpengine with opensips, when I use rtpengine without
>     setid_avp
>      > all works like a charm
>      >
>      > modparam("rtpengine", "rtpengine_sock", "udp:10.13.0.129:12221
>     <http://10.13.0.129:12221>
>      > <http://10.13.0.129:12221>")
>      >
>      > _When I want use setid_avp:_
>      >
>      > modparam("rtpengine", "setid_avp", "$avp(setid)")
>      > modparam("rtpengine", "rtpengine_sock", "1 ==
>     udp:10.13.0.129:12221 <http://10.13.0.129:12221>
>      > <http://10.13.0.129:12221>")
>      >
>      > _I call manage function in initial INVITE:_
>      >
>      > $avp(setid) =  1;
>      > create_dialog();
>      > xlog("L_INFO","setid: $avp(setid)\n");
>      > if(rtpengine_manage("ICE=remove"))
>      > {
>      >    xlog("L_INFO","SDP Offer: $ci for INVITE\n");
>      > }
>      >
>      > for an reply $avp(setid) is populate, and rtpengine works.
>      >
>      > _but for BYE and CANCEL I have an issue:_
>      > _
>      > _
>      > you can see the setid variable isn't populate for this CANCEL,
>     but it is
>      > populate for 487 reply !
>      > I have this error log: ERROR:rtpengine:select_rtpe_node: script
>     error
>      > -no valid set selected / ERROR:rtpengine:rtpe_function_call: no
>      > available proxies
>      >
>      > When I force the setid to 1 for BYE and CANCEL, there isn't issue.
>      >
>      > However, the module documentation explains :
>      > /IMPORTANT: if you use multiple sets, take care and use the same
>     set for
>      > both rtpengine_offer()/rtpengine_answer() and rtpengine_delete()!!
>      > /
>      > /If the set was selected using setid_avp, the avp needs to be set
>     only
>      > once before rtpengine_offer() or rtpengine_manage() call. /
>      >
>      > Can you help me please ?
>      >
>      > thanks in advance
>      >
>      > PS: same issue with BYE method
>      > __
>      >
>      > __
>      >
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      >
>     ################################################################################
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>     CANCEL END
>      > OF CALL : call-id 1def6e7f-66b6-1237-7b9d-0050569229dc
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      >
>     ################################################################################
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>     setid: <null>
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      > *ERROR:rtpengine:select_rtpe_node: script error -no valid set
>     selected*
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
>      > *ERROR:rtpengine:rtpe_function_call: no available proxies*
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:
>      > 1def6e7f-66b6-1237-7b9d-0050569229dc In ONREPLY ROUTE 2 - fu :
>      > sip:+******@am-isbc1-******** , ru : <null> , si : 10.13.0.80,
>     status : 487
>      > Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:
>     setid: 1
>      >
>      > if (is_method("CANCEL"))
>      >    {
>      >
>      >
>     xlog("L_INFO","################################################################################
>
>      > \n");
>      >      xlog("L_INFO","CANCEL END OF CALL : call-id $ci \n");
>      >
>      >
>     xlog("L_INFO","################################################################################
>
>      > \n");
>      >      xlog("L_INFO","setid: $avp(setid)\n");
>      >      if(rtpengine_manage("ICE=remove"))
>      >      {
>      >        xlog("L_INFO","SDP Offer: $ci for CANCEL\n");
>      >      }
>      > .............
>      >
>      >
>      >
>      >
>      >
>      >
>      > _______________________________________________
>      > Users mailing list
>      > [hidden email] <mailto:[hidden email]>
>      > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>      >
>
>     --
>     Răzvan Crainea
>     OpenSIPS Core Developer
>     http://www.opensips-solutions.com
>
>     _______________________________________________
>     Users mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users