<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>can you open an issue on the tracker from github kamailio project
      on this topic? Once I get some time I would like to investigate
      why dlg vars are not available in the event routes. It is good to
      have it on tracker, not to forget about it.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 28/05/16 10:16, Minh Phan wrote:<br>
    </div>
    <blockquote
cite="mid:CAMqAU1iSjUGd3B2Ji-HDpceuH5tnZeZ+ohfbjyDHR2XLx7U5hw@mail.gmail.com"
      type="cite">
      <div dir="ltr">I managed to make it work by using $dlg(callid) and
        $dlg(from_tag) as dialog identifier:
        <div><br>
        </div>
        <div>
          <div style="font-size:12.8px">
            <div>event_route[dialog:start] {</div>
            <div>        evapi_relay("{'callid':<b> '</b><span
                style="font-size:small">$dlg(callid)'</span><b>,</b> 'from_tag':
              '$dlg(from_tag)', 'event': 'answered'}");<br>
            </div>
            <div>}<br>
            </div>
            <div>event_route[dialog:end] {</div>
            <div>        evapi_relay("<span style="font-size:12.8px">{'callid':</span><b
                style="font-size:12.8px"> '</b><span
                style="font-size:small">$dlg(callid)'</span><b
                style="font-size:12.8px">,</b><span
                style="font-size:12.8px"> 'from_tag': '$dlg(from_tag)'</span>,
              'event': 'ended'}");<br>
            </div>
            <div>}</div>
            <div><br>
            </div>
            <div>event_route[dialog:failed] {</div>
            <div>        evapi_relay("<span style="font-size:12.8px">{'callid':</span><b
                style="font-size:12.8px"> '</b><span
                style="font-size:small">$dlg(callid)'</span><b
                style="font-size:12.8px">,</b><span
                style="font-size:12.8px"> 'from_tag': '$dlg(from_tag)'</span>,
              'event': 'failed'}");</div>
            <div>}</div>
            <div><br>
            </div>
            <div>Regards,</div>
            <div>Minh</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2016-05-27 18:25 GMT+02:00 Minh Phan <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:mphan@wengo.com" target="_blank">mphan@wengo.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Hi List,
              <div><br>
              </div>
              <div>I'm trying to have an external application to write
                CDR to a database by doing this:</div>
              <div><br>
              </div>
              <div>
                <div>event_route[dialog:start] {</div>
                <div>        evapi_relay("{'cdr_id':<b>
                    $dlg_var(cdr_id),</b> 'event': 'answered'}");<br>
                </div>
                <div>}<br>
                </div>
                <div>event_route[dialog:end] {</div>
                <div>        evapi_relay("{'cdr_id': <b>$dlg_var(cdr_id)</b>,
                  'event': 'ended'}");<br>
                </div>
                <div>}</div>
                <div><br>
                </div>
                <div>event_route[dialog:failed] {</div>
                <div>        evapi_relay("{'cdr_id': <b>$dlg_var(cdr_id)</b>,
                  'event': 'failed'}");</div>
                <div>}</div>
              </div>
              <div><br>
              </div>
              <div>$dlg_var(cdr_id) is set inside a request route.
                However, in these event routes, its value is always
                null. Its seems that $dlg_var variables are not
                available in those event routes.<br>
              </div>
              <div><br>
              </div>
              <div>What are the variables available in dialog event
                route? Any suggestion on how to achieve what I'm trying
                to do?</div>
              <div><br>
              </div>
              <div>Best regards,</div>
              <div>Minh</div>
              <div><br>
              </div>
              <div><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a> - <a class="moz-txt-link-freetext" href="http://www.kamailio.org">http://www.kamailio.org</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>