Fix a bunch of const stuff, merge queue changes, add experimental "hybrid" DTMF mode

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-03-28 20:48:24 +00:00
parent 5c12ec4755
commit dc9faa21e4
17 changed files with 369 additions and 267 deletions

View File

@@ -476,6 +476,7 @@ bininstall: all
rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax

View File

@@ -26,3 +26,10 @@ Applications:
* The CallerPres application has been removed. Use SetCallerPres
instead. It accepts both numeric and symbolic names.
Queues:
* A queue is now considered empty not only if there are no members but if
none of the members are available (e.g. agents not logged on). To
restore the original behavior, use "leavewhenempty=strict" or
"joinwhenempty=strict" instead of "=yes" for those options.

File diff suppressed because it is too large Load Diff

View File

@@ -2219,14 +2219,14 @@ int ast_channel_supports_html(struct ast_channel *chan)
return 0;
}
int ast_channel_sendhtml(struct ast_channel *chan, int subclass, char *data, int datalen)
int ast_channel_sendhtml(struct ast_channel *chan, int subclass, const char *data, int datalen)
{
if (chan->tech->send_html)
return chan->tech->send_html(chan, subclass, data, datalen);
return -1;
}
int ast_channel_sendurl(struct ast_channel *chan, char *url)
int ast_channel_sendurl(struct ast_channel *chan, const char *url)
{
if (chan->tech->send_html)
return chan->tech->send_html(chan, AST_HTML_URL, url, strlen(url) + 1);

View File

@@ -201,7 +201,7 @@ static int agent_hangup(struct ast_channel *ast);
static int agent_answer(struct ast_channel *ast);
static struct ast_frame *agent_read(struct ast_channel *ast);
static int agent_write(struct ast_channel *ast, struct ast_frame *f);
static int agent_sendhtml(struct ast_channel *ast, int subclass, char *data, int datalen);
static int agent_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen);
static int agent_indicate(struct ast_channel *ast, int condition);
static int agent_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static struct ast_channel *agent_bridgedchannel(struct ast_channel *chan, struct ast_channel *bridge);
@@ -450,7 +450,7 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
return f;
}
static int agent_sendhtml(struct ast_channel *ast, int subclass, char *data, int datalen)
static int agent_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen)
{
struct agent_pvt *p = ast->tech_pvt;
int res = -1;

View File

@@ -653,11 +653,11 @@ static ast_mutex_t iaxsl[IAX_MAX_CALLS];
static struct timeval lastused[IAX_MAX_CALLS];
static int send_command(struct chan_iax2_pvt *, char, int, unsigned int, char *, int, int);
static int send_command_locked(unsigned short callno, char, int, unsigned int, char *, int, int);
static int send_command_immediate(struct chan_iax2_pvt *, char, int, unsigned int, char *, int, int);
static int send_command_final(struct chan_iax2_pvt *, char, int, unsigned int, char *, int, int);
static int send_command_transfer(struct chan_iax2_pvt *, char, int, unsigned int, char *, int);
static int send_command(struct chan_iax2_pvt *, char, int, unsigned int, const char *, int, int);
static int send_command_locked(unsigned short callno, char, int, unsigned int, const char *, int, int);
static int send_command_immediate(struct chan_iax2_pvt *, char, int, unsigned int, const char *, int, int);
static int send_command_final(struct chan_iax2_pvt *, char, int, unsigned int, const char *, int, int);
static int send_command_transfer(struct chan_iax2_pvt *, char, int, unsigned int, const char *, int);
static struct iax2_user *build_user(const char *name, struct ast_variable *v, int temponly);
static void destroy_user(struct iax2_user *user);
static int expire_registry(void *data);
@@ -670,9 +670,9 @@ static int iax2_provision(struct sockaddr_in *end, char *dest, const char *templ
static struct ast_channel *iax2_request(const char *type, int format, void *data, int *cause);
static int iax2_devicestate(void *data);
static int iax2_digit(struct ast_channel *c, char digit);
static int iax2_sendtext(struct ast_channel *c, char *text);
static int iax2_sendtext(struct ast_channel *c, const char *text);
static int iax2_sendimage(struct ast_channel *c, struct ast_frame *img);
static int iax2_sendhtml(struct ast_channel *c, int subclass, char *data, int datalen);
static int iax2_sendhtml(struct ast_channel *c, int subclass, const char *data, int datalen);
static int iax2_call(struct ast_channel *c, char *dest, int timeout);
static int iax2_hangup(struct ast_channel *c);
static int iax2_answer(struct ast_channel *c);
@@ -681,7 +681,7 @@ static int iax2_write(struct ast_channel *c, struct ast_frame *f);
static int iax2_indicate(struct ast_channel *c, int condition);
static int iax2_setoption(struct ast_channel *c, int option, void *data, int datalen);
static int iax2_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc);
static int iax2_transfer(struct ast_channel *c, char *dest);
static int iax2_transfer(struct ast_channel *c, const char *dest);
static int iax2_fixup(struct ast_channel *oldchannel, struct ast_channel *newchan);
static const struct ast_channel_tech iax2_tech = {
@@ -2487,7 +2487,7 @@ static int iax2_digit(struct ast_channel *c, char digit)
return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_DTMF, digit, 0, NULL, 0, -1);
}
static int iax2_sendtext(struct ast_channel *c, char *text)
static int iax2_sendtext(struct ast_channel *c, const char *text)
{
return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_TEXT,
@@ -2499,7 +2499,7 @@ static int iax2_sendimage(struct ast_channel *c, struct ast_frame *img)
return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_IMAGE, img->subclass, 0, img->data, img->datalen, -1);
}
static int iax2_sendhtml(struct ast_channel *c, int subclass, char *data, int datalen)
static int iax2_sendhtml(struct ast_channel *c, int subclass, const char *data, int datalen)
{
return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_HTML, subclass, 0, data, datalen, -1);
}
@@ -3214,7 +3214,7 @@ static int iax2_indicate(struct ast_channel *c, int condition)
return send_command_locked(callno, AST_FRAME_CONTROL, condition, 0, NULL, 0, -1);
}
static int iax2_transfer(struct ast_channel *c, char *dest)
static int iax2_transfer(struct ast_channel *c, const char *dest)
{
unsigned short callno = PTR_TO_CALLNO(c->tech_pvt);
struct iax_ie_data ied;
@@ -4484,7 +4484,7 @@ static int iax2_write(struct ast_channel *c, struct ast_frame *f)
return res;
}
static int __send_command(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, char *data, int datalen, int seqno,
static int __send_command(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, const char *data, int datalen, int seqno,
int now, int transfer, int final)
{
struct ast_frame f;
@@ -4495,16 +4495,16 @@ static int __send_command(struct chan_iax2_pvt *i, char type, int command, unsig
f.mallocd = 0;
f.offset = 0;
f.src = (char *)__FUNCTION__;
f.data = data;
f.data = (char *)data;
return iax2_send(i, &f, ts, seqno, now, transfer, final);
}
static int send_command(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, char *data, int datalen, int seqno)
static int send_command(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, const char *data, int datalen, int seqno)
{
return __send_command(i, type, command, ts, data, datalen, seqno, 0, 0, 0);
}
static int send_command_locked(unsigned short callno, char type, int command, unsigned int ts, char *data, int datalen, int seqno)
static int send_command_locked(unsigned short callno, char type, int command, unsigned int ts, const char *data, int datalen, int seqno)
{
int res;
ast_mutex_lock(&iaxsl[callno]);
@@ -4514,25 +4514,25 @@ static int send_command_locked(unsigned short callno, char type, int command, un
}
#ifdef BRIDGE_OPTIMIZATION
static int forward_command(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, char *data, int datalen, int seqno)
static int forward_command(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, const char *data, int datalen, int seqno)
{
return __send_command(iaxs[i->bridgecallno], type, command, ts, data, datalen, seqno, 0, 0, 0);
}
#endif
static int send_command_final(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, char *data, int datalen, int seqno)
static int send_command_final(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, const char *data, int datalen, int seqno)
{
/* It is assumed that the callno has already been locked */
iax2_predestroy_nolock(i->callno);
return __send_command(i, type, command, ts, data, datalen, seqno, 0, 0, 1);
}
static int send_command_immediate(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, char *data, int datalen, int seqno)
static int send_command_immediate(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, const char *data, int datalen, int seqno)
{
return __send_command(i, type, command, ts, data, datalen, seqno, 1, 0, 0);
}
static int send_command_transfer(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, char *data, int datalen)
static int send_command_transfer(struct chan_iax2_pvt *i, char type, int command, unsigned int ts, const char *data, int datalen)
{
return __send_command(i, type, command, ts, data, datalen, 0, 0, 1, 0);
}

View File

@@ -61,7 +61,7 @@ static struct ast_frame *local_read(struct ast_channel *ast);
static int local_write(struct ast_channel *ast, struct ast_frame *f);
static int local_indicate(struct ast_channel *ast, int condition);
static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static int local_sendhtml(struct ast_channel *ast, int subclass, char *data, int datalen);
static int local_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen);
static const struct ast_channel_tech local_tech = {
.type = type,
@@ -264,7 +264,7 @@ static int local_digit(struct ast_channel *ast, char digit)
return res;
}
static int local_sendhtml(struct ast_channel *ast, int subclass, char *data, int datalen)
static int local_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen)
{
struct local_pvt *p = ast->tech_pvt;
int res = -1;
@@ -273,7 +273,7 @@ static int local_sendhtml(struct ast_channel *ast, int subclass, char *data, int
ast_mutex_lock(&p->lock);
isoutbound = IS_OUTBOUND(ast, p);
f.subclass = subclass;
f.data = data;
f.data = (char *)data;
f.datalen = datalen;
res = local_queue_frame(p, isoutbound, &f, ast);
ast_mutex_unlock(&p->lock);

View File

@@ -120,6 +120,7 @@ static const char config[] = "mgcp.conf";
#define MGCP_DTMF_RFC2833 (1 << 0)
#define MGCP_DTMF_INBAND (1 << 1)
#define MGCP_DTMF_HYBRID (1 << 2)
#define DEFAULT_MGCP_GW_PORT 2427 /* From RFC 2705 */
#define DEFAULT_MGCP_CA_PORT 2727 /* From RFC 2705 */
@@ -988,6 +989,8 @@ static int mgcp_hangup(struct ast_channel *ast)
if ((p->dtmfmode & MGCP_DTMF_INBAND) && p->dsp) {
/* SC: check whether other channel is active. */
if (!sub->next->owner) {
if (p->dtmfmode & MGCP_DTMF_HYBRID)
p->dtmfmode &= ~MGCP_DTMF_INBAND;
if (mgcpdebug) {
ast_verbose(VERBOSE_PREFIX_2 "MGCP free dsp on %s@%s\n", p->name, p->parent->name);
}
@@ -1377,7 +1380,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
if (sub->rtp)
tmp->fds[0] = ast_rtp_fd(sub->rtp);
tmp->type = type;
if (i->dtmfmode & MGCP_DTMF_INBAND) {
if (i->dtmfmode & (MGCP_DTMF_INBAND | MGCP_DTMF_HYBRID)) {
i->dsp = ast_dsp_new();
ast_dsp_set_features(i->dsp,DSP_FEATURE_DTMF_DETECT);
/* SC: this is to prevent clipping of dtmf tones during dsp processing */
@@ -2617,6 +2620,10 @@ static void *mgcp_ss(void *data)
}
ast_setstate(chan, AST_STATE_RING);
/*zt_enable_ec(p);*/
if (p->dtmfmode & MGCP_DTMF_HYBRID) {
p->dtmfmode |= MGCP_DTMF_INBAND;
ast_indicate(chan, -1);
}
res = ast_pbx_run(chan);
if (res) {
ast_log(LOG_WARNING, "PBX exited non-zero\n");
@@ -3608,6 +3615,8 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
dtmfmode = MGCP_DTMF_INBAND;
else if (!strcasecmp(v->value, "rfc2833"))
dtmfmode = MGCP_DTMF_RFC2833;
else if (!strcasecmp(v->value, "hybrid"))
dtmfmode = MGCP_DTMF_HYBRID;
else if (!strcasecmp(v->value, "none"))
dtmfmode = 0;
else
@@ -3702,6 +3711,8 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
e->capability = capability;
e->parent = gw;
e->dtmfmode = dtmfmode;
if (!ep_reload && e->sub->rtp)
e->dtmfmode |= MGCP_DTMF_INBAND;
e->adsi = adsi;
e->type = TYPE_LINE;
e->immediate = immediate;

View File

@@ -139,7 +139,7 @@ static int phone_answer(struct ast_channel *ast);
static struct ast_frame *phone_read(struct ast_channel *ast);
static int phone_write(struct ast_channel *ast, struct ast_frame *frame);
static struct ast_frame *phone_exception(struct ast_channel *ast);
static int phone_send_text(struct ast_channel *ast, char *text);
static int phone_send_text(struct ast_channel *ast, const char *text);
static const struct ast_channel_tech phone_tech = {
.type = type,
@@ -536,7 +536,7 @@ static struct ast_frame *phone_read(struct ast_channel *ast)
return &p->fr;
}
static int phone_write_buf(struct phone_pvt *p, char *buf, int len, int frlen)
static int phone_write_buf(struct phone_pvt *p, const char *buf, int len, int frlen)
{
int res;
/* Store as much of the buffer as we can, then write fixed frames */
@@ -567,7 +567,7 @@ static int phone_write_buf(struct phone_pvt *p, char *buf, int len, int frlen)
return len;
}
static int phone_send_text(struct ast_channel *ast, char *text)
static int phone_send_text(struct ast_channel *ast, const char *text)
{
int length = strlen(text);
return phone_write_buf(ast->tech_pvt, text, length, length) ==

View File

@@ -653,9 +653,9 @@ static int transmit_request_with_auth(struct sip_pvt *p, int sipmethod, int inc,
static int transmit_invite(struct sip_pvt *p, int sipmethod, int sendsdp, char *auth, char *authheader, char *vxml_url, char *distinctive_ring, char *osptoken, int addsipheaders, int init);
static int transmit_reinvite_with_sdp(struct sip_pvt *p);
static int transmit_info_with_digit(struct sip_pvt *p, char digit);
static int transmit_message_with_text(struct sip_pvt *p, char *text);
static int transmit_refer(struct sip_pvt *p, char *dest);
static int sip_sipredirect(struct sip_pvt *p, char *dest);
static int transmit_message_with_text(struct sip_pvt *p, const char *text);
static int transmit_refer(struct sip_pvt *p, const char *dest);
static int sip_sipredirect(struct sip_pvt *p, const char *dest);
static struct sip_peer *temp_peer(char *name);
static int do_proxy_auth(struct sip_pvt *p, struct sip_request *req, char *header, char *respheader, int sipmethod, int init);
static void free_old_route(struct sip_route *route);
@@ -670,17 +670,16 @@ static int callevents = 0;
static struct ast_channel *sip_request(const char *type, int format, void *data, int *cause);
static int sip_devicestate(void *data);
static int sip_sendtext(struct ast_channel *ast, char *text);
static int sip_sendtext(struct ast_channel *ast, const char *text);
static int sip_call(struct ast_channel *ast, char *dest, int timeout);
static int sip_hangup(struct ast_channel *ast);
static int sip_answer(struct ast_channel *ast);
static struct ast_frame *sip_read(struct ast_channel *ast);
static int sip_write(struct ast_channel *ast, struct ast_frame *frame);
static int sip_indicate(struct ast_channel *ast, int condition);
static int sip_transfer(struct ast_channel *ast, char *dest);
static int sip_transfer(struct ast_channel *ast, const char *dest);
static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static int sip_senddigit(struct ast_channel *ast, char digit);
static int sip_sendtext(struct ast_channel *ast, char *text);
static int clear_realm_authentication(struct sip_auth *authlist); /* Clear realm authentication list (at reload) */
static struct sip_auth *add_realm_authentication(struct sip_auth *authlist, char *configuration, int lineno); /* Add realm authentication in list */
static struct sip_auth *find_realm_authentication(struct sip_auth *authlist, char *realm); /* Find authentication for a specific realm */
@@ -1178,7 +1177,7 @@ static char *ditch_braces(char *tmp)
/*--- sip_sendtext: Send SIP MESSAGE text within a call ---*/
/* Called from PBX core text message functions */
static int sip_sendtext(struct ast_channel *ast, char *text)
static int sip_sendtext(struct ast_channel *ast, const char *text)
{
struct sip_pvt *p = ast->tech_pvt;
int debug=sip_debug_test_pvt(p);
@@ -2098,7 +2097,7 @@ static int sip_senddigit(struct ast_channel *ast, char digit)
/*--- sip_transfer: Transfer SIP call */
static int sip_transfer(struct ast_channel *ast, char *dest)
static int sip_transfer(struct ast_channel *ast, const char *dest)
{
struct sip_pvt *p = ast->tech_pvt;
int res;
@@ -3122,7 +3121,7 @@ static int add_blank_header(struct sip_request *req)
}
/*--- add_line: Add content (not header) to SIP message */
static int add_line(struct sip_request *req, char *line)
static int add_line(struct sip_request *req, const char *line)
{
if (req->len >= sizeof(req->data) - 4) {
ast_log(LOG_WARNING, "Out of space, can't add anymore\n");
@@ -3573,7 +3572,7 @@ static int transmit_response_with_auth(struct sip_pvt *p, char *msg, struct sip_
}
/*--- add_text: Add text body to SIP message ---*/
static int add_text(struct sip_request *req, char *text)
static int add_text(struct sip_request *req, const char *text)
{
/* XXX Convert \n's to \r\n's XXX */
int len = strlen(text);
@@ -4603,7 +4602,7 @@ static int transmit_register(struct sip_registry *r, int sipmethod, char *auth,
}
/*--- transmit_message_with_text: Transmit text with SIP MESSAGE method ---*/
static int transmit_message_with_text(struct sip_pvt *p, char *text)
static int transmit_message_with_text(struct sip_pvt *p, const char *text)
{
struct sip_request req;
reqprep(&req, p, SIP_MESSAGE, 0, 1);
@@ -4612,7 +4611,7 @@ static int transmit_message_with_text(struct sip_pvt *p, char *text)
}
/*--- transmit_refer: Transmit SIP REFER message ---*/
static int transmit_refer(struct sip_pvt *p, char *dest)
static int transmit_refer(struct sip_pvt *p, const char *dest)
{
struct sip_request req;
char from[256];
@@ -10633,7 +10632,7 @@ static int sip_getheader(struct ast_channel *chan, void *data)
/* Called by the transfer() dialplan application through the sip_transfer() */
/* pbx interface function if the call is in ringing state */
/* coded by Martin Pycko (m78pl@yahoo.com) */
static int sip_sipredirect(struct sip_pvt *p, char *dest)
static int sip_sipredirect(struct sip_pvt *p, const char *dest)
{
char *cdest;
char *extension, *host, *port;

View File

@@ -299,7 +299,7 @@ static int restart_monitor(void);
static int zt_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc);
static int zt_sendtext(struct ast_channel *c, char *text);
static int zt_sendtext(struct ast_channel *c, const char *text);
static inline int zt_get_event(int fd)
{
@@ -615,7 +615,7 @@ static struct zt_pvt {
static struct ast_channel *zt_request(const char *type, int format, void *data, int *cause);
static int zt_digit(struct ast_channel *ast, char digit);
static int zt_sendtext(struct ast_channel *c, char *text);
static int zt_sendtext(struct ast_channel *c, const char *text);
static int zt_call(struct ast_channel *ast, char *rdest, int timeout);
static int zt_hangup(struct ast_channel *ast);
static int zt_answer(struct ast_channel *ast);
@@ -10189,7 +10189,7 @@ int load_module(void)
return res;
}
static int zt_sendtext(struct ast_channel *c, char *text)
static int zt_sendtext(struct ast_channel *c, const char *text)
{
#define END_SILENCE_LEN 400
#define HEADER_MS 50

View File

@@ -45,7 +45,7 @@
;
;context=local
;host=dynamic
;dtmfmode=none ; DTMF Mode can be 'none', 'rfc2833', or 'inband'. Default is none.
;dtmfmode=none ; DTMF Mode can be 'none', 'rfc2833', or 'inband' or 'hybrid' which starts in none and moves to inband. Default is none.
;slowsequence=yes ; The DPH100M does not follow MGCP standards for sequencing
;line => aaln/1

View File

@@ -122,14 +122,21 @@ persistentmembers = yes
;
; monitor-join = yes
;
; If you wish to allow queues that have no members currently to be joined, set this to yes
; This setting controls whether callers can join a queue with no members. There are three
; choices:
;
; yes - callers can join a queue with no members or only unavailable members
; no - callers cannot join a queue with no members or only unavailable members
; strict - callers cannot join a queue with no members
;
; joinempty = yes
;
; If you wish to remove callers from the queue if there are no agents present, set this to yes
; If you wish to remove callers from the queue when new callers cannot join, set this setting
; to one of the same choices for 'joinwhenempty'
;
; leavewhenempty = yes
;
;
; Asterisk can generate AgentCalled events when an agent is rung, if this is turned on
; (may generate a LOT of extra manager events)
;

View File

@@ -340,6 +340,8 @@ ${MONITOR_EXEC} Application to execute after monitoring a call
${MONITOR_EXEC_ARGS} Arguments to application
${MONITOR_FILENAME} File for monitoring (recording) calls in queue
${QUEUE_PRIO} Queue priority
${QUEUESTATUS} Status of the call, one of:
(TIMEOUT | FULL | JOINEMPTY | LEAVEEMPTY | JOINUNAVAIL | LEAVEUNAVAIL)
${RECORDED_FILE} * Recorded file in record()
${TALK_DETECED} * Result from talkdetect()
${TOUCH_MONITOR} The filename base to use with Touch Monitor (auto record)

View File

@@ -115,13 +115,13 @@ struct ast_channel_tech {
int (* const write)(struct ast_channel *chan, struct ast_frame *frame);
/*! Display or transmit text */
int (* const send_text)(struct ast_channel *chan, char *text);
int (* const send_text)(struct ast_channel *chan, const char *text);
/*! Display or send an image */
int (* const send_image)(struct ast_channel *chan, struct ast_frame *frame);
/*! Send HTML data */
int (* const send_html)(struct ast_channel *chan, int subclass, char *data, int len);
int (* const send_html)(struct ast_channel *chan, int subclass, const char *data, int len);
/*! Handle an exception, reading a frame */
struct ast_frame * (* const exception)(struct ast_channel *chan);
@@ -143,7 +143,7 @@ struct ast_channel_tech {
int (* const queryoption)(struct ast_channel *chan, int option, void *data, int *datalen);
/*! Blind transfer other side */
int (* const transfer)(struct ast_channel *chan, char *newdest);
int (* const transfer)(struct ast_channel *chan, const char *newdest);
/*! Write a frame, in standard format */
int (* const write_video)(struct ast_channel *chan, struct ast_frame *frame);
@@ -841,11 +841,11 @@ int ast_channel_supports_html(struct ast_channel *channel);
/*! Sends HTML on given channel */
/*! Send HTML or URL on link. Returns 0 on success or -1 on failure */
int ast_channel_sendhtml(struct ast_channel *channel, int subclass, char *data, int datalen);
int ast_channel_sendhtml(struct ast_channel *channel, int subclass, const char *data, int datalen);
/*! Sends a URL on a given link */
/*! Send URL on link. Returns 0 on success or -1 on failure */
int ast_channel_sendurl(struct ast_channel *channel, char *url);
int ast_channel_sendurl(struct ast_channel *channel, const char *url);
/*! Defers DTMF */
/*! Defer DTMF so that you only read things like hangups and audio. Returns

View File

@@ -35,7 +35,7 @@ extern void tdd_init(void);
* This function creates a stream of TDD data in ulaw format. It returns the size
* (in bytes) of the data (if it returns a size of 0, there is probably an error)
*/
extern int tdd_generate(struct tdd_state *tdd, unsigned char *buf, char *string);
extern int tdd_generate(struct tdd_state *tdd, unsigned char *buf, const char *string);
/*! Create a TDD state machine */
/*!

2
tdd.c
View File

@@ -233,7 +233,7 @@ static inline float tdd_getcarrier(float *cr, float *ci, int bit)
PUT_TDD_STOP; /* Stop bit */ \
} while(0);
int tdd_generate(struct tdd_state *tdd, unsigned char *buf, char *str)
int tdd_generate(struct tdd_state *tdd, unsigned char *buf, const char *str)
{
int bytes=0;
int i,x;