Delayed Paging

The Scenario:

At our central fire station, we are doing paging over selected phones and through an overhead PA system. A page group was set up with the selected extensions. The problem is that there is often feedback from the overhead speakers.

What I’d like to do, instead of directly paging, would be to record the page and when the paging party hangs up, the page would be be played back over the page group. This would prevent a direct accoustical connection between the paging phone and the speakers, thus eliminating the feedback.

I’d appreciate any ideas…

Thanks
Bill

how about a simpler solution… Disable the duplex option in the paging group. That disables the microphone pickup so that the phones don’t cause the feedback loop to begin with.

Don’t think that will work. Since the phone, in half-duplex, basically uses a Voice Operated Switch to transition between send and receive, the audio path between the overhead speaker and the handset microphone will still exist, thus creating feedback…

Bill/W5WAF

hum, According to the Duplex Popup help…

Paging is typically one way for annoucements only. Checking this will make the paging duplex, allowing all phones in the paging group to be able to talk and be heard by all. This makes it like an “instant conference”

You didn’t say what your phone are, but with Aastra phones you can control the mic with a single line in the phones config (sip intercom mute mic:) and disable it (0).

Just looking at different ways (and hopefully simpler) to solve the problem. I’ve been meaning to setup paging here but have not done it due to some office politics that would arise out of enabling that feature.

Fred/KC2TNK

In any case, duplex is not enabled. These are AASTRA phones. The feedback is coming from the overhead speakers to the phone that is doing the paging…

Bill/W5WAF

Ah, ok then I don’t see a solution except to make it a feature request…

that or tweak the rx gain on the phone down so it does not pick it up…

I did find an AGI script that Rob Thomas wrote back in 2005 , but can’t get it to work…
see: http://kensalter.com/2008/02/20/my-asterisk-paging-routine/

My system is Freepbx 2.5, Asterisk 1.4 and Aastra phones…

Bill/W5WAF

Bill that extension code looks like it should work unless that allpage.agi does not exist anymore.

Can you post the log output when it fails? Should be able to get it to work.

Here is the portion of the log that calls allpage.agi:

