diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a70fd64f7a..1130eabc7f 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -10000,7 +10000,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action /* Setup audio address and port */ if (p->rtp) { - if (portno > 0) { + if (sa && portno > 0) { ast_sockaddr_set_port(sa, portno); ast_rtp_instance_set_remote_address(p->rtp, sa); if (debug) { @@ -10047,7 +10047,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action /* Setup video address and port */ if (p->vrtp) { - if (vportno > 0) { + if (vsa && vportno > 0) { ast_sockaddr_set_port(vsa, vportno); ast_rtp_instance_set_remote_address(p->vrtp, vsa); if (debug) { @@ -10064,7 +10064,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action /* Setup text address and port */ if (p->trtp) { - if (tportno > 0) { + if (tsa && tportno > 0) { ast_sockaddr_set_port(tsa, tportno); ast_rtp_instance_set_remote_address(p->trtp, tsa); if (debug) { @@ -10087,7 +10087,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action /* Setup image address and port */ if (p->udptl) { - if (udptlportno > 0) { + if (isa && udptlportno > 0) { if (ast_test_flag(&p->flags[1], SIP_PAGE2_SYMMETRICRTP) && ast_test_flag(&p->flags[1], SIP_PAGE2_UDPTL_DESTINATION)) { ast_rtp_instance_get_remote_address(p->rtp, isa); if (!ast_sockaddr_isnull(isa) && debug) {