<div>modparam("acc", "evi_extra", "json=$avp(json_acc)")<br></div><div><br></div><div>startup_route {</div><div>  if (!subscribe_event("E_ACC_CDR", "rabbitmq:user:pass@host/queue")) {</div><div>    xlog("L_ERR","Cannot subscribe RabbitMQ to E_ACC_CDR\n");</div><div>  }</div><div>}</div><div><br></div><div><div>route["set_acc_variables"] {</div><div>  $json(acc) := "{}";       </div><div>  $json(acc/from_user)      = $avp(ani);</div><div>  $json(acc/to_user)        = $avp(dnis);</div></div><div>  ...</div><div><div>  $avp(json_acc)            = $json(acc); #deserialize for raising the event</div><div>}</div></div><div><br></div><div>Obviously there are other parameters involved for the acc module but this should provide the gist for using aqmp or any other method you want once you deserialize the json object.  You can catch this in a worker and serialize it to json using any language you want.</div><br>On Friday, February 23, 2018, SamyGo <<a href="mailto:govoiper@gmail.com">govoiper@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Razvan, will open a feature request. <br>Jarrod Can you elaborate the steps involved please?<div><br><div>So, I don't have anything against XML right now but my XML receiver side is a bit of difficulty in terms of parsing the XML structure (Its done but not in a way I like it) - JSON will make it far easier.</div><div><br></div><div>Regards,</div><div>Sammy</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 23, 2018 at 10:49 AM, Jarrod Baumann <span dir="ltr"><<a href="mailto:jarrod@unixc.org" target="_blank">jarrod@unixc.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">I build the JSON data with cdr and convert to a string for throwing events. Then whatever collects your CDR can serialize it again. This works well and is probably similar to what XML is doing. </div><div><br><div class="gmail_quote"><div><div><div>On Thu, Feb 22, 2018 at 10:14 PM SamyGo <<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div>Hi,<div><br></div><div>I'm using ACC module to trigger accounting events which land up in event_xmlrpc and ultimately shipped to remote CDR collection server. The sent data is obviously an XML - now, can I have an event_json like module so data is sent as JSON or is there any other way I can achieve the same ?</div><div><br></div><div>Regards</div><div>Sammy</div><div><br></div><div><br></div></div></div></div><span>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
</span></blockquote></div></div>
<br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>
</blockquote>