diff options
author | Jason Parker <jparker@digium.com> | 2007-12-11 21:58:26 +0000 |
---|---|---|
committer | Jason Parker <jparker@digium.com> | 2007-12-11 21:58:26 +0000 |
commit | b0968803b941c4c2c299f73306cdf24003aa7366 (patch) | |
tree | 56cc87f32a74da75ce5dae52e24ac65d4df9e026 /channels | |
parent | 27cebd1d5ca6ad8d742c7985cf1f264766e9046b (diff) |
We need to set the address we want to match against before we actually do the match..
Closes issue #11518.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 99adad20b..19d3dba73 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2200,15 +2200,17 @@ static void ast_sip_ouraddrfor(struct in_addr *them, struct sockaddr_in *us) * when passed to ast_apply_ha() so it does need to be remapped. * This fourth condition is checked later. */ - int want_remap = localaddr && - (externip.sin_addr.s_addr || stunaddr.sin_addr.s_addr) && - ast_apply_ha(localaddr, &theirs) == AST_SENSE_ALLOW ; + int want_remap; *us = internip; /* starting guess for the internal address */ /* now ask the system what would it use to talk to 'them' */ ast_ouraddrfor(them, &us->sin_addr); theirs.sin_addr = *them; + want_remap = localaddr && + (externip.sin_addr.s_addr || stunaddr.sin_addr.s_addr) && + ast_apply_ha(localaddr, &theirs) == AST_SENSE_ALLOW ; + if (want_remap && (!global_matchexterniplocally || !ast_apply_ha(localaddr, us)) ) { /* if we used externhost or stun, see if it is time to refresh the info */ |