mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 14:44:17 +00:00
mod_sofia: fire an event for gateway ping
This commit is contained in:
1 parent
194e57268a
commit
3c5c5905ad
3 files changed
+28
-7
No files matched your search
@@ -90,12 +90,13 @@ static void sofia_reg_kill_reg(sofia_gateway_t *gateway_ptr)
|
||||
|
||||
}
|
||||
|
||||
static void sofia_reg_fire_custom_gateway_state_event(sofia_gateway_t *gateway, int status, const char *phrase)
|
||||
void sofia_reg_fire_custom_gateway_state_event(sofia_gateway_t *gateway, int status, const char *phrase)
|
||||
{
|
||||
switch_event_t *s_event;
|
||||
if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_GATEWAY_STATE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "Gateway", gateway->name);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "State", sofia_state_string(gateway->state));
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "Ping-Status", sofia_gateway_status_name(gateway->status));
|
||||
if (!zstr(phrase)) {
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "Phrase", phrase);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user