[OpenSIPS-Users] avp scope bug in 3.2 ?

Răzvan Crainea razvan at opensips.org
Thu Jun 3 10:12:30 EST 2021


Hi, Johan!

This is the intended behavior.
Local route is run for requests generated by OpenSIPS. I can't see in 
your snippet where you call route(relay) from, but if it's not from 
local route, it must be from a different route that is executed for 
received messages (rather than generated ones), thus completely 
different requests.
If you are looking for a B2B scope variable, you should be looking at 
the new #b2b_logic.ctx var[1].

[1] https://opensips.org/docs/modules/3.2.x/b2b_logic_xml.html#b2b_logic.ctx

Best regards,

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

On 5/28/21 1:39 PM, johan wrote:
> script :
> 
> 
> local_route
> {
>      xlog("callid=$ci: local_route: received message $mb");
>      xlog("callid=$ci: local_route: what ever comes from local goes to 
> b2bua");
>      $avp(b2bua)=1;
>      xlog("callid=$ci: avp(b2bua)=$avp(b2bua)");
> }
> 
> 
> route[relay]
> {
>      # for INVITEs enable some additional helper routes
>      xlog("route realy ft [$ft] tt [$tt]");
>      if (is_method("INVITE"))
>      {
>          t_on_branch("per_branch_ops");
>          t_on_reply("handle_nat");
>          t_on_failure("missed_call");
>          route(rtpengine);
>      }
>      if ($avp(b2bua)==1)
>      {
>          xlog("route relay: avp(b2bua)=$avp(b2bua)==1; adding 
> record-route, reset avp and sending to b2bua");
>          $avp(b2bua)=0;
>          record_route();
>          if (!t_relay(,"udp:192.168.68.116:5060"))
>          {
>              send_reply(500,"Internal Error");
>              xlog("route relay: routing to b2bua failed");
>          }
>      }
>      else
>      {
>          xlog("route relay: avp(b2bua)=$avp(b2bua)!=1; normal call flow ");
>          if (!t_relay())
>          {
>              send_reply(500,"Internal Error");
>          }
>      }
>      exit;
> }
> 
> 
> expected behaviour :when local_route is entered the avp value goes to 1.
> 
> I would expect it to be 1 in route[relay] also.
> 
> 
> However :
> 
> 
> May 28 06:31:02 debian10opensips31 /data/opensips/sbin/opensips[13548]: 
> callid=1976ffb3-6749-4920-b7ef-5ce56cef6c8a: local_route: what ever 
> comes from local goes to b2bua
> May 28 06:31:02 debian10opensips31 /data/opensips/sbin/opensips[13548]: 
> callid=1976ffb3-6749-4920-b7ef-5ce56cef6c8a: avp(b2bua)=1
> ...
> 
> May 28 06:31:02 debian10opensips31 /data/opensips/sbin/opensips[13543]: 
> route relay: avp(b2bua)=<null>!=1; normal call flow
> 
> => avp(b2bua) is not seen in route[relay].  Is this a bug or is this 
> intended behaviour ?
> __
> 
> _
> _
> 
> _wkr, _
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 



More information about the Users mailing list