[Asterisk-Users] Does AEL support arrays?
Eric "ManxPower" Wieling
eric at fnords.org
Fri Nov 4 08:37:55 MST 2005
Kevin P. Fleming wrote:
> Chris Bagnall wrote:
>
>> Does anyone know whether there's any support in AEL for arrays, and if
>> so,
>> how one would go about implementing a shift statement?
>
>
> No, it does not provide any types of variables that are not available
> already in the dialplan. Technically, it is only a new _syntax_, not a
> new dialplan language.
If that's the case then the following could be easily converted to AEL.
Notice the "fake" subscripts I used.
[macro-whatever]
exten =>
s,1,AGI(callerid-fixup.agi,${CALLERIDNUM}&${MACRO_EXTEN}&0000000000)
exten => s,2,Noop(AGI(set-ring))
exten => s,3,GotoIf($[${LEN(${FAX_DEST})} = 0]?9:4)
exten => s,4,Cut(TECHNOLOGY=CHANNEL,/,1)
exten => s,5,GotoIf($["${TECHNOLOGY}" = "Zap"]?6:9)
exten => s,6,Answer
exten => s,7,Ringing
exten => s,8,NVFaxDetect(4,d)
exten => s,9,Goto(${MACRO_EXTEN},1)
exten => _XXXX,1,GotoIf($[${LEN(${DIAL_DEST[1]})} = 0]?2:4)
exten => _XXXX,2,GotoIf($[${LEN(${DIAL_DEST})} = 0]?14:3)
exten => _XXXX,3,SetVar(DIAL_DEST[1]=${DIAL_DEST})
exten => _XXXX,4,SetVar(INDEX=1)
exten => _XXXX,5,GotoIf($[${LEN(${DIAL_TIMEOUT[${INDEX}]})} = 0]?6:7)
exten => _XXXX,6,SetVar(DIAL_TIMEOUT[${INDEX}]=20)
exten =>
_XXXX,7,Dial(${DIAL_DEST[${INDEX}]},${DIAL_TIMEOUT[${INDEX}]},${DIAL_OPTS[${INDEX}]}g)
exten => _XXXX,8,GotoIf($["${DIALSTATUS}" = "BUSY" | "${DIALSTATUS}" =
"CHANUNAVAIL" | "${DIALSTATUS}" = "CONGESTION"]?12:9)
exten => _XXXX,9,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?14:10)
exten => _XXXX,10,Noop(DIALSTATUS=${DIALSTATUS})
exten => _XXXX,11,Hangup
exten => _XXXX,12,SetVar(INDEX=$[${INDEX} + 1])
exten => _XXXX,13,GotoIf($[${LEN(${DIAL_DEST[${INDEX}]})} = 0]?14:5)
exten => _XXXX,14,GotoIf($[${LEN(${VOICE_MAILBOX})} = 0]?19:15)
exten => _XXXX,15,Voicemail(${VOICE_MAILBOX})
exten => _XXXX,16,Wait(2)
exten => _XXXX,17,Hangup
exten => _XXXX,18,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?19:22)
exten => _XXXX,19,Voicemail(u${EXTEN})
exten => _XXXX,20,Wait(2)
exten => _XXXX,21,Hangup
exten => _XXXX,22,Voicemail(b${EXTEN})
exten => _XXXX,23,Wait(2)
exten => _XXXX,24,Hangup
exten => _XXXX,116,AbsoluteTimeout(30)
exten => _XXXX,117,Playback(sorry-mailbox-full)
exten => _XXXX,118,Wait(2)
exten => _XXXX,119,Congestion
exten => _XXXX,120,Goto(116)
exten => _XXXX,123,Goto(116)
exten => talk,1,Goto(${MACRO_EXTEN},1)
exten => fax,1,Cut(FAX_TECH=FAX_DEST,/,1)
exten => fax,2,GotoIf($["${FAX_TECH}" = "Zap"]?3:7)
exten => fax,3,Dial(${FAX_DEST},20)
exten => fax,4,AbsoluteTimeout(30)
exten => fax,5,Wait(2)
exten => fax,6,Congestion
exten => fax,7,RxFax(/tmp/fax-${UNIQUEID}.tiff)
exten =>
fax,8,DeadAGI(/usr/local/bin/fax2email.pl,/tmp/fax-${UNIQUEID}.tiff)
exten => fax,9,Hangup
exten => fax,104,AbsoluteTimeout(30)
exten => fax,105,Busy
exten => a,1,Playback(/etc/asterisk/directvm)
exten => a,2,VoicemailMain()
exten => a,3,Wait(.5)
exten => a,4,Goto(1)
exten => o,1,GotoIf($[${LEN(${OPER_DEST})} = 0]?2:4)
exten => o,2,Goto(extensions,0,1)
exten => o,3,Hangup
exten => o,4,GotoIf($[${OPER_TIMEOUT} = 0]?5:6)
exten => o,5,SetVar(OPER_TIMEOUT=)
exten => o,6,GotoIf($[${LEN(${OPER_MESSAGE})} = 0]?8:7)
exten => o,7,Playback(${OPER_MESSAGE})
exten => o,8,Dial(${OPER_DEST},${OPER_TIMEOUT},${OPER_FLAGS})
exten => o,9,Voicemail(u${MACRO_EXTEN})
exten => o,10,Hangup
More information about the asterisk-users
mailing list