summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2009-05-28 13:47:45 +0000
committerJoshua Colp <jcolp@digium.com>2009-05-28 13:47:45 +0000
commit318929b75fbc9b015b8768f83f0bad57ca410ba9 (patch)
tree240874c89b8830711e578174f406f81aa92c4d02 /channels/chan_sip.c
parente9cb075d9429da9495173c73e84cbee531381019 (diff)
Merged revisions 197466 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r197466 | file | 2009-05-28 10:44:58 -0300 (Thu, 28 May 2009) | 8 lines Fix a bug where the flag indicating the presence of rport would get overwritten by the nat setting. The presence of rport is now stored as a separate flag. Once the dialog is setup and authenticated (or it passes through unauthenticated) the proper nat flag is set. (closes issue #13823) Reported by: dimas ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 07b2330d6..ce12fc779 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1502,7 +1502,7 @@ struct sip_auth {
#define SIP_PAGE2_CONNECTLINEUPDATE_PEND (1 << 10)
#define SIP_PAGE2_RPID_IMMEDIATE (1 << 11)
-
+#define SIP_PAGE2_RPORT_PRESENT (1 << 12) /*!< Was rport received in the Via header? */
#define SIP_PAGE2_PREFERRED_CODEC (1 << 13) /*!< GDP: Only respond with single most preferred joint codec */
#define SIP_PAGE2_VIDEOSUPPORT (1 << 14) /*!< DP: Video supported if offered? */
#define SIP_PAGE2_TEXTSUPPORT (1 << 15) /*!< GDP: Global text enable */
@@ -13581,7 +13581,7 @@ static void check_via(struct sip_pvt *p, struct sip_request *req)
/* Check for rport */
c = strstr(via, ";rport");
if (c && (c[6] != '=')) /* rport query, not answer */
- ast_set_flag(&p->flags[0], SIP_NAT_ROUTE);
+ ast_set_flag(&p->flags[1], SIP_PAGE2_RPORT_PRESENT);
c = strchr(via, ';');
if (c)
@@ -13953,6 +13953,11 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ
else
res = AUTH_SECRET_FAILED; /* we don't want any guests, authentication will fail */
+
+ if (ast_test_flag(&p->flags[1], SIP_PAGE2_RPORT_PRESENT)) {
+ ast_set_flag(&p->flags[0], SIP_NAT_ROUTE);
+ }
+
return res;
}