E_DLG_STATE_CHANGED missing dialog information for ENDED state.

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

E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Adam Overbeeke

 

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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 


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

Re: E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Bogdan-Andrei Iancu-2
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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 



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


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

Re: E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Adam Overbeeke

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 <[hidden email]>
Date: Thursday, March 7, 2019 at 5:37 AM
To: OpenSIPS devel mailling list <[hidden email]>, Adam Overbeeke <[hidden email]>
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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 




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




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

Re: E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Bogdan-Andrei Iancu-2
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 [hidden email]
Date: Thursday, March 7, 2019 at 5:37 AM
To: OpenSIPS devel mailling list [hidden email], Adam Overbeeke [hidden email]
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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 




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





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

Re: E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Adam Overbeeke

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@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@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 <[hidden email]>
Date: Thursday, March 7, 2019 at 10:10 AM
To: Adam Overbeeke <[hidden email]>, OpenSIPS devel mailling list <[hidden email]>
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 [hidden email]
Date: Thursday, March 7, 2019 at 5:37 AM
To: OpenSIPS devel mailling list [hidden email], Adam Overbeeke [hidden email]
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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 





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







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

Re: E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Bogdan-Andrei Iancu-2
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": [hidden email], "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": [hidden email], "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 [hidden email]
Date: Thursday, March 7, 2019 at 10:10 AM
To: Adam Overbeeke [hidden email], OpenSIPS devel mailling list [hidden email]
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 [hidden email]
Date: Thursday, March 7, 2019 at 5:37 AM
To: OpenSIPS devel mailling list [hidden email], Adam Overbeeke [hidden email]
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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 





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








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

Re: E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Adam Overbeeke

Hi Bogdan,

 

Thanks for confirming my suspicions. I am not saying it is bad or good, either. I can see why you would not be able to access the dialog information when processing event routes, asynchronous. I still would like a way to access the dialog variables around the time the dialog will be terminated. As I stated before, my first thought was that the variables would be available during synchronous event route processing, but you have confirmed that is not the case (now). Would you like me to create a feature request on github? I am sure you already have an idea what could be done; but my two cents would be something like a new WILL_TERMINATE state or have the information available in the terminated state for a period of time.

 

Thank you for your time,

 

Adam

 

