Eric Wieling
2004-Oct-16 17:17 UTC
[Asterisk-Users] Macro exmaple for saying digits in a more natural sounding way.
[macro-say-digits] ; ; Usage: exten => 666,1,Macro(say-digits,915045551212) ; ; This macro uses SayDigits to read numbers with logical pauses like a human ; might say. Please send changes/patches/suggestions to eric@fnords.org ; ; Should handle 1-6 digits, 7 digits, 8 digits, 10 digits, 11 digits, 12 digits ; ; exten => s,1,GotoIf($[${LEN(${ARG1})} != 10]?s,3) exten => s,2,SayDigits(${ARG1:0:3}) exten => s,3,GotoIf($[${LEN(${ARG1})} != 10]?s,6) exten => s,4,Wait(.25) exten => s,5,SayDigits(${ARG1:3:3}) exten => s,6,GotoIf($[${LEN(${ARG1})} != 10]?s,10) exten => s,7,Wait(.25) exten => s,8,SayDigits(${ARG1:6}) exten => s,9,Goto(s,12) exten => s,10,Wait(.25) exten => s,11,SayDigits(${ARG1}) exten => s,12,NoOp -------------- next part -------------- A non-text attachment was scrubbed... Name: eric.vcf Type: text/x-vcard Size: 146 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20041016/21073c24/eric.vcf