<div dir="ltr"><div>Sorry for being a little ambiguous. I am looking at this function:<br><br></div><div>static int console_write(struct ast_channel *chan, struct ast_frame *f)</div><div>{</div><div><span class="" style="white-space:pre">        </span>struct console_pvt *pvt = ast_channel_tech_pvt(chan);</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>Pa_WriteStream(pvt->stream, f->data.ptr, f->samples);</div><div><br></div><div><span class="" style="white-space:pre">        </span>return 0;</div><div>
}<br><br>However, I dont use PortAudio, instead I have my own stream that instead will send throught a socket the raw buffer of the frame. I just need to be able to get the raw voice buffer off of the phone every 10ms doing 8khz raw PCM data (SLINEAR). That is all I am trying to get from the console_write. Is there a better way to get that voice data coming from the endpoint device?<br>
<br>Basically, I have a SIP configured phone and my custom driver, so when console_write gets hit, I should be taking the SIP phone's voice frames and then I want to send those on their way with my stream to a totally separate device. <br>
<br>-Ryan </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 13, 2013 at 11:44 AM, Russell Bryant <span dir="ltr"><<a href="mailto:russell@russellbryant.net" target="_blank">russell@russellbryant.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im">On Tue, Aug 13, 2013 at 9:51 AM, Ryan Conrad <span dir="ltr"><<a href="mailto:rconrad54@gmail.com" target="_blank">rconrad54@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I am not sure if this is a bug or not, but in chan_console, the function console_write returns frames with 320 samples instead of 160 eventhough the channels writeformat, readformat, rawwriteformat, and rawreadformat are all set to SLINEAR and not SLINEAR16.<br>
</div></blockquote><div><br></div></div><div>console_write doesn't return frames, but I'm assuming you're just talking about the audio frames that get queued up to be read from the channel.</div><div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">Please help, what else should I set to have console_write be correct? Or is this truly a bug?</div></blockquote><div><br></div></div><div>I don't know what all you've changed to try to make it do what you want, but it's more than just setting those fields on the ast_channel.</div>
<div><br></div><div>You would need to change this so that portaudio gets set up correctly:</div><div><br></div><div><a href="https://github.com/russellb/asterisk/blob/685ab908534cd2f6f7e25b117974a82fe1a5229a/channels/chan_console.c#L86" target="_blank">https://github.com/russellb/asterisk/blob/685ab908534cd2f6f7e25b117974a82fe1a5229a/channels/chan_console.c#L86</a> </div>
<div><br></div><div>Also look for everywhere you see AST_FORMAT_SLINEAR16. The function reading audio from portaudio and queueing it up on the channel is:</div><div><br></div><div><a href="https://github.com/russellb/asterisk/blob/685ab908534cd2f6f7e25b117974a82fe1a5229a/channels/chan_console.c#L277" target="_blank">https://github.com/russellb/asterisk/blob/685ab908534cd2f6f7e25b117974a82fe1a5229a/channels/chan_console.c#L277</a><br>
</div></div></div></div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br></div>