ignore boost messages with no span

git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@896 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Moises Silva 2009-11-23 16:40:41 +00:00
parent 10f8ab0806
commit e508938675
1 changed files with 16 additions and 2 deletions

View File

@ -1524,13 +1524,27 @@ static zap_state_map_t boost_state_map = {
static BOOST_WRITE_MSG_FUNCTION(zap_boost_write_msg)
{
zap_sangoma_boost_data_t *sangoma_boost_data = span->signal_data;
sangomabc_queue_element_t *element = zap_calloc(1, sizeof(*element));
sangomabc_short_event_t *shortmsg = NULL;
zap_sangoma_boost_data_t *sangoma_boost_data = NULL;
sangomabc_queue_element_t *element = NULL;
zap_assert(msg != NULL, ZAP_FAIL, "Boost message to write was null");
if (!span) {
shortmsg = msg;
zap_log(ZAP_LOG_ERROR, "Unexpected boost message %d\n", shortmsg->event_id);
return ZAP_FAIL;
}
/* duplicate the event and enqueue it */
element = zap_calloc(1, sizeof(*element));
if (!element) {
return ZAP_FAIL;
}
memcpy(&element->boostmsg, msg, msglen);
element->size = msglen;
sangoma_boost_data = span->signal_data;
return zap_queue_enqueue(sangoma_boost_data->boost_queue, element);
}