Merge "Chaos: make hangup NULL tolerant"
authorMark Michelson <mmichelson@digium.com>
Thu, 27 Aug 2015 19:53:45 +0000 (14:53 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Thu, 27 Aug 2015 19:53:46 +0000 (14:53 -0500)
channels/chan_sip.c
res/res_pjsip_sdp_rtp.c

index 1888091..e385ddb 100644 (file)
@@ -24527,10 +24527,9 @@ static void *sip_pickup_thread(void *stuff)
        struct ast_channel *chan;
        chan = stuff;
 
+       ast_channel_hangupcause_set(chan, AST_CAUSE_NORMAL_CLEARING);
        if (ast_pickup_call(chan)) {
                ast_channel_hangupcause_set(chan, AST_CAUSE_CALL_REJECTED);
-       } else {
-               ast_channel_hangupcause_set(chan, AST_CAUSE_NORMAL_CLEARING);
        }
        ast_hangup(chan);
        ast_channel_unref(chan);
index f1314f5..96ef91f 100644 (file)
@@ -611,6 +611,9 @@ static enum ast_sip_session_media_encryption get_media_encryption_type(pj_str_t
 
        *optimistic = 0;
 
+       if (!transport_str) {
+               return AST_SIP_MEDIA_TRANSPORT_INVALID;
+       }
        if (strstr(transport_str, "UDP/TLS")) {
                return AST_SIP_MEDIA_ENCRYPT_DTLS;
        } else if (strstr(transport_str, "SAVP")) {