[Freeswitch-users] using enable_heartbeat to detect network problems in event_socket

Babak Yakhchali babak.freeswitch at gmail.com
Wed Aug 5 13:47:07 MSD 2015


http://stackoverflow.com/questions/1480236/does-a-tcp-socket-connection-have-a-keep-alive

On Wed, Aug 5, 2015 at 1:50 PM, Babak Yakhchali <babak.freeswitch at gmail.com>
wrote:

> no. if socket is closed, an exception is thrown and you can catch it and
> handle it. but if for example your connection is lost, socket will be open
> till keep alive timer expires. this keep alive is os based and you can not
> set it for every socket (may be I'm wrong about this part).
>
> On Wed, Aug 5, 2015 at 1:44 PM, Michael Jerris <mike at jerris.com> wrote:
>
>> are you saying Java provides no way to detect a tcp socket disconnect?
>>
>>
>> On Wednesday, August 5, 2015, Babak Yakhchali <babak.freeswitch at gmail.com>
>> wrote:
>>
>>> but if for example network connection is lost the socket will remain
>>> open forever!
>>>
>>> On Wed, Aug 5, 2015 at 12:04 PM, Michael Jerris <mike at jerris.com> wrote:
>>>
>>>> I would just detect the socket closing instead of using a heartbeat for
>>>> sure
>>>>
>>>>
>>>> On Wednesday, August 5, 2015, Babak Yakhchali <
>>>> babak.freeswitch at gmail.com> wrote:
>>>>
>>>>> Hi
>>>>> I'm using pure java sockets (not current available esl
>>>>> implementations) with event_socket to control sessions. to detect lan
>>>>> disconnects I'm using session_heartbeat events every 1 second (this is
>>>>> adjustable). Considering performance is this a bad approach or not ? any
>>>>> better suggestions?
>>>>> if I execute enable_heartbeat before answering the call this message
>>>>> is printed on console:
>>>>> switch_core_session.c:1555 sofia/internal/1000 at 172.16.90.1 using
>>>>> scheduler due to bypass media or media is not established.
>>>>>
>>>>> should I answer the session before calling enable_heartbeat?
>>>>> thanks
>>>>>
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:
>>>> consulting at freeswitch.org
>>>> http://www.freeswitchsolutions.com
>>>>
>>>> Official FreeSWITCH Sites
>>>> http://www.freeswitch.org
>>>> http://confluence.freeswitch.org
>>>> http://www.cluecon.com
>>>>
>>>> FreeSWITCH-users mailing list
>>>> FreeSWITCH-users at lists.freeswitch.org
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:
>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>> http://www.freeswitch.org
>>>>
>>>
>>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150805/acde25a7/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list