diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-28 13:50:19 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-28 13:50:19 +0000 |
commit | c47881af4ba190c2e8788765b1bea5bdd0289db8 (patch) | |
tree | f24a06c0c9a1966ec9133c7afe0a744b4e1d0dbf | |
parent | ec3089dff04811296cd9e1f9cfa83217b48bcaab (diff) |
Merged revisions 197467 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r197467 | file | 2009-05-28 10:47:45 -0300 (Thu, 28 May 2009) | 15 lines
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: http://svn.digium.com/svn/asterisk/branches/1.6.0@197469 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 8a38ce29f..782efaa6b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -975,6 +975,7 @@ struct sip_auth { /* Space for addition of other realtime flags in the future */ #define SIP_PAGE2_STATECHANGEQUEUE (1 << 9) /*!< D: Unsent state pending change exists */ +#define SIP_PAGE2_RPORT_PRESENT (1 << 10) /*!< Was rport received in the Via header? */ #define SIP_PAGE2_VIDEOSUPPORT (1 << 14) /*!< DP: Video supported if offered? */ #define SIP_PAGE2_TEXTSUPPORT (1 << 15) /*!< GDP: Global text enable */ #define SIP_PAGE2_ALLOWSUBSCRIBE (1 << 16) /*!< GP: Allow subscriptions from this peer? */ @@ -11606,7 +11607,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) @@ -12135,6 +12136,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; } |