Hi, I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues?
Hi Sam, My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at: http://wiki.freeswitch.org/wiki/Event_List specifically the channel events list. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 2:32 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Asterisk dial status Hi, I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues?
Sam, Does this require event sockets? Or how would I check these events? --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 11:57 AM Hi Sam, My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at: http://wiki.freeswitch.org/wiki/Event_List specifically the channel events list. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 2:32 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Asterisk dial status Hi, I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues? -----Inline Attachment Follows----- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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
It does. You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you. As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven't used Asterisk before so I'm not sure how the AGI fits on the FS architecture. You can get more info at: http://wiki.freeswitch.org/wiki/Mod_event_socket And a working demo at: http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 4:23 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Asterisk dial status Sam, Does this require event sockets? Or how would I check these events? --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 11:57 AM Hi Sam, My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at: http://wiki.freeswitch.org/wiki/Event_List specifically the channel events list. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 2:32 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Asterisk dial status Hi, I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues? -----Inline Attachment Follows----- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org</mc/compose?to=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, You can also get these status in xml_curl post. see http://wiki.freeswitch.org/wiki/Mod_xml_curl http://wiki.freeswitch.org/wiki/Mod_xml_curl_CGI_example On Sat, Jul 23, 2011 at 2:28 AM, Hector Geraldino < Hector.Geraldino@ip-soft.net> wrote:
It does.****
** **
You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you. ****
** **
As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven’t used Asterisk before so I’m not sure how the AGI fits on the FS architecture.****
** **
You can get more info at:****
http://wiki.freeswitch.org/wiki/Mod_event_socket****
** **
And a working demo at:****
http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example****
** **
** **
** **
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Sam *Sent:* Friday, July 22, 2011 4:23 PM *To:* FreeSWITCH Users Help
*Subject:* Re: [Freeswitch-users] Asterisk dial status****
** **
Sam,
Does this require event sockets? Or how would I check these events?
--- On *Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net>*wrote: ****
From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 11:57 AM****
Hi Sam,****
****
My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at:****
****
http://wiki.freeswitch.org/wiki/Event_List****
****
specifically the channel events list.****
****
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Sam *Sent:* Friday, July 22, 2011 2:32 PM *To:* freeswitch-users@lists.freeswitch.org *Subject:* [Freeswitch-users] Asterisk dial status****
****
Hi,
I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues?****
****
-----Inline Attachment Follows-----****
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<http://mc/compose?to=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****
** **
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
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
-- Regards, Zohair Raza www.zuhair.info *http://ae.linkedin.com/in/zuhairraza** ***
For the life of me I am still unable to get the bridged call status, when I subscribe to an "event" I am not here is my perl code snippet below, what am I doing wrong? my $fs = new ESL::ESLconnection($host, $port, $password); $session->answer(); if ($session->ready ()) { #set bridge settings $session->execute("set", "ringback=$ringback_tone"); $session->execute("set", "instant_ringback=true"); $session->execute("set", "ignore_early_media=false"); $session->execute("set", "call_timeout=60"); $session->execute("set", "progress_timeout=15"); $session->execute("set", "origination_caller_id_number=$caller_id"); $session->execute("set", "continue_on_fail=false"); $session->execute("bridge", "sofia/gateway/provider1/$destination_number"); $fs->sendRecv("event plain ALL"); $fs->send("linger"); while($fs->connected()) { $data = $fs->recvEvent(); if ( $data =~ m/Answered-State: (\w+)/m ) { my $state = $1; #print "Channel state is $state\n"; if ( $state eq 'answered' ) { freeswitch::consoleLog("INFO", "CALL ANSWERED\n"); } else { freeswitch::consoleLog("INFO", "NO CALLS ANSWERED\n"); } } } } $session->hangup(); return 1; --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 2:28 PM It does. You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you. As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven’t used Asterisk before so I’m not sure how the AGI fits on the FS architecture. You can get more info at:http://wiki.freeswitch.org/wiki/Mod_event_socket And a working demo at: http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 4:23 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Asterisk dial status Sam, Does this require event sockets? Or how would I check these events? --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 11:57 AMHi Sam, My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at: http://wiki.freeswitch.org/wiki/Event_List specifically the channel events list. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 2:32 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Asterisk dial status Hi, I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues? -----Inline Attachment Follows-----_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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 -----Inline Attachment Follows----- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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
I've never used Perl for this, but I'm pretty sure that the last line won't return until the bridge is done (because of call finishied or failed). What exactly do you want to accomplish - I think there is probably an easier way for what you're trying to solve. /Peter ________________________________________ Från: freeswitch-users-bounces@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] för Sam [lakersman2006@yahoo.com] Skickat: den 24 juli 2011 20:45 Till: FreeSWITCH Users Help Ämne: Re: [Freeswitch-users] Asterisk dial status For the life of me I am still unable to get the bridged call status, when I subscribe to an "event" I am not here is my perl code snippet below, what am I doing wrong? my $fs = new ESL::ESLconnection($host, $port, $password); $session->answer(); if ($session->ready ()) { #set bridge settings $session->execute("set", "ringback=$ringback_tone"); $session->execute("set", "instant_ringback=true"); $session->execute("set", "ignore_early_media=false"); $session->execute("set", "call_timeout=60"); $session->execute("set", "progress_timeout=15"); $session->execute("set", "origination_caller_id_number=$caller_id"); $session->execute("set", "continue_on_fail=false"); $session->execute("bridge", "sofia/gateway/provider1/$destination_number"); $fs->sendRecv("event plain ALL"); $fs->send("linger"); while($fs->connected()) { $data = $fs->recvEvent(); if ( $data =~ m/Answered-State: (\w+)/m ) { my $state = $1; #print "Channel state is $state\n"; if ( $state eq 'answered' ) { freeswitch::consoleLog("INFO", "CALL ANSWERED\n"); } else { freeswitch::consoleLog("INFO", "NO CALLS ANSWERED\n"); } } } } $session->hangup(); return 1; --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 2:28 PM It does. You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you. As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven’t used Asterisk before so I’m not sure how the AGI fits on the FS architecture. You can get more info at: http://wiki.freeswitch.org/wiki/Mod_event_socket And a working demo at: http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 4:23 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Asterisk dial status Sam, Does this require event sockets? Or how would I check these events? --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 11:57 AM Hi Sam, My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at: http://wiki.freeswitch.org/wiki/Event_List specifically the channel events list. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 2:32 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Asterisk dial status Hi, I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues? -----Inline Attachment Follows----- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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 -----Inline Attachment Follows----- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org</mc/compose?to=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 !DSPAM:4e2c68e932761895611653!
I just want to be able to get the call statues like ANSWER, NO_ANSWER, BUSY etc. but Freeswitch does not return these statuses after the bridge app is finished. --- On Sun, 7/24/11, Peter Olsson <peter.olsson@visionutveckling.se> wrote: From: Peter Olsson <peter.olsson@visionutveckling.se> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Sunday, July 24, 2011, 12:01 PM I've never used Perl for this, but I'm pretty sure that the last line won't return until the bridge is done (because of call finishied or failed). What exactly do you want to accomplish - I think there is probably an easier way for what you're trying to solve. /Peter ________________________________________ Från: freeswitch-users-bounces@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] för Sam [lakersman2006@yahoo.com] Skickat: den 24 juli 2011 20:45 Till: FreeSWITCH Users Help Ämne: Re: [Freeswitch-users] Asterisk dial status For the life of me I am still unable to get the bridged call status, when I subscribe to an "event" I am not here is my perl code snippet below, what am I doing wrong? my $fs = new ESL::ESLconnection($host, $port, $password); $session->answer(); if ($session->ready ()) { #set bridge settings $session->execute("set", "ringback=$ringback_tone"); $session->execute("set", "instant_ringback=true"); $session->execute("set", "ignore_early_media=false"); $session->execute("set", "call_timeout=60"); $session->execute("set", "progress_timeout=15"); $session->execute("set", "origination_caller_id_number=$caller_id"); $session->execute("set", "continue_on_fail=false"); $session->execute("bridge", "sofia/gateway/provider1/$destination_number"); $fs->sendRecv("event plain ALL"); $fs->send("linger"); while($fs->connected()) { $data = $fs->recvEvent(); if ( $data =~ m/Answered-State: (\w+)/m ) { my $state = $1; #print "Channel state is $state\n"; if ( $state eq 'answered' ) { freeswitch::consoleLog("INFO", "CALL ANSWERED\n"); } else { freeswitch::consoleLog("INFO", "NO CALLS ANSWERED\n"); } } } } $session->hangup(); return 1; --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 2:28 PM It does. You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you. As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven’t used Asterisk before so I’m not sure how the AGI fits on the FS architecture. You can get more info at: http://wiki.freeswitch.org/wiki/Mod_event_socket And a working demo at: http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 4:23 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Asterisk dial status Sam, Does this require event sockets? Or how would I check these events? --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 11:57 AM Hi Sam, My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at: http://wiki.freeswitch.org/wiki/Event_List specifically the channel events list. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 2:32 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Asterisk dial status Hi, I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues? -----Inline Attachment Follows----- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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 -----Inline Attachment Follows----- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org</mc/compose?to=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 !DSPAM:4e2c68e932761895611653! _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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 Again, Sorry I forgot to mention xml_cdr. *http://wiki.freeswitch.org/wiki/Mod_xml_cdr* I use it with xml curl and take all after call information through it. On Mon, Jul 25, 2011 at 3:20 AM, Sam <lakersman2006@yahoo.com> wrote:
I just want to be able to get the call statues like ANSWER, NO_ANSWER, BUSY etc. but Freeswitch does not return these statuses after the bridge app is finished.
--- On *Sun, 7/24/11, Peter Olsson <peter.olsson@visionutveckling.se>*wrote:
From: Peter Olsson <peter.olsson@visionutveckling.se>
Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Sunday, July 24, 2011, 12:01 PM
I've never used Perl for this, but I'm pretty sure that the last line won't return until the bridge is done (because of call finishied or failed).
What exactly do you want to accomplish - I think there is probably an easier way for what you're trying to solve.
/Peter ________________________________________ Från: freeswitch-users-bounces@lists.freeswitch.org<http://mc/compose?to=freeswitch-users-bounces@lists.freeswitch.org>[ freeswitch-users-bounces@lists.freeswitch.org<http://mc/compose?to=freeswitch-users-bounces@lists.freeswitch.org>] för Sam [lakersman2006@yahoo.com<http://mc/compose?to=lakersman2006@yahoo.com> ]
Skickat: den 24 juli 2011 20:45 Till: FreeSWITCH Users Help Ämne: Re: [Freeswitch-users] Asterisk dial status
For the life of me I am still unable to get the bridged call status, when I subscribe to an "event" I am not here is my perl code snippet below, what am I doing wrong?
my $fs = new ESL::ESLconnection($host, $port, $password);
$session->answer();
if ($session->ready ()) { #set bridge settings $session->execute("set", "ringback=$ringback_tone"); $session->execute("set", "instant_ringback=true"); $session->execute("set", "ignore_early_media=false"); $session->execute("set", "call_timeout=60"); $session->execute("set", "progress_timeout=15"); $session->execute("set", "origination_caller_id_number=$caller_id"); $session->execute("set", "continue_on_fail=false"); $session->execute("bridge", "sofia/gateway/provider1/$destination_number");
$fs->sendRecv("event plain ALL"); $fs->send("linger");
while($fs->connected()) { $data = $fs->recvEvent();
if ( $data =~ m/Answered-State: (\w+)/m ) { my $state = $1;
#print "Channel state is $state\n";
if ( $state eq 'answered' ) {
freeswitch::consoleLog("INFO", "CALL ANSWERED\n");
} else { freeswitch::consoleLog("INFO", "NO CALLS ANSWERED\n"); } } } }
$session->hangup();
return 1;
--- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net<http://mc/compose?to=Hector.Geraldino@ip-soft.net>> wrote:
From: Hector Geraldino <Hector.Geraldino@ip-soft.net<http://mc/compose?to=Hector.Geraldino@ip-soft.net>
Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org<http://mc/compose?to=freeswitch-users@lists.freeswitch.org>
Date: Friday, July 22, 2011, 2:28 PM
It does.
You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you.
As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven’t used Asterisk before so I’m not sure how the AGI fits on the FS architecture.
You can get more info at:
http://wiki.freeswitch.org/wiki/Mod_event_socket
And a working demo at:
http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example
From: freeswitch-users-bounces@lists.freeswitch.org<http://mc/compose?to=freeswitch-users-bounces@lists.freeswitch.org>[mailto: freeswitch-users-bounces@lists.freeswitch.org<http://mc/compose?to=freeswitch-users-bounces@lists.freeswitch.org>] On Behalf Of Sam Sent: Friday, July 22, 2011 4:23 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Asterisk dial status
Sam,
Does this require event sockets? Or how would I check these events?
--- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net<http://mc/compose?to=Hector.Geraldino@ip-soft.net>> wrote:
From: Hector Geraldino <Hector.Geraldino@ip-soft.net<http://mc/compose?to=Hector.Geraldino@ip-soft.net>
Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org<http://mc/compose?to=freeswitch-users@lists.freeswitch.org>
Date: Friday, July 22, 2011, 11:57 AM
Hi Sam,
My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at:
http://wiki.freeswitch.org/wiki/Event_List
specifically the channel events list.
From: freeswitch-users-bounces@lists.freeswitch.org<http://mc/compose?to=freeswitch-users-bounces@lists.freeswitch.org>[mailto: freeswitch-users-bounces@lists.freeswitch.org<http://mc/compose?to=freeswitch-users-bounces@lists.freeswitch.org>] On Behalf Of Sam Sent: Friday, July 22, 2011 2:32 PM To: freeswitch-users@lists.freeswitch.org<http://mc/compose?to=freeswitch-users@lists.freeswitch.org> Subject: [Freeswitch-users] Asterisk dial status
Hi,
I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues?
-----Inline Attachment Follows-----
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<http://mc/compose?to=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
-----Inline Attachment Follows-----
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org> </mc/compose?to=FreeSWITCH-users@lists.freeswitch.org<http://mc/compose?to=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
!DSPAM:4e2c68e932761895611653!
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<http://mc/compose?to=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
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
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
-- Regards, Zohair Raza www.zuhair.info *http://ae.linkedin.com/in/zuhairraza** ***
Where are you getting $session from? Print out $e->serialize to get all the keys and use getHeader(''), after looking at sample code in libs/esl/perl. Tons of examples. Also subscribe to specific events: http://wiki.freeswitch.org/wiki/Mod_event_socket http://wiki.freeswitch.org/wiki/Event_Socket_Library http://wiki.freeswitch.org/wiki/Event_List I'm using bgapi and originate: http://wiki.freeswitch.org/wiki/Mod_event_socket#bgapi Thanks. -- http://www.suretecsystems.com/services/openldap/ http://www.surevoip.co.uk
What you are trying to do is not possible in this fashion. The bridge occurs in the same thread as the perl script. The thread can only do one thing at a time. If you need to know the dial status while the thread is still running you'll want a separate event socket app running and listening for channel status events. If you just need to know the dial status once the bridge is complete (i.e. once the call ends) then just use a api_hangup_hook chan var to launch a script to do whatever it is that you need done. -MC On Sun, Jul 24, 2011 at 11:45 AM, Sam <lakersman2006@yahoo.com> wrote:
For the life of me I am still unable to get the bridged call status, when I subscribe to an "event" I am not here is my perl code snippet below, what am I doing wrong?
my $fs = new ESL::ESLconnection($host, $port, $password);
$session->answer();
if ($session->ready ()) { #set bridge settings $session->execute("set", "ringback=$ringback_tone"); $session->execute("set", "instant_ringback=true"); $session->execute("set", "ignore_early_media=false"); $session->execute("set", "call_timeout=60");
$session->execute("set", "progress_timeout=15"); $session->execute("set", "origination_caller_id_number=$caller_id"); $session->execute("set", "continue_on_fail=false"); $session->execute("bridge", "sofia/gateway/provider1/$destination_number");
$fs->sendRecv("event plain ALL"); $fs->send("linger");
while($fs->connected()) { $data = $fs->recvEvent();
if ( $data =~ m/Answered-State: (\w+)/m ) { my $state = $1;
#print "Channel state is $state\n";
if ( $state eq 'answered' ) {
freeswitch::consoleLog("INFO", "CALL ANSWERED\n");
} else { freeswitch::consoleLog("INFO", "NO CALLS ANSWERED\n"); } } } }
$session->hangup();
return 1;
--- On *Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net>*wrote:
From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 2:28 PM
It does.
You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you.
As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven’t used Asterisk before so I’m not sure how the AGI fits on the FS architecture.
You can get more info at:
http://wiki.freeswitch.org/wiki/Mod_event_socket
And a working demo at:
http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Sam *Sent:* Friday, July 22, 2011 4:23 PM *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] Asterisk dial status
Sam,
Does this require event sockets? Or how would I check these events?
--- On *Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net>*wrote:
From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 11:57 AM
Hi Sam,
My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at:
http://wiki.freeswitch.org/wiki/Event_List
specifically the channel events list.
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Sam *Sent:* Friday, July 22, 2011 2:32 PM *To:* freeswitch-users@lists.freeswitch.org *Subject:* [Freeswitch-users] Asterisk dial status
Hi,
I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues?
-----Inline Attachment Follows-----
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
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
-----Inline Attachment Follows-----
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<http://mc/compose?to=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
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
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
Actually you have no other way except parsing channel events not only from parent channel but from child channels too since there can be many child channels in bridge attempt. Actually, FS doesn't have a direct method like Asterisk DIALSTATUS. If you answer incoming call and then doing bridge to some endpoint, you will see ANSWER in disposition variables even in channel events. I can be wrong, but I haven't found any other way as to parse hangup / hangup_complete / answer events of parent and child channels to correctly determine disposition, cause codes and so on in all cases. 2011/7/25 Michael Collins <msc@freeswitch.org>
What you are trying to do is not possible in this fashion. The bridge occurs in the same thread as the perl script. The thread can only do one thing at a time.
If you need to know the dial status while the thread is still running you'll want a separate event socket app running and listening for channel status events. If you just need to know the dial status once the bridge is complete (i.e. once the call ends) then just use a api_hangup_hook chan var to launch a script to do whatever it is that you need done.
-MC
On Sun, Jul 24, 2011 at 11:45 AM, Sam <lakersman2006@yahoo.com> wrote:
For the life of me I am still unable to get the bridged call status, when I subscribe to an "event" I am not here is my perl code snippet below, what am I doing wrong?
my $fs = new ESL::ESLconnection($host, $port, $password);
$session->answer();
if ($session->ready ()) { #set bridge settings $session->execute("set", "ringback=$ringback_tone"); $session->execute("set", "instant_ringback=true"); $session->execute("set", "ignore_early_media=false"); $session->execute("set", "call_timeout=60");
$session->execute("set", "progress_timeout=15"); $session->execute("set", "origination_caller_id_number=$caller_id"); $session->execute("set", "continue_on_fail=false"); $session->execute("bridge", "sofia/gateway/provider1/$destination_number");
$fs->sendRecv("event plain ALL"); $fs->send("linger");
while($fs->connected()) { $data = $fs->recvEvent();
if ( $data =~ m/Answered-State: (\w+)/m ) { my $state = $1;
#print "Channel state is $state\n";
if ( $state eq 'answered' ) {
freeswitch::consoleLog("INFO", "CALL ANSWERED\n");
} else { freeswitch::consoleLog("INFO", "NO CALLS ANSWERED\n"); } } } }
$session->hangup();
return 1;
--- On *Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net>*wrote:
From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 2:28 PM
It does.
You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you.
As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven’t used Asterisk before so I’m not sure how the AGI fits on the FS architecture.
You can get more info at:
http://wiki.freeswitch.org/wiki/Mod_event_socket
And a working demo at:
http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Sam *Sent:* Friday, July 22, 2011 4:23 PM *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] Asterisk dial status
Sam,
Does this require event sockets? Or how would I check these events?
--- On *Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net>*wrote:
From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 11:57 AM
Hi Sam,
My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at:
http://wiki.freeswitch.org/wiki/Event_List
specifically the channel events list.
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Sam *Sent:* Friday, July 22, 2011 2:32 PM *To:* freeswitch-users@lists.freeswitch.org *Subject:* [Freeswitch-users] Asterisk dial status
Hi,
I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues?
-----Inline Attachment Follows-----
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
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
-----Inline Attachment Follows-----
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<http://mc/compose?to=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
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
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
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
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
-- Best regards, Dmitry Sytchev, IT Engineer
What I want to do is play different sound files back to the caller when the call is NO_ANSWER, BUSY, etc. So I don't think your suggestion would work. --- On Mon, 7/25/11, Michael Collins <msc@freeswitch.org> wrote: From: Michael Collins <msc@freeswitch.org> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Monday, July 25, 2011, 8:07 AM What you are trying to do is not possible in this fashion. The bridge occurs in the same thread as the perl script. The thread can only do one thing at a time. If you need to know the dial status while the thread is still running you'll want a separate event socket app running and listening for channel status events. If you just need to know the dial status once the bridge is complete (i.e. once the call ends) then just use a api_hangup_hook chan var to launch a script to do whatever it is that you need done. -MC On Sun, Jul 24, 2011 at 11:45 AM, Sam <lakersman2006@yahoo.com> wrote: For the life of me I am still unable to get the bridged call status, when I subscribe to an "event" I am not here is my perl code snippet below, what am I doing wrong? my $fs = new ESL::ESLconnection($host, $port, $password); $session->answer(); if ($session->ready ()) { #set bridge settings $session->execute("set", "ringback=$ringback_tone"); $session->execute("set", "instant_ringback=true"); $session->execute("set", "ignore_early_media=false"); $session->execute("set", "call_timeout=60"); $session->execute("set", "progress_timeout=15"); $session->execute("set", "origination_caller_id_number=$caller_id"); $session->execute("set", "continue_on_fail=false"); $session->execute("bridge", "sofia/gateway/provider1/$destination_number"); $fs->sendRecv("event plain ALL"); $fs->send("linger"); while($fs->connected()) { $data = $fs->recvEvent(); if ( $data =~ m/Answered-State: (\w+)/m ) { my $state = $1; #print "Channel state is $state\n"; if ( $state eq 'answered' ) { freeswitch::consoleLog("INFO", "CALL ANSWERED\n"); } else { freeswitch::consoleLog("INFO", "NO CALLS ANSWERED\n"); } } } } $session->hangup(); return 1; --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 2:28 PM It does. You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you. As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven’t used Asterisk before so I’m not sure how the AGI fits on the FS architecture. You can get more info at:http://wiki.freeswitch.org/wiki/Mod_event_socket And a working demo at: http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 4:23 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Asterisk dial status Sam, Does this require event sockets? Or how would I check these events? --- On Fri, 7/22/11, Hector Geraldino <Hector.Geraldino@ip-soft.net> wrote: From: Hector Geraldino <Hector.Geraldino@ip-soft.net> Subject: Re: [Freeswitch-users] Asterisk dial status To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Date: Friday, July 22, 2011, 11:57 AMHi Sam, My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at: http://wiki.freeswitch.org/wiki/Event_List specifically the channel events list. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Sam Sent: Friday, July 22, 2011 2:32 PM To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Asterisk dial status Hi, I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues? -----Inline Attachment Follows-----_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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 -----Inline Attachment Follows----- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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 _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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 -----Inline Attachment Follows----- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE 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
On Mon, Jul 25, 2011 at 10:56 AM, Sam <lakersman2006@yahoo.com> wrote:
What I want to do is play different sound files back to the caller when the call is NO_ANSWER, BUSY, etc. So I don't think your suggestion would work.
I think maybe you have a case of "Asteriskitis" in all this. :) FreeSWITCH makes it easy to do this without actually checking the dial status. The only thing you need to do is come up with a dialplan extension that handles the various failure notifications to the caller. Consider an extremely simple case: <extension name="bridge_with_failover"> <condition field="destination_number" expression="1?(\d{10})"> <action application="set" data="hangup_after_bridge=false"/> <action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,NO_ROUTE_DESTINATION"/> <action application="bridge" data="sofia/gateway/mygw/+1$1"> <!-- the stuff after the bridge only gets executed on the failure conditions listed above --> <action application="playback" data="call_failed.wav"/> <action application="hangup"/> </condition> </extension> In the above case, if the call works then there's no problem. If the call fails, dialplan processing continues on and plays to the caller an error. If you want to get fancy and have something specific happen then you can either create some dialplan extensions that play various sound files, or you can launch a dialplan script (like your perl script) and check ${bridge_hangup_cause} to see what "really" happened on the bridge attempt. Enjoy! -MC
Why not bgapi and listen for the CHANNEL_ANSWER event? On 25 July 2011 19:36, Michael Collins <msc@freeswitch.org> wrote:
On Mon, Jul 25, 2011 at 10:56 AM, Sam <lakersman2006@yahoo.com> wrote:
What I want to do is play different sound files back to the caller when the call is NO_ANSWER, BUSY, etc. So I don't think your suggestion would work.
I think maybe you have a case of "Asteriskitis" in all this. :)
FreeSWITCH makes it easy to do this without actually checking the dial status. The only thing you need to do is come up with a dialplan extension that handles the various failure notifications to the caller. Consider an extremely simple case:
<extension name="bridge_with_failover"> <condition field="destination_number" expression="1?(\d{10})"> <action application="set" data="hangup_after_bridge=false"/> <action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,NO_ROUTE_DESTINATION"/> <action application="bridge" data="sofia/gateway/mygw/+1$1"> <!-- the stuff after the bridge only gets executed on the failure conditions listed above --> <action application="playback" data="call_failed.wav"/> <action application="hangup"/> </condition> </extension>
In the above case, if the call works then there's no problem. If the call fails, dialplan processing continues on and plays to the caller an error. If you want to get fancy and have something specific happen then you can either create some dialplan extensions that play various sound files, or you can launch a dialplan script (like your perl script) and check ${bridge_hangup_cause} to see what "really" happened on the bridge attempt.
Enjoy! -MC
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
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
-- http://www.suretecsystems.com/services/openldap/ http://www.surevoip.co.uk
On Mon, Jul 25, 2011 at 11:59 AM, Gavin Henry <gavin.henry@gmail.com> wrote:
Why not bgapi and listen for the CHANNEL_ANSWER event?
Dealer's choice. You can totally do that if you so desire. It all depends on what the ultimate goal is. If you just need to have a few calls hit the dp, attempt bridge, then play messages based on failure types then the dialplan itself can handle it with just continue_on_fail and transfer apps. You can throw in a dp script if you have some specific logic you wish to apply. Keeps it clean and simple. However, if you are wanting to do some async stuff like real-time status updates, etc. then event socket w/ bgapi originates is definitely the way to go. -MC
Yeah, that's what I'm doing and just finished tonight. Still a bit to go but gist is: 1. Follow @SureVoIPLabs 2. Bot auto follows you back if not already following 3. Sends you a DM with a thank you and instructions. 4. You then send a DM like so: d @SureVoIPLabs my_mobile_number/number_I_wish_to_call 5. Do some tariff checks and fire off a bgapi with 2 or 10min limit 6. Send you a DM back All free but limited to UK for now. Will be live next week or so. Full version with international and App auth coming with credit topups via DM too :) Gav. http://www.surevoip.co.uk
On Mon, Jul 25, 2011 at 11:59 AM, Gavin Henry <gavin.henry@gmail.com> wrote:
Why not bgapi and listen for the CHANNEL_ANSWER event?
Dealer's choice. You can totally do that if you so desire. It all depends on what the ultimate goal is. If you just need to have a few calls hit the dp, attempt bridge, then play messages based on failure types then the dialplan itself can handle it with just continue_on_fail and transfer apps. You can throw in a dp script if you have some specific logic you wish to apply. Keeps it clean and simple. However, if you are wanting to do some async stuff like real-time status updates, etc. then event socket w/ bgapi originates is definitely the way to go.
-MC
participants (7)
-
Dmitry Sytchev
-
Gavin Henry
-
Hector Geraldino
-
Michael Collins
-
Peter Olsson
-
Sam
-
Zohair Raza