Paging Delay

fatboy
Posts: 2
Member Since:
2007-01-25

Our paging system (via loudspeakers) has unbearable feedback from some extensions. We'd like to introduce a delay.

So a user would:
1) dial the appropriate code to start paging
2) speak their announcement
3) hang up

The system would record their announcement and then upon hang up immediately play it back over the paging group.

Has anyone done this yet? Any suggestions on how to do it?

I searched the forum but haven't found what I'm looking for. If it is there just point me in the right direction.

Thanks



crees
Posts: 293
Member Since:
2006-08-09
http://www.trixbox.org/forums

The following tutorial will do just that. It will record your page then play it back over the soundcard after you hangup. If you have an audio feed it will also mute your music and then bring it back up after the page.

http://www.trixbox.org/forums/trixbox-forums/open-discussion/tuto...



groogs
Posts: 20
Member Since:
2006-10-04
http://www.freepbx.org/trac/t

http://www.freepbx.org/trac/ticket/1451

--

Greg MacLellan, FreePBX Core Developer
http://freepbx.org - #freepbx on irc.freenode.net



pcbytc
Posts: 153
Member Since:
2007-12-04
That's all fine and dandy, but I need FXO Out

Help,
I reviewed these scripts and I need them to work differently. I don't need music support and I need to output to an FXO port, not the server sound card (I run a failover config, server is geographically isolated) I have functional paging now dialing the a Cisco FXO port, connected to a Bogen PRSLSI (to add battery, https://www.telcom-data.com/products/PRSLSI.aspx if you are curious) and sending T&R to multiple powered speakers, works fine, but I need to store & play to the FXO due to feedback.

Somebody help an idiot?

Tim



pcbytc
Posts: 153
Member Since:
2007-12-04
WORKING Store & Play paging on an FXO port!

Not easy at first, but it works great! (Lots of help from Google)
I am paging out an FXO port on a Cisco router, connected via a SIP trunk on a "unique" dial peer (*4*401)
555 is my paging number
The method I used records the file, then moves a "do this" file (555.call) to /var/spool/asterisk/outbound, which has instructions to play the recorded file, then just for giggles, I gave users the ability to re-listen to the last announcement by dialing 10000 (in case they mis-heard it) and they LOVE that feature!

