星号中的多个SendDTMF扩展名

时间:2014-05-29 17:34:19

标签: asterisk

美好的一天,我需要在拨号后进行类型扩展,我写了一个宏并在拨号命令中使用它,例如:

Dial(Local/123123@outbound-allroutes,,M(sendnum^5^123)

[macro-sendnum]
exten => s,1,Wait(${ARG1})
exten => s,n,SendDTMF(${ARG2})

但有时我需要键入几个分机。数字,我该怎么办?

我猜测在第一个参数的宏中传递更多的参数是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

但这并不奏效。请你帮助我好吗?提前谢谢你,抱歉我的结局不好。

1 个答案:

答案 0 :(得分:0)

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'作为暂停。