summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/res_pjsip_sdp_rtp.c5
-rw-r--r--res/res_pjsip_t38.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 4b0862114..57c673e0c 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1097,6 +1097,11 @@ static void change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struc
char host[NI_MAXHOST];
struct ast_sockaddr addr = { { 0, } };
+ /* If the stream has been rejected there will be no connection line */
+ if (!stream->conn) {
+ return;
+ }
+
ast_copy_pj_str(host, &stream->conn->addr, sizeof(host));
ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index 285e9015e..e44820214 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -776,6 +776,11 @@ static void change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struc
char host[NI_MAXHOST];
struct ast_sockaddr addr = { { 0, } };
+ /* If the stream has been rejected there will be no connection line */
+ if (!stream->conn) {
+ return;
+ }
+
ast_copy_pj_str(host, &stream->conn->addr, sizeof(host));
ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);