working version with Asterisk 1.4

Comment on Asterisk Dynamic conferences macro
achauvin
Joined: Wed 07 of Feb, 2007

working version with Asterisk 1.4

Posted:Wed 07 of Feb, 2007 (17:08 UTC)
[macro-3ptyconference]
;
;
;
exten => s,1,NooP(${BLINDTRANSFER})
exten => s,2,Gotoif($["${BLINDTRANSFER}" != ""]?s-TRANSFERED|1:s-NOTTRANSFERED|1)

exten => s-TRANSFERED,1,Set(TECH=${CUT(BLINDTRANSFER,/,1)})
exten => s-TRANSFERED,2,Gotoif($["${TECH}" : "Zap"]?s-ZAPHOLDER|1:s-TRYSIP|1)

exten => s-ZAPHOLDER,1,Set(CONFHOLDER=${CUT(BLINDTRANSFER,/,2)})
exten => s-ZAPHOLDER,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-ZAPHOLDER,3,Goto(s-USERJOIN|1)

exten => s-TRYSIP,1,Gotoif($["${TECH}" : "SIP"]?s-SIPHOLDER|1:s-TRYmISDN|1)

exten => s-SIPHOLDER,1,Set(CONFHOLDER=${CUT(BLINDTRANSFER,/,2)})
exten => s-SIPHOLDER,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-SIPHOLDER,3,Goto(s-USERJOIN|1)

exten => s-TRYmISDN,1,Gotoif($["${TECH}" : "mISDN"]?s-mISDNHOLDER|1:s-TRYELSE|1)

exten => s-mISDNHOLDER,1,Set(CONFHOLDER=${CUT(BLINDTRANSFER,/,3)})
exten => s-mISDNHOLDER,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-mISDNHOLDER,3,Goto(s-USERJOIN|1)

exten => s-TRYELSE,1,Noop(SCCP, IAX channels and other technologies)
exten => s-TRYELSE,2,Noop(not supported at the moment)
exten => s-TRYELSE,3,Noop(Feel free to add support)
exten => s-TRYELSE,4,Goto(s-INVALID|1)

exten => s-NOTTRANSFERED,1,Noop(${CHANNEL})
exten => s-NOTTRANSFERED,2,Gotoif($["${CHANNEL}" != ""]?s-TRY2ZAP|1:s-INVALID|1)

exten => s-TRY2ZAP,1,Set(TECH=${CUT(CHANNEL,/,1)})
exten => s-TRY2ZAP,2,Gotoif($["${TECH}" : "Zap"]?s-ZAP2HOLDER|1:s-TRY2SIP|1)

exten => s-ZAP2HOLDER,1,Set(CONFHOLDER=${CUT(CHANNEL,/,2)})
exten => s-ZAP2HOLDER,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-ZAP2HOLDER,3,Goto(s-CHECKCONFEXIST|1)

exten => s-TRY2SIP,1,Gotoif($["${TECH}" : "SIP"]?s-SIP2HOLDER|1:s-TRY2mISDN|1)

exten => s-SIP2HOLDER,1,Set(CONFHOLDER=${CUT(CHANNEL,/,2)})
exten => s-SIP2HOLDER,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-SIP2HOLDER,3,Goto(s-CHECKCONFEXIST|1)

exten => s-TRY2mISDN,1,Gotoif($["${TECH}" : "mISDN"]?s-mISDN2HOLDER|1:s-TRY2ELSE|1)

exten => s-mISDN2HOLDER,1,Set(CONFHOLDER=${CUT(CHANNEL,/,3)})
exten => s-mISDN2HOLDER,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-mISDN2HOLDER,3,Goto(s-CHECKCONFEXIST|1)

exten => s-TRY2ELSE,1,Noop(SCCP,IAX channels and other technologies not)
exten => s-TRY2ELSE,2,Noop(supported at the moment.)
exten => s-TRY2ELSE,3,Noop(Feel free to add support !)
exten => s-TRY2ELSE,4,Goto(s-INVALID|1)

exten => s-USERJOIN,1,MeetMe(${CONFHOLDER},qdwx)

exten => s-CHECKCONFEXIST,1,MeetmeCount(${CONFHOLDER},CONFCOUNT)
exten => s-CHECKCONFEXIST,2,GotoIf($["${CONFCOUNT}" = ""]?s-INVALID|1:s-CONFNOTEMPTY|1)

exten => s-CONFNOTEMPTY,1,Gotoif($[${CONFCOUNT} > 0]?s-HOLDERJOIN|1:s-INVALID|1)

exten => s-HOLDERJOIN,1,Meetme(${CONFHOLDER},qdAx)

exten => s-INVALID,1,Playtones(info)
exten => s-INVALID,2,Wait(10)
exten => s-INVALID,3,Hangup()