Merged revisions 290506 via svnmerge from
[asterisk/asterisk.git] / channels / chan_iax2.c
index 5f085e5..0438c97 100644 (file)
@@ -7312,7 +7312,6 @@ static char *handle_cli_iax2_set_debug(struct ast_cli_entry *e, int cmd, struct
                struct iax2_peer *peer;
                struct sockaddr_in peer_addr;
 
-               ast_sockaddr_to_sin(&peer->addr, &peer_addr);
 
                if (a->argc != e->args + 1)
                        return CLI_SHOWUSAGE;
@@ -7324,6 +7323,8 @@ static char *handle_cli_iax2_set_debug(struct ast_cli_entry *e, int cmd, struct
                        return CLI_FAILURE;
                }
 
+               ast_sockaddr_to_sin(&peer->addr, &peer_addr);
+
                debugaddr.sin_addr = peer_addr.sin_addr;
                debugaddr.sin_port = peer_addr.sin_port;