user.conf entries in SIP were not having their peer type set.
authorDavid Vossel <dvossel@digium.com>
Tue, 3 Nov 2009 17:12:52 +0000 (17:12 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 3 Nov 2009 17:12:52 +0000 (17:12 +0000)
(closes issue #16120)
Reported by: jsmith

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227238 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 092d82f..f669513 100644 (file)
@@ -25908,6 +25908,8 @@ static int reload_config(enum channelreloadreason reason)
                                if (ast_true(hassip) || (!hassip && genhassip)) {
                                        peer = build_peer(cat, gen, ast_variable_browse(ucfg, cat), 0, 0);
                                        if (peer) {
                                if (ast_true(hassip) || (!hassip && genhassip)) {
                                        peer = build_peer(cat, gen, ast_variable_browse(ucfg, cat), 0, 0);
                                        if (peer) {
+                                               /* user.conf entries are always of type friend */
+                                               peer->type = SIP_TYPE_USER | SIP_TYPE_PEER;
                                                ao2_t_link(peers, peer, "link peer into peer table");
                                                if ((peer->type & SIP_TYPE_PEER) && peer->addr.sin_addr.s_addr) {
                                                        ao2_t_link(peers_by_ip, peer, "link peer into peers_by_ip table");
                                                ao2_t_link(peers, peer, "link peer into peer table");
                                                if ((peer->type & SIP_TYPE_PEER) && peer->addr.sin_addr.s_addr) {
                                                        ao2_t_link(peers_by_ip, peer, "link peer into peers_by_ip table");