]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] Remove redundant sip_from->a_url checks
authornrensen <nathanael@polymorpheus.com>
Thu, 21 Oct 2021 16:39:19 +0000 (00:39 +0800)
committerGitHub <noreply@github.com>
Thu, 21 Oct 2021 16:39:19 +0000 (19:39 +0300)
src/mod/endpoints/mod_sofia/sofia.c

index 82b912341ba334c148cecf950d8bcc11c976698a..491b9c6444b27f80e0f3c5e50cd8fc473e180b23 100644 (file)
@@ -10661,7 +10661,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
                }
        }
 
-       if (sip->sip_from && sip->sip_from->a_url) {
+       if (sip->sip_from) {
                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);
@@ -11236,7 +11236,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
 
        if (profile->pres_type) {
                const char *presence_id = switch_channel_get_variable(channel, "presence_id");
-               if (zstr(presence_id) && sip->sip_from && sip->sip_from->a_url) {
+               if (zstr(presence_id) && sip->sip_from) {
                        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);