[asterisk-dev] System/SHELL in redirecting macro hangs asterisk

J.A. Bezemer J.A.Bezemer+asteriskdev at opensourcepartners.nl
Mon Sep 17 08:31:19 CDT 2012


Hi all,

Asterisk 1.8.8.0 on Debian 6.0.5, stock Debian-backports kernel 
2.6.39-bpo.2-486.

Three SIP phones: 123, 456 and 789. All have sendrpid=pai.

Phone 456 is set to unconditionally forward all calls to 789; it correctly 
says 302 "Moved Temporarily".

Minimal dialplan:

[fromsip]
exten => 456,1,NoOp(This is ${CONTEXT}:${EXTEN})
exten => 456,n,Set(__REDIRECTING_CALLER_SEND_MACRO=redirtest1)
exten => 456,n,Set(__REDIRECTING_CALLEE_SEND_MACRO=redirtest1)
exten => 456,n,Dial(SIP/456)
exten => 789,1,NoOp(This is ${CONTEXT}:${EXTEN})
exten => 789,n,Dial(SIP/789)

[macro-redirtest1]
exten => s,1,NoOp(This is ${CONTEXT}:${EXTEN})
;exten => s,n,System(/bin/true)  ; HANGS asterisk
;exten => s,n,Set(DUMMY=${SHELL(echo abc)})  ; HANGS asterisk


Phone 123 dials 456. Phone 456 forwards the call to 789.

Once I use System or SHELL in the redirecting macro, asterisk will hang 
on it. Actually, console will still work, but no SIP traffic is 
processed at all and that's all I can test with.

Am I doing something wrong? Is this forbidden? Can anyone reproduce?


(Above minimal dialplan was distilled from something rather more 
elaborate, using Answer'ed channels, thkTHK Dial flags, and one or more 
Local channels in-between; in that scenario, SHELL would actually 
properly execute a shell script _unless_ wget was used inside it. Am I 
going crazy?)


Thanks for any help,

Anne Bezemer



More information about the asterisk-dev mailing list