<div dir="ltr"><div>Checking quickly on google for call control app for sip, it resulted in a github repository and at my first guess after searching for dlg_end_dlg is that you need to change the line:</div><div><br></div><div>  * <a href="https://github.com/AGProjects/callcontrol/blob/master/callcontrol/opensips.py#L177">https://github.com/AGProjects/callcontrol/blob/master/callcontrol/opensips.py#L177</a></div><div><br></div><div>To be from:</div><div><br></div><div>cmd <span class="gmail-pl-k">=</span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>:dlg_end_dlg:<span class="gmail-pl-cce">\n</span><span class="gmail-pl-c1">%s</span><span class="gmail-pl-cce">\n</span><span class="gmail-pl-c1">%s</span><span class="gmail-pl-cce">\n\n</span><span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-k">%</span> (dialog_id.h_entry, dialog_id.h_id)</div><div><br></div><div>something like:</div><div><br></div><div>cmd <span class="gmail-pl-k">=</span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>{ "jsonrpc": "2.0", "method": "dlg.end_dlg", "params": [<span class="gmail-pl-cce"></span><span class="gmail-pl-c1">%s</span><span class="gmail-pl-cce">, </span><span class="gmail-pl-c1">%s], "id": 1}</span><span class="gmail-pl-cce"></span><span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-k">%</span> (dialog_id.h_entry, dialog_id.h_id)</div><div><br></div><div>You don't need reply_name, because it is using socket file not fifo file for interacting with the sip server. In kamailio use jsonrpcs module configured with a unix socket control file. Not a python developer, so take the above as guidelines, maybe you need some small changes to make the cmd assignment done properly.<br></div><div><br></div><div>Cheers,<br></div><div>Daniel<br></div><div>  <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 27, 2019 at 2:33 PM Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div>if the external call control is open source, then you can patch it -- the changes should be quite minimal, the format of MI command was line oriented, for jsonrpc is in json format, but the values put there should be the same.</div><div><br></div><div>So, for MI, to the Kamailio's fifo file was written something like:</div><div><br></div><div><pre class="gmail-m_-7763718669265355133gmail-programlisting">:dlg_end_dlg:_reply_fifo_file_
342
56
_empty_line_<br><br></pre><pre class="gmail-m_-7763718669265355133gmail-programlisting">For JSONRPC, it should be:<br><br>{
 "jsonrpc": "2.0",
  "method": "dlg.end_dlg",<br>  "params": [342, 56],<br>  "reply_name": "_reply_fifo_file_",
  "id": 1
}<br><br></pre><pre class="gmail-m_-7763718669265355133gmail-programlisting">The values 342 and 56 are taken from dialog module example for v4.4, representing dialog id values (hash id and label), so they are specific for each call.<br><br>Likely you have to also handle the response that will be in json format, but expecting again to be something simple to deal with.<br><br></pre><pre class="gmail-m_-7763718669265355133gmail-programlisting">The alternative will be to make a FIFO proxy to translate from MI to JSONRPC and back for this specific command -- it should be several lines of python, node or other scripting language.<br></pre><pre class="gmail-m_-7763718669265355133gmail-programlisting">Cheers,<br></pre><pre class="gmail-m_-7763718669265355133gmail-programlisting">Daniel<br></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 27, 2019 at 11:29 AM Efelin Novak <<a href="mailto:efelin.novak@gmail.com" target="_blank">efelin.novak@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Daniel,<div><br></div><div>so ag-projects (Call-control developer) said the Call-control python app is designed for MI and there is no plan to support anything else (<a href="http://lists.opensips.org/pipermail/users/2019-June/041235.html" target="_blank">http://lists.opensips.org/pipermail/users/2019-June/041235.html</a>). So this makes this project unusable in Kamailio 5.x.</div><div><br></div><div>I have hacked call-control module to return something, so the Kamailio does not error, but this is just a hack, nothing production.</div><div><br></div><div>I humbly suggest to remove call-control from modules or at least write in documentation, that it does not support ag-projects applications anymore.</div><div><br></div><div>Anyway thanks for willingness to help</div><div><br></div><div>Kind regards</div><div><br></div><div>Efelin</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">st 26. 6. 2019 o 14:45 Efelin Novak <<a href="mailto:efelin.novak@gmail.com" target="_blank">efelin.novak@gmail.com</a>> napísal(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Daniel,<div><br></div><div>thanks for a reply. No, the module is not using an MI. The Python application call-control is using the MI to end the calls using dlg_end_dlg. I see it like this: the communication from Kamailio to Call-control works, however the communication from Call-Control to Kamailio (I think this is only used to kill a call - <a href="http://callcontrol.ag-projects.com/images/prepaid-engine.png" target="_blank">http://callcontrol.ag-projects.com/images/prepaid-engine.png</a>) does not. It is using an MI (CallControl -> Kamailio).</div><div><br></div><div>I understand this is not your problem (that is why I also post a message to the developer list), but call_control module without call-control application is useless (as far as I understand).</div><div><br></div><div>Is there any workaround how to turn the MI on or to have some interface separately, to do MI <-> JSON-RPC?</div><div><br></div><div>I want to switch to Evapi and CGRateS, however in a meanwhile I wanted to have both systems running simultaneously.</div><div><br></div><div>Again thanks</div><div><br></div><div>Efelin</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">st 26. 6. 2019 o 14:21 Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>> napísal(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>are you saying that the call_control module in kamailio is still using MI in version 5.2.x? The code related to MI was removed, should not be any use of it, can you point in the code where that happens? It can be migrated to RPC if is some raw MI operation ...</div><div><br></div><div>Cheers,</div><div>Daniel<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 26, 2019 at 1:45 PM Efelin Novak <<a href="mailto:efelin.novak@gmail.com" target="_blank">efelin.novak@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Folks,<div><br></div><div>I'm migrating to Kamailio 5.2.x from 4.4.x. Everything seems to be fine, however I have came to an issue with call_control module as this one is still using old MI interface.</div><div><br></div><div>Standard situations work nice (maximum debit, prepaid, "CDRs") however when call_control needs to kill a call (credit is gone), it tries to send dlg_end_dlg over MI and it fails.</div><div><br></div><div>Question are:</div><div>Is call_control still supported? I haven't found any note about it.</div><div>Is there any workaround from Kamailio point of view?</div><div><br></div><div>I'm running last versions of both applications. I'm also rising a ticket at ag-projects side.</div><div><br></div><div>Thanks</div><div><br></div><div>Efelin</div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail-m_-7763718669265355133gmail-m_-5994343356926899386gmail-m_-4281535783671204511gmail-m_-8077891511667883069gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></div><div><a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a></div></div></div></div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail-m_-7763718669265355133gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></div><div><a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></div><div><a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a></div></div></div></div></div>