[Freeswitch-users] Mod_perl $session in not hangup

lakshmanan lakindia89 at gmail.com
Tue Sep 22 02:30:36 PDT 2009


Hi all, I've the following mod_perl program to execute when I call to an
extension (say 777).
I use twinkle as a soft phone, to make calls.

#!/usr/bin/perl
use strict;
use freeswitch;
our $session;
$session->answer();
if($session->ready())
{
        my $uuid=$session->getVariable("uuid");
        freeswitch::consoleLog("INFO","UUID is $uuid\n");

        freeswitch::consoleLog("INFO","Session is answered\n");
       
$session->execute("playback","/usr/local/freeswitch/sounds/en/us/callie/time/8000/day-1.wav");
        my $dtmf = $session->getDigits(4,"", 5000);
        freeswitch::consoleLog("INFO","I received $dtmf\n");
        $session->hangup("NORMAL_CLEARING");
        sleep(5);
        # Some other statements.
}
return 1;

Everything is fine. 
After executing $session->hangup, I got NORMAL_CLEARING in my freeswitch
console. But in my soft phone, still the channel is active for 5 seconds.
The call got ended only after the 5 seconds sleep.

But if I create my own session like 
                                  my $session=new
freeswitch::Session("user/1000");
and I say $session->hangup(), it got terminated.

I wanted to know why there is such difference?? or am I wrong??
Please clarify me.


-- 
View this message in context: http://www.nabble.com/Mod_perl-%24session-in-not-hangup-tp25530646p25530646.html
Sent from the Freeswitch-users mailing list archive at Nabble.com.





More information about the FreeSWITCH-users mailing list