diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-01 17:35:06 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-01 17:35:06 +0000 |
commit | e6f7fe5a815ec919c4fd149d7eed50eab4a9eb06 (patch) | |
tree | 975008b66c899df5c6d761bfa5cb4bbf12a9dbd6 /channels | |
parent | b7f2193c53c3cf035eaae1cf30f2c76644737c45 (diff) |
put in proper fix for issue #7294 instead of the broken partial fix that was committed, and thereby also fix issue #7438
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@41716 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index cd7583b8d..aa6e69a89 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12931,21 +12931,25 @@ static struct ast_rtp *sip_get_vrtp_peer(struct ast_channel *chan) static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active) { struct sip_pvt *p; + int changed = 0; p = chan->tech_pvt; if (!p) return -1; ast_mutex_lock(&p->lock); if (rtp) - ast_rtp_get_peer(rtp, &p->redirip); + changed |= ast_rtp_get_peer(rtp, &p->redirip); else memset(&p->redirip, 0, sizeof(p->redirip)); if (vrtp) - ast_rtp_get_peer(vrtp, &p->vredirip); + changed |= ast_rtp_get_peer(vrtp, &p->vredirip); else memset(&p->vredirip, 0, sizeof(p->vredirip)); - p->redircodecs = codecs; - if (codecs && !ast_test_flag(p, SIP_GOTREFER)) { + if (codecs && (p->redircodecs != codecs)) { + p->redircodecs = codecs; + changed = 1; + } + if (changed && !ast_test_flag(p, SIP_GOTREFER)) { if (!p->pendinginvite) { if (option_debug > 2) { char iabuf[INET_ADDRSTRLEN]; |