VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
msc at freeswitch.org Guest
|
Posted: Thu Aug 27, 2009 11:31 am Post subject: [Freeswitch-users] How to make a call back |
|
|
On Wed, Aug 26, 2009 at 9:38 PM, lakshmanan <lakindia89@gmail.com (lakindia89@gmail.com)> wrote:
Quote: |
When I give the following from the command line it calls to 1010 extension
and once answered, it calls to 1000 and bridge the connection.
originate user/1010 &bridge(user/1000)
But I want to do this in perl. So I have given as follows
$session->originate($session,"user/1010 &bridge user/1000");
But it is not working. It says "user/1010 &bridge user/1000 is invalid
user".
How to do this in perl. pls help. |
Are you calling this perl script from the CLI? If so you won't have the $session object because a channel does not exist for a simple API call.
-MC |
|
Back to top |
|
|
lakindia89 at gmail.com Guest
|
Posted: Fri Aug 28, 2009 12:13 am Post subject: [Freeswitch-users] How to make a call back |
|
|
No. In the dial plan I said, application="perl" data="The perl script".
I also checked $session->execute("bridge","user/1010"). This is working fine.
But originate is not working as I expected.
On Thu, Aug 27, 2009 at 9:46 PM, Michael Collins <msc@freeswitch.org (msc@freeswitch.org)> wrote:
|
|
Back to top |
|
|
msc at freeswitch.org Guest
|
Posted: Fri Aug 28, 2009 1:02 am Post subject: [Freeswitch-users] How to make a call back |
|
|
Sent from my iPhone
On Aug 27, 2009, at 10:01 PM, lakshmanan ganapathy <[url=mailto:lakindia89@gmail.com]lakindia89@gmail.com (lakindia89@gmail.com)[/url]> wrote:
Quote: | No. In the dial plan I said, application="perl" data="The perl script".
I also checked $session->execute("bridge","user/1010"). This is working fine.
But originate is not working as I expected.
| I think you might be confusing Dialplan apps with API commands. The $session object represents an existing channel and therefore it uses Dialplan apps. Originate is an API, that is, it is a command that you type at the CLI.
You need an API object to use originate from a script:
my $api = new $freeswitch::API();
my $res = $api->executeString("originate user/1010 &bridge(user/1000);
What kind of application are you developing? I'm curious why you need an originate to create a whole new call.
-MC
|
|
Back to top |
|
|
delianspam at gmail.com Guest
|
Posted: Fri Aug 28, 2009 1:49 am Post subject: [Freeswitch-users] How to make a call back |
|
|
Hello Michael!
#Does this Python code helps:
new_api_obj = API()
result = new_api_obj.executeString("show channels")) # Replace “show channels” with a command of your choice
# By the way, I use the command below to connect an existing and answered leg to a second one:
destination=1000
session.execute("bridge", "sofia/internal/" + destination + "@yourpbx.domain.com")
Best Regards,
Delian Tashev
From: lakshmanan ganapathy [mailto:lakindia89@gmail.com]
Sent: Friday, August 28, 2009 8:02 AM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] How to make a call back
No. In the dial plan I said, application="perl" data="The perl script".
I also checked $session->execute("bridge","user/1010"). This is working fine.
But originate is not working as I expected.
On Thu, Aug 27, 2009 at 9:46 PM, Michael Collins <msc@freeswitch.org (msc@freeswitch.org)> wrote:
On Wed, Aug 26, 2009 at 9:38 PM, lakshmanan <lakindia89@gmail.com (lakindia89@gmail.com)> wrote:
When I give the following from the command line it calls to 1010 extension
and once answered, it calls to 1000 and bridge the connection.
originate user/1010 &bridge(user/1000)
But I want to do this in perl. So I have given as follows
$session->originate($session,"user/1010 &bridge user/1000");
But it is not working. It says "user/1010 &bridge user/1000 is invalid
user".
How to do this in perl. pls help.
Are you calling this perl script from the CLI? If so you won't have the $session object because a channel does not exist for a simple API call.
-MC
_______________________________________________
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 |
|
Back to top |
|
|
lakindia89 at gmail.com Guest
|
Posted: Fri Aug 28, 2009 1:50 am Post subject: [Freeswitch-users] How to make a call back |
|
|
The following is the requirement.
Let say I have 3 extensions in my freeswitch. (777,1000,1010).
When 1000 made a call to 777, I'll execute a perl application.
In that, I'll get the DTMF (1010) from the caller. Then I'll make a call to
the entered digit and I've to bridge 1000 and 1010.
This is what my requirement.
I also tried the following.
#!/usr/bin/perl
use strict;
use freeswitch;
our $session;
my $sess=new freeswitch::Session("user/1000");
$sess->answer();
if($sess->ready())
{
freeswitch::consoleLog("INFO","Session is answered\n");
$sess->execute("playback","/usr/local/freeswitch/sounds/en/us/callie/time/8000/day-1.wav");
my $dtmf = $sess->getDigits(4,"", 5000);
freeswitch::consoleLog("INFO","I received $dtmf\n");
my $new_sess=new freeswitch::Session("user/$dtmf");
$new_sess->answer();
if($new_sess->ready())
{
$session->bridge($sess,$new_sess);
}
}
In the above program I got usage error on $session->bridge.
mercutioviz wrote:
Quote: |
Sent from my iPhone
On Aug 27, 2009, at 10:01 PM, lakshmanan ganapathy
<lakindia89@gmail.com> wrote:
Quote: | No. In the dial plan I said, application="perl" data="The perl
script".
I also checked $session->execute("bridge","user/1010"). This is
working fine.
But originate is not working as I expected.
| I think you might be confusing Dialplan apps with API commands. The
$session object represents an existing channel and therefore it uses
Dialplan apps. Originate is an API, that is, it is a command that you
type at the CLI.
You need an API object to use originate from a script:
my $api = new $freeswitch::API();
my $res = $api->executeString("originate user/1010 &bridge(user/1000);
What kind of application are you developing? I'm curious why you need
an originate to create a whole new call.
-MC
Quote: | On Thu, Aug 27, 2009 at 9:46 PM, Michael Collins
<msc@freeswitch.org> wrote:
On Wed, Aug 26, 2009 at 9:38 PM, lakshmanan <lakindia89@gmail.com>
wrote:
When I give the following from the command line it calls to 1010
extension
and once answered, it calls to 1000 and bridge the connection.
originate user/1010 &bridge(user/1000)
But I want to do this in perl. So I have given as follows
$session->originate($session,"user/1010 &bridge user/
1000");
But it is not working. It says "user/1010 &bridge user/1000 is invalid
user".
How to do this in perl. pls help.
Are you calling this perl script from the CLI? If so you won't have
the $session object because a channel does not exist for a simple
API call.
-MC
_______________________________________________
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
|
_______________________________________________
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
|
--
View this message in context: http://www.nabble.com/How-to-make-a-call-back-tp25166083p25184832.html
Sent from the Freeswitch-users mailing list archive at Nabble.com.
_______________________________________________
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 |
|
Back to top |
|
|
lakindia89 at gmail.com Guest
|
Posted: Fri Aug 28, 2009 2:11 am Post subject: [Freeswitch-users] How to make a call back |
|
|
Hey I'm sorry. I've solved this as follows
my $sess=new freeswitch::Session("user/1000");
$sess->answer();
#$sess->waitForAnswer($session);
if($sess->ready())
{
freeswitch::consoleLog("INFO","Session is answered\n");
$sess->execute("playback","/usr/local/freeswitch/sounds/en/us/callie/time/8000/day-1.wav");
my $dtmf = $sess->getDigits(4,"", 5000);
freeswitch::consoleLog("INFO","I received $dtmf\n");
$sess->execute("bridge","user/$dtmf");
}
lakshmanan wrote:
Quote: |
I also tried the following.
#!/usr/bin/perl
use strict;
use freeswitch;
our $session;
my $sess=new freeswitch::Session("user/1000");
$sess->answer();
if($sess->ready())
{
freeswitch::consoleLog("INFO","Session is answered\n");
$sess->execute("playback","/usr/local/freeswitch/sounds/en/us/callie/time/8000/day-1.wav");
my $dtmf = $sess->getDigits(4,"", 5000);
freeswitch::consoleLog("INFO","I received $dtmf\n");
my $new_sess=new freeswitch::Session("user/$dtmf");
$new_sess->answer();
if($new_sess->ready())
{
$session->bridge($sess,$new_sess);
}
}
In the above program I got usage error on $session->bridge.
mercutioviz wrote:
Quote: |
Sent from my iPhone
On Aug 27, 2009, at 10:01 PM, lakshmanan ganapathy
<lakindia89@gmail.com> wrote:
Quote: | No. In the dial plan I said, application="perl" data="The perl
script".
I also checked $session->execute("bridge","user/1010"). This is
working fine.
But originate is not working as I expected.
| I think you might be confusing Dialplan apps with API commands. The
$session object represents an existing channel and therefore it uses
Dialplan apps. Originate is an API, that is, it is a command that you
type at the CLI.
You need an API object to use originate from a script:
my $api = new $freeswitch::API();
my $res = $api->executeString("originate user/1010 &bridge(user/1000);
What kind of application are you developing? I'm curious why you need
an originate to create a whole new call.
-MC
Quote: | On Thu, Aug 27, 2009 at 9:46 PM, Michael Collins
<msc@freeswitch.org> wrote:
On Wed, Aug 26, 2009 at 9:38 PM, lakshmanan <lakindia89@gmail.com>
wrote:
When I give the following from the command line it calls to 1010
extension
and once answered, it calls to 1000 and bridge the connection.
originate user/1010 &bridge(user/1000)
But I want to do this in perl. So I have given as follows
$session->originate($session,"user/1010 &bridge user/
1000");
But it is not working. It says "user/1010 &bridge user/1000 is invalid
user".
How to do this in perl. pls help.
Are you calling this perl script from the CLI? If so you won't have
the $session object because a channel does not exist for a simple
API call.
-MC
_______________________________________________
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
|
_______________________________________________
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
|
|
--
View this message in context: http://www.nabble.com/How-to-make-a-call-back-tp25166083p25185052.html
Sent from the Freeswitch-users mailing list archive at Nabble.com.
_______________________________________________
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 |
|
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
|