From 6904ae6f3be9d973f066fa9078061d9a955d885c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 10 Jul 2012 13:28:38 -0500 Subject: [PATCH] FS-4404 regression from b9b4db7d40159ec1b8d2a0c0f41655339daa0887 --- src/mod/endpoints/mod_sofia/sofia.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index e5722566e6..9364b50569 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1074,13 +1074,15 @@ static void our_sofia_event_callback(nua_event_t event, case nua_i_cancel: - switch_channel_set_variable(channel, "sip_hangup_disposition", "recv_cancel"); + if (sip && channel) { + switch_channel_set_variable(channel, "sip_hangup_disposition", "recv_cancel"); - if (sip && channel && sip->sip_reason) { - char *reason_header = sip_header_as_string(nh->nh_home, (void *) sip->sip_reason); + if (sip->sip_reason) { + char *reason_header = sip_header_as_string(nh->nh_home, (void *) sip->sip_reason); - if (!zstr(reason_header)) { - switch_channel_set_variable_partner(channel, "sip_reason", reason_header); + if (!zstr(reason_header)) { + switch_channel_set_variable_partner(channel, "sip_reason", reason_header); + } } }