Remove a couple of peerification bbugs (bug #3576)
authorMark Spencer <markster@digium.com>
Sun, 13 Feb 2005 22:40:41 +0000 (22:40 +0000)
committerMark Spencer <markster@digium.com>
Sun, 13 Feb 2005 22:40:41 +0000 (22:40 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5024 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 691fe8f..9f249a0 100755 (executable)
@@ -6172,7 +6172,7 @@ static int sip_show_objects(int fd, int argc, char *argv[])
 static void  print_group(int fd, unsigned int group) 
 {
        char buf[256];
 static void  print_group(int fd, unsigned int group) 
 {
        char buf[256];
-       ast_cli(fd, ast_print_group(buf, sizeof(buf), group) );
+       ast_cli(fd, "%s\n", ast_print_group(buf, sizeof(buf), group) );
 }
 
 /*--- dtmfmode2str: Convert DTMF mode to printable string ---*/
 }
 
 /*--- dtmfmode2str: Convert DTMF mode to printable string ---*/
@@ -9177,6 +9177,11 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
                        peer->defaddr.sin_family = AF_INET;
                        peer->expiry = expiry;
                }
                        peer->defaddr.sin_family = AF_INET;
                        peer->expiry = expiry;
                }
+               /* If we have channel variables, remove them (reload) */
+               if(peer->chanvars) {
+                       ast_variables_destroy(peer->chanvars);
+                       peer->chanvars = NULL;
+               }
                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);
                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);