taf taffey
2005-Feb-06 01:45 UTC
[Asterisk-Users] Need help with perl script/agi for ringback
Hi,
I'm trying to write a simple perl script that will run
the following:
Action: Originate
Channel: local/xxx@callback/r/n
Exten: 1234
Context: callback
Priority: 1
Extensions.conf
exten => 500,1,agi,callback.pl
callback perl script:
use Net::Telnet ();
$mgrUSERNAME='fred';
$mgrSECRET='bloggs';
$server_ip='127.0.0.1';
$tn->print("Action: originate\nExten: 1234\nContext:
user\nChannel: local/xxx@user/r/n\nPriority:
1\nCallerid: 1234\n\n");
$tn->waitfor('/Event: Newchannel.*/') or die "Unable
to determine call status", $tn->lastline;
# wait for asterisk to process
$tn->print("Action: Logoff\n\n");
I'm not a programmer (as u can probably tell) so any
pointers would be much appreciated.
Cheers,
Taff.
___________________________________________________________
ALL-NEW Yahoo! Messenger - all new features - even more fun!
http://uk.messenger.yahoo.com
Matt Klein
2005-Feb-06 02:43 UTC
[Asterisk-Users] Need help with perl script/agi for ringback
kill the line breaks? On Sun, 6 Feb 2005, taf taffey wrote:> Hi, > I'm trying to write a simple perl script that will run > the following: > > Action: Originate > Channel: local/xxx@callback/r/n > Exten: 1234 > Context: callback > Priority: 1 > > Extensions.conf > exten => 500,1,agi,callback.pl > > callback perl script: > > use Net::Telnet (); > > $mgrUSERNAME='fred'; > $mgrSECRET='bloggs'; > $server_ip='127.0.0.1'; > > > > $tn->print("Action: originate\nExten: 1234\nContext: > user\nChannel: local/xxx@user/r/n\nPriority: > 1\nCallerid: 1234\n\n"); > $tn->waitfor('/Event: Newchannel.*/') or die "Unable > to determine call status", $tn->lastline; > # wait for asterisk to process > $tn->print("Action: Logoff\n\n"); > > I'm not a programmer (as u can probably tell) so any > pointers would be much appreciated. > > Cheers, > Taff. > > > > > > > > ___________________________________________________________ > ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Jean-Denis Girard
2005-Feb-06 15:57 UTC
[Asterisk-Users] Need help with perl script/agi for ringback
taf taffey a ?crit :> Hi, > I'm trying to write a simple perl script that will run > the following: > > Action: Originate > Channel: local/xxx@callback/r/n > Exten: 1234 > Context: callback > Priority: 1 > > Extensions.conf > exten => 500,1,agi,callback.pl > > callback perl script: > > use Net::Telnet (); > > $mgrUSERNAME='fred'; > $mgrSECRET='bloggs'; > $server_ip='127.0.0.1'; > > > > $tn->print("Action: originate\nExten: 1234\nContext: > user\nChannel: local/xxx@user/r/n\nPriority: > 1\nCallerid: 1234\n\n"); > $tn->waitfor('/Event: Newchannel.*/') or die "Unable > to determine call status", $tn->lastline; > # wait for asterisk to process > $tn->print("Action: Logoff\n\n"); > > I'm not a programmer (as u can probably tell) so any > pointers would be much appreciated. > > Cheers, > Taff. >You should take a look at the perl modules from http://asterisk.gnuinter.net/ Thanks, Jean-Denis