]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add support to see whether NAT was detected (yay symmetric RTP) and also add a check...
authorJoshua Colp <jcolp@digium.com>
Thu, 11 Jan 2007 05:19:39 +0000 (05:19 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 11 Jan 2007 05:19:39 +0000 (05:19 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50466 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
include/asterisk/rtp.h
main/rtp.c

index 93779640686f14735e726356a26ebcae1b4a090e..be0228d393979de29fe8784bbcad96fcff51f82b 100644 (file)
@@ -16656,7 +16656,9 @@ static enum ast_rtp_get_result sip_get_rtp_peer(struct ast_channel *chan, struct
 
        *rtp = p->rtp;
 
-       if (ast_test_flag(&p->flags[0], SIP_CAN_REINVITE))
+       if (ast_rtp_getnat(*rtp) && !ast_test_flag(&p->flags[0], SIP_CAN_REINVITE_NAT))
+               res = AST_RTP_TRY_PARTIAL;
+       else if (ast_test_flag(&p->flags[0], SIP_CAN_REINVITE))
                res = AST_RTP_TRY_NATIVE;
        else if (ast_test_flag(&global_jbconf, AST_JB_FORCED))
                res = AST_RTP_GET_FAILED;
index f6f26e942b2249be6c7923a242613b6954e4dbaa..501068987bc9f8dc762cf5cfbb094687547b570d 100644 (file)
@@ -180,6 +180,8 @@ char *ast_rtp_lookup_mime_multiple(char *buf, size_t size, const int capability,
 
 void ast_rtp_setnat(struct ast_rtp *rtp, int nat);
 
+int ast_rtp_getnat(struct ast_rtp *rtp);
+
 /*! \brief Indicate whether this RTP session is carrying DTMF or not */
 void ast_rtp_setdtmf(struct ast_rtp *rtp, int dtmf);
 
index e7795af6390332a9e74625aac148967d54b90290..c1285654d83845e58483f0436c650ca175ea4faf 100644 (file)
@@ -591,6 +591,11 @@ void ast_rtp_setnat(struct ast_rtp *rtp, int nat)
        rtp->nat = nat;
 }
 
+int ast_rtp_getnat(struct ast_rtp *rtp)
+{
+       return ast_test_flag(rtp, FLAG_NAT_ACTIVE);
+}
+
 void ast_rtp_setdtmf(struct ast_rtp *rtp, int dtmf)
 {
        ast_set2_flag(rtp, dtmf ? 1 : 0, FLAG_HAS_DTMF);