[SR-Users] Kamailio sending HTTP request to another app

Konstantin M. evilzluk at gmail.com
Mon Nov 18 18:16:53 CET 2013


Hello,


2013/11/18 Victor Torre Antunez <victor.torre at stoneworksolutions.net>

> Hi all,
>
> I´m using EXEC Module to execute a HTTP request via curl, to comunicate
> with another app like this:
>
>     exec_avp("curl --connect-timeout 1 --max-time 2  http://IP_ADDR:PORT/PATH/'$fU'/'$tU'/'$hdr(Call-ID)'",
> "$avp(s:output)");
>
> Sometimes Kamailio blocks when HTTP server does not response in time,
> despite the max-time parameter.
>
> I found this know issue on EXEC module docs:
>     "There is currently no guarantee that scripts ever return and stop
> blocking SIP server. (There is kill.c but it is not used along with the
> current mechanisms based on popen. Besides that kill.c is ugly)."
>
> Does anyone know a better way to communicate Kamailio with a HTTP server
> without blocks? I will try a python script to send the HTTP request and
> call it with APP_PYTHON module. Has anyone had blocks with APP_PYTHON
> module?
>
>
You can app_python and urllib2 with block/nonblock socket and timeouts,
e.g., you can define 5 seconds of timeout or so.


>
> Thanks in advance.
>
> --
> *Victor*
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20131118/b1384153/attachment.html>


More information about the sr-users mailing list