EvoluxBR/greenswitch

Catch all event handler to collect all events from FreeSWITCH

alochym01 opened this issue · 6 comments

hi list

i want to collect all events of freeswitch

i read the example but

fs.register_handle('sofia::register_failure', on_sofia_register_failure)

show only the register failure event

how to collect all events and then send them to center logs server

thank you

Hi!

First you need to listen to all events like

fs.send('api events plain ALL')

and register your handlers to the events like you did with sofia one.

FreeSWITCH has a bunch os events, you may need to take a look at FS Docs.

@italorossi

hi italorossi

there is a lot of event lists to name few of them
https://freeswitch.org/confluence/display/FREESWITCH/Event+List#EventList-Channelevents
https://freeswitch.org/confluence/display/FREESWITCH/Event+List#EventList-Customevents
https://freeswitch.org/confluence/display/FREESWITCH/Event+List

In the example code , there is only register handle specific event('sofia::register_failure')

how do i do for all events like

def on_sofia_register_failure(event):
message = 'event message'
print(message.format(**event.headers))

fs.register_handle('::', on_sofia_register_failure)

thank you

I think we can add a catch all event handler for that, what you think?

yeah, that would be nice a feature 👍 +1:

This is being covered on the outbound-socket branch.

Current master implements it.