Hello all
im replacing an Asterisk 1.4 server with Asterisk 11 (on seperate servers)
i have copied across all the dial plans etc
on the 1.4 server if i dial *96 this initiates the page agi script - which works brilliant
i have copied this across to the new machine (dialplan & agi) when i initiate the pagecall i get
call then ends
this is what is in my dial plan
exten => *10,1,Set(TIMEOUT(absolute)=15)
exten => *10,n,AGI
(page.agi,101@Internal,102@Internal, 103@Internal,104@Internal105@Internal,104@Internal
exten => *10,n,Set(CALLERID(all)=Page:${CALLERID(name)} <${CALLERID(num)}>)
exten => *10,n,Set(_ALERT_INFO="Ring Answer")
exten => *10,n,Set(SIPAddHeader(Call-Info:\; answer-after=0)
exten => *10,n,Page(${PAGE_GROUP})
exten => *10,n,Hangup()
can anyone spot any problems with my code?
thanks
[/code]
PAGE_GROUP is not set. There is nothing in the code that you have presented that would set it, although something in the AGI might do so.
Morning David thanks for the reply
the contents of the agi are
# page.agi will find all available sip & sccp phones
# it then sets the dialplan variable PAGE_GROUP to allow the phones to be paged with the Page #cmd.
# This works with both my aastra, polycom, sipura/linksys and cisco sccp phones.
# It should be easily modified for other sip phones
# Documentation:
# Add something similar to your dialplan,arguments are extensions to
# to be excluded from the page. Use just the extension numbers.
#exten => *61,1,Set(TIMEOUT(absolute) = 15)
#exten => *61,n,AGI(page.agi|<arg>|<arg>)
#exten => *61,n,SetCallerID("Page:${CALLERIDNAME}" <${CALLERIDNUM}>)
#exten => *61,n,Set(_ALERT_INFO="Ring Answer")
#exten => *61,n,SIPAddHeader(Call-Info: answer-after=0)
#exten => *61,n,Page(${PAGE_GROUP})
#exten => *61,n,Hangup()
#use Asterisk::AGI;
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
# set our array of phones that we will NOT be paging
@bypass = "@ARGV";
# Get our needed info for idle sip & sccp phones
@sips = grep(/^\s+\d+.*/, `asterisk -rx "show hints"`);
# Now check each phone to see if it's in use and also
# against our exclude list. If it passes both, it's
# added to our array of calls to make
# Then set the dialplan variable thru AGI
foreach $sipline (@sips) {
my ($junk0, $exten, $junk1, $chan, $state, $junk2) = split(/ +/, $sipline,6);
my ($type, $extension) = split(/\//,$chan,2);
unless (($state ne "State:Idle") || (grep(/$exten/i, @bypass))) {
if ($type eq "SCCP") {
my $SCCP = $chan . "/aa=1wu/ringer=outside";
push(@mypage,$SCCP);
} else {
push(@mypage,"$chan");
}
}
}
$page = join("&",@mypage);
$AGI->set_variable("PAGE_GROUP", "$page");
exit;
is this any help?
thanks - really appreciate it
hi guys can anyone comment on this at all??
thanks
Try doing a NoOp(${PAGE_GROUP}) right before calling Page().
I join david55 saying that the variable must be empty considering the warning message it generates.
You need to enable AGI debugging and work backwards to where it should be set.
I try to minimise the use of AGI.
Gotcha!
thanks for the replies, i have been playing around with a work around that seems to work (an also avoids the AGI)
exten => *96,1,Answer
exten => *96,n,Wait(1)
exten => *96,2,Playback(beep)
exten => *96,n,SIPAddHeader(Call-Info: <sip:192.168.0.1>\;answer-after=0)
exten => *96,n,Page(SIP/101&SIP/102&SIP/103) ;
exten => *96,n,Hangup()
this seems to work, although i have manually add all of our extensions!