<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \,serif";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi Bogdan, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">We are trying to access the dialog information during the event route. The function that we are using is </span><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">get_dialog_vals.</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> 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. <o:p></o:p></span></pre>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></pre>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">i.e. in this example: variableOne and variableTwo are dialog variables.<o:p></o:p></span></pre>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></pre>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">event_route[E_DLG_STATE_CHANGED] {<o:p></o:p></span></p>
<pre style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">         </span><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">fetch_event_params("hash_entry=$avp(eparm_hash_entry)");<o:p></o:p></span></pre>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">        fetch_event_params("hash_id=$avp(eparm_hash_id)");<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">        fetch_event_params("callid=$avp(eparm_callid)");<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">        fetch_event_params("from_tag=$avp(eparm_from_tag)");<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">        fetch_event_params("to_tag=$avp(eparm_to_tag)");<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">        fetch_event_params("old_state=$avp(eparm_old_state)");<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">        fetch_event_params("new_state=$avp(eparm_new_state)");<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">         if ( get_dialog_vals("$avp(d_names)","$avp(d_vals)","$avp(eparm_callid)") ) {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                $var(i) = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                while ( $(avp(d_names)[$var(i)]) != NULL ) {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                         $var(k) = $(avp(d_names)[$var(i)]);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                         $var(v) = $(avp(d_vals)[$var(i)]);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                         switch($var(k)) {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                                  case "variableOne":<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                                           #// log statement here<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                                           break;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                                  case "variableTwo":<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                                           #// log statement here<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                                           break;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                         }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                         $var(i) = $var(i) + 1;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">                }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D">        }<o:p></o:p></span></p>
<p class="MsoNormal">}<o:p></o:p></p>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></pre>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">^ when the state is ENDED, get_dialog_vals returns nothing back for the dialog’s callid.<o:p></o:p></span></pre>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></pre>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Hope it helps, <o:p></o:p></span></pre>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></pre>
<pre style="line-height:13.5pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Adam</span><span style="font-size:9.0pt;font-family:Consolas;color:#172B4D"><o:p></o:p></span></pre>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Bogdan-Andrei Iancu <bogdan@opensips.org><br>
<b>Date: </b>Thursday, March 7, 2019 at 5:37 AM<br>
<b>To: </b>OpenSIPS devel mailling list <devel@lists.opensips.org>, Adam Overbeeke <Adam.Overbeeke@genesys.com><br>
<b>Subject: </b>Re: [OpenSIPS-Devel] E_DLG_STATE_CHANGED missing dialog information for ENDED state.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><tt><span style="font-size:10.0pt">Hi Adam,</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
</span><tt><span style="font-size:10.0pt">Sorry for the late reply.</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
</span><tt><span style="font-size:10.0pt">How exactly are you trying to retrieve the dialog info (during the TERMINATED event) ?</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
</span><tt><span style="font-size:10.0pt">Regards,</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
</span><o:p></o:p></p>
<pre>Bogdan-Andrei Iancu<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>OpenSIPS Founder and Developer<o:p></o:p></pre>
<pre>  <a href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a><o:p></o:p></pre>
<pre>OpenSIPS Summit 2019<o:p></o:p></pre>
<pre>  <a href="https://www.opensips.org/events/Summit-2019Amsterdam/">https://www.opensips.org/events/Summit-2019Amsterdam/</a><o:p></o:p></pre>
<div>
<p class="MsoNormal">On 02/20/2019 04:55 PM, Adam Overbeeke wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Hello all, <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">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.
<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">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.
<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks, <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Adam <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Times New Roman ,serif",serif">Adam Overbeeke</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Times New Roman ,serif",serif">Lead Voice Network Engineer, PureCloud
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Times New Roman ,serif",serif"><img border="0" width="291" height="9" style="width:3.0312in;height:.0937in" id="Picture_x0020_8" src="cid:image001.png@01D4D4CB.0F9EC520" alt="cid:image001.png@01D2DB78.7C3D8250"></span><o:p></o:p></p>
<p class="MsoNormal"><a href="http://www.genesys.com/"><span style="color:windowtext;text-decoration:none"><span style="color:#0563C1"><img border="0" width="143" height="53" style="width:1.4895in;height:.552in" id="Picture_x0020_7" src="cid:image002.png@01D4D4CB.0F9EC520" alt="cid:image002.png@01D2DB78.7C3D8250"></span></span></a><o:p></o:p></p>
<p class="MsoNormal"><a href="https://twitter.com/Genesys"><span style="color:windowtext;text-decoration:none"><span style="color:#0563C1"><img border="0" width="25" height="23" style="width:.2604in;height:.2395in" id="Picture_x0020_6" src="cid:image003.png@01D4D4CB.0F9EC520" alt="cid:image003.png@01D2DB78.7C3D8250"></span></span></a><a href="http://www.linkedin.com/company/601919?trk=tyah"><span style="color:windowtext;text-decoration:none"><span style="color:#0563C1"><img border="0" width="25" height="23" style="width:.2604in;height:.2395in" id="Picture_x0020_5" src="cid:image004.png@01D4D4CB.0F9EC520" alt="cid:image004.png@01D2DB78.7C3D8250"></span></span></a><a href="https://plus.google.com/+Genesyslab?rel=publisher"><span style="color:windowtext;text-decoration:none"><span style="color:#0563C1"><img border="0" width="23" height="23" style="width:.2395in;height:.2395in" id="Picture_x0020_4" src="cid:image005.png@01D4D4CB.0F9EC520" alt="cid:image005.png@01D2DB78.7C3D8250"></span></span></a><a href="https://www.facebook.com/Genesys/"><span style="color:windowtext;text-decoration:none"><span style="color:#0563C1"><img border="0" width="25" height="23" style="width:.2604in;height:.2395in" id="Picture_x0020_3" src="cid:image006.png@01D4D4CB.0F9EC520" alt="cid:image006.png@01D2DB78.7C3D8250"></span></span></a><a href="https://www.youtube.com/Genesys"><span style="color:windowtext;text-decoration:none"><span style="color:#0563C1"><img border="0" width="25" height="23" style="width:.2604in;height:.2395in" id="Picture_x0020_2" src="cid:image007.png@01D4D4CB.0F9EC520" alt="cid:image007.png@01D2DB78.7C3D8250"></span></span></a><a href="http://blog.genesys.com/"><span style="color:windowtext;text-decoration:none"><span style="color:#0563C1"><img border="0" width="23" height="23" style="width:.2395in;height:.2395in" id="Picture_x0020_1" src="cid:image008.png@01D4D4CB.0F9EC520" alt="cid:image008.png@01D2DB78.7C3D8250"></span></span></a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Devel mailing list<o:p></o:p></pre>
<pre><a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a><o:p></o:p></pre>
<pre><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
</div>
</body>
</html>