Bit of dial plan assistance needed

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,623
Reaction score
139
I need some help with dialplan code. I am trying to have a way to dial a number, enter a password, and then play a message on certain phones that Asterisk makes auto-answer. I found some code to start off with online, and this is what I have now.

Code:
exten => 999,1,BackGround(vm-pass)
exten => 999,n,Authenticate(########)
exten => 999,n,Set(phone=${SIPPEER(${CUT(DIAL,/,2)}:useragent)})
;exten => 999,n,Set(SIPURI=)
;exten => 999,n,Set(CALLERID(name)="Announcement")
;exten => 999,n,Set(CALLERID(number)=1111)
exten => 999,n,Set(ALERTINFO=Alert-Info: Ring Answer)
exten => 999,n,Set(CALLINFO=Call-Info: <sip:broadworks.net>\;answer-after=0)
exten => 999,n,SipAddHeader(Alert-Info: Ring Answer)
exten => 999,n,SipAddHeader(Call-Info: <sip:broadworks.net>\;answer-after=0)
exten => 999,n,Set(__SIP_URI_OPTIONS=intercom=true)
exten => 999,n,Set(SIPURI=intercom=true)
exten => 999,n,Set(DOPTIONS=A(beep))
exten => 999,n,Set(DTIME=5)
exten => 999,n,Set(ANSWERMACRO=)
exten => 999,n,Dial(SIP/215,5,A(beep))
exten => 999,n,Dial(SIP/213,5,A(beep))
exten => 999,n,Dial(SIP/201,5,A(beep))
exten => 999,n,BackGround(custom/Sound1)
exten => 999,n,BackGround(custom/Sound1)
exten => 999,n,BackGround(custom/Sound3)
As this code stands, I only get one call placed and that is to Ext 215. At that point, Ext. 215 and the calling extension are bridged.

OR with this version
Code:
exten => 999,1,BackGround(vm-pass)
exten => 999,n,Authenticate(########)
exten => 999,n,Set(phone=${SIPPEER(${CUT(DIAL,/,2)}:useragent)})
;exten => 999,n,Set(SIPURI=)
;exten => 999,n,Set(CALLERID(name)="Announcement")
;exten => 999,n,Set(CALLERID(number)=1111)
exten => 999,n,Set(ALERTINFO=Alert-Info: Ring Answer)
exten => 999,n,Set(CALLINFO=Call-Info: <sip:broadworks.net>\;answer-after=0)
exten => 999,n,SipAddHeader(Alert-Info: Ring Answer)
exten => 999,n,SipAddHeader(Call-Info: <sip:broadworks.net>\;answer-after=0)
exten => 999,n,Set(__SIP_URI_OPTIONS=intercom=true)
exten => 999,n,Set(SIPURI=intercom=true)
exten => 999,n,Set(DOPTIONS=A(beep))
exten => 999,n,Set(DTIME=5)
exten => 999,n,Set(ANSWERMACRO=)
exten => 999,n,Dial(SIP/215&SIP/213,5,M(notification-sounds))
Whichever extension picks up first is the only one that plays the audio. This version uses a macro (hence the M) with the audio files listed there.

What do I need to change to my code to dial a set of extensions and play a set sound or sounds over all the extensions at one time over auto-answer? I know it has to be something with that pesky Dial statement.

Thanks!
 
I think you'll have better luck with the Page application:

https://wiki.asterisk.org/wiki/display/AST/Application_Page

The 'A' option plays an announcement to everyone just like in the Dial() application.

I'm not sure, but because of the way it appears to work ("The original caller is dumped into the conference as a speaker and the room is destroyed when the original callers leaves.") the person initiating the page may need to stay on line as long as the announcement is being played.
 
I think you'll have better luck with the Page application:

https://wiki.asterisk.org/wiki/display/AST/Application_Page

The 'A' option plays an announcement to everyone just like in the Dial() application.

I'm not sure, but because of the way it appears to work ("The original caller is dumped into the conference as a speaker and the room is destroyed when the original callers leaves.") the person initiating the page may need to stay on line as long as the announcement is being played.
I had no idea that this even existed! That's exactly what I need!
I searched for that and got a VoipInfo result which led me to this:

Code:
[intercom-custom] 
exten => s,1,Answer 
exten => s,2,Wait(1)
exten => s,3,Flite(Page Notification System)
exten => s,4,BackGround(vm-pass)
exten => s,5,Authenticate(############)
exten => s,6,Flite(Enter an extension number or press star to page all phones.)
exten => s,7,Set(TIMEOUT(digit)=7) 
exten => s,8,WaitExten(10)
exten => s,9,BackGround(beep)

exten => *,1,SIPAddHeader(Call-Info: <sip:192.168.4.2>\;answer-after=0)
exten => *,2,Set(CALLERID(number)=111)
exten => *,3,Set(CALLERID(name)=Page)
exten => *,4,Page(SIP/201,qA(custom/PageAnnouncement)) ;play one sound
;exten => *,4,Page(SIP/201&SIP/202&SIP/204&SIP/206&SIP/212&SIP/213&SIP/214&SIP/215&SIP/216&SIP/217&SIP/218&SIP/219&SIP/220,,M(pagesound)) ;play multiple sounds from macro-pagesound (not working yet)

exten => _XXX,1,SIPAddHeader(Call-Info: <sip:192.168.4.2>\;answer-after=0) 
exten => _XXX,2,Set(CALLERID(number)=111)
exten => _XXX,3,Set(CALLERID(name)=Notification)
;exten => _XXX,4,Dial(SIP/${EXTEN},,A(custom/PageAnnouncement)) ;play one sound
exten => _XXX,4,Dial(SIP/${EXTEN},,M(pagesound)) ;play multiple sounds from macro-pagesound

Add in a Misc Application and Custom Destination and you've got yourself a paging system.

If I hang up on the endpoint that is being paged, the endpoint that launched the page is still in the call with dead air and other endpoints are not affected. If the page launcher hangs up, all endpoints hang up as stated in the link provided above.

This works with Mitel 5224, SPA504g, Snom 320, Polycom 330, and Nortel 1535. Sadly no auto answer on Snom M3 or SPA-3102/2101 or Obi 100/110 (Analog). They do ring and play the sounds, though.
 
Hi

Can you expand on why the existing paging facilities in FreePBX weren't suitable for you?

Joe
 
Hi

Can you expand on why the existing paging facilities in FreePBX weren't suitable for you?

Joe

Those worked fine for paging one extension at a time - but those wouldn't allow me to page all phones and play a sound programmatically. That is what I am using this for - to call all or a group of phones that will auto-answer and play a predefined message without me having to dial *80XXX and hold up the handset mic to each one.

Sure, a page group would have worked for paging all phones, but it wouldn't play the file.
 

Members online

No members online now.

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top