]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_outbound_registration: Allow to use multiple proxies for registration
authorIgor Goncharovsky <igor.goncharovsky@gmail.com>
Fri, 9 Sep 2022 17:20:18 +0000 (23:20 +0600)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 31 Oct 2022 13:40:58 +0000 (08:40 -0500)
Current registration code use pjsip_parse_uri to verify outbound_proxy
that is different from the reading this option for the endpoint. This
made value with multiple proxies invalid for registration pjsip settings.
Removing URI validation helps to use registration through multiple proxies.

ASTERISK-30217 #close

Change-Id: I064558e66f04b9f3260c46181812a01349761357

res/res_pjsip_outbound_registration.c

index 565425290b1cc64804c4be3b0726852af3ff42be..b05c7ff14b94cff6aef388f5821504c93338e482 100644 (file)
@@ -1583,20 +1583,8 @@ static int sip_outbound_registration_regc_alloc(void *data)
                return -1;
        }
 
-       if (!ast_strlen_zero(registration->outbound_proxy)) {
-               pj_strdup2_with_null(pool, &tmp, registration->outbound_proxy);
-               uri = pjsip_parse_uri(pool, tmp.ptr, tmp.slen, 0);
-               if (!uri) {
-                       ast_log(LOG_ERROR, "Invalid outbound proxy URI '%s' specified on outbound registration '%s'\n",
-                               registration->outbound_proxy, ast_sorcery_object_get_id(registration));
-                       pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool);
-                       return -1;
-               }
-       }
-
        pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool);
 
-
        ast_assert(state->client_state->client == NULL);
        if (pjsip_regc_create(ast_sip_get_pjsip_endpoint(), state->client_state,
                        sip_outbound_registration_response_cb,