[OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Mar 11 04:37:58 EDT 2019


Hi Adam,

Checking a bit more the code, it seems that the inner 
get_dlg_by_callid() function (used for locating dialogs in the internal 
dlg table) does no return the dialogs in state 5 (terminated).

So, once the dialog switched to final state 5, it becomes "invisible" to 
the get_dlg_vals() function. Same approach is also implemented by 
get_dialog_info().

I'm not saying it is good or bad, I'm just saying how it is right now.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 2019
   https://www.opensips.org/events/Summit-2019Amsterdam/

On 03/08/2019 04:15 PM, Adam Overbeeke wrote:
>
> Hi Bogdan,
>
> I hope this answers your question. I’ve reconstructed the scenario and 
> confirmed that from OLD_STATE(4) to NEW_STATE(5) the dialog variables 
> are not available or return NULL. The trigger for the state change was 
> a BYE. Let me know if you want me to try any thing else. I’ve provided 
> some log output below. The first log is a state transistion from 3 to 
> 4… You can see the presence of my variables dialog_org and dialog_dir. 
> Please refer to the code I posted before.
>
> Thanks
>
> Adam
>
> _STATE 3 __à__4_
>
> Mar  8 13:58:56 [371] { "t": "2019-03-08T13:58:56.428889Z", 
> "logger_name": "control", "thread_name": 371, "level": "INFO", 
> "route": "event_dialog_log", "message": { "hash_entry": "3352", 
> "hash_id": "1296669127", "callid": "IB_MAP-27\/\/\/1-16 at 203.0.113.4", 
> "from_tag": "16SIPpTag61", "to_tag": "7SIPpTag92", "old_state": 3, 
> "new_state": 4 } }
>
> Mar  8 13:58:56 [371] { "t": "2019-03-08T13:58:56.429075Z", 
> "logger_name": "control", "thread_name": 371, "level": "INFO", 
> "route": "E_DLG_STATE_CHANGED", "message": { "dialog_org": "Org", 
> "dialog_dir": "Inbound" } }
>
> _STATE 4 __à__5_
>
> Mar  8 13:58:56 [371] { "t": "2019-03-08T13:58:56.934118Z", 
> "logger_name": "control", "thread_name": 371, "level": "INFO", 
> "route": "event_dialog_log", "message": { "hash_entry": "3352", 
> "hash_id": "1296669127", "callid": "IB_MAP-27\/\/\/1-16 at 203.0.113.4", 
> "from_tag": "16SIPpTag61", "to_tag": "7SIPpTag92", "old_state": 4, 
> "new_state": 5 } }
>
> Mar  8 13:58:56 [371] { "t": "2019-03-08T13:58:56.934228Z", 
> "logger_name": "control", "thread_name": 371, "level": "INFO", 
> "route": "E_DLG_STATE_CHANGED" }
>
> *From: *Bogdan-Andrei Iancu <bogdan at opensips.org>
> *Date: *Thursday, March 7, 2019 at 10:10 AM
> *To: *Adam Overbeeke <Adam.Overbeeke at genesys.com>, OpenSIPS devel 
> mailling list <devel at lists.opensips.org>
> *Subject: *Re: [OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog 
> information for ENDED state.
>
> HI Adam,
>
> When the Terminated event is triggered, the dialog is already in state 
> 5/Terminated and it should still be foundable - is the termination of 
> the dialog triggered by a BYE request or ?
>
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
>    https://www.opensips-solutions.com
> OpenSIPS Summit 2019
>    https://www.opensips.org/events/Summit-2019Amsterdam/
>
> On 03/07/2019 04:49 PM, Adam Overbeeke wrote:
>
>     Hi Bogdan,
>
>     We are trying to access the dialog information during the event
>     route. The function that we are using is get_dialog_vals.During my
>     testing, I was able to get the expected parameters that was passed
>     from the event route, but the dialog variables was returning
>     nothing. This happens only when the state transitions to ENDED,
>     all other states have the information. This makes me believe that
>     the dialog was destroy.
>
>     i.e. in this example: variableOne and variableTwo are dialog
>     variables.
>
>     event_route[E_DLG_STATE_CHANGED] {
>
>              fetch_event_params("hash_entry=$avp(eparm_hash_entry)");
>
>     fetch_event_params("hash_id=$avp(eparm_hash_id)");
>
>     fetch_event_params("callid=$avp(eparm_callid)");
>
>     fetch_event_params("from_tag=$avp(eparm_from_tag)");
>
>     fetch_event_params("to_tag=$avp(eparm_to_tag)");
>
>     fetch_event_params("old_state=$avp(eparm_old_state)");
>
>     fetch_event_params("new_state=$avp(eparm_new_state)");
>
>     if (
>     get_dialog_vals("$avp(d_names)","$avp(d_vals)","$avp(eparm_callid)")
>     ) {
>
>     $var(i) = 0;
>
>     while ( $(avp(d_names)[$var(i)]) != NULL ) {
>
>     $var(k) = $(avp(d_names)[$var(i)]);
>
>     $var(v) = $(avp(d_vals)[$var(i)]);
>
>     switch($var(k)) {
>
>     case "variableOne":
>
>     #// log statement here
>
>     break;
>
>     case "variableTwo":
>
>     #// log statement here
>
>     break;
>
>     }
>
>     $var(i) = $var(i) + 1;
>
>     }
>
>     }
>
>     }
>
>     ^ when the state is ENDED, get_dialog_vals returns nothing back
>     for the dialog’s callid.
>
>     Hope it helps,
>
>     Adam
>
>     *From: *Bogdan-Andrei Iancu <bogdan at opensips.org>
>     <mailto:bogdan at opensips.org>
>     *Date: *Thursday, March 7, 2019 at 5:37 AM
>     *To: *OpenSIPS devel mailling list <devel at lists.opensips.org>
>     <mailto:devel at lists.opensips.org>, Adam Overbeeke
>     <Adam.Overbeeke at genesys.com> <mailto:Adam.Overbeeke at genesys.com>
>     *Subject: *Re: [OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog
>     information for ENDED state.
>
>     Hi Adam,
>
>     Sorry for the late reply.
>
>     How exactly are you trying to retrieve the dialog info (during the
>     TERMINATED event) ?
>
>     Regards,
>
>
>     Bogdan-Andrei Iancu
>
>       
>
>     OpenSIPS Founder and Developer
>
>        https://www.opensips-solutions.com
>
>     OpenSIPS Summit 2019
>
>        https://www.opensips.org/events/Summit-2019Amsterdam/
>
>     On 02/20/2019 04:55 PM, Adam Overbeeke wrote:
>
>         Hello all,
>
>         We are trying to use the dialog event routes and ran into some
>         unexpected behavior. The issue is that we cannot retrieve the
>         dialog information when the dialog state transitions to ENDED.
>         We believe the dialog have been destroyed or removed prior to
>         firing the event change. Is it possible to change this
>         behavior in the synchronous case? We understand design
>         decision for asynchronous handling but believe it should be
>         possible to retrieve the information in the synchronous case.
>
>         If our assumptions are incorrect, we are open to ideas on how
>         we could get the dialog information during the ENDED state. We
>         are considering using a local cache in the meantime, but that
>         will duplicate a lot of information in our system. My hopes
>         are that we are just missing some function call. We appreciate
>         your help/response.
>
>         Thanks,
>
>         Adam
>
>         Adam Overbeeke
>
>         Lead Voice Network Engineer, PureCloud
>
>         cid:image001.png at 01D2DB78.7C3D8250
>
>         cid:image002.png at 01D2DB78.7C3D8250 <http://www.genesys.com/>
>
>         cid:image003.png at 01D2DB78.7C3D8250
>         <https://twitter.com/Genesys>cid:image004.png at 01D2DB78.7C3D8250
>         <http://www.linkedin.com/company/601919?trk=tyah>cid:image005.png at 01D2DB78.7C3D8250
>         <https://plus.google.com/+Genesyslab?rel=publisher>cid:image006.png at 01D2DB78.7C3D8250
>         <https://www.facebook.com/Genesys/>cid:image007.png at 01D2DB78.7C3D8250
>         <https://www.youtube.com/Genesys>cid:image008.png at 01D2DB78.7C3D8250
>         <http://blog.genesys.com/>
>
>
>
>
>
>         _______________________________________________
>
>         Devel mailing list
>
>         Devel at lists.opensips.org <mailto:Devel at lists.opensips.org>
>
>         http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
>
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20190311/03545c2a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 1244 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20190311/03545c2a/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 7164 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20190311/03545c2a/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2056 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20190311/03545c2a/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 2043 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20190311/03545c2a/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 2046 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20190311/03545c2a/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 1922 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20190311/03545c2a/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 2059 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20190311/03545c2a/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.png
Type: image/png
Size: 2073 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20190311/03545c2a/attachment-0015.png>


More information about the Devel mailing list