Ok, after requesting information to digium (no answer yet) and being informed that asterisk-dev is *NOT* a support hot line, I am trying in this list to see if someone has information on this regard. I know this is not a support area so I am only trying to get some clues. I have asterisk be and I am trying to use the CURL function (or application?). It is not available when I try it even though it is documented. Does anyone knows if there is a way to load it as a function/application inside asterisk? if so, is there code to download/compile to get it working inside asterisk? Any clue will be highly appreciated. (I keep trying digium support). Elpidio Elpidio Ramos President RM International Services SA CV Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell USA: +1 (801) 494-1415 Office +1 (240) 250-8264 Fax +1 (801) 938-4740 Direct -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060921/6dc9f6cf/attachment.htm
You can always use the System() command in asterisk to call the curl executable. jerry --------------- Ok, after requesting information to digium (no answer yet) and being informed that asterisk-dev is *NOT* a support hot line, I am trying in this list to see if someone has information on this regard. I know this is not a support area so I am only trying to get some clues. I have asterisk be and I am trying to use the CURL function (or application?). It is not available when I try it even though it is documented. Does anyone knows if there is a way to load it as a function/application inside asterisk? if so, is there code to download/compile to get it working inside asterisk? Any clue will be highly appreciated. (I keep trying digium support). Elpidio Elpidio Ramos President RM International Services SA CV Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell USA: +1 (801) 494-1415 Office +1 (240) 250-8264 Fax +1 (801) 938-4740 Direct
Jerry, Using system, is there a way to read into an asterisk variable the content of the response (i.e. a text in an http response) ?. If this is possible then I can use this approach. Thanks Jerry Geis <geisj@pagestation.com> wrote: You can always use the System() command in asterisk to call the curl executable. jerry --------------- Ok, after requesting information to digium (no answer yet) and being informed that asterisk-dev is *NOT* a support hot line, I am trying in this list to see if someone has information on this regard. I know this is not a support area so I am only trying to get some clues. I have asterisk be and I am trying to use the CURL function (or application?). It is not available when I try it even though it is documented. Does anyone knows if there is a way to load it as a function/application inside asterisk? if so, is there code to download/compile to get it working inside asterisk? Any clue will be highly appreciated. (I keep trying digium support). Elpidio Elpidio Ramos President RM International Services SA CV Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell USA: +1 (801) 494-1415 Office +1 (240) 250-8264 Fax +1 (801) 938-4740 Direct _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users Elpidio Ramos President RM International Services SA CV Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell USA: +1 (801) 494-1415 Office +1 (240) 250-8264 Fax +1 (801) 938-4740 Direct -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060921/b07f9400/attachment.htm
You need to use AGI to do this. You would put a shell script yourscript.agi in /var/lib/asterisk/agi-bin If you want an HTTP response dumped into your dialplan as a variable, you would use wget: myagi.agi: #!/bin/bash TMPFILE=/tmp/$$.$RANDOM wget -q -t3 --output-document=$TMPFILE http://mysite.com/myhtml.html <http://mysite.com/myhtml.html> MYVAR=$(cat $TMPFILE) echo "SET VARIABLE MYASTERISKVAR \"$MYVAR\"" rm $TMPFILE You would call the AGI like this: exten => foo,1,AGI(/var/lib/asterisk/agi-bin/myagi.agi) Optionally you can pass a parameter to the AGI: exten => foo,1,AGI(/var/lib/asterisk/agi-bin/myagi.agi foo) and you would retrieve the parameter in the AGI using the $1, $2, $3 variables in the AGI for parameter 1,2,3 etc. hth -----Original Message----- From: Elpidio Ramos [mailto:elpidio@ramosoft.com] Sent: Thursday, September 21, 2006 10:52 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] CURL Jerry, Using system, is there a way to read into an asterisk variable the content of the response (i.e. a text in an http response) ?. If this is possible then I can use this approach. Thanks Jerry Geis <geisj@pagestation.com> wrote: You can always use the System() command in asterisk to call the curl executable. jerry --------------- Ok, after requesting information to digium (no answer yet) and being informed that asterisk-dev is *NOT* a support hot line, I am trying in this list to see if someone has information on this regard. I know this is not a support area so I am only trying to get some clues. I have asterisk be and I am trying to use the CURL function (or application?). It is not available when I try it even though it is documented. Does anyone knows if there is a way to load it as a function/application inside asterisk? if so, is there code to download/compile to get it working inside asterisk? Any clue will be highly appreciated. (I keep trying digium support). Elpidio Elpidio Ramos President RM International Services SA CV Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell USA: +1 (801) 494-1415 Office +1 (240) 250-8264 Fax +1 (801) 938-4740 Direct _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users Elpidio Ramos President RM International Services SA CV Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell USA: +1 (801) 494-1415 Office +1 (240) 250-8264 Fax +1 (801) 938-4740 Direct -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060921/59097e58/attachment.htm
On Thu, Sep 21, 2006 at 12:03:06PM -0600, Colin Anderson wrote:> You need to use AGI to do this.Why not use the application or function Curl?> You would put a shell script yourscript.agi > in /var/lib/asterisk/agi-bin > > If you want an HTTP response dumped into your dialplan as a variable, you > would use wget: > > myagi.agi: > > #!/bin/bash > TMPFILE=/tmp/$$.$RANDOMinstead of that: set -e TMPFILE=`mktemp`> wget -q -t3 --output-document=$TMPFILE http://mysite.com/myhtml.html > MYVAR=$(cat $TMPFILE) > echo "SET VARIABLE MYASTERISKVAR \"$MYVAR\"" > rm $TMPFILE-- Tzafrir Cohen sip:tzafrir@local.xorcom.com icq#16849755 iax:tzafrir@local.xorcom.com +972-50-7952406 jabber:tzafrir@jabber.org tzafrir.cohen@xorcom.com http://www.xorcom.com
Jerry, Great information. I will try to implement it. Thanks a lot. Elpidio Colin Anderson <ColinA@landmarkmasterbuilder.com> wrote: You need to use AGI to do this. You would put a shell script yourscript.agi in /var/lib/asterisk/agi-bin If you want an HTTP response dumped into your dialplan as a variable, you would use wget: myagi.agi: #!/bin/bash TMPFILE=/tmp/$$.$RANDOM wget -q -t3 --output-document=$TMPFILE http://mysite.com/myhtml.html MYVAR=$(cat $TMPFILE) echo "SET VARIABLE MYASTERISKVAR \"$MYVAR\"" rm $TMPFILE You would call the AGI like this: exten => foo,1,AGI(/var/lib/asterisk/agi-bin/myagi.agi) Optionally you can pass a parameter to the AGI: exten => foo,1,AGI(/var/lib/asterisk/agi-bin/myagi.agi foo) and you would retrieve the parameter in the AGI using the $1, $2, $3 variables in the AGI for parameter 1,2,3 etc. hth -----Original Message----- From: Elpidio Ramos [mailto:elpidio@ramosoft.com] Sent: Thursday, September 21, 2006 10:52 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] CURL Jerry, Using system, is there a way to read into an asterisk variable the content of the response (i.e. a text in an http response) ?. If this is possible then I can use this approach. Thanks Jerry Geis <geisj@pagestation.com> wrote: You can always use the System() command in asterisk to call the curl executable. jerry --------------- Ok, after requesting information to digium (no answer yet) and being informed that asterisk-dev is *NOT* a support hot line, I am trying in this list to see if someone has information on this regard. I know this is not a support area so I am only trying to get some clues. I have asterisk be and I am trying to use the CURL function (or application?). It is not available when I try it even though it is documented. Does anyone knows if there is a way to load it as a function/application inside asterisk? if so, is there code to download/compile to get it working inside asterisk? Any clue will be highly appreciated. (I keep trying digium support). Elpidio Elpidio Ramos President RM International Services SA CV Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell USA: +1 (801) 494-1415 Office +1 (240) 250-8264 Fax +1 (801) 938-4740 Direct _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users Elpidio Ramos President RM International Services SA CV Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell USA: +1 (801) 494-1415 Office +1 (240) 250-8264 Fax +1 (801) 938-4740 Direct _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users Elpidio Ramos President RM International Services SA CV Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell USA: +1 (801) 494-1415 Office +1 (240) 250-8264 Fax +1 (801) 938-4740 Direct -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060921/aaf15e66/attachment.htm
On Thu, Sep 21, 2006 at 08:41:37AM -0700, Elpidio Ramos wrote:> Ok, after requesting information to digium (no answer yet) and being informed that asterisk-dev is *NOT* a support hot line, I am trying in this list to see if someone has information on this regard. > > I know this is not a support area so I am only trying to get some clues. > > I have asterisk be and I am trying to use the CURL function (or application?). It is not available when I try it even though it is documented. Does anyone knows if there is a way to load it as a function/application inside asterisk? if so, is there code to download/compile to get it working inside asterisk? > > Any clue will be highly appreciated. (I keep trying digium support).Do you actually have the application and function curl? in the asterisk CLI: show application curl show function curl show modules like app_curl.so (use tab completion) If you do not have it, it may be because libcurl (or its "development" package) was not availble. You may need a package of the sort of curl-devel or libcurl-dev installed on your system. Those are the basics. -- Tzafrir Cohen sip:tzafrir@local.xorcom.com icq#16849755 iax:tzafrir@local.xorcom.com +972-50-7952406 jabber:tzafrir@jabber.org tzafrir.cohen@xorcom.com http://www.xorcom.com
I suspect you need something like libcurl to build the CURL() function when building Asterisk Jerry Geis wrote:> You can always use the System() command in asterisk to call the curl > executable. > > jerry > --------------- > > Ok, after requesting information to digium (no answer yet) and being > informed that asterisk-dev is *NOT* a support hot line, I am trying in > this list to see if someone has information on this regard. > I know this is not a support area so I am only trying to get some clues. > I have asterisk be and I am trying to use the CURL function (or > application?). It is not available when I try it even though it is > documented. Does anyone knows if there is a way to load it as a > function/application inside asterisk? if so, is there code to > download/compile to get it working inside asterisk? > Any clue will be highly appreciated. (I keep trying digium support). > Elpidio > > > Elpidio Ramos President RM International Services SA CV > Web: http://www.ramosoft.com Mex: +52 (55) 5116-9804 Office > +52 (55) 5116-9805 Fax +52 (55) 1755-6601 Cell > USA: +1 (801) 494-1415 Office > +1 (240) 250-8264 Fax > +1 (801) 938-4740 Direct > > > > > > > > > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >