[asterisk-users] Simple(?) dialplan question.

Asterisk asterisk at solutionengineers.com
Sun Mar 22 05:09:48 CDT 2009


Hi List,

I have a nice simple dialplan question for you.... Currently, I have
definitions similar to the following in my extensions.conf file, to allow me
to dial out using a variety of channels:

	; Direct dial (number starts with zero), use 0151 xxx xxxx:
	exten => _0.,1,Set(CALLERID(number)=0845xxxxxxx) 
	exten => _0.,n,Dial(SIP/${EXTEN}@sipgate,90,t)
	exten => _0.,n,Playback(invalid)  
	exten => _0.,n,Hangup[/code]

(I've munged some of the numbers, hence the x's)

Now, this works fine provided the person answers in 90 seconds or less: If
not, I get "that option is invalid" announced, and it hangs up. I want to do
this:

If DIAL fails because the other party is engaged, I'd like Asterisk to
automatically re-try the number, for as long as I've got the handset off the
hook or until the other party starts ringing. As there'll be no ring tone,
it'd be nice it it could play music until DIAL succeeds in getting a ring
tone; at which point it makes "ring ring" noises (this will serve as my
prompt that - hopefully - someone's going to answer soon).

If DIAL fails because I got the number wrong, then a PLAYBACK to that effect
would be useful... I can record my own soundfile if there isn't a standard
one. By wrong, I mean the exchange would return number unavailable, rather
than I get the wrong person!

If DIAL fails after it's been ringing for ages (e.g. when calling the local
Post Office sorting office, who only answer 1 in 5 calls), I'd like it to
retry, ala the busy response.

IF DIAL exits because the other party hung up, I'd want it to simply hang up
on me like it does now. I suspect this is standard behaviour? But maybe it
tries to read the invalid announce to a closed channel with my dialplan, I'm
not sure.

If the above can be achieved in extensions.conf, that's great, as I've not
done any AEL... but if AEL (or AGI, even) is the only way, so be it...

FWIW, I'm using Asterisk 1.4.18 on Ubuntu 4.1.2 (kernel version
2.6.20-15-server).

Cheers!
Ade.





More information about the asterisk-users mailing list