[OpenSIPS-Users] AVP availability in CANCEL

Callum Guy callum.guy at x-on.co.uk
Mon Mar 16 21:15:06 EST 2020


Hi Ben,

Just following up to confirm that you were correct and t_check_trans()
makes all the difference - without it the isflagset check doesn't
match.

Thank you!

  if (is_method("BYE|CANCEL")) {
     match_dialog();
     t_check_trans();
     if (is_dlg_flag_set(10) || isflagset(RTPENGINE_ENGAGED)) {
      rtpengine_delete();
     }
   }


On Mon, 16 Mar 2020 at 13:33, Callum Guy <callum.guy at x-on.co.uk> wrote:
>
> Hi Ben,
>
> Thank you for the information, I've checked the tm module docs and t_check_trans() doesn't highlight this behaviour - it just sounds like a method to confirm the presence of the transaction. To try and confirm this I've been looking at the tm module code and it matches the documentation description - some of the nested methods are locating the transaction within a hash table however there is no clear indicator to me that this would be somehow loading the AVPs and/or flags into the current request process. I am not a C expert and could definitely be missing something however but it would be great if one the dev team could confirm if this is indeed the correct approach. For now I'll implement some logging to try and confirm the behaviour.
>
> Your feature request for dialog method flags sounds useful, I suspect once my current CANCEL issue is resolved that there may be a few remaining call scenarios where rtpengine isn't being cleared due to the dialog having been closed, if that happens to me I'll see if I can find time to implement your idea.
>
> Thanks,
>
> Callum
>
>
> On Mon, 16 Mar 2020 at 13:02, Ben Newlin <Ben.Newlin at genesys.com> wrote:
>>
>> Callum,
>>
>>
>>
>> Both AVPs and transaction flags are tied to the transaction, so you must call t_check_trans so the transaction will be matched. I don’t see that happening in your code. I don’t believe match_dialog will do that for you.
>>
>>
>>
>> Also, I think the issues you are having with dialog variables as you mentioned in another response may be related to an feature request we have open [1]. Basically, once the BYE is received the dialog is set to ENDED state and the dialog variable retrieval ignores dialogs in this state. Our use case is a bit different than yours, so it may not be the same.
>>
>>
>>
>> [1] - https://github.com/OpenSIPS/opensips/issues/1637
>>
>>
>>
>> Ben Newlin
>>
>>
>>
>> From: Users <users-bounces at lists.opensips.org> on behalf of Callum Guy <callum.guy at x-on.co.uk>
>> Reply-To: OpenSIPS users mailling list <users at lists.opensips.org>
>> Date: Monday, March 16, 2020 at 7:23 AM
>> To: OpenSIPS users mailling list <users at lists.opensips.org>
>> Subject: [OpenSIPS-Users] AVP availability in CANCEL
>>
>>
>>
>> Hi All,
>>
>> I have a simple question regarding availability of AVP variables in CANCEL. I'm not sure when OpenSIPs will load the AVP's for a transaction so am looking for information here. The situation is that I want to flag sessions using a media proxy and close the sessions when a CANCEL arrives before the call is answered.
>>
>>
>>
>> This is how I enable and track rtpengine:
>>
>>
>>
>> route[RTPENGINE_OFFER_IE] {
>>   set_dlg_flag(10);
>>   $avp(media_proxy) := "on";
>>   rtpengine_offer("trust-address replace-session-connection in-iface=internal out-iface=external ICE=remove");
>> }
>>
>> The current logic sets both a dialog variable and an AVP when rtpengine is offered. When BYE/CANCEL messages arrive the script does this:
>>
>> if (is_method("BYE|CANCEL")) {
>>   match_dialog();
>>   if (is_dlg_flag_set(10) || $avp(media_proxy) == "on") {
>>     rtpengine_delete();
>>   }
>> }
>>
>>
>>
>> I was hoping that the dialog would be matched by call ID and tags however this does not appear to work so I must be missing some info. The AVP was added later to try and make it work for the CANCEL requests but also did not work.
>>
>>
>>
>> I'm planning on replacing the AVP with a transaction flag tonight, is that likely to resolve the issue? Apologies if these are basic questions, availability of different types of flags and AVP's really aren't clear to me so any advice would be appreciated!
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Callum
>>
>>
>>
>>
>>
>> 0333 332 0000  |  www.x-on.co.uk  |
>>
>> X-on is a trading name of Storacall Technology Ltd a limited company registered in England and Wales.
>> Registered Office : Avaland House, 110 London Road, Apsley, Hemel Hempstead, Herts, HP3 9SD. Company Registration No. 2578478.
>> The information in this e-mail is confidential and for use by the addressee(s) only. If you are not the intended recipient, please notify X-on immediately on +44(0)333 332 0000 and delete the
>> message from your computer. If you are not a named addressee you must not use, disclose, disseminate, distribute, copy, print or reply to this email. Views or opinions expressed by an individual
>> within this email may not necessarily reflect the views of X-on or its associated companies. Although X-on routinely screens for viruses, addressees should scan this email and any attachments
>> for viruses. X-on makes no representation or warranty as to the absence of viruses in this email or any attachments.
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-- 





*0333 332 0000  |  www.x-on.co.uk <http://www.x-on.co.uk>  |   ** 
<https://www.linkedin.com/company/x-on>   <https://www.facebook.com/XonTel> 
  <https://twitter.com/xonuk> *


X-on
is a trading name of Storacall 
Technology Ltd a limited company registered in
England and Wales.


Registered Office : Avaland House, 110 London Road, Apsley, Hemel 
Hempstead,
Herts, HP3 9SD. Company Registration No. 2578478.

The 
information in this e-mail is confidential and for use by the addressee(s)

only. If you are not the intended recipient, please notify X-on immediately 
on +44(0)333 332 0000 and delete the
message from your computer. If you are 
not a named addressee you must not use,
disclose, disseminate, distribute, 
copy, print or reply to this email. Views
or opinions expressed by an 
individual
within this email may not necessarily
reflect the views of X-on 
or its associated companies. Although X-on routinely
screens for viruses, 
addressees should scan this email and any attachments
for
viruses. X-on 
makes no representation or warranty as to the absence of viruses
in this 
email or any attachments.













More information about the Users mailing list