你好,我需要在拨号后键入扩展,我写了一个宏并在拨号命令中使用,例如:
Dial(Local/123123@outbound-allroutes,,M(sendnum^5^123)
[macro-sendnum]
exten => s,1,Wait(${ARG1})
exten => s,n,SendDTMF(${ARG2})
u2028
但有时我需要键入几个分机号码,我该怎么做?
我猜在宏中传递更多的参数。第一个参数是IVR步骤的计数,其他参数是步骤的选项,然后在宏中循环处理这些参数,例如:
Dial(Local/123123@outbound-allroutes,,M(sendnum^2^5^2010^6^123)
和宏:
macro-sendnum]
exten => s,1,Set(TIMES=${ARG1})
exten => s,n,Set(i=0})
exten => s,n,While($[${i} < ${TIMES}])
exten => s,n,Set(i=$[ ${i} + 1 ])
exten => s,n,Wait(${ARG$[${i} + 1]})
exten => s,n,SendDTMF(${ARG$[${i} + 2]})
exten => s,n,EndWhile
但这行不通。你能帮帮我吗?提前谢谢你,为我的糟糕结局感到抱歉。
pro-sip*CLI> core show application SendDTMF
-= Info about application 'SendDTMF' =-
[Synopsis]
Sends arbitrary DTMF digits
[Description]
It will send all digits or terminate if it encounters an error.
[Syntax]
SendDTMF(digits[,timeout_ms[,duration_ms[,channel]]])
[Arguments]
digits
List of digits 0-9,*#,a-d,A-D to send also w for a half second pause,
and f or F for a flash-hook if the channel supports flash-hook.
timeout_ms
Amount of time to wait in ms between tones. (defaults to .25s)
duration_ms
Duration of each digit
channel
Channel where digits will be played
所以你可以用"w"作为停顿。