<p>I'm trying to have an external application to write CDR to a database by doing this:</p>

<p>event_route[dialog:start] {<br>
        evapi_relay("{'cdr_id': $dlg_var(cdr_id), 'event': 'answered'}");<br>
}<br>
event_route[dialog:end] {<br>
        evapi_relay("{'cdr_id': $dlg_var(cdr_id), 'event': 'ended'}");<br>
}</p>

<p>event_route[dialog:failed] {<br>
        evapi_relay("{'cdr_id': $dlg_var(cdr_id), 'event': 'failed'}");<br>
}</p>

<p>$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.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/646">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AF36ZVg7EKd8v7NTe0xViGmadGCx9KVXks5qGq9SgaJpZM4IppAz">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZVNiPSBG617jTc7WbNZ3e2nN8tx4ks5qGq9SgaJpZM4IppAz.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/646"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>