== Spawn extension (custom-paging, 7243, 2) exited non-zero on ‘SIP/2995-b6b3b7d8’
– Executing [[email protected]:1] NoOp(“SIP/2995-b6b3b7d8”, “Finished recording page”) in new stack
– Executing [[email protected]:2] Goto(“SIP/2995-b6b3b7d8”, “custom-do-paging|s|1”) in new stack
– Goto (custom-do-paging,s,1)
– Executing [[email protected]:1] NoCDR(“SIP/2995-b6b3b7d8”, “”) in new stack
– Executing [[email protected]:2] DeadAGI(“SIP/2995-b6b3b7d8”, “allpage.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/allpage.agi
– AGI Script allpage.agi completed, returning 0
– Executing [[email protected]:3] Hangup(“SIP/2995-b6b3b7d8”, “”) in new stack

Would you like to see the allpage.agi

BF

Yes, please do post it use the [code]tags[/code]. It is interesting that no calls are spawned after the agi script is executed.

Here’s the allpage.agi

#!/usr/bin/perl -w

#
# allpage.agi - Copyright Rob Thomas ([email protected]) 2005.
#
# Revision 1.1 - 14th October 2005 - Added Polycom Support
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of Version 2 of the GNU General
# Public License as published by the Free Software Foundation
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Simple AGI to page all SIP extensions (no IAX device, because at the time
# of writing this, no device supported IAX_ANSWER_IMMED) that aren't on
# the phone. Tested with Asterisk 1.2. Should work out-of-the-box with
# Grandstream GXP phones with firmware greater than 1.0.12, and Snoms with
# 'enable intercom' on and 'filter packets from registrar' off.
#
# Documentation:
# Your dialplan consists of two things. Firstly, in the context that your
# normal phones are in, you need to have something like this:
# exten => 999,1,AGI,allpage.agi
# exten => 999,2,MeetMe(999,dq)
# exten => 999,3,Playback(beep)
# exten => 999,4,Hangup
#
# The paged phones then jump to this context:
# all-page
# exten => s,1,AbsoluteTimeout(10)
# exten => s,2,MeetMe(999,dmq)
# exten => s,3,Hangup
# exten => t,1,Hangup
# exten => T,1,Hangup
#
# Any questions? Join
#openpbx on irc.freenode.net
# --Rob Thomas 28th Sep, 2005.

use Net::Telnet;

# You need to configure this: Your manager API username and password. This
# is the information from /etc/asterisk/manager.conf. You need something like
# this in it:
# admin
# secret = amp111
# deny=0.0.0.0/0.0.0.0
# permit=127.0.0.0/255.255.255.0
# read = system,call,log,verbose,command,agent,user
# write = system,call,log,verbose,command,agent,user
# IF that's what you have in your conf file, this is what you should have here:
my $mgruser = "admin";
my $mgrpass = "amp111";
my $mgrport = 5038;

# If you're using a SNOM they need a 'sip:ip.add.re.ss' added to the Call-Info field,
# with the IP address of the registrar. Most other phones will silently ignore this,
# but if you have trouble, you may need to fiddle with this line. Change the IP Address
# to be that of your Asterisk Server.
#my $callinfo = 'Call-Info: sip:10.10.100.1\; answer-after=0';
# This is for Polycom phones - see
# http://www.voip-info.org/tiki-index.php?page=Polycom+auto-answer+config
#my $alertinfo = 'Alert-Info: Ring Answer';
# AASTRA Phones
my $alertinfo = 'Call-Info: sip:\;answer-after=0'
# That's it. Nothing else should need to be changed

# Some variables we use later...
my @tocall;
my %useref;

# If you don't want any intelligence, you can just delete all the logic above
# here, and specify the SIP extensions to call here. Also useful for debugging.
#@tocall = (1000,1003,1004,1006,1007,1008,1009,1012,1013,1015,1021,1027,1033,1035,1037,1038,1040,1041);
@tocall = (2995);
# Now, we have an array (@tocall) with all valid SIP extensions.
while (my $sipxtn = shift @tocall)
{
        # Open connection to AGI
        my $tn = new Net::Telnet ( Port => $mgrport, Prompt => '/.*$%#> $/', Output_record_separator => '', Errmode => 'return', );
        $tn->open("127.0.0.1");
        $tn->waitfor('/0\n$/');
        $tn->print("Action: Login\n");
        $tn->print("Username: $mgruser\n");
        $tn->print("Secret: $mgrpass\n");
        $tn->print("Events: off\n\n");
        my ($pm, $m) = $tn->waitfor('/Authentication (.+)\n\n/');
        if ($m =~ /Authentication failed/)
        {
                print "VERBOSE \"Incorrect MGRUSER or MGRPASS - unable to connect to manager interface\" 0\n";
                exit;
        }
        $tn->print("Action: Originate\nChannel: SIP/$sipxtn\nContext: all-page\nPriority: 1\n");
        #$tn->print("Variable: SIPADDHEADER=\"$callinfo\"\n");
        $tn->print("Variable: SIPADDHEADER=\"$alertinfo\"\n");
        $tn->print("Variable: SIPADDHEADER=\"$callinfo\"\n");
        $tn->print("Extension: s\nCallerID: SYSTEM PAGE\n\n");
        $tn->print("Action: Logoff\n\n");
        $tn->close;
}

Ok, so you have it set to only page 2995, yet we don’t see that call hit.

Can you turn on AGI debugging and post the output from /var/log/asterisk/full???

[2008-11-05 19:15:27] DEBUG[3363] db.c: Unable to find key 'DND4552' in family 'CustomDevstate'
[2008-11-05 19:15:29] DEBUG[13463] app_record.c: Got hangup
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:   == Spawn extension (custom-paging, 7243, 2) exited non-zero on 'SIP/3502-09484138'
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:     -- Executing [[email protected]:1] NoOp("SIP/3502-09484138", "Finished recording page") in new stack
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:     -- Executing [[email protected]:2] Goto("SIP/3502-09484138", "custom-do-paging|s|1") in new stack
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:     -- Goto (custom-do-paging,s,1)
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:     -- Executing [[email protected]:1] NoCDR("SIP/3502-09484138", "") in new stack
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:     -- Executing [[email protected]:2] DeadAGI("SIP/3502-09484138", "allpage.agi") in new stack
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:     -- Launched AGI Script /var/lib/asterisk/agi-bin/allpage.agi
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_request: allpage.agi
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_channel: SIP/3502-09484138
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_language: en
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_type: SIP
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_uniqueid: 1225934124.7999
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_callerid: 3502
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_calleridname: device
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_callingpres: 0
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_callingani2: 0
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_callington: 0
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_callingtns: 0
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_dnid: 7243
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_rdnis: unknown
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_context: custom-do-paging
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_extension: s
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_priority: 2
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_enhanced: 0.0
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >> agi_accountcode: 999-999
[2008-11-05 19:15:29] VERBOSE[13463] logger.c: AGI Tx >>
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:     -- AGI Script allpage.agi completed, returning 0
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:     -- Executing [[email protected]:3] Hangup("SIP/3502-09484138", "") in new stack
[2008-11-05 19:15:29] VERBOSE[13463] logger.c:   == Spawn extension (custom-do-paging, s, 3) exited non-zero on 'SIP/3502-09484138'
[2008-11-05 19:15:32] DEBUG[3363] db.c: Unable to find key 'DND2210' in family 'CustomDevstate'
[2008-11-05 19:15:32] DEBUG[3363] db.c: Unable to find key 'DND2210' in family 'CustomDevstate'
~
~
~
~
~

are you trying to dial a page group 2995? Because this script (which looks pretty fragile) will be explicitly trying to dial SIP/2995 which means a call straight to that endpoint. (And if it’s a page group then they have nothing to do with each other).

Trying to dial directly 2995.

BF

Why did you configure the script as 2995?

You have to place your extension list in the called phone array (@tocall).

2995 IS placed in the @tocall line…

BF

Bill, I am very confused, reread the thread several times. What is not working if it is dialing the extension?

It’s not dialing the extension…

Bill/W5WAF

Bill,

I started a new thread for this before I realized you had started this one. Here is my post from the other thread.

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