List, We're working on an upcoming job that may require us to access a web service (WS). I'm curious to hear peoples thoughts on the best way to do this with asterisk. We'll be submitting a single number to the WS and it will return a success or error. One solution would be to write a simple perl script to interface into to the WS, and use SYSTEM() from asterisk to call it. Another may be to use the func_curl to do it too. If anybody have suggestions / ideas please post them. Thanks again, PB
On Jul 15, 2008, at 10:08 PM, Paul Belanger wrote:> List, > > We're working on an upcoming job that may require us to access a web > service (WS). I'm curious to hear peoples thoughts on the best way to > do this with asterisk. We'll be submitting a single number to the WS > and it will return a success or error. >Honestly, if you're running a webservice, I like using the CURL function. Works like a charm for me. Fred Posner fred at teamforrest.com Tel: +1 (212) 937-7844 x501 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2162 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080715/396d6031/attachment.bin
Try Adhersion and or Telegraph -E http://mobiquity.ws -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080715/5464aa60/attachment.htm
On Tue, 15 Jul 2008, Paul Belanger wrote:> We're working on an upcoming job that may require us to access a web > service (WS). I'm curious to hear peoples thoughts on the best way to > do this with asterisk. We'll be submitting a single number to the WS > and it will return a success or error. > > One solution would be to write a simple perl script to interface into > to the WS, and use SYSTEM() from asterisk to call it. Another may be > to use the func_curl to do it too. > > If anybody have suggestions / ideas please post them.curl() doesn't fire up another process. The response is returned as just one big chunk. In my case, it was the HTML to an entire web page :) If you need to do a bunch of parsing, maybe an AGI calling libcurl -- saving a bunch of ugly dialplan. Thanks in advance, ------------------------------------------------------------------------ Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
On Wed, Jul 16, 2008 at 3:08 AM, Paul Belanger <pabelanger at gmail.com> wrote:> List, > > We're working on an upcoming job that may require us to access a web > service (WS). I'm curious to hear peoples thoughts on the best way to > do this with asterisk. We'll be submitting a single number to the WS > and it will return a success or error. > > One solution would be to write a simple perl script to interface into > to the WS, and use SYSTEM() from asterisk to call it. Another may be > to use the func_curl to do it too. > > If anybody have suggestions / ideas please post them. >If you need to use a web service and return a SOAP payload then I'd strongly suggest using the FastAGI. I've always found the FastAGI interface simple and reliable and it allows you to put all your web service processing code into whatever development environment you are comfortable with. I am a heavier user of web services with Asterisk and FastAGI is the way I do it. By using FastAGI you'll also have a nice process separation boundary between you new logic and Asterisk. It's pretty likely you'll need to do a lot of changes to your logic at least in the short term and it's a lot easier to restart the FastAGI process then it is to re-start Asterisk when it has a bunch of live calls. And then of course you'll need to add security to your web serivces or the API will change etc. etc. Incidentally I do use Curl calls from Asterisk as well but not for web service end points. I use Curl to call a very basic HTTP server that returns a single integer value. That's a whole different kettle of fish compared to a web services API. Regards, Greyman.