[SR-Users] Differentiating between regular hangup and dialog timeout

Daniel-Constantin Mierla miconda at gmail.com
Wed Apr 15 17:11:43 CEST 2015



On 15/04/15 15:35, Mickael Marrache wrote:
>
> Thanks for your reply, the solution you proposed works fine.
>
>  
>
> However, I created a pull request with the flag change you proposed. I
> tested the change, it works, however I wonder if there is a way to
> access the flag name inside the script?
>

Using bitwise operations is the way to test, like you showed in the
issues tracker:

if($dlg(dflags)&(1<<10))

You can use defines to make it easier to read.

Cheers,
Daniel


>  
>
> Mickael
>
>  
>
> *From:*sr-users [mailto:sr-users-bounces at lists.sip-router.org] *On
> Behalf Of *Daniel-Constantin Mierla
> *Sent:* Wednesday, April 15, 2015 3:20 PM
> *To:* Kamailio (SER) - Users Mailing List
> *Subject:* Re: [SR-Users] Differentiating between regular hangup and
> dialog timeout
>
>  
>
> Hello,
>
> On 15/04/15 14:02, Mickael Marrache wrote:
>
>     Hi,
>
>      
>
>     I'm looking for a way to differentiate between regular hangup and
>     dialog timeout.
>
>      
>
>     In both case, the dialog:end event is called. Do you know which
>     information can I use in the event route to differentiate between
>     the two cases?
>
> no embedded mechanism comes in my mind now. For the future, maybe we
> can set a specific flag in one of the internal flags fields (dflags
> seems appropriate, not being persistent and already exposed via $dlg()
> variable).
>
> For now the solution would be to set and avp when you receive a BYE,
> before calling dlg_manage() or loose_route(). In event route that avp
> should be present if the dialog is terminated is due to a BYE on the
> wire and not present if it is internal timeout.
>
> Cheers,
> Daniel
>
> -- 
> Daniel-Constantin Mierla
> http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> - http://www.linkedin.com/in/miconda
> Kamailio World Conference, May 27-29, 2015
> Berlin, Germany - http://www.kamailioworld.com

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150415/c66db06c/attachment.html>


More information about the sr-users mailing list