freetdm: check if the event was created before firing it

This commit is contained in:
Moises Silva 2011-06-07 09:54:50 -04:00
parent 8d8e5a23a6
commit 5042b21fc5
1 changed files with 23 additions and 21 deletions

View File

@ -1855,6 +1855,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_common_signal)
break;
}
if (event) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "span-name", "%s", ftdm_channel_get_span_name(sigmsg->channel));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "span-number", "%d", ftdm_channel_get_span_id(sigmsg->channel));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "chan-number", "%d", ftdm_channel_get_id(sigmsg->channel));
@ -1878,6 +1879,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_common_signal)
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm", "general");
}
switch_event_fire(&event);
}
return FTDM_BREAK;
}