From: Kinsey Moore Date: Mon, 10 Sep 2012 20:56:35 +0000 (+0000) Subject: Ensure iax2 debug output is displayed when expected X-Git-Tag: 10.9.0-rc1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=537d53dba563686a450e056699530b2102511077;p=thirdparty%2Fasterisk.git Ensure iax2 debug output is displayed when expected When IAX2 debug was changed from iax_showframe to iax_outputframe, some instances were missed (or added afterward). This was causing debug output to not be displayed when expected. (closes issue ASTERISK-20338) Reported-by: John Covert Patch-by: John Covert ........ Merged revisions 372804 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@372805 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 841eeb6c7f..a446d60f90 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -3426,12 +3426,10 @@ static int send_packet(struct iax_frame *f) ast_debug(3, "Sending %d on %d/%d to %s:%d\n", f->ts, callno, iaxs[callno]->peercallno, ast_inet_ntoa(iaxs[callno]->addr.sin_addr), ntohs(iaxs[callno]->addr.sin_port)); if (f->transfer) { - if (iaxdebug) - iax_showframe(f, NULL, 0, &iaxs[callno]->transfer, f->datalen - sizeof(struct ast_iax2_full_hdr)); + iax_outputframe(f, NULL, 0, &iaxs[callno]->transfer, f->datalen - sizeof(struct ast_iax2_full_hdr)); res = sendto(iaxs[callno]->sockfd, f->data, f->datalen, 0,(struct sockaddr *)&iaxs[callno]->transfer, sizeof(iaxs[callno]->transfer)); } else { - if (iaxdebug) - iax_showframe(f, NULL, 0, &iaxs[callno]->addr, f->datalen - sizeof(struct ast_iax2_full_hdr)); + iax_outputframe(f, NULL, 0, &iaxs[callno]->addr, f->datalen - sizeof(struct ast_iax2_full_hdr)); res = sendto(iaxs[callno]->sockfd, f->data, f->datalen, 0,(struct sockaddr *)&iaxs[callno]->addr, sizeof(iaxs[callno]->addr)); } if (res < 0) { @@ -4832,9 +4830,7 @@ static int send_apathetic_reply(unsigned short callno, unsigned short dcallno, data.f.type = AST_FRAME_IAX; data.f.csub = compress_subclass(command); - if (iaxdebug) { - iax_outputframe(NULL, &data.f, 0, sin, size - sizeof(struct ast_iax2_full_hdr)); - } + iax_outputframe(NULL, &data.f, 0, sin, size - sizeof(struct ast_iax2_full_hdr)); return sendto(sockfd, &data, size, 0, (struct sockaddr *)sin, sizeof(*sin)); }