First off: Record an announcement wav file, call it "page-announce", move it to /var/lib/asterisk/sounds (if you used asterisk to record it, it will be 1 more directory down in /custom.
My announcement says "Please say your announcement; and then press the pound sign, hang up to cancel."

Now, make a new folder at "/etc/asterisk/" called "pa-system"
Create a new file in pa-system called 555.call, edit the file and add the following: (minus any ________________________________________________________________________________
Channel: SIP/FXO-to-NEC/*4*401 Callerid:PAGE MaxRetries: 10
RetryTime: 5
WaitTime: 20
Context: pa-call-file Extension:401 Priority: 1 _________________________________________________________________________________
Now, save the file & set it's permissions to 777 (anyone overwrite)

Next Editing:
extensions_custom.conf

Somewhere under [from-internal-custom] add:
exten => 555,1,Goto(pa-system,s,1)
exten => 10000,1,Goto(pa-call-file,s,1)

Then, elsewhere (near the bottom)
[pa-system]
; Dial 555 to Page (warehouse)
exten => s,1,Answer
exten => s,n,Playback(page-announce)
exten => s,n,Wait(1)
exten => s,n,Record(pa-message.wav)
exten => s,n,System(cp -p /etc/asterisk/pa-system/555.call /var/spool/asterisk)
exten => s,n,System(mv /var/spool/asterisk/555.call /var/spool/asterisk/outgoing/)
exten => s,n,Hangup()

[pa-call-file]
exten => s,1,Wait(1)
exten => s,n,Playback(beep)
exten => s,n,Playback(pa-message)
exten => s,n,Wait(1)
exten => s,n,Hangup()

It copies the file first, THEN it moves it, if you copy into /var/spool/asterisk/outgoing/, it may process an incomplete file, hence we move instead.
This file MUST have 777 permissions! If not, the outgoing spool chokes on it. (hence the cp -p to preserve permissions)

Users can dial 10000 to manually run "pa-call-file" to hear the last overhead page.

Cool? Questions? Post away!

The Timmy!



domiflichi
Posts: 164
Member Since:
2007-04-06
Thanks for posting your

Thanks for posting your solution back here! I may need this functionality in the future, so I may be implementing your solution.



pcbytc
Posts: 153
Member Since:
2007-12-04
UPDATE: This has a bug -RESOLVED-

We use this system daily, but today, it stopped working, some moron had dialed 555 and left the phone off-hook for an hour, then apparently pressed pound.
The resulting 20 Megabyte "pa-message.wav" in /var/lib/asterisk/sounds would not be overwritten (for some odd reason) and it just stopped playing the announcement altogether. Once I deleted the offending file, the problem was fixed, but I need to figure out how to prevent this from happening in the future, anybody got a simple suggestion? Maybe I should start the script off by deleting /var/lib/asterisk/pa-message as step 1?

Anybody?

Tim C

Updated: Easy Fix, I answered my own question, I delete the .wav before I record anything, so add a second line to [pa system] as follows:
[pa-system]
; Dial 555 to Page (warehouse)
exten => s,1,Answer
exten => s,n System(rm -f /var/lib/asterisk/sounds/pa-message.wav) exten => s,n,Playback(tim-page-announce)
exten => s,n,Wait(1)
exten => s,n,Record(pa-message.wav)
exten => s,n,System(cp -p /etc/asterisk/pa-system/555.call /var/spool/asterisk)
exten => s,n,System(mv /var/spool/asterisk/555.call /var/spool/asterisk/outgoing/)
exten => s,n,Hangup()

Done!

The Timmy



mpwita
Posts: 1
Member Since:
2010-06-09
UPDATE: This has a bug -RESOLVED-

As another addition to this, you might want to consider adding the other options for Record() to stop at a certain amount of silence and max recording length.

http://www.voip-info.org/wiki/view/Asterisk+cmd+Record

Has info on the syntax, but it looks like the recording line should be something like this

exten => s,n,Record(pa-message.wav,3,20)

would do same thing as hitting pound after 3 seconds of silence or a max of 20 seconds of page length.



pcbytc
Posts: 153
Member Since:
2007-12-04
New Update

Ended up having to change things to:

exten => s,1,Answer
exten => s,n System(mv /var/lib/asterisk/sounds/old-message.wav /var/lib/asterisk/sounds/pa-message.wav) exten => 0,1,Goto(s,3) ; if 0 is pressed, skip playback Goto record exten => s,2,Playback(tim-page-announce)
exten => s,3,Wait(1)
exten => s,4,Record(pa-message.wav,0,20) exten => s,5,System(cp -p /etc/asterisk/pa-system/555.call /var/spool/asterisk)
exten => s,6,System(mv /var/spool/asterisk/555.call /var/spool/asterisk/outgoing/)
exten => s,7,Hangup()

This code works very well (except for the skip), I wish I could say the same for my Bogen PRSLSI which died today, replacing with a Valcom V2000A



pcbytc
Posts: 153
Member Since:
2007-12-04
Fixed the skip

New code is:
[pa-system]
; Dial 555 to Page (warehouse)
exten => s,1,Answer
exten => s,n System(mv /var/lib/asterisk/sounds/old-message.wav /var/lib/asterisk/sounds/pa-message.wav)
exten => s,n,Background(page-announce)
exten => s,n,Wait(1)
exten => s,n,Goto(0,1)
exten => 0,1,Record(pa-message.wav,0,20)
exten => 0,2,System(cp -p /etc/asterisk/pa-system/555.call /var/spool/asterisk)
exten => 0,3,System(mv /var/spool/asterisk/555.call /var/spool/asterisk/outgoing/)
exten => 0,4,Hangup()

Stupid me, I needed to change "Playback" to "Background" so it will accept input during the message playback.
Had to add the "exten => s,n,Goto(0,1)" or else it simply ended, which I guess makes sense?

Tim



computer_cody
Posts: 53
Member Since:
2009-03-01
I like what you did with

I like what you did with this. Now I just want to make it so it will do it through my phones only. My page code is 767.

Thanks!

--

Cody Campbell



Comment viewing options

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