Make chan_usbradio compile.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/1.8.6
Russell Bryant 16 years ago
parent fe19e1fbd3
commit 96f382fb60

@ -659,9 +659,9 @@ static char *usbradio_active; /* the active device */
static int setformat(struct chan_usbradio_pvt *o, int mode); static int setformat(struct chan_usbradio_pvt *o, int mode);
static struct ast_channel *usbradio_request(const char *type, int format, static struct ast_channel *usbradio_request(const char *type, format_t format,
const struct ast_channel *requestor, const struct ast_channel *requestor,
void *data, int *cause); void *data, int *cause);
static int usbradio_digit_begin(struct ast_channel *c, char digit); static int usbradio_digit_begin(struct ast_channel *c, char digit);
static int usbradio_digit_end(struct ast_channel *c, char digit, unsigned int duration); static int usbradio_digit_end(struct ast_channel *c, char digit, unsigned int duration);
static int usbradio_text(struct ast_channel *c, const char *text); static int usbradio_text(struct ast_channel *c, const char *text);
@ -2052,14 +2052,14 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
{ {
o->lastrx = 0; o->lastrx = 0;
//printf("AST_CONTROL_RADIO_UNKEY\n"); //printf("AST_CONTROL_RADIO_UNKEY\n");
wf.subclass = AST_CONTROL_RADIO_UNKEY; wf.subclass.integer = AST_CONTROL_RADIO_UNKEY;
ast_queue_frame(o->owner, &wf); ast_queue_frame(o->owner, &wf);
} }
else if ((!o->lastrx) && (o->rxkeyed)) else if ((!o->lastrx) && (o->rxkeyed))
{ {
o->lastrx = 1; o->lastrx = 1;
//printf("AST_CONTROL_RADIO_KEY\n"); //printf("AST_CONTROL_RADIO_KEY\n");
wf.subclass = AST_CONTROL_RADIO_KEY; wf.subclass.integer = AST_CONTROL_RADIO_KEY;
if(o->rxctcssdecode) if(o->rxctcssdecode)
{ {
wf.data.ptr = o->rxctcssfreq; wf.data.ptr = o->rxctcssfreq;
@ -2074,7 +2074,7 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
return f; return f;
/* ok we can build and deliver the frame to the caller */ /* ok we can build and deliver the frame to the caller */
f->frametype = AST_FRAME_VOICE; f->frametype = AST_FRAME_VOICE;
f->subclass = AST_FORMAT_SLINEAR; f->subclass.codec = AST_FORMAT_SLINEAR;
f->samples = FRAME_SIZE; f->samples = FRAME_SIZE;
f->datalen = FRAME_SIZE * 2; f->datalen = FRAME_SIZE * 2;
f->data.ptr = o->usbradio_read_buf_8k + AST_FRIENDLY_OFFSET; f->data.ptr = o->usbradio_read_buf_8k + AST_FRIENDLY_OFFSET;
@ -2098,14 +2098,14 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
if ((f1->frametype == AST_FRAME_DTMF_END) || if ((f1->frametype == AST_FRAME_DTMF_END) ||
(f1->frametype == AST_FRAME_DTMF_BEGIN)) (f1->frametype == AST_FRAME_DTMF_BEGIN))
{ {
if ((f1->subclass == 'm') || (f1->subclass == 'u')) if ((f1->subclass.integer == 'm') || (f1->subclass.integer == 'u'))
{ {
f1->frametype = AST_FRAME_NULL; f1->frametype = AST_FRAME_NULL;
f1->subclass = 0; f1->subclass.integer = 0;
return(f1); return(f1);
} }
if (f1->frametype == AST_FRAME_DTMF_END) if (f1->frametype == AST_FRAME_DTMF_END)
ast_log(LOG_NOTICE,"Got DTMF char %c\n",f1->subclass); ast_log(LOG_NOTICE, "Got DTMF char %c\n", f1->subclass.integer);
return(f1); return(f1);
} }
} }
@ -2223,7 +2223,7 @@ static struct ast_channel *usbradio_new(struct chan_usbradio_pvt *o, char *ext,
} }
/* /*
*/ */
static struct ast_channel *usbradio_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause) static struct ast_channel *usbradio_request(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause)
{ {
struct ast_channel *c; struct ast_channel *c;
struct chan_usbradio_pvt *o = find_desc(data); struct chan_usbradio_pvt *o = find_desc(data);
@ -2240,7 +2240,7 @@ static struct ast_channel *usbradio_request(const char *type, int format, const
return NULL; return NULL;
} }
if ((format & AST_FORMAT_SLINEAR) == 0) { if ((format & AST_FORMAT_SLINEAR) == 0) {
ast_log(LOG_NOTICE, "Format 0x%x unsupported\n", format); ast_log(LOG_NOTICE, "Format 0x%lx unsupported\n", format);
return NULL; return NULL;
} }
if (o->owner) { if (o->owner) {

Loading…
Cancel
Save