• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
AsteriskGuru Archives
Mailing List Archives
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[asterisk-speech-rec] PHPAGI

 
   AsteriskGuru Archives Forum Index -> Asterisk-Speech-Rec
View previous topic :: View next topic  
Author Message
nitesh at vipernetworks.c
Guest





PostPosted: Fri Dec 28, 2007 1:22 am    Post subject: [asterisk-speech-rec] PHPAGI

Hello All,

Currently, we have IVR based application written using PHPAGI and we
would like to enhanced it more using Voice recognition. I believe
LumenVox speech recognition software is the best for Asterisk based IVR.

Now is there anyway to integrate LumenVox speech recognition app with
PHPAGI? I want to keep on using PHPAGI as it gives me flexibility to
access DB and do other stuff. The main purpose to use LumenVox is to
give users some flexibility of speaking instead of keying the DTMF when
IVR ask for some input.

Here is an example of PHPAGI: -

#!/usr/bin/php -q
<?php
ob_implicit_flush(true);
set_time_limit(6);
...
do {
$pin_no = $agi->get_data('ivr_voice/EnterPersonalPin', 60000,
6); //IVR will prompt a user to enter PIN Number (DTMF).
$pin_no = $pin_no['result']; // Key input is stored in the
$pin_no variable
....
....
?>

Now how can I use speech to capture the input and store it in $pin_no
variable?

Cheers,
Nitesh



_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
Back to top
StephenKeller at LumenVox
Guest





PostPosted: Fri Dec 28, 2007 1:37 am    Post subject: [asterisk-speech-rec] PHPAGI

Quote:
Now is there anyway to integrate LumenVox speech recognition
app with PHPAGI?

Hi Nitesh,

In short the answer to this question is yes. When you use LumenVox speech recognition on Asterisk, you will just make use of the standard Asterisk speech applications exported by res_speech.so.

All the documentation for these applications is at http://www.asterisk.org/doxygen/1.4/AstSpeech.html

Quote:
Now how can I use speech to capture the input and store it in
$pin_no variable?

I am no expert at PHP or the AGI, but basically all you will need to do is use AGI to execute the SpeechBackground() function and then from your application read in the value of the Asterisk $SPEECH_TEXT(0) variable. Perhaps somebody more familiar with PHP and AGI can give you a code snippet of how this is done in PHP.

If you know Java, you can see some sample Java applications that do this via the AGI at http://www.lumenvox.com/partners/digium/applicationzone/index.aspx

I have a video series at LumenVox.com that will really walk you through the basics of speech recognition on Asterisk that begins at http://www.lumenvox.com/support/videos/asteriskSpeechRec101/vid01_summary.aspx

That assumes you are using dialplan, but the core logic should be the same regardless of how you implement it.

Thanks,


Stephen Keller
Technical Support
LumenVox
P: 1-877-977-0707 - just say, "Support"
P: +1-858-707-7700
F: +1-858-707-7072
support@LumenVox.com
www.LumenVox.com


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
Back to top
jsmith at digium.com
Guest





PostPosted: Fri Dec 28, 2007 1:38 pm    Post subject: [asterisk-speech-rec] PHPAGI

On Thu, 2007-12-27 at 20:18 -0500, Nitesh Divecha wrote:
Quote:
Now is there anyway to integrate LumenVox speech recognition app with
PHPAGI?

As long as PHPAGI exposes the EXEC command, you can call any dialplan
applications from your PHP script, including SpeechBackground() and the
rest of the speech applications.

---
Jared Smith
Community Relations Manager
Digium, Inc.


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
Back to top
nitesh at vipernetworks.c
Guest





PostPosted: Wed Jan 02, 2008 4:14 pm    Post subject: [asterisk-speech-rec] PHPAGI

Thanks Steven...

This will help alot to get started with LumenVox app...

Cheers,
Nitesh

Steven Mathers wrote:
Quote:
Hi Nitesh,

Ive got this set up threw PHPAGI

Sample code:

#!/usr/bin/php
<?php
/* Speech app that takes input and speaks the number you say */

function mylog($str){
global $LOGFILE, $UID;
$fp = fopen($LOGFILE,"a");

fputs($fp,date("M:j:Y")."-".date("H:i:s")."-UID=".$UID."-".$str."\n");
fclose($fp);
}
require('/var/lib/asterisk/agi-bin/phpagi-2.14/phpagi.php');
$LOGFILE="/var/log/asterisk/call_log";

$agi = new AGI();
$UID=$agi->request[agi_uniqueid];
$ANI=$agi->request[agi_callerid];
$DNIS=$agi->request[agi_dnid];
$CHANNEL=$agi->request[agi_channel];
$channelnum = substr_replace((ltrim($CHANNEL, 'Zap /')),'',-2);
$rownum = 1979+$channelnum;

//$agi->exec('Playback','hello-world', 'noanwser');
$agi->stream_file('hello-world');
$code=$agi->exec("SpeechCreate");
$code=$agi->exec("SpeechActivateGrammar","ABNFNumber");
$code=$agi->exec("SpeechStart");
//If($code<0) do something?
$agi->exec("SpeechBackground","vm-msginstruct",5);
$res=$agi->get_variable("SPEECH_TEXT(0)");
$data=$res['data'];
mylog("SR result=".$data);
//append the speech results to the CDR so the logger will include it in
the caller mysql entry
$datalog='SpeechResults:'.$data;
$agi->exec('Set','CDR(userfield)='.$datalog);
//destroy speech object
$agi->exec("SpeechDeactivateGrammar","ABNFNumber");
$agi->exec('SpeechDestroy');
$agi->exec('SayNumber',$data,'f');

?>


This will work with Lumenvox connector installed. Basically all this
does is accept a number and say the Speech result back at the person.

Cheers.

-----Original Message-----
From: asterisk-speech-rec-bounces@lists.digium.com
[mailto:asterisk-speech-rec-bounces@lists.digium.com] On Behalf Of
Stephen Keller
Sent: Thursday, December 27, 2007 6:34 PM
To: Use of speech recognition in Asterisk
Subject: Re: [asterisk-speech-rec] PHPAGI


> Now is there anyway to integrate LumenVox speech recognition
> app with PHPAGI?
>

Hi Nitesh,

In short the answer to this question is yes. When you use LumenVox
speech recognition on Asterisk, you will just make use of the standard
Asterisk speech applications exported by res_speech.so.

All the documentation for these applications is at
http://www.asterisk.org/doxygen/1.4/AstSpeech.html


> Now how can I use speech to capture the input and store it in
> $pin_no variable?
>

I am no expert at PHP or the AGI, but basically all you will need to do
is use AGI to execute the SpeechBackground() function and then from your
application read in the value of the Asterisk $SPEECH_TEXT(0) variable.
Perhaps somebody more familiar with PHP and AGI can give you a code
snippet of how this is done in PHP.

If you know Java, you can see some sample Java applications that do this
via the AGI at
http://www.lumenvox.com/partners/digium/applicationzone/index.aspx

I have a video series at LumenVox.com that will really walk you through
the basics of speech recognition on Asterisk that begins at
http://www.lumenvox.com/support/videos/asteriskSpeechRec101/vid01_summar
y.aspx

That assumes you are using dialplan, but the core logic should be the
same regardless of how you implement it.

Thanks,


Stephen Keller
Technical Support
LumenVox
P: 1-877-977-0707 - just say, "Support"
P: +1-858-707-7700
F: +1-858-707-7072
support@LumenVox.com
www.LumenVox.com


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec




_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
Back to top
nitesh at vipernetworks.c
Guest





PostPosted: Wed Jan 02, 2008 4:17 pm    Post subject: [asterisk-speech-rec] PHPAGI

Thanks Stephen,

Videos are really helpful to get started with LumenVox app... Now I just
need to purchase the starter kit and test it out...

Cheers,
Nitesh



Stephen Keller wrote:
Quote:
> Now is there anyway to integrate LumenVox speech recognition
> app with PHPAGI?
>

Hi Nitesh,

In short the answer to this question is yes. When you use LumenVox speech recognition on Asterisk, you will just make use of the standard Asterisk speech applications exported by res_speech.so.

All the documentation for these applications is at http://www.asterisk.org/doxygen/1.4/AstSpeech.html


> Now how can I use speech to capture the input and store it in
> $pin_no variable?
>

I am no expert at PHP or the AGI, but basically all you will need to do is use AGI to execute the SpeechBackground() function and then from your application read in the value of the Asterisk $SPEECH_TEXT(0) variable. Perhaps somebody more familiar with PHP and AGI can give you a code snippet of how this is done in PHP.

If you know Java, you can see some sample Java applications that do this via the AGI at http://www.lumenvox.com/partners/digium/applicationzone/index.aspx

I have a video series at LumenVox.com that will really walk you through the basics of speech recognition on Asterisk that begins at http://www.lumenvox.com/support/videos/asteriskSpeechRec101/vid01_summary.aspx

That assumes you are using dialplan, but the core logic should be the same regardless of how you implement it.

Thanks,


Stephen Keller
Technical Support
LumenVox
P: 1-877-977-0707 - just say, "Support"
P: +1-858-707-7700
F: +1-858-707-7072
support@LumenVox.com
www.LumenVox.com


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec




_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
Back to top
nitesh at vipernetworks.c
Guest





PostPosted: Wed Jan 02, 2008 4:21 pm    Post subject: [asterisk-speech-rec] PHPAGI

Thanks Jared,

Making some progress... Thanks for your support...

Cheers,
Nitesh


Jared Smith wrote:
Quote:
On Thu, 2007-12-27 at 20:18 -0500, Nitesh Divecha wrote:

> Now is there anyway to integrate LumenVox speech recognition app with
> PHPAGI?
>

As long as PHPAGI exposes the EXEC command, you can call any dialplan
applications from your PHP script, including SpeechBackground() and the
rest of the speech applications.

---
Jared Smith
Community Relations Manager
Digium, Inc.


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec




_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
Back to top
Display posts from previous:   
   AsteriskGuru Archives Forum Index -> Asterisk-Speech-Rec All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™