how bind_meta_app works?
Hi all, I was experimenting the bind_mea_app and I have a doubt. There is a call from 1000 to FreeSwitch extension and it is connecting to event outbound socket. I've the following script in place. #!/usr/bin/perl use strict; use warnings; use Data::Dumper; use lib '/usr/src/freeswitch/libs/esl/perl/'; use IO::Socket::INET; use ESL; my $SOCK = new IO::Socket::INET ( LocalHost => 'localhost', LocalPort => '8447', Proto => 'tcp', Listen => 10, Reuse => 1 ); unless ($SOCK) { print("Could not create socket: $!"); exit(2); } while (1) { # Wait for any client through accept function in socket module. my $new_sock = $SOCK->accept(); next if (not defined($new_sock)); # Get socket host my $host = $new_sock->sockhost(); print("Got a client accepted from $host\n"); my $pid = fork(); if ($pid) { close($new_sock); next; } my $fd = fileno($new_sock); print("Newly forked child, pid: $$\n"); my $EslCon = new ESL::ESLconnection($fd); print "Connection created successfully\n"; my $info = $EslCon->getInfo(); $EslCon->setEventLock("true"); my $uuid = $info->getHeader("unique-id"); print Dumper $info->serialize(); $EslCon->execute("set","bind_meta_key=#"); $EslCon->execute("bind_meta_app","1 b o event::appli=testing"); my $api = $EslCon->execute("bridge","{ignore_early_media=true}freetdm/1/a/xxxxxxxxx"); } The script called to the number that was dialed. In that number I pressed #1, but the event was not sent, and I assume that the bridge application is executing in the A leg ( is it correct?? ) . So only after that bridge application gets completed the event gets triggered out. If I execute the application in the B leg, then it is working fine, since there is no application that is running at that time. Now I wanted to know if there is any way to run the application on A leg, I need that application to be executed even the bridge is not completed.
On Monday 06 December 2010 12:19 PM, lakshmanan ganapathy wrote:
Hi all, I was experimenting the bind_mea_app and I have a doubt. There is a call from 1000 to FreeSwitch extension and it is connecting to event outbound socket. I've the following script in place.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use lib '/usr/src/freeswitch/libs/esl/perl/'; use IO::Socket::INET; use ESL;
my $SOCK = new IO::Socket::INET ( LocalHost => 'localhost', LocalPort => '8447', Proto => 'tcp', Listen => 10, Reuse => 1 ); unless ($SOCK) { print("Could not create socket: $!"); exit(2); }
while (1) { # Wait for any client through accept function in socket module. my $new_sock = $SOCK->accept(); next if (not defined($new_sock)); # Get socket host my $host = $new_sock->sockhost(); print("Got a client accepted from $host\n"); my $pid = fork(); if ($pid) { close($new_sock); next; } my $fd = fileno($new_sock); print("Newly forked child, pid: $$\n"); my $EslCon = new ESL::ESLconnection($fd); print "Connection created successfully\n"; my $info = $EslCon->getInfo(); $EslCon->setEventLock("true"); my $uuid = $info->getHeader("unique-id"); print Dumper $info->serialize(); $EslCon->execute("set","bind_meta_key=#"); $EslCon->execute("bind_meta_app","1 b o event::appli=testing"); my $api = $EslCon->execute("bridge","{ignore_early_media=true}freetdm/1/a/xxxxxxxxx"); }
The script called to the number that was dialed. In that number I pressed #1, but the event was not sent, and I assume that the bridge application is executing in the A leg ( is it correct?? ) . So only after that bridge application gets completed the event gets triggered out.
If I execute the application in the B leg, then it is working fine, since there is no application that is running at that time. Now I wanted to know if there is any way to run the application on A leg, I need that application to be executed even the bridge is not completed.
_______________________________________________ FreeSWITCH-users mailing list 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
Try after running the answer application in leg A -- Best regards, N.Abubacker , Associate system engineer , bk systems pvt ltd , Ph : 9144-43902701 Disclaimer: http://www.bksystems.co.in/email-policy
The user can press #1 in any time of the call. Not necessarily after answer and before bridge. On Mon, Dec 6, 2010 at 3:17 PM, abubacker <abubacker@bksystems.co.in> wrote:
On Monday 06 December 2010 12:19 PM, lakshmanan ganapathy wrote:
Hi all, I was experimenting the bind_mea_app and I have a doubt. There is a call from 1000 to FreeSwitch extension and it is connecting to event outbound socket. I've the following script in place.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use lib '/usr/src/freeswitch/libs/esl/perl/'; use IO::Socket::INET; use ESL;
my $SOCK = new IO::Socket::INET ( LocalHost => 'localhost', LocalPort => '8447', Proto => 'tcp', Listen => 10, Reuse => 1 ); unless ($SOCK) { print("Could not create socket: $!"); exit(2); }
while (1) { # Wait for any client through accept function in socket module. my $new_sock = $SOCK->accept(); next if (not defined($new_sock)); # Get socket host my $host = $new_sock->sockhost(); print("Got a client accepted from $host\n"); my $pid = fork(); if ($pid) { close($new_sock); next; } my $fd = fileno($new_sock); print("Newly forked child, pid: $$\n"); my $EslCon = new ESL::ESLconnection($fd); print "Connection created successfully\n"; my $info = $EslCon->getInfo(); $EslCon->setEventLock("true"); my $uuid = $info->getHeader("unique-id"); print Dumper $info->serialize(); $EslCon->execute("set","bind_meta_key=#"); $EslCon->execute("bind_meta_app","1 b o event::appli=testing"); my $api = $EslCon->execute("bridge","{ignore_early_media=true}freetdm/1/a/xxxxxxxxx"); }
The script called to the number that was dialed. In that number I pressed #1, but the event was not sent, and I assume that the bridge application is executing in the A leg ( is it correct?? ) . So only after that bridge application gets completed the event gets triggered out.
If I execute the application in the B leg, then it is working fine, since there is no application that is running at that time. Now I wanted to know if there is any way to run the application on A leg, I need that application to be executed even the bridge is not completed.
_______________________________________________ FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
Try after running the answer application in leg A
-- Best regards, N.Abubacker , Associate system engineer , bk systems pvt ltd , Ph : 9144-43902701
Disclaimer: http://www.bksystems.co.in/email-policy
_______________________________________________ FreeSWITCH-users mailing list 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
Hi all, Is my understanding is right??. If so, is it possible to run applications in A leg... On Mon, Dec 6, 2010 at 12:19 PM, lakshmanan ganapathy <lakindia89@gmail.com>wrote:
Hi all, I was experimenting the bind_mea_app and I have a doubt. There is a call from 1000 to FreeSwitch extension and it is connecting to event outbound socket. I've the following script in place.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use lib '/usr/src/freeswitch/libs/esl/perl/'; use IO::Socket::INET; use ESL;
my $SOCK = new IO::Socket::INET ( LocalHost => 'localhost', LocalPort => '8447', Proto => 'tcp', Listen => 10, Reuse => 1 ); unless ($SOCK) { print("Could not create socket: $!"); exit(2); }
while (1) { # Wait for any client through accept function in socket module. my $new_sock = $SOCK->accept(); next if (not defined($new_sock)); # Get socket host my $host = $new_sock->sockhost(); print("Got a client accepted from $host\n"); my $pid = fork(); if ($pid) { close($new_sock); next; } my $fd = fileno($new_sock); print("Newly forked child, pid: $$\n"); my $EslCon = new ESL::ESLconnection($fd); print "Connection created successfully\n"; my $info = $EslCon->getInfo(); $EslCon->setEventLock("true"); my $uuid = $info->getHeader("unique-id"); print Dumper $info->serialize(); $EslCon->execute("set","bind_meta_key=#"); $EslCon->execute("bind_meta_app","1 b o event::appli=testing"); my $api = $EslCon->execute("bridge","{ignore_early_media=true}freetdm/1/a/xxxxxxxxx"); }
The script called to the number that was dialed. In that number I pressed #1, but the event was not sent, and I assume that the bridge application is executing in the A leg ( is it correct?? ) . So only after that bridge application gets completed the event gets triggered out.
If I execute the application in the B leg, then it is working fine, since there is no application that is running at that time. Now I wanted to know if there is any way to run the application on A leg, I need that application to be executed even the bridge is not completed.
Did you try enabling on the A leg also? $EslCon->execute("bind_meta_app","1 ab o event::appli=testing") Just curious as I've never actually tried this before. -MC On Wed, Dec 8, 2010 at 5:01 AM, lakshmanan ganapathy <lakindia89@gmail.com>wrote:
Hi all, Is my understanding is right??. If so, is it possible to run applications in A leg...
On Mon, Dec 6, 2010 at 12:19 PM, lakshmanan ganapathy < lakindia89@gmail.com> wrote:
Hi all, I was experimenting the bind_mea_app and I have a doubt. There is a call from 1000 to FreeSwitch extension and it is connecting to event outbound socket. I've the following script in place.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use lib '/usr/src/freeswitch/libs/esl/perl/'; use IO::Socket::INET; use ESL;
my $SOCK = new IO::Socket::INET ( LocalHost => 'localhost', LocalPort => '8447', Proto => 'tcp', Listen => 10, Reuse => 1 ); unless ($SOCK) { print("Could not create socket: $!"); exit(2); }
while (1) { # Wait for any client through accept function in socket module. my $new_sock = $SOCK->accept(); next if (not defined($new_sock)); # Get socket host my $host = $new_sock->sockhost(); print("Got a client accepted from $host\n"); my $pid = fork(); if ($pid) { close($new_sock); next; } my $fd = fileno($new_sock); print("Newly forked child, pid: $$\n"); my $EslCon = new ESL::ESLconnection($fd); print "Connection created successfully\n"; my $info = $EslCon->getInfo(); $EslCon->setEventLock("true"); my $uuid = $info->getHeader("unique-id"); print Dumper $info->serialize(); $EslCon->execute("set","bind_meta_key=#"); $EslCon->execute("bind_meta_app","1 b o event::appli=testing"); my $api = $EslCon->execute("bridge","{ignore_early_media=true}freetdm/1/a/xxxxxxxxx"); }
The script called to the number that was dialed. In that number I pressed #1, but the event was not sent, and I assume that the bridge application is executing in the A leg ( is it correct?? ) . So only after that bridge application gets completed the event gets triggered out.
If I execute the application in the B leg, then it is working fine, since there is no application that is running at that time. Now I wanted to know if there is any way to run the application on A leg, I need that application to be executed even the bridge is not completed.
_______________________________________________ FreeSWITCH-users mailing list 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
Hi Collins, Thanks for your suggestion. I've just now figured out what was the problem. I believe, It is because of setting the setEventLock to true. I've set that to false and after that it works as expected. Here is my understanding. SetEventLock=true. In A leg, currently bridge application is running. When B leg presses the #1, since SetEventLock is set to true, it was queued for execution. When B hangup the call ( bridge application got completed ) , the queued application got executed. Somebody can correct me if I am wrong. On Thu, Dec 9, 2010 at 11:42 PM, Michael Collins <msc@freeswitch.org> wrote:
Did you try enabling on the A leg also? $EslCon->execute("bind_meta_app","1 ab o event::appli=testing")
Just curious as I've never actually tried this before. -MC
On Wed, Dec 8, 2010 at 5:01 AM, lakshmanan ganapathy <lakindia89@gmail.com
wrote:
Hi all, Is my understanding is right??. If so, is it possible to run applications in A leg...
On Mon, Dec 6, 2010 at 12:19 PM, lakshmanan ganapathy < lakindia89@gmail.com> wrote:
Hi all, I was experimenting the bind_mea_app and I have a doubt. There is a call from 1000 to FreeSwitch extension and it is connecting to event outbound socket. I've the following script in place.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use lib '/usr/src/freeswitch/libs/esl/perl/'; use IO::Socket::INET; use ESL;
my $SOCK = new IO::Socket::INET ( LocalHost => 'localhost', LocalPort => '8447', Proto => 'tcp', Listen => 10, Reuse => 1 ); unless ($SOCK) { print("Could not create socket: $!"); exit(2); }
while (1) { # Wait for any client through accept function in socket module. my $new_sock = $SOCK->accept(); next if (not defined($new_sock)); # Get socket host my $host = $new_sock->sockhost(); print("Got a client accepted from $host\n"); my $pid = fork(); if ($pid) { close($new_sock); next; } my $fd = fileno($new_sock); print("Newly forked child, pid: $$\n"); my $EslCon = new ESL::ESLconnection($fd); print "Connection created successfully\n"; my $info = $EslCon->getInfo(); $EslCon->setEventLock("true"); my $uuid = $info->getHeader("unique-id"); print Dumper $info->serialize(); $EslCon->execute("set","bind_meta_key=#"); $EslCon->execute("bind_meta_app","1 b o event::appli=testing"); my $api = $EslCon->execute("bridge","{ignore_early_media=true}freetdm/1/a/xxxxxxxxx"); }
The script called to the number that was dialed. In that number I pressed #1, but the event was not sent, and I assume that the bridge application is executing in the A leg ( is it correct?? ) . So only after that bridge application gets completed the event gets triggered out.
If I execute the application in the B leg, then it is working fine, since there is no application that is running at that time. Now I wanted to know if there is any way to run the application on A leg, I need that application to be executed even the bridge is not completed.
_______________________________________________ FreeSWITCH-users mailing list 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
_______________________________________________ FreeSWITCH-users mailing list 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
participants (3)
-
abubacker
-
lakshmanan ganapathy
-
Michael Collins