Kevin DeGraaf
2008-Mar-11 23:19 UTC
[asterisk-users] AGI - calling functions, CHANNEL STATUS broken?
Greetings,
I am writing an AGI script that needs to check on the idle/busy status
of a number of SIP peers (mostly SPA9xx phones, with a few Polycoms and
Snoms thrown in for fun).
Is it possible to call Asterisk functions (e.g. SIPPEER) from AGI
scripts? Based on my Googling, I would guess in the negative. I have
tried various permutations of Set() and Eval() without success.
I have also tried to use the "CHANNEL STATUS" AGI command, but that
doesn't seem to work, as indicated by these results:
exten => 610,1,NoOp()
exten => 610,n,Set(CC_200=${SIPPEER(200:curcalls)})
exten => 610,n,Set(CC_221=${SIPPEER(221:curcalls)})
exten => 610,n,Set(CC_231=${SIPPEER(231:curcalls)})
exten => 610,n,AGI(test.agi)
$cc[0] = $AGI->get_variable('CC_200');
$cc[1] = $AGI->get_variable('CC_221');
$cc[2] = $AGI->get_variable('CC_231');
$AGI->verbose("Test using Set(): $cc[0] $cc[1] $cc[2]");
$AGI->verbose("Status of 200: " .
$AGI->channel_status('SIP/200'));
$AGI->verbose("Status of 221: " .
$AGI->channel_status('SIP/221'));
$AGI->verbose("Status of 231: " .
$AGI->channel_status('SIP/231'));
test.agi: Test using Set(): 0 1 0 ; Exactly as expected
test.agi: Status of 200: -1
test.agi: Status of 221: -1
test.agi: Status of 231: -1
Any advice?
--
Kevin DeGraaf
Matt Riddell
2008-Mar-12 01:04 UTC
[asterisk-users] AGI - calling functions, CHANNEL STATUS broken?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kevin DeGraaf wrote:> $AGI->verbose("Test using Set(): $cc[0] $cc[1] $cc[2]"); > $AGI->verbose("Status of 200: " . $AGI->channel_status('SIP/200')); > $AGI->verbose("Status of 221: " . $AGI->channel_status('SIP/221')); > $AGI->verbose("Status of 231: " . $AGI->channel_status('SIP/231'));I may be off base here as I haven't used the channel status via AGI, but SIP/200 seems like an account to me rather than a channel. - -- Kind Regards, Matt Riddell Director _______________________________________________ http://www.venturevoip.com (Great new VoIP end to end solution) http://www.venturevoip.com/news.php (Daily Asterisk News - html) http://www.venturevoip.com/newrssfeed.php (Daily Asterisk News - rss) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH1ywwDQNt8rg0Kp4RAkYcAJwKBYJOUVgz0ii5Ky2DZtwFWvCtHwCfX/+r 1HFlsDnMHVHKfELEGyZgk/s=21xo -----END PGP SIGNATURE-----
Kevin DeGraaf
2008-Mar-12 17:27 UTC
[asterisk-users] AGI - calling functions, CHANNEL STATUS broken?
> I am writing an AGI script that needs to check on the idle/busy status > of a number of SIP peers (mostly SPA9xx phones, with a few Polycoms and > Snoms thrown in for fun).I ended up grabbing this info from the manager interface, within an AGI script. A little back-asswards, but it works. I still would like to know whether it's possible to call Asterisk functions from within AGI scripts... -- Kevin DeGraaf