SUGGESTIONS Delayed Paging

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
I have had customers that would like to have delayed paging. This cuts down on the feedback if the extension creating the page is near a paging speaker. Here is the code. Both extensions are in the from-internal-custom context.

[from-internal-custom]

; Delayed paging. It this case, you dial 3205 to activate the paging system
; This context records your page, creates a call file that plays the message
; back. Extension 3206 actually plays back the file once the paging system
; answers. The third line of 3205 is used to set the extension number of your
; paging system.
exten => 3205,1,Answer
exten => 3205,2,Wait(2)
exten => 3205,n,set(pageext="local/305")
exten => 3205,n,flite(Reecord your message and then press the pound key)
exten => 3205,n,record(asterisk-recording:ulaw)
exten => 3205,n,system(echo "Channel: ${pageext}" > /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo "WaitTime: 20" >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo "Context: from-internal" >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo "Extension: 3206" >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo "Priority: 1" >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(chmod 777 /var/spool/asterisk/outgoing/john.call)
exten => 3205,n,system(mv /var/spool/asterisk/tmp/john.call /var/spool/asterisk/outgoing/)
exten => 3205,n,hangup()

exten => 3206,1,playback(beep)
exten => 3206,n,playback(asterisk-recording)
exten => 3206,n,Wait(2)
exten => 3206,n,Hangup
 

mac

Member
Joined
Dec 19, 2007
Messages
72
Reaction score
1
Which is essentially a $400 anti-feedback device from Viking.

WORKS GREAT!!!!

Oh and in case any of you are new here, Mullinix rocks!
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
It does not work for me.
Code:
  PBX in a Flash Version 1.3 Daemon Status
********************************************************************
* Asterisk  * ONLINE  * Zaptel    * ONLINE  * MySQL      * ONLINE  *
* SSH       * ONLINE  * Apache    * ONLINE  * Iptables   * ONLINE  *
* Fail2ban  * ONLINE  * IP Connect* ONLINE  * Ip6tables  * ONLINE  *
* BlueTooth * ONLINE  * Hidd      * ONLINE  * NTPD       * ONLINE  *
* Sendmail  * ONLINE  * Samba     * ONLINE  * Webmin     * ONLINE  *
* Ethernet0 * ONLINE  * Ethernet1 *   N/A   * Wlan0      *   N/A   *
********************************************************************
* Running Asterisk Version : Asterisk 1.4.21.2
* Asterisk Source Version  : 1.4.21.2
* Zaptel Source Version    : 1.4.12.1
* Libpri Source Version    : 1.4.7
* Addons Source Version    : 1.4.7
********************************************************************
pbx.local on 192.168.1.24 - eth0
CentOS release 5.2 (Final) :32 Bit Kernel: 2.6.18-92.1.6.el5

I have the code in, and it will record. I can call 3206 myself and have it play back. My page extension is 819. I changed that in the script. However, this is all that I get when I make the call:
Code:
    -- Executing [3205@from-internal:1] Answer("SIP/2000-0841be38", "") in new stack
    -- Executing [3205@from-internal:2] Wait("SIP/2000-0841be38", "2") in new stack
    -- Executing [3205@from-internal:3] Set("SIP/2000-0841be38", "pageext="local/819"") in new stack
    -- Executing [3205@from-internal:4] Swift("SIP/2000-0841be38", "Record your message to be paged| and then press the pound key") in new stack
    -- Executing [3205@from-internal:5] Record("SIP/2000-0841be38", "asterisk-recording:ulaw") in new stack
    -- <SIP/2000-0841be38> Playing 'beep' (language 'en')
    -- Executing [3205@from-internal:6] System("SIP/2000-0841be38", "echo "Channel: local/819" > /var/spool/asterisk/tmp/john.call") in new stack
    -- Executing [3205@from-internal:7] System("SIP/2000-0841be38", "echo "WaitTime: 20" >> /var/spool/asterisk/tmp/john.call") in new stack
    -- Executing [3205@from-internal:8] System("SIP/2000-0841be38", "echo "Context: from-internal" >> /var/spool/asterisk/tmp/john.call") in new stack
    -- Executing [3205@from-internal:9] System("SIP/2000-0841be38", "echo "Extension: 3206" >> /var/spool/asterisk/tmp/john.call") in new stack
    -- Executing [3205@from-internal:10] System("SIP/2000-0841be38", "echo "Priority: 1" >> /var/spool/asterisk/tmp/john.call") in new stack
    -- Executing [3205@from-internal:11] System("SIP/2000-0841be38", "chmod 777 /var/spool/asterisk/outgoing/john.call") in new stack
    -- Executing [3205@from-internal:12] System("SIP/2000-0841be38", "mv /var/spool/asterisk/tmp/john.call /var/spool/asterisk/outgoing/") in new stack
    -- Executing [3205@from-internal:13] Hangup("SIP/2000-0841be38", "") in new stack
  == Spawn extension (from-internal, 3205, 13) exited non-zero on 'SIP/2000-0841be38'
    -- Executing [h@from-internal:1] Macro("SIP/2000-0841be38", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] ResetCDR("SIP/2000-0841be38", "w") in new stack
    -- Executing [s@macro-hangupcall:2] NoCDR("SIP/2000-0841be38", "") in new stack
    -- Executing [s@macro-hangupcall:3] GotoIf("SIP/2000-0841be38", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,6)
    -- Executing [s@macro-hangupcall:6] GotoIf("SIP/2000-0841be38", "1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,9)
    -- Executing [s@macro-hangupcall:9] GotoIf("SIP/2000-0841be38", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,11)
    -- Executing [s@macro-hangupcall:11] Hangup("SIP/2000-0841be38", "") in new stack
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/2000-0841be38' in macro 'hangupcall'
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/2000-0841be38'
    -- Attempting call on local/819 for 3206@from-internal:1 (Retry 1)
Then it stops.
What am I doing wrong?
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
Could you post your modified script for me. I will take a look. Also, are you pressing the # key after recording your announcement. If you just hang up, I think it cancels the page.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Here you go! Yes, I am pressing #.
Code:
; Delayed paging. It this case, you dial 3205 to activate the paging system
; This context records your page, creates a call file that plays the message
; back. Extension 3206 actually plays back the file once the paging system
; answers. The third line of 3205 is used to set the extension number of your
; paging system.
exten => 3205,1,Answer
exten => 3205,2,Wait(2)
exten => 3205,n,set(pageext="local/819")
exten => 3205,n,Swift(Record your message to be paged, and then press the pound key)
exten => 3205,n,record(asterisk-recording:ulaw)
exten => 3205,n,system(echo "Channel: ${pageext}" > /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo "WaitTime: 20" >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo "Context: from-internal" >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo "Extension: 3206" >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(echo "Priority: 1" >> /var/spool/asterisk/tmp/john.call)
exten => 3205,n,system(chmod 777 /var/spool/asterisk/outgoing/john.call)
exten => 3205,n,system(mv /var/spool/asterisk/tmp/john.call /var/spool/asterisk/outgoing/)
exten => 3205,n,hangup()

exten => 3206,1,playback(beep)
exten => 3206,n,playback(asterisk-recording)
exten => 3206,n,Wait(2)
exten => 3206,n,Hangup
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
I assume that both 3205 and 3206 are in from-internal-custom. If not, they need to be.

Does extension 819, your paging extension, auto answer? That would probably make it fail if it didn't auto answer.

I found nothing wrong with the code.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
They are in from-internal-custom. 819 does auto answer after 1 ring.
 

kenn10

Well-Known Member
Joined
Dec 16, 2007
Messages
3,791
Reaction score
2,206
They are in from-internal-custom. 819 does auto answer after 1 ring.


John -

I'll study this some more but the code does not seem to work if you are using SIP page groups rather than an extension into a separate paging system.
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
I have never tried it with a Paging Group. The original design was to integrate the phone system with a Paging Amplifier by hacking a Grandstream phone. I have used this script successfully in that scenario.

We wire a plug to the headphone jack that is connected to the paging amp. Then we set the phone to auto answer and all is done.
 
Joined
Apr 22, 2009
Messages
230
Reaction score
0
I had some problem before to send a playback to a paging group. The way to have it work was to use two contexts. The first one instead of callling the playback call a
dial(local/yourpaginggroup@ext-paging,,CG(pagercontext,mycontext,1))

where you then put in
[pagercontext]
exten => mycontext,1,Playback(your file)
exten => mycontext,n, Hangup()
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Got it to work now! I followed your idea with the hacking Grandstream idea and it works perfectly! Thanks! :)
EDIT:
Could I change the extension number to page to something different without breaking anything?
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
That's the beauty of Open Souce. Keep a copy of what works, and have fun.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Another question:
Why does the CID show up as Unknown/Unknown? Can I set it to something else?
Thanks!
Ross
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
I don't know. I suspect that you could add it to the .call fall that is created. Why do you need it? The Grandstream phone should just auto answer and send the page. The CDR should already have the call that records the announcement.
 

sigmaz

Member
Joined
Dec 17, 2010
Messages
100
Reaction score
1
Just to revisit an old but very useful mod...

Is there a way to implement similar timing limits such as the VM systems minsecs and maxmsg?
The reason I ask about (minsec) is that if my users envoke the delayed page and immediately hit # the call is passed to 3206 but since the recording file wasn't created yet it opens up the page group and just hangs on the phones.
Since the missing recording is never played to the end the dial plan doesn't know how when to hang up.
The other scenario (maxmsg) is if someone accidentally hits ITCM and then some few mins later hit #.. then the long unintended recording streams unstoppable.

I found the option maxduration but Im not sure the proper syntax for 1.8.x
 

Ariel Ramos

New Member
Joined
Aug 22, 2013
Messages
14
Reaction score
0
Hi. i have this working perfectly. Thank you so much for this
Here comes the but...

i have this installd at a shopping center and its used hundresds of time a day. but on rare ocations 2 operators try paging simultaniously. at that point one of the two pages randomely selected or first recorded is played while the other one seems to be lost. is there anyway of havin one page be played and then the other one. something like a queue

Please advice
Thanks
ArielRamos
 

kenn10

Well-Known Member
Joined
Dec 16, 2007
Messages
3,791
Reaction score
2,206
The Schmooze Page Pro module works well too....but it isn't free.
 

Members online

Forum statistics

Threads
25,825
Messages
167,856
Members
19,250
Latest member
mark-curtis
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.
Top