Hi all,
I wanted to execute one of mySQL query when the call is answered i
tried with the following code but it dones not seems to work.
$AGI->exec('Dial', $dialext);
my $dialstatus = $AGI->get_variable("DIALSTATUS");
if($dialstatus="ANSWER"){$Accounting_update->execute($fdatetime,$Cuniq,$UserName,$CalledN);}
It is not updating my query when the call is successfull answered, and
i checked my query from outside using perl commond it is working well
without any issue.
--
Thank You,
Code Lover
($dialstatus="ANSWER") replace with $dialstatus eq "ANSWER" perl treats = as an assignment operator. For comparison, you need eq or =. -apu On 12/18/05, Code Lover <lateef.np@gmail.com> wrote:> > Hi all, > > I wanted to execute one of mySQL query when the call is answered i > tried with the following code but it dones not seems to work. > > $AGI->exec('Dial', $dialext); > > my $dialstatus = $AGI->get_variable("DIALSTATUS"); > > if($dialstatus="ANSWER"){$Accounting_update->execute($fdatetime,$Cuniq,$UserName,$CalledN);} > > It is not updating my query when the call is successfull answered, and > i checked my query from outside using perl commond it is working well > without any issue. > > > > > -- > Thank You, > Code Lover > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051219/271dbe9a/attachment.htm
Hi Code Lover,
Please try this code :
if ($dialstatus eq
"ANSWER"){$Accounting_update->execute($fdatetime,$Cuniq,$UserName,$CalledN);}
I hope it will solve your problem. We use "eq" instead of
"=" in perl or cgi
for strings.
Thanks
Furqan Ahmed
Software Engineer
B.E. (Computer System), DBA
Super Technologies Inc., Pensacola, Florida
Http://www.SuperTec.com - Tommrow's Technology, Today.
Http://www.SuperTec.com/solutions/ - VOIP Billing Solutions.
Http://www.AsteriskSupport.com - Premium Asterisk Support & Development
Services.
----- Original Message -----
From: "Code Lover" <lateef.np@gmail.com>
To: <asterisk-users@lists.digium.com>
Sent: Sunday, December 18, 2005 2:13 AM
Subject: [Asterisk-Users] PERL AGI DIALSTATUS
Hi all,
I wanted to execute one of mySQL query when the call is answered i
tried with the following code but it dones not seems to work.
$AGI->exec('Dial', $dialext);
my $dialstatus = $AGI->get_variable("DIALSTATUS");
if($dialstatus="ANSWER"){$Accounting_update->execute($fdatetime,$Cuniq,$UserName,$CalledN);}
It is not updating my query when the call is successfull answered, and
i checked my query from outside using perl commond it is working well
without any issue.
--
Thank You,
Code Lover
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users