appliance

Automated Paging announcement

djyvr8
Posts: 59
Member Since:
2007-02-01

Is there anyway to have a sound file be paged to all pageable phones? I'm trying to implement a more advanced version of ParkAndAnnouce that will page a bunch of phones with the parking lot number.

I've tried:
exten => 77,1,Answer
exten => 77,n,AGI(testpage.agi|108|109)
exten => 77,n,Noop(DEBUG===${DEBUG_OUT})
exten => 77,n,Page(${PAGE_GROUP})
exten => 77,n,Playback(abandon-all-hope)
exten => 77,n,Hangup

but that doesn't do anything other than open a paging channel to the desired phones.

Thanks,
Derek



ethans
Posts: 267
Member Since:
2007-01-16
Yes. I've done it before

Yes. I've done it before and it involved some fairly complicated dial plans where you pass options into the Asterisk Dial command to execute a macro that handles the playback and passes control through setting the MACRO_RESULT variable.

It's a lot easier when you use the built-in dial plans FreePBX has for paging, though in my case I had to override some of those dial plans because I was paging ring groups with a message before connecting the caller to the ring group.

I can't remember if all of that was necessary for simply playing the message over the page channel or if it was only necessary to keep control of the channel so after the message was played the caller could be connected to the ring group. It could have also been to synchronize the message that was being played so you wouldn't hear the message out of sync across 10 phones in the office.

I'd have to think about it but you might be in the same boat as I was and need to involve AGI to do some action (like the actual park through the manager interface) in order to play an appropriate message or if you could actually feed the page into the ParkAndAnnounce command. That would require some testing.

--

Ethan Schroeder - ethan d.o.t schroeder a.t schmoozecom d.o.t com
Comprehensive bounty list | Blog



Basildane
Posts: 70
Member Since:
2007-06-30
Here is an example

This is the code I use to allow members of the household to shutdown the computer network at home by dialing 999.

In this example, dial 999. You will be prompted to enter a pin from Pinset 1.

If successful, the system will do a page (on 34, which is my paging code) and announce: "the system will self destruct in 10 seconds"
It will then perform a network shutdown of every computer in the house.

We use it for severe thunderstorms.

exten => 999,n,Set(spooldir=/var/spool/asterisk)
exten => 999,n,Set(ARG1=34)
exten => 999,n,Answer
exten => 999,n,Playback(self-destruct)
exten => 999,n(auth),Authenticate(/etc/asterisk/pinset_1|j)
exten => 999,n,Playback(initiating&self-destruct)
exten => 999,n,System(echo "CallerID: System Shutdown <999>" > ${spooldir}/${ARG1}.call)
exten => 999,n,System(echo "Channel: Local/34@from-internal" >> ${spooldir}/${ARG1}.call)
exten => 999,n,System(echo "MaxRetries: 1" >> ${spooldir}/${ARG1}.call)
exten => 999,n,System(echo "RetryTime: 60" >> ${spooldir}/${ARG1}.call)
exten => 999,n,System(echo "WaitTime: 10" >> ${spooldir}/${ARG1}.call)
exten => 999,n,System(echo "Context: AlertMSG" >> ${spooldir}/${ARG1}.call)
exten => 999,n,System(echo "Extension: s" >> ${spooldir}/${ARG1}.call)
exten => 999,n,System(echo "Priority: 1" >> ${spooldir}/${ARG1}.call)
exten => 999,n,System(mv ${spooldir}/${ARG1}.call ${spooldir}/outgoing/)
exten => 999,n,Hangup
exten => 999,auth+101,Playback(sorry-cant-let-you-do-that)
exten => 999,n,Hangup

[AlertMSG]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(self-destruct&initiated&silence/1)
exten => s,n,Playback(self-destruct-in&digits/10&seconds)
; do shutdown here.  deleted from the example.
exten => s,n,Hangup


satexas
Posts: 65
Member Since:
2007-12-11
Basildane, That's a neat

Basildane,

That's a neat idea! I'm learning how to get a script like that to do external stuff, run unix scripts, etc... can you elaborate or give an example by posting maybe a snipit of what you deleted here ---> "; do shutdown here. deleted from the example."



Basildane
Posts: 70
Member Since:
2007-06-30
For shutdown, what I did was

In the dial plan, it executes this line which hits a secure web page on a server

exten => s,n,System(/usr/bin/curl -s ht tp://thor.aquila.local/shutdown.asp)

The webpage just calls a batch file like this

<% 
	set wshell = CreateObject("WScript.Shell") 
    	wshell.run "c:\shutdown.cmd"
	set wshell = nothing
%>

And the batch file does the shutdown

@START "" "c:\windows\system32\shutdown.exe" /m \\Worf      /s /f /d 6:12 /c "Power Failure!"
@START "" "c:\windows\system32\shutdown.exe" /m \\Wangchung /s /f /d 6:12 /c "Power Failure!"
@START "" "c:\windows\system32\shutdown.exe" /m \\itchy     /s /f /d 6:12 /c "Power Failure!"
@START "" "c:\windows\system32\shutdown.exe" /m \\calculon  /s /f /d 6:12 /c "Power Failure!"
@START "" "c:\windows\system32\shutdown.exe" /m \\hope      /s /f /d 6:12 /c "Power Failure!"
@START "" "c:\windows\system32\shutdown.exe" /m \\lorax     /s /f /d 6:12 /c "Power Failure!"
@START "" "c:\windows\system32\shutdown.exe" /m \\thor      /s /f /d 6:12 /c "Power Failure!"


satexas
Posts: 65
Member Since:
2007-12-11
Basildane - Thank you. Neat.

Basildane - Thank you. Neat.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.