[Freeswitch-users] Heartbeat question

Diego Viola diego.viola at gmail.com
Fri Oct 9 15:01:46 PDT 2009


Here's my heartbeat script now.

#!/usr/bin/env ruby

require 'rubygems'
require 'fsr'
require "fsr/listener/inbound"

def custom_channel_heartbeat_handler(event)
  puts "Got a SESSION_HEARTBEAT at #{Time.now.strftime('%H:%M:%S')}"
end
FSL::Inbound.add_event_hook(:SESSION_HEARTBEAT) {|event|
custom_channel_heartbeat_handler(event) }
FSR.start_ies!(FSL::Inbound, :host => "localhost", :port => 8021)

Thanks again.

Diego

On Fri, Oct 9, 2009 at 9:30 PM, Diego Viola <diego.viola at gmail.com> wrote:

> Here is on two seconds ;)
>
> Got a SESSION_HEARTBEAT at 17:17:13
> Got a SESSION_HEARTBEAT at 17:17:15
> Got a SESSION_HEARTBEAT at 17:17:17
> Got a SESSION_HEARTBEAT at 17:17:19
> Got a SESSION_HEARTBEAT at 17:17:21
> Got a SESSION_HEARTBEAT at 17:17:23
> Got a SESSION_HEARTBEAT at 17:17:25
> Got a SESSION_HEARTBEAT at 17:17:27
> Got a SESSION_HEARTBEAT at 17:17:29
> Got a SESSION_HEARTBEAT at 17:17:31
> Got a SESSION_HEARTBEAT at 17:17:33
> Got a SESSION_HEARTBEAT at 17:17:35
> Got a SESSION_HEARTBEAT at 17:17:37
> Got a SESSION_HEARTBEAT at 17:17:39
> Got a SESSION_HEARTBEAT at 17:17:41
> Got a SESSION_HEARTBEAT at 17:17:43
> Got a SESSION_HEARTBEAT at 17:17:45
> Got a SESSION_HEARTBEAT at 17:17:47
> Got a SESSION_HEARTBEAT at 17:17:49
> Got a SESSION_HEARTBEAT at 17:17:51
> Got a SESSION_HEARTBEAT at 17:17:53
> Got a SESSION_HEARTBEAT at 17:17:55
> Got a SESSION_HEARTBEAT at 17:17:57
> Got a SESSION_HEARTBEAT at 17:17:59
> Got a SESSION_HEARTBEAT at 17:18:01
> Got a SESSION_HEARTBEAT at 17:18:03
> Got a SESSION_HEARTBEAT at 17:18:05
> Got a SESSION_HEARTBEAT at 17:18:07
> Got a SESSION_HEARTBEAT at 17:18:09
> Got a SESSION_HEARTBEAT at 17:18:11
> Got a SESSION_HEARTBEAT at 17:18:13
> Got a SESSION_HEARTBEAT at 17:18:15
> Got a SESSION_HEARTBEAT at 17:18:17
>
>
>
> On Fri, Oct 9, 2009 at 9:27 PM, Diego Viola <diego.viola at gmail.com> wrote:
>
>> Thanks Anthony, this solved it. You rock :)
>>
>> My program now outputs:
>>
>> Got a SESSION_HEARTBEAT at 17:14:59
>> Got a SESSION_HEARTBEAT at 17:15:00
>> Got a SESSION_HEARTBEAT at 17:15:02
>> Got a SESSION_HEARTBEAT at 17:15:03
>> Got a SESSION_HEARTBEAT at 17:15:04
>> Got a SESSION_HEARTBEAT at 17:15:05
>> Got a SESSION_HEARTBEAT at 17:15:06
>> Got a SESSION_HEARTBEAT at 17:15:07
>> Got a SESSION_HEARTBEAT at 17:15:08
>> Got a SESSION_HEARTBEAT at 17:15:09
>> Got a SESSION_HEARTBEAT at 17:15:10
>> Got a SESSION_HEARTBEAT at 17:15:11
>> Got a SESSION_HEARTBEAT at 17:15:12
>> Got a SESSION_HEARTBEAT at 17:15:13
>> Got a SESSION_HEARTBEAT at 17:15:14
>> Got a SESSION_HEARTBEAT at 17:15:15
>> Got a SESSION_HEARTBEAT at 17:15:16
>> Got a SESSION_HEARTBEAT at 17:15:17
>> Got a SESSION_HEARTBEAT at 17:15:18
>> Got a SESSION_HEARTBEAT at 17:15:19
>> Got a SESSION_HEARTBEAT at 17:15:20
>> Got a SESSION_HEARTBEAT at 17:15:21
>> Got a SESSION_HEARTBEAT at 17:15:22
>> Got a SESSION_HEARTBEAT at 17:15:23
>> Got a SESSION_HEARTBEAT at 17:15:24
>> Got a SESSION_HEARTBEAT at 17:15:25
>> Got a SESSION_HEARTBEAT at 17:15:26
>> Got a SESSION_HEARTBEAT at 17:15:27
>> Got a SESSION_HEARTBEAT at 17:15:28
>> Got a SESSION_HEARTBEAT at 17:15:29
>> Got a SESSION_HEARTBEAT at 17:15:30
>>
>>
>>
>>
>>
>> On Fri, Oct 9, 2009 at 4:02 PM, Anthony Minessale <
>> anthony.minessale at gmail.com> wrote:
>>
>>> Update to trunk and try it with fs_cli it for sure will let you do every
>>> 1 second
>>>
>>> in fs_cli type
>>>
>>> /events plain all
>>>
>>> if you make that call you will see one every 1 second
>>>
>>>
>>>
>>> On Fri, Oct 9, 2009 at 12:45 AM, Diego Viola <diego.viola at gmail.com>wrote:
>>>
>>>> Nope, I was just wondering why it didn't work at 1 second exactly...
>>>>
>>>>
>>>> On Fri, Oct 9, 2009 at 3:36 AM, William Suffill <
>>>> william.suffill at gmail.com> wrote:
>>>>
>>>>> Why do you need it every second? If you want real time channel counts
>>>>> you would  be able to track each create/destroy even instead of
>>>>> relying on the heartbeat summary.
>>>>>
>>>>> -- W
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>>
>>>
>>> --
>>> Anthony Minessale II
>>>
>>> FreeSWITCH http://www.freeswitch.org/
>>> ClueCon http://www.cluecon.com/
>>> Twitter: http://twitter.com/FreeSWITCH_wire
>>>
>>> AIM: anthm
>>> MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
>>> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
>>> IRC: irc.freenode.net #freeswitch
>>>
>>> FreeSWITCH Developer Conference
>>> sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
>>> iax:guest at conference.freeswitch.org/888
>>> googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
>>> pstn:213-799-1400
>>>
>>> _______________________________________________
>>> 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/20091009/71c0216b/attachment-0002.html 


More information about the FreeSWITCH-users mailing list