char st[80] = "";
#endif
- if (!session) {
+ if (!session || !sip) {
return;
}
authorization = sip->sip_proxy_authorization;
}
- if (authorization) {
+ if (authorization && sip->sip_request) {
char network_ip[80] = "";
int network_port;
sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), &network_port);
}
}
-
- tech_pvt->from_user = switch_core_session_strdup(session, sip->sip_from->a_url->url_user);
+ if (sip->sip_from && sip->sip_from->a_url) {
+ tech_pvt->from_user = switch_core_session_strdup(session, sip->sip_from->a_url->url_user);
+ }
tech_pvt->mparams.remote_ip = switch_core_session_strdup(session, network_ip);
tech_pvt->mparams.remote_port = network_port;
if (profile->pres_type) {
const char *presence_id = switch_channel_get_variable(channel, "presence_id");
- if (zstr(presence_id)) {
+ if (zstr(presence_id) && sip->sip_from && sip->sip_from->a_url) {
const char *user = switch_str_nil(sip->sip_from->a_url->url_user);
const char *host = switch_str_nil(sip->sip_from->a_url->url_host);
char *tmp = switch_mprintf("%s@%s", user, host);