Trying to understand EVENTs

Hi.

Event System | FreeSWITCH Documentation tells me “For a comprehensive list of events, see Event List.”
Going to Event List | FreeSWITCH Documentation I find a list of events, but it’s not comprehensive, because for example NOTIFY_IN is not shown.
I have after several days of struggling managed to get FreeSwitch to run a lua script when a NOTIFY_IN event occurs.
Where can I find the documentation telling me how to get the values from that event?

I’ve found Events | FreeSWITCH Documentation (which does list NOTIFY_IN) and has a section at the end named “How to process events” but simply lists a few languages etc which could be used - it still doesn’t seem to tell me how to get the detail of what the event actually contains.

All help gratefully received :slight_smile:

Thanks,

Antony.

you are able to scroll to the bottom, and click Edit This Page, process any edits you think may clarify, and issue a Pull Request from GitHub, I’ll review and merge it if the changes make sense.

/b

  • I think subclasses (or CUSTOM events), module specific, like for Sofia-SIP.

I have created a lua hook for event processing:

<hook event=“ALL” script=“Events.lua”/>

This is successfully catching events of the following types:
ADD_SCHEDULE
API
CHANNEL_CALLSTATE
CHANNEL_CREATE
CHANNEL_DESTROY
CHANNEL_EXECUTE
CHANNEL_EXECUTE_COMPLETE
CHANNEL_HANGUP
CHANNEL_HANGUP_COMPLETE
CHANNEL_ORIGINATE
CHANNEL_OUTGOING
CHANNEL_STATE
CUSTOM
DEL_SCHEDULE
HEARTBEAT
MODULE_LOAD
MODULE_UNLOAD
NOTIFY_IN
PRESENCE_IN
PUBLISH
RELOADXML
RE_SCHEDULE
SHUTDOWN
STARTUP
UNPUBLISH

The NOTIFY_IN events are being triggered by a presence NOTIFY from the PBX,
but not by a message-summary NOTIFY.

I’m trying to work out what I’ve missed which stops FreeSwitch from parsing
the message-summary NOTIFY correctly.

Antony.

We never really tested that thing you’re doing, so it might just be a bug.

/b

1 Like

In trying to work out why FreeSwitch isn’t generating a NOTIFY_IN event in response to an incoming NOTIFY whose Event is “message-summary”, I’ve started tracing backwards through the C source from the error message “Gateway information missing Subscription Event”.

Everything seems to be in the single file src/mod/endpoints/mod_sofia/sofia.c

So far I’ve found:

  1. The message is generated from the function sofia_handle_sip_i_notify when looking at the data structure sofia_private.

  2. This data structure is passed through the function our_sofia_event_callback

  3. This is called from the function sofia_process_dispatch_event

  4. This function creates the sofia_private structure using the function call:

nua_handle_magic(de->nh)

Now I get stuck. There is no definition anywhere of the function nua_handle_magic.

Looking online I find references to nua.c but this doesn’t exist in the FreeSwitch source code (at least, not in the copies I have, for versions 1.10.6 and 1.10.9)

So, can anyone point me from here to find out what the function nua_handle_magic does please?

Antony.

So, am I going about this the wrong way, then? How should I be getting FreeSwitch to react to an incoming message-summary Event in a NOTIFY?

FreeSWITCH will just 200OK the thing and do nothing at all with it, what are you expecting?

I’m expecting it to fire a NOTIFY_IN event just the same as it does when it
receives a “presence” NOTIFY.

Antony

This makes me believe that the error message “Gateway information missing Subscription Event” is being generated because the structure sofia_private does not even exist, never mind have the required content (the actual test being performed is:
if (!sofia_private || zstr(sofia_private->gateway_name))
so it wasn’t initially clear to me which part was failing).

Can anyone please point me at where nua_handle_magic is defined (I can’t understand how FreeSwitch would even compile if this is not present)?

I really want to get to the bottom of this, even if I end up modifying source code and re-compiling, but currently the lack of any apparent way to get at the content of a NOTIFY from a remote PBX for an Event message-summary is a significant problem for me.

Thanks for any help,

Antony.

I don’t believe that fires the event you expect, its not something we did the original patch for.

/b