Junghanns.NET - Quality Statement
Deutsch|Support|Disclaimer|Contact us
HomeProductsOpen SourceSolutionsClientsPartnerDownload



Open Source


Custom dialtones with PlayTones()

In extension.conf we need the following macro and helper context:
[macro-internaldialtone]
exten => s,1,SetVar(DIALED=${ARG1})
exten => s,2,SetVar(TOCONTEXT=${ARG2})
exten => s,3,SetVar(STRIP=${ARG3})
exten => s,4,SetVar(TONES=500/150,600/150,6000/15,1234/59,400/100)
exten => s,5,Goto(internaldialtone-XXX-helper|s|1)

[internaldialtone-XXX-helper]
exten => s,1,DigitTimeout(0)
exten => s,2,Wait(0.5)
exten => s,3,Playtones(${TONES})
exten => s,4,WaitExten(3)

exten => _X,1,GotoIF(${DIALED}${EXTEN} > 0?100:2)
exten => _X,2,SetVar(DIALED=${DIALED}${EXTEN})
exten => _X,3,DigitTimeout(0)

exten => _X,100,SetVar(DIALED=${DIALED}${EXTEN})
exten => _X,101,StopPlaytones
exten => _X,102,DigitTimeout(3)

exten => _X.,1,Goto(${TOCONTEXT}|$[${DIALED:${STRIP}}]${EXTEN}|1)


Then we can easily integrate it into our dialplan:
[phones]
;dial 0 for an outside line (this is so 80s!!!)
exten => 0,1,Macro(internaldialtone,${EXTEN},outgoing,1)

;internal extension are 100 - 199 (isdn phones on span 1)
exten => _1XX,1,Dial(ZAP/g1/${EXTEN},30,R)
exten => _1XX,2,Hangup

[outgoing]
;external calls go out via zaptel group 2
exten => _X.,1,Dial(ZAP/g2/${EXTEN})




Home|The Company|Products|Solutions|Press|Reseller|Support|Contact
Copyright 2000-2011 Junghanns.NET GmbH. All rights reserved. Privacy Policy - Terms and Conditions