[Asterisk-code-review] chan sip: Reload peer without its old capabilities. (asterisk[13])

Matt Jordan asteriskteam at digium.com
Tue Jun 23 08:06:39 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: chan_sip: Reload peer without its old capabilities.
......................................................................


chan_sip: Reload peer without its old capabilities.

On reload, previously allowed codecs were not removed. Therefore, it was not
possible to remove codecs while Asterisk was running. Furthermore, newly added
codecs got appended behind the previous codecs. Therefore, it was not possible
to add a codec with a priority of #1. This change removes the old capabilities
before the current ones are added.

ASTERISK-25182 #close
Reported by: Alexander Traud
patches:
 asterisk_13_allow_codec_reload.patch uploaded by Alexander Traud (License 6520)

Change-Id: I62a06bcf15e08e8c54a35612195f97179ebe5802
---
M channels/chan_sip.c
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Matt Jordan: Looks good to me, approved; Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 25096e2..30cb20d 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -30424,8 +30424,11 @@
 		if (!ast_sockaddr_isnull(&peer->addr)) {
 			ao2_t_unlink(peers_by_ip, peer, "ao2_unlink peer from peers_by_ip table");
 		}
-		if (!(peer->the_mark))
+		if (!(peer->the_mark)) {
 			firstpass = 0;
+		} else {
+			ast_format_cap_remove_by_type(peer->caps, AST_MEDIA_TYPE_UNKNOWN);
+		}
 	} else {
 		if (!(peer = ao2_t_alloc(sizeof(*peer), sip_destroy_peer_fn, "allocate a peer struct"))) {
 			return NULL;

-- 
To view, visit https://gerrit.asterisk.org/681
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I62a06bcf15e08e8c54a35612195f97179ebe5802
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list