VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
thangappan143 at gmail... Guest
|
Posted: Fri Jul 31, 2009 12:09 am Post subject: [Freeswitch-users] Fwd: IVR Problem |
|
|
If I missed out the async mode from the dial plan I am not able to get the events from it.
Here is my Perl script.
# Create a conenction with Event socket library.
my $conn = new ESL::ESLconnection($fd);
# Getting the connection informations and values of the variables.
my $info = $conn->getInfo();
# Getting the caller id and print the statement.
my $caller_id =$info->getHeader("caller-caller-id-number");
printf "Connected from %s\n", $caller_id;
# Receive the events from only in this switch.
$conn->sendRecv("myevents");
# Answer the call.
$conn->execute("answer");
# playback the welcome message.
$conn->execute("playback",$sound_path."ivr/ivr-welcome_to_freeswitch.wav");
$conn->execute("playback",$sound_path."ivr/ivr-this_ivr_will_let_you_test_features.wav");
$conn->execute("playback",$sound_path."ivr/ivr-you_may_exit_by_hanging_up.wav");
$conn->execute("sleep", "1000");
# Until the connection get disconnected
while($conn->connected()){
# Receive the event
my $event = $conn->recvEvent();
# Check the event is received
if($event){
# Get the event name and print it.
my $name = $event->getHeader("event-name");
print "EVENT:[$name]\n";
# If the event name is DTMF then print the enterted digit.
if($name eq 'DTMF'){
my $digit = $event->getHeader("dtmf-digit");
my $duration = $event->getHeader("dtmf-duration");
# And duration.
print "DTMF digit $digit ($duration)\n";
}
}
}
If I specified data field in the dial plan as <127.0.0.1:5000 full> All the voice files are played in order.But I am not able to get the EVENTS in the while loop.
If I specified data field in the dial plan as <127.0.0.1:5000 async full>.The voice files are not played in order.But I am able to get the events in the while loop.
I need to receive EVENS.Then I check the event name if it is DTMF based on the DTMF input I processed that option.
In the case of $conn->setEventLock("true") , where can I reset this value to false.
Please Help Me.......
---------- Forwarded message ----------
From: Thangappan.M <thangappan143@gmail.com (thangappan143@gmail.com)>
Date: Thu, Jul 30, 2009 at 12:42 PM
Subject: IVR Problem
To: freeswitch-users <freeswitch-users@lists.freeswitch.org (freeswitch-users@lists.freeswitch.org)>
Dear all,
I am in the process of implementing an IVR using event outbound socket. In the dial plan I used the following statement.
<action application="socket" data="127.0.0.1:5000 async full"/>
I implemented a Perl script which is listening on the dial plan specified IP address and PORT ( In this case 127.0.0.1 and 5000). Whenever the caller is calling 5000 I executed the above dial plan.
Before dialing to the number I executed the Perl script.
In my Perl script, first I did the following steps.
* Accepting the client connection
* Fork a process
* Connect with Event Socket Library
* Finally send and receive the events to that channel.
In the sending part, at first I am sending ($conn->sendRecv("myevents") ) myevents to the freeswitch.It means receive the events from this channel only.
I answer for that call ( $conn->execute("answer") )
Then I play back three files as
$conn->execute("playback",$sound_path."ivr/ivr-welcome_to_freeswitch.wav");
$conn->execute("playback",$sound_path."ivr/ivr-this_ivr_will_let_you_test_features.wav");
$conn->execute("playback",$sound_path."ivr/ivr-you_may_exit_by_hanging_up.wav");
Here the sound path is /usr/local/freeswitch/sounds/en/us/callie/
But it is not play backed the sound in order. Why?
I know that it is a problem in mode(async, full). Can you please clarify these two keywords?
I have studied from the wiki page. But I was not able to get it.
I also specified the lock mode after every play back as
$conn->SetEventBlock("true");
But is not working. Could you please solve this issue?
--
Regards,
Thangappan.M
--
Regards,
Thangappan.M |
|
Back to top |
|
|
anthony.minessale at g... Guest
|
Posted: Fri Jul 31, 2009 10:22 am Post subject: [Freeswitch-users] Fwd: IVR Problem |
|
|
Like I said you set the event lock to true right away when you create the connection,
Then all your sendmsg events will be queued and processed one at a time instead of "as received"
On Fri, Jul 31, 2009 at 12:04 AM, Thangappan.M <thangappan143@gmail.com (thangappan143@gmail.com)> wrote:
Quote: |
If I missed out the async mode from the dial plan I am not able to get the events from it.
Here is my Perl script.
# Create a conenction with Event socket library.
my $conn = new ESL::ESLconnection($fd);
# Getting the connection informations and values of the variables.
my $info = $conn->getInfo();
# Getting the caller id and print the statement.
my $caller_id =$info->getHeader("caller-caller-id-number");
printf "Connected from %s\n", $caller_id;
# Receive the events from only in this switch.
$conn->sendRecv("myevents");
# Answer the call.
$conn->execute("answer");
# playback the welcome message.
$conn->execute("playback",$sound_path."ivr/ivr-welcome_to_freeswitch.wav");
$conn->execute("playback",$sound_path."ivr/ivr-this_ivr_will_let_you_test_features.wav");
$conn->execute("playback",$sound_path."ivr/ivr-you_may_exit_by_hanging_up.wav");
$conn->execute("sleep", "1000");
# Until the connection get disconnected
while($conn->connected()){
# Receive the event
my $event = $conn->recvEvent();
# Check the event is received
if($event){
# Get the event name and print it.
my $name = $event->getHeader("event-name");
print "EVENT:[$name]\n";
# If the event name is DTMF then print the enterted digit.
if($name eq 'DTMF'){
my $digit = $event->getHeader("dtmf-digit");
my $duration = $event->getHeader("dtmf-duration");
# And duration.
print "DTMF digit $digit ($duration)\n";
}
}
}
If I specified data field in the dial plan as <127.0.0.1:5000 full> All the voice files are played in order.But I am not able to get the EVENTS in the while loop.
If I specified data field in the dial plan as <127.0.0.1:5000 async full>.The voice files are not played in order.But I am able to get the events in the while loop.
I need to receive EVENS.Then I check the event name if it is DTMF based on the DTMF input I processed that option.
In the case of $conn->setEventLock("true") , where can I reset this value to false.
Please Help Me.......
---------- Forwarded message ----------
From: Thangappan.M <thangappan143@gmail.com (thangappan143@gmail.com)>
Date: Thu, Jul 30, 2009 at 12:42 PM
Subject: IVR Problem
To: freeswitch-users <freeswitch-users@lists.freeswitch.org (freeswitch-users@lists.freeswitch.org)>
Dear all,
I am in the process of implementing an IVR using event outbound socket. In the dial plan I used the following statement.
<action application="socket" data="127.0.0.1:5000 async full"/>
I implemented a Perl script which is listening on the dial plan specified IP address and PORT ( In this case 127.0.0.1 and 5000). Whenever the caller is calling 5000 I executed the above dial plan.
Before dialing to the number I executed the Perl script.
In my Perl script, first I did the following steps.
* Accepting the client connection
* Fork a process
* Connect with Event Socket Library
* Finally send and receive the events to that channel.
In the sending part, at first I am sending ($conn->sendRecv("myevents") ) myevents to the freeswitch.It means receive the events from this channel only.
I answer for that call ( $conn->execute("answer") )
Then I play back three files as
$conn->execute("playback",$sound_path."ivr/ivr-welcome_to_freeswitch.wav");
$conn->execute("playback",$sound_path."ivr/ivr-this_ivr_will_let_you_test_features.wav");
$conn->execute("playback",$sound_path."ivr/ivr-you_may_exit_by_hanging_up.wav");
Here the sound path is /usr/local/freeswitch/sounds/en/us/callie/
But it is not play backed the sound in order. Why?
I know that it is a problem in mode(async, full). Can you please clarify these two keywords?
I have studied from the wiki page. But I was not able to get it.
I also specified the lock mode after every play back as
$conn->SetEventBlock("true");
But is not working. Could you please solve this issue?
--
Regards,
Thangappan.M
--
Regards,
Thangappan.M
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400 |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot 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
|