codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Return values from Perl to asterisk  padmaja3 at 07:17 on Monday, October 15, 2007
 

Hi all,
I'm stuck with how to pass the return value to asterisk. That is, a value has to be passed from perl script to asterisk. The variable returned in Perl has to be passed to asterisk, where if the return value is 1 from perl , i have to do something and if return value is 0, i have to do something else.

I have written code like this.

exten => 9999,23,AGI(insert_into_database.pl|${intime}|${outtime}|${telephone_number}|${date}|${month}|${year}


in Perl Script:
******************


$fullDate = $ARGV[3]."".SARGV[4]."".$ARGV[5];
...........
........(some more code)


if($record == 0 && $rec == 0 && $pri == 0)
{
$stmt = "INSERT into $table_name values($ARGV[0],$ARGV[1],$ARGV[2],$fullDate)";
$fetch = $dbh->prepare($stmt);
$fetch->execute();
}
else
{
print "\nValues cannot be inserted in database\n\n";
}





If that "if" condition satisfies, then it has to return some value, say 0.Otherwise 1. Even if i write return 0, there in "if" condition, how can i get that value to asterisk?

Pls suggest me how to proceed.

Thanks in advance,
Padmaja T N.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  tree
•  Please tell me the links for chapterwise mock tests in C++
•  Return values from Perl to asterisk
•  Re: Problem with concatenation
•  Perl integration with other Languages
•  help
•  reg column sorting for long type..
•  Random Images In An ASP.NET Web Page
•  How to support Unicode for Embeded Perl


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007