Robert Hajime Lanning
2003-Oct-05 14:41 UTC
[Asterisk-Users] ChanIsAvail app setting ${AVAILCHAN} to an unusable value.
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
Tilghman Lesher
2003-Oct-05 15:43 UTC
[Asterisk-Users] ChanIsAvail app setting ${AVAILCHAN} to an unusable value.
On Sunday 05 October 2003 16:41, Robert Hajime Lanning wrote:> 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?Oh, it's quite simple. You just write your own application to remove the suffix. Or you wait for someone else to write it. Untested code. UAYOR. -Tilghman -------------- next part -------------- A non-text attachment was scrubbed... Name: app_cut.c Type: text/x-csrc Size: 2782 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20031005/07f6f487/app_cut.c