<div dir="ltr">Hello,<div><br></div><div>do you want authentication with username and password or IP based authorization?<div><br></div><div>Cheers,<br>Daniel</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 23, 2017 at 7:04 AM, Olli Attila <span dir="ltr"><<a href="mailto:olli.attila@oatel.net" target="_blank">olli.attila@oatel.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I got the POST request working now by adding the "listen tcp:<a href="http://127.0.0.1:5060" rel="noreferrer" target="_blank">127.0.0.1:5060</a>". I tested this with dialplan.reload, dialplan.dump and htable.reload. Works ok.<br>
<br>
Is there any way to authenticate the request in Kamailio?<br>
<br>
Now all of the valid methods included in request: "<a href="http://127.0.0.1/RPC" rel="noreferrer" target="_blank">http://127.0.0.1/RPC</a>" are getting executed and Kamailio returns 200 OK directly.<br>
<br>
Cheers,<br>
<br>
--Olli<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
Diego Nadares kirjoitti 2017-05-22 15:06:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Olli,<br>
<br>
Did configure kamailio to listen on tcp:127.0.0.1?<br>
<br>
Diego<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
El 22 may. 2017, a las 02:54, Olli Attila <<a href="mailto:olli.attila@oatel.net" target="_blank">olli.attila@oatel.net</a>> escribió:<br>
<br>
Hi,<br>
<br>
I'm using kamailio 5.0.0 and trying to use core commands through xmlrpc interface but the requests are failing towards Kamailio.<br>
I have compiled and enabled the xmlrpc module in config and I have this on my kamailio.cfg:<br>
<br>
<br>
# XMLRPC routing<br>
#!ifdef WITH_XMLRPC<br>
route[XMLRPC] {<br>
 # allow XMLRPC from localhost<br>
 if ((method=="POST" || method=="GET")<br>
     && (src_ip==127.0.0.1)) {<br>
   # close connection only for xmlrpclib user agents (there is a bug in<br>
   # xmlrpclib: it waits for EOF before interpreting the response).<br>
   if ($hdr(User-Agent) =~ "xmlrpclib")<br>
     set_reply_close();<br>
   set_reply_no_connect();<br>
   dispatch_rpc();<br>
   exit;<br>
 }<br>
 send_reply("403", "Forbidden");<br>
 exit;<br>
}<br>
#!endif<br>
<br>
I have tried to test this by using curl and calling "core.uptime" method in xml body (core.uptime works when executed through kamcmd commandline tool).<br>
The curl is called from the same machine that I have Kamailio installed on:<br>
<br>
"curl -X POST -H 'Host: <a href="http://127.0.0.1:5060" rel="noreferrer" target="_blank">127.0.0.1:5060</a>' -H 'User-Agent: xmlrpcclient' -H 'Content-Type: text/xml' -d '<?xml version='1.0'?><methodCall><me<wbr>thodName>core.uptime</methodNa<wbr>me><params></params></methodCa<wbr>ll>' <a href="http://127.0.0.1:5060" rel="noreferrer" target="_blank">http://127.0.0.1:5060</a>"<br>
<br>
This fails and I only get: "curl: (7) Failed to connect to 127.0.0.1 port 5060: Connection refused"<br>
<br>
network traffic shows me this.. firewall is disabled completely when doing the test:<br>
1   0.000000    127.0.0.1 -> 127.0.0.1    TCP 74 55630→5060 [SYN] Seq=0 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=1347930477 TSecr=0 WS=64<br>
2   0.000032    127.0.0.1 -> 127.0.0.1    TCP 54 5060→55630 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0<br>
<br>
Can anyone help me to get to the right direction with this?<br>
<br>
Cheers,<br>
<br>
--Olli<br>
<br>
<br>
______________________________<wbr>_________________<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<wbr>-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
<br>
______________________________<wbr>_________________<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<wbr>-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
<br>
______________________________<wbr>_________________<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<wbr>-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="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>
</div>