[Freeswitch-users] Cannot connect to ESL via perl

王聡 cong.wang.itsherpa at gmail.com
Mon Nov 13 03:21:52 UTC 2017


Hey all,

I had made an ivr system based on perl and esl connectivity, which looks like below:

while(1){
  if(!$self->{esl}->connected()){
    $self->{esl} = new ESL::ESLconnection("127.0.0.1", "8021", "ClueCon");
      print "connecting...\n";
      next;
      sleep(1);
    }
    ...
    ...
    my $t_from = $self->{esl}->api("uuid_getvar $row[0] sip_from_user")->getBody();
    if(funca($t_from)){
      $self->{esl}->api("uuid_kill $row[0]");
    }
    ....
    ....
  sleep(1);
}

Most of the time it works well, but sometimes the esl connection returns unconnected and the whole ivr system got freeze.

 [ !$self->{esl}->connected() ] returned false.

I had checked console and no error found. Actually it will recover by itself after about 1 hour, but it makes me annoying for the random call failure. Is there any solution about this connection failure?

FreeSWITCH version : FreeSWITCH Version 1.4.26+git~20160205T175853Z~ca9207aa32~64bit (git ca9207a 2016-02-05 17:58:53Z 64bit)

Regards.


More information about the FreeSWITCH-users mailing list