exten => s, 31, Playback(${ply_file}) ;
exten => s, 32, Record(genesys-rec-${rec_file}.wav) ;can't detect|report dtmf
exten => s, 33, Goto(s,98)
;
; ELSE
; Play treatment
exten => s, 40, GotoIf($[${LEN(${ply_file})} = 0] ? 41 : 43)
exten => s, 41, Set(ply_file=${DEFAULT_FILE_TO_PLAY})
exten => s, 42, Goto(s,44)
exten => s, 43, Set(ply_count=$["${ARG1}":"${FIND_REP_REGEX}"])
exten => s, 44, GotoIf($[$[${LEN(${ply_count})} = 0] | $["$ply_count" = "forever"]]?
50 : 60)
; Playback forever
exten => s, 50, Playback(${ply_file})
exten => s, 51, GotoIf($[${PLAYBACKSTATUS}=FAILED] ? 52 : 50) ;Goto(s, 50)
exten => s, 52, Goto(s, 99)
; Counted playback
; here probably possible to use background()
exten => s, 60, Playback(${ply_file}) ; Playback
exten => s, 61, Set(ply_count=$[${ply_count} - 1])
exten => s, 62, GotoIf($[$[${ply_count} > 0] & $[${PLAYBACKSTATUS} = SUCCESS]] ? 61 :
98)
exten => s, 98, Hangup
exten => s, 99, NoOp(end-withot-hagup)
Dialing Plan Macro to Collect DTMF Digits
You must add this treatment to the Asterisk dialing plan to collect DTMF digits. Replace <COLLECT-
MESSAGE-PLACEHOLDER> in the macros below with the name of the @le to play to announce digit
collection.
[macro-get-digits]
exten => s,1, GotoIf($[$[${ARG1}=music/collect] | $[${ARG1}=music/silence]] ? 2 : 3)
exten => s,2, Set(ARG1=silence/2)
exten => s,3,Read(dncdigits,<COLLECT-MESSAGE-PLACEHOLDER>,1,s)
exten => s,4,SendText(Signal=${dncdigits})
exten => s,5, Goto(macro-get-digits,s,3)
Dialing Plan Macro to Create a Conference
You must add this treatment to the Asterisk dialing plan to organize a conference using the Asterisk
MeetMe application.
[macro-conf]
exten => s, 1, Set(conf_id=$["${ARG1}":"${FIND_COF_REGEX}"])
exten => s, 2, NoOp(${ARG1})
exten => s, 3, GotoIf($[${LEN(${conf_id})} != 0] ? 4 : 20)
exten => s, 4, Set(rec_file=$["${ARG1}":"${FIND_REC_REGEX}"])
exten => s, 5, GotoIf($[${LEN(${rec_file})} != 0] ? 6 : 8)
exten => s, 6, MeetMe(${conf_id},drq)
exten => s, 7, Goto(s,20)
exten => s, 8, MeetMe(${conf_id},dq)
exten => s, 20, NoOp()
Asterisk as a Media Server
Integration Reference Manual 4