don't segfault on notify message with no contact

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16130 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2010-01-03 21:10:34 +00:00
parent e8060a8140
commit 8a877fb87a
1 changed files with 5 additions and 2 deletions

View File

@ -144,8 +144,11 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status,
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "event-package", sip->sip_event->o_type); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "event-package", sip->sip_event->o_type);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "event-id", sip->sip_event->o_id); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "event-id", sip->sip_event->o_id);
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "contact", "%s@%s", if (sip->sip_contact && sip->sip_contact->m_url) {
sip->sip_contact->m_url->url_user, sip->sip_contact->m_url->url_host); switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "contact", "%s@%s",
sip->sip_contact->m_url->url_user, sip->sip_contact->m_url->url_host);
}
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from", "%s@%s", switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from", "%s@%s",
sip->sip_from->a_url->url_user, sip->sip_from->a_url->url_host); sip->sip_from->a_url->url_user, sip->sip_from->a_url->url_host);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-tag", sip->sip_from->a_tag); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-tag", sip->sip_from->a_tag);