diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index fd60ebb765..a953e6e9c2 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2008-2026 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono * * This program is free software; you can redistribute it and/or modify @@ -1998,9 +1998,7 @@ static pj_status_t app_init(void) pjsua_transport_config udp_cfg; udp_cfg = app_config.udp_cfg; - if (udp_cfg.port == 0) - udp_cfg.port = 5060; - else + if (udp_cfg.port != 0) udp_cfg.port += 10; status = pjsua_transport_create(type, &udp_cfg, @@ -2071,7 +2069,9 @@ static pj_status_t app_init(void) pjsua_acc_id aid; pjsip_transport_type_e type = PJSIP_TRANSPORT_TCP6; - tcp_cfg.port += 10; + if (tcp_cfg.port != 0) { + tcp_cfg.port += 10; + } status = pjsua_transport_create(type, &tcp_cfg, @@ -2113,11 +2113,15 @@ static pj_status_t app_init(void) sizeof(tcp_cfg.qos_params)); /* Set TLS port as TCP port+1 */ - tcp_cfg.port++; + if (tcp_cfg.port != 0) { + tcp_cfg.port++; + } status = pjsua_transport_create(PJSIP_TRANSPORT_TLS, &tcp_cfg, &transport_id); - tcp_cfg.port--; + if (tcp_cfg.port != 0) { + tcp_cfg.port--; + } if (status != PJ_SUCCESS) goto on_error; @@ -2145,7 +2149,9 @@ static pj_status_t app_init(void) pjsua_acc_id aid; pjsip_transport_type_e type = PJSIP_TRANSPORT_TLS6; - tcp_cfg.port += 10; + if (tcp_cfg.port != 0) { + tcp_cfg.port += 10; + } status = pjsua_transport_create(type, &tcp_cfg,