--- channels/chan_ooh323.c 2009-06-23 03:09:25.000000000 +0400 +++ /home/may/chan_ooh323.c 2009-06-25 21:01:23.000000000 +0400 @@ -285,8 +285,8 @@ ast_channel_lock(ch); ch->tech = &ooh323_tech; - fmt = (capability) ? capability : i->capability; - ch->nativeformats = AST_FORMAT_SLINEAR; + fmt = capability; + ch->nativeformats = (capability) ? 0 : AST_FORMAT_SLINEAR; ch->fds[0] = ast_rtp_fd(i->rtp); ch->fds[1] = ast_rtcp_fd(i->rtp); @@ -295,9 +295,9 @@ ch->rings = 1; ch->adsicpe = AST_ADSI_UNAVAILABLE; - ch->writeformat = 0; + ch->writeformat = fmt; ch->rawwriteformat = 0; - ch->readformat = 0; + ch->readformat = fmt; ch->rawreadformat = 0; ch->tech_pvt = i; i->owner = ch; @@ -1512,7 +1512,7 @@ if (gH323Debug) ast_verbose("--- onOutgoingCall %lx: %s\n", call, call->callToken); - if (strcmp(call->callType, "outgoing")) { + if (!strcmp(call->callType, "outgoing")) { p = find_call(call); if (!p) { ast_log(LOG_ERROR, "Failed to find a matching call.\n");