Sound Playback on Paging Hangup

mark.bielech
Posts: 9
Member Since:
2008-05-31

I will confess, I am inexperienced on the subject of asterisk, especially within the context of trixbox! I will also confess that I am a HUGE Star Trek fan too! I am looking for a way to play a sound (channel-closed from STTNG) to all the phones in the paging group as soon as a user hangs up the phone from dialing the paging extension. So far, I've managed to change the beep that is played once the phone goes off the hook to the "hailing whistle" from the original series. Is there a way to edit either the autoanswer or ext-paging macro to play a sound through the paging phones once the user hangs up the phone? In a business environment, this would be a benefit to let everyone know that the page announcement has been completed. Any help would be GREATLY appreciated! I know I'm close, but I could be closer!

-Mark Bielech

--

>M0toM@rk_



pezzz
Posts: 14
Member Since:
2010-05-15
any luck with this ?

This sounds like a great idea and i have read posts where people say they have done this.
How did you modify the beep to the hailing whistle?



mark.bielech
Posts: 9
Member Since:
2008-05-31
Well...

No luck yet on finding a way to have a sound play just before the paging extensions go back on hook. Changing the off-hook sound was relatively easy. Here's what I did, please forgive that I use Windows:

1. Grab your favorite sound file and convert it to WAV format, 8000 Hz (8KHz), 16-bit sample rate, and mono (I used dBpoweramp). I suggest naming it using no spaces or weird characters. Once converted, place the file in /var/lib/asterisk/sounds on your trixbox; use WinSCP for that if you have a Windows machine.

2. Copy the [macro-autoanswer] context from etc/asterisk/extensions_additional.conf file and paste it into Notepad. From there, edit the following line, replacing "beep" with the name of the file you converted and just put in the sounds folder:

exten => s,n,Set(DOPTIONS=A(beep))

3. Copy (once again) everything from the edited [macro-autoanswer] context that was in Notepad and place it into the /etc/asterisk/extensions_override_freepbx.conf file. Reset your trixbox and hopefully the sound should have changed!

Below is what my [macro-autoanswer] context looks like in my /etc/asterisk/extensions_override_freepbx.conf file:

[macro-autoanswer]
include => macro-autoanswer-custom
exten => s,1,Set(DIAL=${DB(DEVICE/${ARG1}/dial)})
exten => s,n,GotoIf($["${DB(DEVICE/${ARG1}/autoanswer/macro)}" != "" ]?macro)
exten => s,n,Set(phone=${SIPPEER(${CUT(DIAL,/,2)}:useragent)})
exten => s,n,Set(SIPURI=)
exten => s,n,Set(ALERTINFO=Alert-Info: Ring Answer)
exten => s,n,Set(CALLINFO=Call-Info: \;answer-after=0)
exten => s,n,Set(SIPURI=intercom=true)
exten => s,n,Set(DOPTIONS=A(hailwhistle))
exten => s,n,Set(DTIME=5)
exten => s,n,Set(ANSWERMACRO=)
exten => s,n,ExecIf($["${phone:0:5}" = "Mitel"]?Set(CALLINFO=Call-Info: \;answer-after=0))
exten => s,n,GotoIf($["${ANSWERMACRO}" != ""]?macro2)
exten => s,n,ExecIf($["${ALERTINFO}" != ""]?SipAddHeader(${ALERTINFO}))
exten => s,n,ExecIf($["${CALLINFO}" != ""]?SipAddHeader(${CALLINFO}))
exten => s,n,ExecIf($["${SIPURI}" != ""]?Set(__SIP_URI_OPTIONS=${SIPURI}))
exten => s,n+2(macro),Macro(${DB(DEVICE/${ARG1}/autoanswer/macro)},${ARG1})
exten => s,n+2(macro2),Macro(${ANSWERMACRO},${ARG1})

; end of [macro-autoanswer]

The problem with editing the extensions_additional.conf file is that it gets automatically overwritten by the system; hence that's why we place it into the extensions_override_freepbx.conf instead. Hope this helps! If anyone can help with the post-page sound, that would be great! Thanks!

--

>M0toM@rk_



pezzz
Posts: 14
Member Since:
2010-05-15
Thanks for that

Hey Mark,
Thanks for that info. I actually worked it out yesterday afternoon and posted a quick guide last night.
I did however mess up and not make note to put the context into extensions_override_freepbx instead so i have edited my post and referenced your advice.
If i find a way to do it i will let you know.

I know there is school bell software out there that would do the trick, but it should be doable in asterisk i am sure.
I also stuck in my post how to change the wav file to gsm using sox as that was the only way i could get it to play and sox is included in TB so it saved me buying a third party program to change the sound file. Very easy. Just 1 line of code :-)

Hope this helps for future.



Comment viewing options

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