[Asterisk-Users] can the dialtone be changed after pressing 9?

Steve Murphy murf at e-tools.com
Mon Jan 24 11:16:17 MST 2005


On Mon, 2005-01-24 at 11:01 -0600, asterisk-users-
request at lists.digium.com wrote:
> Alexander (or anyone),
>  
> Can you point me to where this can be done for zap devices?
> zonedata.c, perhaps?  How?
>  
> Thanks,
>  
> Greg
>  
> > Yes you can but it only works for zap devices. IP based would be a
> function of the hardware. 
> 
> >> extensions.conf has
> >>
> >> ignorepat => 9
> >> exten => _9X.,1,Dial(Zap/G2/${EXTEN:1})
> >> 
> >> The first user to try it asked if instead of keeping the same
> dialtone 
> >> after pressing 9, if I could play a different dialtone.  Can this
> be 
> >> done?  I'm running asterisk 1.0.0 in case that matters.


I've been thinking about this. The only logical way to change the
dialtone after dialing 9 is to do something like this, I think:

[dialcontext]
;; ignorepat => 9  no more
exten => 9,1,Goto(dialContext9,s,1)
...

[dialContext9]
exten => s,1,PlayTones(dial9)
..
exten => _X.,1,Dial(Zap/G2/${EXTEN})
exten => _X.,2,StopPlaytones
exten => i,1,StopPlaytones
exten => o,1,StopPlaytones
exten => t,1,StopPlaytones


where the dial9 tone is defined in the [us] (or whatever language you
are using) section of the
indications.conf file:

[us]
description = United States / North America
ringcadance = 2000,4000
dial = 350+440
busy = 480+620/500,0/500
ring = 440+480/2000,0/4000
congestion = 480+620/250,0/250
callwaiting = 440/300,0/10000
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!
0/100,350+440
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0
dial9 = 337+463  ;; I have no idea how bad this will sound!

Or, you skip the config file stuff, and just use:

exten => s,1,PlayTones(337+463)

The only reason for using the config file, is to be better organized, by
having a single definition,
and possibly many references.

I really pulled the 337+463 out of the hat; my guess is, it should sound
pretty sour, hopefully be distinguished easily as a different dialtone.

I've not tried any of the above. It's just a guess. There may be all
sorts of interesting complications.
There may be more places to stick the StopPlaytones call. Who knows. It
may not work at all. All I can say is, if I wanted to do this myself,
this would be MY first attack... If anybody else has really done it,
it's time to share....!

Good luck!

murf


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20050124/bac75791/attachment.pgp


More information about the asterisk-users mailing list