[Asterisk-Users] Re: cmd curl crashes asterisk:

Tony Mountifield tony at softins.clara.co.uk
Tue May 31 00:51:09 MST 2005


In article <20050528221911.A4F782FDE3C at lists.digium.com>,
Tim Connolly <tim at timsnet.com> wrote:
> 	I recently began using the curl cmd to do an external callerid
> lookup on my own customer database. I've noticed certain lookups will cause
> a crash and not show anything in the messages file or the console.

It is failed lookups (or perhaps also ones that return no data) that
cause a crash. See http://bugs.digium.com/bug_view_page.php?bug_id=4389
or use CVS HEAD later than 2005/05/26

Cheers
Tony

> The curl
> command is connecting to an external webserver which has a oracle db
> connection. The file its hitting is PHP and does a very simply lookup
> showing the text like "C1234 Bobs mowing service" which I later cut off at
> 15 characters to squeeze it in setcidname(). Here is an example crash. 
> 
>     -- Goto (macro-getcustid,s,3)
>     -- Executing NoOp("Zap/2-1", "Call from  using .") in new stack
>     -- Executing Curl("Zap/2-1",
> "http://old-inside.theplanet.com/xmlservices/cnum_lookup.html?cid=") in new
> stack
> pbx01*CLI> 
> Disconnected from Asterisk server
> 
> [macro-getcustid]; ${DEFAULT} is my own number..i.e. no cid was given...
> exten => s,1,setvar(CURL=)
> exten => s,2,gotoif($["${CALLERIDNUM}" = "${DEFAULT}"]?9:3)
> exten => s,3,noop(Call from ${CALLERIDNAME} using ${CALLERIDNUM}.)
> exten =>
> s,4,curl('http://mywebserver-name/xmlservices/cnum_lookup.html\?cid=${CALLER
> IDNUM}')
> exten => s,5,setvar(CURL=${CURL:0:15})
> exten => s,6,noop(Setting callerid ${CALLERIDNUM} to ${CURL})
> exten => s,7,setcidname(${CURL})
> exten => s,8,goto(s,10)
> exten => s,9,noop(Skipping because CID = ${CALLERIDNUM})
> exten => s,10,noop
> 
> 	I can easily avoid these crashes (I hope) by not executing the curl
> command if the ${CALLERID} variable is less than 10 characters, but I
> thought I would point out that CURL should not be crashing the whole system
> because a URL was disliked.
> 
> Asterisk CVS-HEAD-04/14/05-15:57:59
> 
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
> 


-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-users mailing list