|
|
|
@ -659,9 +659,9 @@ static char *usbradio_active; /* the active device */
|
|
|
|
|
|
|
|
|
|
static int setformat(struct chan_usbradio_pvt *o, int mode);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
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_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;
|
|
|
|
|
//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);
|
|
|
|
|
}
|
|
|
|
|
else if ((!o->lastrx) && (o->rxkeyed))
|
|
|
|
|
{
|
|
|
|
|
o->lastrx = 1;
|
|
|
|
|
//printf("AST_CONTROL_RADIO_KEY\n");
|
|
|
|
|
wf.subclass = AST_CONTROL_RADIO_KEY;
|
|
|
|
|
wf.subclass.integer = AST_CONTROL_RADIO_KEY;
|
|
|
|
|
if(o->rxctcssdecode)
|
|
|
|
|
{
|
|
|
|
|
wf.data.ptr = o->rxctcssfreq;
|
|
|
|
@ -2074,7 +2074,7 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
|
|
|
|
|
return f;
|
|
|
|
|
/* ok we can build and deliver the frame to the caller */
|
|
|
|
|
f->frametype = AST_FRAME_VOICE;
|
|
|
|
|
f->subclass = AST_FORMAT_SLINEAR;
|
|
|
|
|
f->subclass.codec = AST_FORMAT_SLINEAR;
|
|
|
|
|
f->samples = FRAME_SIZE;
|
|
|
|
|
f->datalen = FRAME_SIZE * 2;
|
|
|
|
|
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) ||
|
|
|
|
|
(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->subclass = 0;
|
|
|
|
|
f1->subclass.integer = 0;
|
|
|
|
|
return(f1);
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -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 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;
|
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
if (o->owner) {
|
|
|
|
|