summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2015-06-22 16:26:48 +0200
committerAlexander Traud <pabstraud@compuserve.com>2015-06-22 09:49:50 -0500
commita419c69def639745ac9988b3800501f68dfef350 (patch)
treea4bc173ef5adaa844d14219b431d39a318c5e476 /channels/chan_sip.c
parent74616ae43d4e24e914ee612846a464da5b241b9b (diff)
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
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 25096e272..30cb20de8 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -30424,8 +30424,11 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
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;