Fix reload on sip peers (bug #3432)
authorMark Spencer <markster@digium.com>
Thu, 27 Jan 2005 04:46:31 +0000 (04:46 +0000)
committerMark Spencer <markster@digium.com>
Thu, 27 Jan 2005 04:46:31 +0000 (04:46 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4897 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index db06529..a7a0a2b 100755 (executable)
@@ -8829,15 +8829,27 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
                if (!found) {
                        if (name)
                                strncpy(peer->name, name, sizeof(peer->name)-1);
-                       strncpy(peer->context, default_context, sizeof(peer->context)-1);
-                       strncpy(peer->language, default_language, sizeof(peer->language)-1);
-                       strncpy(peer->musicclass, global_musicclass, sizeof(peer->musicclass)-1);
                        peer->addr.sin_port = htons(DEFAULT_SIP_PORT);
                        peer->addr.sin_family = AF_INET;
                        peer->defaddr.sin_family = AF_INET;
                        peer->expiry = expiry;
-                       ast_copy_flags(peer, &global_flags, SIP_USEREQPHONE);
                }
+               strncpy(peer->context, default_context, sizeof(peer->context)-1);
+               strncpy(peer->language, default_language, sizeof(peer->language)-1);
+               strncpy(peer->musicclass, global_musicclass, sizeof(peer->musicclass)-1);
+               ast_copy_flags(peer, &global_flags, SIP_USEREQPHONE);
+               peer->secret[0] = '\0';
+               peer->md5secret[0] = '\0';
+               peer->cid_num[0] = '\0';
+               peer->cid_name[0] = '\0';
+               peer->fromdomain[0] = '\0';
+               peer->fromuser[0] = '\0';
+               peer->regexten[0] = '\0';
+               peer->mailbox[0] = '\0';
+               peer->callgroup = 0;
+               peer->pickupgroup = 0;
+               peer->rtpkeepalive = global_rtpkeepalive;
+               peer->maxms = 0;
                peer->prefs = prefs;
                oldha = peer->ha;
                peer->ha = NULL;