diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-19 08:20:01 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-19 08:20:01 +0000 |
commit | 7f88b5234e02bb5c571cf5a36ebc39b2a8c73210 (patch) | |
tree | 675adf5ba6d1fe7e3e98d643bd4b4282eadd47c6 | |
parent | 37e912b541b4b6529812ed8a75b897660e681852 (diff) |
Adding send_text capability to chan_local
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@28520 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_local.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index 4854f49b3..17fc36ae6 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -76,6 +76,7 @@ static int local_write(struct ast_channel *ast, struct ast_frame *f); static int local_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen); static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan); static int local_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen); +static int local_sendtext(struct ast_channel *ast, const char *text); static int local_devicestate(void *data); /* PBX interface structure for channel registration */ @@ -95,6 +96,7 @@ static const struct ast_channel_tech local_tech = { .indicate = local_indicate, .fixup = local_fixup, .send_html = local_sendhtml, + .send_text = local_sendtext, .devicestate = local_devicestate, }; @@ -319,6 +321,22 @@ static int local_digit(struct ast_channel *ast, char digit) return res; } +static int local_sendtext(struct ast_channel *ast, const char *text) +{ + struct local_pvt *p = ast->tech_pvt; + int res = -1; + struct ast_frame f = { AST_FRAME_TEXT, }; + int isoutbound; + + ast_mutex_lock(&p->lock); + isoutbound = IS_OUTBOUND(ast, p); + f.data = (char *) text; + f.datalen = strlen(text) + 1; + res = local_queue_frame(p, isoutbound, &f, ast); + ast_mutex_unlock(&p->lock); + return res; +} + static int local_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen) { struct local_pvt *p = ast->tech_pvt; |