}
if (!(nh = nua_handle_by_call_id(profile->nua, call_id))) {
+
+ if (mod_sofia_globals.debug_presence > 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to find handle for call id %s\n", call_id);
+ }
+
goto end;
}
const char *astate = switch_str_nil(switch_event_get_header(helper->event, "astate"));
const char *answer_state = switch_str_nil(switch_event_get_header(helper->event, "answer-state"));
const char *dft_state;
- const char *from_id = switch_str_nil(switch_event_get_header(helper->event, "Other-Leg-Caller-ID-Number"));
+ const char *from_id;
const char *to_user = switch_str_nil(switch_event_get_header(helper->event, "variable_sip_to_user"));
const char *from_user = switch_str_nil(switch_event_get_header(helper->event, "variable_sip_from_user"));
char *clean_to_user = NULL;
char *clean_from_user = NULL;
int force_status = 0;
+
+ if (!strcasecmp(direction, "inbound")) {
+ from_id = switch_str_nil(switch_event_get_header(helper->event, "Caller-Destination-Number"));
+ } else {
+ from_id = switch_str_nil(switch_event_get_header(helper->event, "Other-Leg-Caller-ID-Number"));
+ }
#if 0
char *buf;
switch_event_serialize(helper->event, &buf, SWITCH_FALSE);