[Asterisk-Users] ChanIsAvail app setting ${AVAILCHAN} to an unusable value.

Robert Hajime Lanning lanning+asterisk at monsoonwind.com
Sun Oct 5 14:41:07 MST 2003


I sent this earlier under "Editting variable contents" but no-one
has responded.  So, the subject is now more to the problem, instead of
the solution I was trying to implement.

ChanIsAvail returns the channel ID plus "-<session>".

How can I edit ${AVAILCHAN} to remove this session ID, so I can use its
contents in a subsequent Dial statement?

Dialing on Zap just gives a warning about unknown option "-", but
dialing a SIP channel completely errors out.

------ extensions.conf snippet-------------
;
; Main Home number (8901)
;
; Bedroom1
exten => 8901,1,Macro(twoline,Zap/1,Zap/2)
; Bedroom2
exten => 8901,2,Macro(twoline,Zap/3,Zap/4)
; Bedroom3
exten => 8901,3,Macro(twoline,Zap/5,Zap/6)
; Kitchen
exten => 8901,4,Macro(twoline,Zap/7,Zap/8)
; Familyroom
;exten => 8901,5,Macro(twoline,Zap/13,Zap/14)
exten => 8901,5,Macro(twoline,sip/set1,sip/set2)
; Now we dial!!!!
exten => 8901,6,Macro(stdexten,8901,${DIALCHANS})

[macro-twoline]
exten => s,1,SetVar(MACRO_OFFSET=0)
exten => s,2,ChanIsAvail(${ARG1}&${ARG2})
exten => s,3,GotoIf($["${DIALCHANS}" = ""]?s,6:s,4)
exten => s,4,SetVar(DIALCHANS=${DIALCHANS}&${AVAILCHAN})
exten => s,5,Goto(s,7)
exten => s,6,SetVar(DIALCHANS=${AVAILCHAN})
exten => s,7,Wait(0)

-- 
END OF LINE



More information about the asterisk-users mailing list