int i,j,k,x;
struct localuser *u;
char tmp[256],arg2[256],exten[AST_MAX_EXTENSION],acctcode[20];
- unsigned char tone_block[640],sil_block[640];
+ unsigned char tone_block[640];
char *ourcontext,*ourcallerid;
struct ast_frame *f,wf;
struct timeval lastout, now, lastdigittime;
int res;
FILE *fp;
+ char *stringp=NULL;
if (ast_set_write_format(chan,AST_FORMAT_ULAW))
{
return -1;
}
lastout.tv_sec = lastout.tv_usec = 0;
- /* make block of silence */
- memset(sil_block,0x7f,sizeof(sil_block));
if (!data || !strlen((char *)data)) {
ast_log(LOG_WARNING, "disa requires an argument (passcode/passcode file)\n");
return -1;
}
strncpy(tmp, (char *)data, sizeof(tmp)-1);
- strtok(tmp, "|");
- ourcontext = strtok(NULL, "|");
+ stringp=tmp;
+ strsep(&stringp, "|");
+ ourcontext = strsep(&stringp, "|");
/* if context specified, save 2nd arg and parse third */
if (ourcontext) {
strcpy(arg2,ourcontext);
- ourcallerid = strtok(NULL,"|");
+ ourcallerid = strsep(&stringp,"|");
}
/* if context not specified, use "disa" */
else {
}
i = k = x = 0; /* k is 0 for pswd entry, 1 for ext entry */
exten[0] = 0;
+ acctcode[0] = 0;
/* can we access DISA without password? */
if (!strcasecmp(tmp, "no-password"))
{
wf.data = tone_block;
wf.datalen = f->datalen;
make_tone_block(tone_block, 350, 440, f->datalen, &x);
- wf.timelen = wf.datalen / 8;
+ wf.samples = wf.datalen;
ast_frfree(f);
if (ast_write(chan, &wf))
{
tmp[0] = 0;
while(fgets(tmp,sizeof(tmp) - 1,fp))
{
+ char *stringp=NULL;
if (!tmp[0]) continue;
if (tmp[strlen(tmp) - 1] == '\n')
tmp[strlen(tmp) - 1] = 0;
/* skip comments */
if (tmp[0] == '#') continue;
if (tmp[0] == ';') continue;
- strtok(tmp, "|");
+ stringp=tmp;
+ strsep(&stringp, "|");
/* save 2nd arg as clid */
ourcallerid = arg2;
- ourcontext = strtok(NULL, "|");
+ ourcontext = strsep(&stringp, "|");
/* password must be in valid format (numeric) */
if (sscanf(tmp,"%d",&j) < 1) continue;
/* if we got it */
wf.mallocd = 0;
wf.data = tone_block;
wf.datalen = f->datalen;
- wf.timelen = wf.datalen / 8;
+ wf.samples = wf.datalen;
if (k)
memset(tone_block, 0x7f, wf.datalen);
else
myf.f.frametype = AST_FRAME_VOICE;
myf.f.subclass = AST_FORMAT_SLINEAR;
myf.f.datalen = res;
- myf.f.timelen = res / 16;
+ myf.f.samples = res / 2;
myf.f.mallocd = 0;
myf.f.offset = AST_FRIENDLY_OFFSET;
myf.f.src = __PRETTY_FUNCTION__;
myf.f.frametype = AST_FRAME_VOICE;
myf.f.subclass = AST_FORMAT_SLINEAR;
myf.f.datalen = res;
- myf.f.timelen = res / 16;
+ myf.f.samples = res / 2;
myf.f.mallocd = 0;
myf.f.offset = AST_FRIENDLY_OFFSET;
myf.f.src = __PRETTY_FUNCTION__;
f.frametype = AST_FRAME_NULL;
f.subclass = 0;
- f.timelen = 0;
+ f.samples = 0;
f.datalen = 0;
f.data = NULL;
f.offset = 0;
}
f.frametype = AST_FRAME_VOICE;
f.subclass = AST_FORMAT_SLINEAR;
- f.timelen = FRAME_SIZE / 8;
+ f.samples = FRAME_SIZE;
f.datalen = FRAME_SIZE * 2;
f.data = buf;
f.offset = AST_FRIENDLY_OFFSET;
static int console_sendtext(int fd, int argc, char *argv[])
{
- int tmparg = 1;
- if (argc < 1)
+ int tmparg = 2;
+ if (argc < 2)
return RESULT_SHOWUSAGE;
if (!alsa.owner) {
ast_cli(fd, "No one is calling us\n");
mye = exten;
myc = context;
if (argc == 2) {
+ char *stringp=NULL;
strncpy(tmp, argv[1], sizeof(tmp)-1);
- strtok(tmp, "@");
- tmp2 = strtok(NULL, "@");
+ stringp=tmp;
+ strsep(&stringp, "@");
+ tmp2 = strsep(&stringp, "@");
if (strlen(tmp))
mye = tmp;
if (tmp2 && strlen(tmp2))
{ { "answer", NULL }, console_answer, "Answer an incoming console call", answer_usage },
{ { "hangup", NULL }, console_hangup, "Hangup a call on the console", hangup_usage },
{ { "dial", NULL }, console_dial, "Dial an extension on the console", dial_usage },
- { { "send text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage },
+ { { "send", "text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage },
{ { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete }
};
p->fr.subclass = 0;
p->fr.data = NULL;
p->fr.datalen = 0;
- p->fr.timelen = 0;
+ p->fr.samples = 0;
p->fr.offset = 0;
p->fr.mallocd = 0;
if (esc)
/* If we get here, we have a complete voice frame */
p->fr.frametype = AST_FRAME_VOICE;
p->fr.subclass = AST_FORMAT_SLINEAR;
- p->fr.timelen = 30;
+ p->fr.samples = 240;
p->fr.data = p->obuf;
p->fr.datalen = p->obuflen;
p->fr.mallocd = 0;
p->fr.subclass = 0;
p->fr.data = NULL;
p->fr.datalen = 0;
- p->fr.timelen = 0;
+ p->fr.samples = 0;
p->fr.offset = 0;
p->fr.mallocd = 0;
if (esc)
/* If we get here, we have a complete voice frame */
p->fr.frametype = AST_FRAME_VOICE;
p->fr.subclass = AST_FORMAT_SLINEAR;
- p->fr.timelen = 30;
+ p->fr.samples = 240;
p->fr.data = p->obuf;
p->fr.datalen = p->obuflen;
p->fr.mallocd = 0;
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
+#include <sys/ioctl.h>
#include <asterisk/lock.h>
#include <asterisk/vmodem.h>
#include <asterisk/module.h>
return -1;
}
}
+ if (strlen(p->incomingmsn)) {
+ char *q;
+ snprintf(cmd, sizeof(cmd), "AT&L%s", p->incomingmsn);
+ // translate , into ; since that is the seperator I4L uses, but can't be directly
+ // put in the config file because it will interpret the rest of the line as comment.
+ q = cmd+4;
+ while (*q) {
+ if (*q == ',') *q = ';';
+ ++q;
+ }
+ if (ast_modem_send(p, cmd, 0) ||
+ ast_modem_expect(p, "OK", 5)) {
+ ast_log(LOG_WARNING, "Unable to set Listen to %s\n", p->msn);
+ return -1;
+ }
+ }
+ if (ast_modem_send(p, "AT&D2", 0) ||
+ ast_modem_expect(p, "OK", 5)) {
+ ast_log(LOG_WARNING, "Unable to set to DTR disconnect mode\n");
+ return -1;
+ }
if (ast_modem_send(p, "ATS18=1", 0) ||
ast_modem_expect(p, "OK", 5)) {
ast_log(LOG_WARNING, "Unable to set to audio only mode\n");
return -1;
}
+ if (ast_modem_send(p, "ATS13.6=1", 0) ||
+ ast_modem_expect(p, "OK", 5)) {
+ ast_log(LOG_WARNING, "Unable to set to RUNG indication\n");
+ return -1;
+ }
if (ast_modem_send(p, "ATS14=4", 0) ||
ast_modem_expect(p, "OK", 5)) {
ast_log(LOG_WARNING, "Unable to set to transparent mode\n");
p->fr.subclass = 0;
p->fr.data = NULL;
p->fr.datalen = 0;
- p->fr.timelen = 0;
+ p->fr.samples = 0;
p->fr.offset = 0;
p->fr.mallocd = 0;
if (esc && option_debug)
int x;
if (p->ministate == STATE_COMMAND) {
/* Read the first two bytes, first, in case it's a control message */
- read(p->fd, result, 2);
+ res = read(p->fd, result, 2);
+ if (res < 2) {
+ // short read, means there was a hangup?
+ // (or is this also possible without hangup?)
+ // Anyway, reading from unitialized buffers is a bad idea anytime.
+ if (errno == EAGAIN)
+ return i4l_handle_escape(p, 0);
+ return NULL;
+ }
if (result[0] == CHAR_DLE) {
return i4l_handle_escape(p, result[1]);
ast_modem_trim(result);
if (!strcasecmp(result, "VCON")) {
/* If we're in immediate mode, reply now */
- if (p->mode == MODEM_MODE_IMMEDIATE)
+// if (p->mode == MODEM_MODE_IMMEDIATE)
return i4l_handle_escape(p, 'X');
} else
if (!strcasecmp(result, "BUSY")) {
} else
if (!strncasecmp(result, "CALLER NUMBER: ", 15 )) {
strncpy(p->cid, result + 15, sizeof(p->cid)-1);
- return i4l_handle_escape(p, 'R');
+ return i4l_handle_escape(p, 0);
} else
if (!strcasecmp(result, "RINGING")) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "%s is ringing...\n", p->dev);
return i4l_handle_escape(p, 'I');
} else
+ if (!strncasecmp(result, "RUNG", 4)) {
+ /* PM2002: the line was hung up before we picked it up, bye bye */
+ if (option_verbose > 2)
+ ast_verbose(VERBOSE_PREFIX_3 "%s was hung up on before we answered\n", p->dev);
+ return NULL;
+ } else
if (!strncasecmp(result, "RING", 4)) {
if (result[4]=='/')
- strncpy(p->dnid, result + 4, sizeof(p->dnid)-1);
+ strncpy(p->dnid, result + 5, sizeof(p->dnid)-1);
return i4l_handle_escape(p, 'R');
} else
if (!strcasecmp(result, "NO CARRIER")) {
if (errno == EAGAIN)
return i4l_handle_escape(p, 0);
ast_log(LOG_WARNING, "Read failed: %s\n", strerror(errno));
+ return NULL;
}
for (x=0;x<res;x++) {
/* If we get here, we have a complete voice frame */
p->fr.frametype = AST_FRAME_VOICE;
p->fr.subclass = AST_FORMAT_SLINEAR;
- p->fr.timelen = 30;
+ p->fr.samples = 240;
p->fr.data = p->obuf;
p->fr.datalen = p->obuflen;
p->fr.mallocd = 0;
static int i4l_hangup(struct ast_modem_pvt *p)
{
char dummy[50];
- sprintf(dummy, "%c%c", 0x10, 0x3);
- if (write(p->fd, dummy, 2) < 0) {
- ast_log(LOG_WARNING, "Failed to break\n");
- return -1;
- }
+ int dtr = TIOCM_DTR;
+
+ /* down DTR to hangup modem */
+ ioctl(p->fd, TIOCMBIC, &dtr);
/* Read anything outstanding */
while(read(p->fd, dummy, sizeof(dummy)) > 0);
- sprintf(dummy, "%c%c", 0x10, 0x14);
- if (write(p->fd, dummy, 2) < 0) {
- ast_log(LOG_WARNING, "Failed to break\n");
- return -1;
- }
- ast_modem_expect(p, "VCON", 1);
-#if 0
- if (ast_modem_expect(p, "VCON", 8)) {
- ast_log(LOG_WARNING, "Didn't get expected VCON\n");
- return -1;
- }
-#endif
+ /* rise DTR to re-enable line */
+ ioctl(p->fd, TIOCMBIS, &dtr);
+
+ /* Read anything outstanding */
+ while(read(p->fd, dummy, sizeof(dummy)) > 0);
+
+ /* basically we're done, just to be sure */
write(p->fd, "\n\n", 2);
read(p->fd, dummy, sizeof(dummy));
- /* Hangup by switching to data, then back to voice */
- if (ast_modem_send(p, "ATH", 0) ||
- ast_modem_expect(p, "NO CARRIER", 8)) {
+ if (ast_modem_send(p, "ATH", 0)) {
ast_log(LOG_WARNING, "Unable to hang up\n");
return -1;
}
ast_log(LOG_WARNING, "Final 'OK' not received\n");
return -1;
}
+
return 0;
}
/* Some nice norms */
p->fr.datalen = 0;
- p->fr.timelen = 0;
+ p->fr.samples = 0;
p->fr.data = NULL;
p->fr.src = type;
p->fr.offset = 0;
/* Some nice norms */
p->fr.datalen = 0;
- p->fr.timelen = 0;
+ p->fr.samples = 0;
p->fr.data = NULL;
p->fr.src = type;
p->fr.offset = 0;
res = 4;
break;
}
+ p->fr.samples = 240;
p->fr.datalen = res;
p->fr.frametype = AST_FRAME_VOICE;
p->fr.subclass = p->lastinput;
strncpy(tmp->context, context, sizeof(tmp->context)-1);
if (strlen(i->ext))
strncpy(tmp->exten, i->ext, sizeof(tmp->exten)-1);
+ else
+ strncpy(tmp->exten, "s", sizeof(tmp->exten) - 1);
if (strlen(i->language))
strncpy(tmp->language, i->language, sizeof(tmp->language)-1);
if (strlen(i->callerid))
tmp->f.frametype = AST_FRAME_VOICE;
tmp->f.subclass = AST_FORMAT_ULAW;
tmp->f.datalen = tmp->tail;
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
if (tmp->tail) {
tmp->f.frametype = AST_FRAME_VOICE;
tmp->f.subclass = AST_FORMAT_ALAW;
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
f.frametype = AST_FRAME_VOICE;
f.subclass = AST_FORMAT_ALAW;
f.datalen = sizeof (ulaw_slin_ex);
- f.timelen = sizeof(ulaw_slin_ex) / 8;
+ f.samples = sizeof(ulaw_slin_ex);
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
f.frametype = AST_FRAME_VOICE;
f.subclass = AST_FORMAT_ULAW;
f.datalen = sizeof (ulaw_slin_ex);
- f.timelen = sizeof(ulaw_slin_ex) / 8;
+ f.samples = sizeof(ulaw_slin_ex);
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
*
* Results:
* Converted signals are placed in tmp->f.data, tmp->f.datalen
- * and tmp->f.timelen are calculated.
+ * and tmp->f.samples are calculated.
*
* Side effects:
* None.
tmp->f.frametype = AST_FRAME_VOICE;
tmp->f.subclass = AST_FORMAT_SLINEAR;
tmp->f.datalen = tmp->tail *2;
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
tmp->f.frametype = AST_FRAME_VOICE;
tmp->f.subclass = AST_FORMAT_ADPCM;
- tmp->f.timelen = i_max / 8;
+ tmp->f.samples = i_max;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
f.frametype = AST_FRAME_VOICE;
f.subclass = AST_FORMAT_ADPCM;
f.datalen = sizeof (adpcm_slin_ex);
- f.timelen = sizeof(adpcm_slin_ex) / 4;
+ f.samples = sizeof(adpcm_slin_ex) * 2;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
f.subclass = AST_FORMAT_SLINEAR;
f.datalen = sizeof (slin_adpcm_ex);
/* Assume 8000 Hz */
- f.timelen = sizeof (slin_adpcm_ex) / 16;
+ f.samples = sizeof (slin_adpcm_ex) / 2;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
*
* Results:
* Converted signals are placed in tmp->f.data, tmp->f.datalen
- * and tmp->f.timelen are calculated.
+ * and tmp->f.samples are calculated.
*
* Side effects:
* None.
tmp->f.frametype = AST_FRAME_VOICE;
tmp->f.subclass = AST_FORMAT_SLINEAR;
tmp->f.datalen = tmp->tail *2;
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
if (tmp->tail) {
tmp->f.frametype = AST_FRAME_VOICE;
tmp->f.subclass = AST_FORMAT_ALAW;
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
f.frametype = AST_FRAME_VOICE;
f.subclass = AST_FORMAT_ALAW;
f.datalen = sizeof (ulaw_slin_ex);
- f.timelen = sizeof(ulaw_slin_ex) / 8;
+ f.samples = sizeof(ulaw_slin_ex);
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
f.subclass = AST_FORMAT_SLINEAR;
f.datalen = sizeof (slin_ulaw_ex);
/* Assume 8000 Hz */
- f.timelen = sizeof (slin_ulaw_ex) / 16;
+ f.samples = sizeof (slin_ulaw_ex) / 2;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
f.subclass = AST_FORMAT_SLINEAR;
f.datalen = sizeof(slin_gsm_ex);
/* Assume 8000 Hz */
- f.timelen = sizeof(slin_gsm_ex)/16;
+ f.samples = sizeof(slin_gsm_ex)/2;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
f.subclass = AST_FORMAT_GSM;
f.datalen = sizeof(gsm_slin_ex);
/* All frames are 20 ms long */
- f.timelen = 20;
+ f.samples = 160;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
tmp->f.subclass = AST_FORMAT_SLINEAR;
tmp->f.datalen = tmp->tail * 2;
/* Assume 8000 Hz */
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
x++;
}
tmp->f.datalen = x * 33;
- tmp->f.timelen = x * 20;
+ tmp->f.samples = x * 160;
return &tmp->f;
}
static struct ast_frame *lintolpc10_sample()
{
static struct ast_frame f;
- static int longer = 0;
f.frametype = AST_FRAME_VOICE;
f.subclass = AST_FORMAT_SLINEAR;
f.datalen = sizeof(slin_lpc10_ex);
/* Assume 8000 Hz */
- f.timelen = LPC10_SAMPLES_PER_FRAME/8;
- f.timelen += longer;
- longer = 1- longer;
+ f.samples = LPC10_SAMPLES_PER_FRAME;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
f.datalen = sizeof(lpc10_slin_ex);
/* All frames are 22 ms long (maybe a little more -- why did he choose
LPC10_SAMPLES_PER_FRAME sample frames anyway?? */
- f.timelen = LPC10_SAMPLES_PER_FRAME/8;
+ f.samples = LPC10_SAMPLES_PER_FRAME;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
tmp->f.subclass = AST_FORMAT_SLINEAR;
tmp->f.datalen = tmp->tail * 2;
/* Assume 8000 Hz */
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
if (tmp->tail < LPC10_SAMPLES_PER_FRAME)
return NULL;
/* Start with an empty frame */
- tmp->f.timelen = 0;
+ tmp->f.samples = 0;
tmp->f.datalen = 0;
tmp->f.frametype = AST_FRAME_VOICE;
tmp->f.subclass = AST_FORMAT_LPC10;
lpc10_encode(tmpbuf, bits, tmp->lpc10.enc);
build_bits(((unsigned char *)tmp->outbuf) + tmp->f.datalen, bits);
tmp->f.datalen += LPC10_BYTES_IN_COMPRESSED_FRAME;
- tmp->f.timelen += 22;
- /* We alternate between 22 and 23 ms to simulate 22.5 ms */
- tmp->f.timelen += tmp->longer;
+ tmp->f.samples += LPC10_SAMPLES_PER_FRAME;
/* Use one of the two left over bits to record if this is a 22 or 23 ms frame...
important for IAX use */
tmp->longer = 1 - tmp->longer;
f.data = mp3_slin_ex;
f.datalen = sizeof(mp3_slin_ex);
/* Dunno how long an mp3 frame is -- kinda irrelevant anyway */
- f.timelen = 30;
+ f.samples = 240;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
tmp->f.subclass = AST_FORMAT_SLINEAR;
tmp->f.datalen = tmp->tail * 2;
/* Assume 8000 Hz */
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
*
* Results:
* Converted signals are placed in tmp->f.data, tmp->f.datalen
- * and tmp->f.timelen are calculated.
+ * and tmp->f.samples are calculated.
*
* Side effects:
* None.
tmp->f.frametype = AST_FRAME_VOICE;
tmp->f.subclass = AST_FORMAT_SLINEAR;
tmp->f.datalen = tmp->tail *2;
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
if (tmp->tail) {
tmp->f.frametype = AST_FRAME_VOICE;
tmp->f.subclass = AST_FORMAT_ULAW;
- tmp->f.timelen = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
f.frametype = AST_FRAME_VOICE;
f.subclass = AST_FORMAT_ULAW;
f.datalen = sizeof (ulaw_slin_ex);
- f.timelen = sizeof(ulaw_slin_ex) / 8;
+ f.samples = sizeof(ulaw_slin_ex);
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
f.subclass = AST_FORMAT_SLINEAR;
f.datalen = sizeof (slin_ulaw_ex);
/* Assume 8000 Hz */
- f.timelen = sizeof (slin_ulaw_ex) / 16;
+ f.samples = sizeof (slin_ulaw_ex) / 2;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;