<br><br><div class="gmail_quote">On Fri, Jan 14, 2011 at 12:14 AM, mayamatakeshi <span dir="ltr"><<a href="mailto:mayamatakeshi@gmail.com">mayamatakeshi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>can someone give me a sample of calling to xhttp from curl or wget?<br><br>I have this in my kamailio.cfg:<br><br><br>listen=tcp:<a href="http://192.168.2.105:80" target="_blank">192.168.2.105:80</a><br><br>loadmodule "xhttp.so"<br>
<br>event_route[xhttp:request] {<br> xhttp_reply("200", "OK", "text/html",<br> "<html><body>OK - [$si:$sp]</body></html>");<br>}<br><br><br>But when I try wget or curl, kamailio closes the connection without sending a response:<br>
<br>[root@centos55-02105 tmp]# curl <a href="http://192.168.2.105/test" target="_blank">http://192.168.2.105/test</a><br>curl: (52) Empty reply from server<br><br>[root@centos55-02105 tmp]# wget <a href="http://192.168.2.105/test" target="_blank">http://192.168.2.105/test</a><br>
--2011-01-14 00:11:49-- <a href="http://192.168.2.105/test" target="_blank">http://192.168.2.105/test</a><br>Connecting to 192.168.2.105:80... connected.<br>HTTP request sent, awaiting response... No data received.<br><br>
<br>I see this in the log file:<br>
<br>Jan 14 00:04:47 centos55-02105 /usr/local/sbin/kamailio[10479]: ERROR: <core> [tcp_read.c:904]: ERROR: tcp_read_req: bad request, state=7, error=4 buf: GET /test HTTP/1.0^M User-Agent: Wget/1.11.4 Red Hat modified^M Accept: */*^M Host: 192.168.2.105^M Connection: Keep-Alive^M ^M parsed: GET /test HTTP/1.0^M User-Agent: Wget/1.11.4 Red Hat modified^M Accept: */*^M Host: 192.168.2.105^M Connection: Keep-Alive^M ^M<br>
</blockquote></div><br>Nevermind.<br>I got it. It must be a POST request:<br><br> wget --post-data="abc" <a href="http://192.168.2.105/test">http://192.168.2.105/test</a><br><br>thanks,<br>takeshi<br><br>