<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 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>