From: Bogdan-Andrei Iancu <[hidden email]>
Date: Monday, March 11, 2019 at 4:38 AM
To: Adam Overbeeke <[hidden email]>, OpenSIPS devel mailling list <[hidden email]>
Subject: Re: [OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog information for ENDED state.

 

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": [hidden email], "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": [hidden email], "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 [hidden email]
Date: Thursday, March 7, 2019 at 10:10 AM
To: Adam Overbeeke [hidden email], OpenSIPS devel mailling list [hidden email]
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 [hidden email]
Date: Thursday, March 7, 2019 at 5:37 AM
To: OpenSIPS devel mailling list [hidden email], Adam Overbeeke [hidden email]
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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 






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











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

Re: E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Bogdan-Andrei Iancu-2
Hi Adam,

It is not about sync/async...from the point of view of accessing the data (as coding) everything is fine (with matching terminated calls also).
It is more about the logic you have in the script, when using such functions (to fetch vars from a different dlg) - in my opinion, in 70% of the cases, your really want to work only with ongoing calls (once terminated, you want the dlg out of your equation). But lately, there are more and more where you need to fetch data from terminate calls too.

A solution (to be sure we do not break anything and we are backward compatible) will be to add some extra flags to the functions to "force" matching of the terminated calls too (as time as the dlg is still in memory, of course).


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/11/2019 02:14 PM, Adam Overbeeke wrote:

Hi Bogdan,

 

Thanks for confirming my suspicions. I am not saying it is bad or good, either. I can see why you would not be able to access the dialog information when processing event routes, asynchronous. I still would like a way to access the dialog variables around the time the dialog will be terminated. As I stated before, my first thought was that the variables would be available during synchronous event route processing, but you have confirmed that is not the case (now). Would you like me to create a feature request on github? I am sure you already have an idea what could be done; but my two cents would be something like a new WILL_TERMINATE state or have the information available in the terminated state for a period of time.

 

Thank you for your time,

 

Adam

 

From: Bogdan-Andrei Iancu [hidden email]
Date: Monday, March 11, 2019 at 4:38 AM
To: Adam Overbeeke [hidden email], OpenSIPS devel mailling list [hidden email]
Subject: Re: [OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog information for ENDED state.

 

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": [hidden email], "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": [hidden email], "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 [hidden email]
Date: Thursday, March 7, 2019 at 10:10 AM
To: Adam Overbeeke [hidden email], OpenSIPS devel mailling list [hidden email]
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 [hidden email]
Date: Thursday, March 7, 2019 at 5:37 AM
To: OpenSIPS devel mailling list [hidden email], Adam Overbeeke [hidden email]
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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 






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












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

Re: E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Adam Overbeeke

Hi Bogdan,

 

Thanks for the detailed explanation. For now, I will continue with my caching implementation. I think your solution would be best and would save my memory resources. I will make sure to refactor our script when/if the functionality is available in the future.

 

Thank you for your time,

 

Adam

 

From: Bogdan-Andrei Iancu <[hidden email]>
Date: Monday, March 11, 2019 at 8:51 AM
To: Adam Overbeeke <[hidden email]>, OpenSIPS devel mailling list <[hidden email]>
Subject: Re: [OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog information for ENDED state.

 

Hi Adam,

It is not about sync/async...from the point of view of accessing the data (as coding) everything is fine (with matching terminated calls also).
It is more about the logic you have in the script, when using such functions (to fetch vars from a different dlg) - in my opinion, in 70% of the cases, your really want to work only with ongoing calls (once terminated, you want the dlg out of your equation). But lately, there are more and more where you need to fetch data from terminate calls too.

A solution (to be sure we do not break anything and we are backward compatible) will be to add some extra flags to the functions to "force" matching of the terminated calls too (as time as the dlg is still in memory, of course).

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/11/2019 02:14 PM, Adam Overbeeke wrote:

Hi Bogdan,

 

Thanks for confirming my suspicions. I am not saying it is bad or good, either. I can see why you would not be able to access the dialog information when processing event routes, asynchronous. I still would like a way to access the dialog variables around the time the dialog will be terminated. As I stated before, my first thought was that the variables would be available during synchronous event route processing, but you have confirmed that is not the case (now). Would you like me to create a feature request on github? I am sure you already have an idea what could be done; but my two cents would be something like a new WILL_TERMINATE state or have the information available in the terminated state for a period of time.

 

Thank you for your time,

 

Adam

 

From: Bogdan-Andrei Iancu [hidden email]
Date: Monday, March 11, 2019 at 4:38 AM
To: Adam Overbeeke [hidden email], OpenSIPS devel mailling list [hidden email]
Subject: Re: [OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog information for ENDED state.

 

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": [hidden email], "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": [hidden email], "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 [hidden email]
Date: Thursday, March 7, 2019 at 10:10 AM
To: Adam Overbeeke [hidden email], OpenSIPS devel mailling list [hidden email]
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 [hidden email]
Date: Thursday, March 7, 2019 at 5:37 AM
To: OpenSIPS devel mailling list [hidden email], Adam Overbeeke [hidden email]
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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 







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
















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

Re: E_DLG_STATE_CHANGED missing dialog information for ENDED state.

Bogdan-Andrei Iancu-2
Hi Adam,

Please open a feature request on GITHUB tracker - implementing this flag should be an easy one.

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/11/2019 03:05 PM, Adam Overbeeke wrote:

Hi Bogdan,

 

Thanks for the detailed explanation. For now, I will continue with my caching implementation. I think your solution would be best and would save my memory resources. I will make sure to refactor our script when/if the functionality is available in the future.

 

Thank you for your time,

 

Adam

 

From: Bogdan-Andrei Iancu [hidden email]
Date: Monday, March 11, 2019 at 8:51 AM
To: Adam Overbeeke [hidden email], OpenSIPS devel mailling list [hidden email]
Subject: Re: [OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog information for ENDED state.

 

Hi Adam,

It is not about sync/async...from the point of view of accessing the data (as coding) everything is fine (with matching terminated calls also).
It is more about the logic you have in the script, when using such functions (to fetch vars from a different dlg) - in my opinion, in 70% of the cases, your really want to work only with ongoing calls (once terminated, you want the dlg out of your equation). But lately, there are more and more where you need to fetch data from terminate calls too.

A solution (to be sure we do not break anything and we are backward compatible) will be to add some extra flags to the functions to "force" matching of the terminated calls too (as time as the dlg is still in memory, of course).

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/11/2019 02:14 PM, Adam Overbeeke wrote:

Hi Bogdan,

 

Thanks for confirming my suspicions. I am not saying it is bad or good, either. I can see why you would not be able to access the dialog information when processing event routes, asynchronous. I still would like a way to access the dialog variables around the time the dialog will be terminated. As I stated before, my first thought was that the variables would be available during synchronous event route processing, but you have confirmed that is not the case (now). Would you like me to create a feature request on github? I am sure you already have an idea what could be done; but my two cents would be something like a new WILL_TERMINATE state or have the information available in the terminated state for a period of time.

 

Thank you for your time,

 

Adam

 

From: Bogdan-Andrei Iancu [hidden email]
Date: Monday, March 11, 2019 at 4:38 AM
To: Adam Overbeeke [hidden email], OpenSIPS devel mailling list [hidden email]
Subject: Re: [OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog information for ENDED state.

 

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": [hidden email], "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": [hidden email], "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 [hidden email]
Date: Thursday, March 7, 2019 at 10:10 AM
To: Adam Overbeeke [hidden email], OpenSIPS devel mailling list [hidden email]
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 [hidden email]
Date: Thursday, March 7, 2019 at 5:37 AM
To: OpenSIPS devel mailling list [hidden email], Adam Overbeeke [hidden email]
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@01D2DB78.7C3D8250

cid:image002.png@01D2DB78.7C3D8250

cid:image003.png@01D2DB78.7C3D8250cid:image004.png@01D2DB78.7C3D8250cid:image005.png@01D2DB78.7C3D8250cid:image006.png@01D2DB78.7C3D8250cid:image007.png@01D2DB78.7C3D8250cid:image008.png@01D2DB78.7C3D8250

 







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

















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