aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-16 13:35:44 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-16 13:35:44 +0000
commit4e2960819ad733e4113779c148bd12cfc261a312 (patch)
tree896555baaa9bfecc19177b5773ace97b5092f7dc /main/channel.c
parentbfa699873067bdb5da1d13e475fc8882946b03ec (diff)
Adding Realtime Text support (T.140) to Asterisk
T.140/RFC 2793 is a live communication channel, originally created for IP based text phones for hearing impaired. Feels very much like the old Unix talk application. This code is developed and disclaimed by John Martin of Aupix, UK. Tested for interoperability by myself and Omnitor in Sweden, the company that wrote most of the specifications. A big thank you to everyone involved in this. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@54838 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/main/channel.c b/main/channel.c
index 94e21d082..0405a7ab5 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2569,8 +2569,13 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
CHECK_BLOCKING(chan);
break;
case AST_FRAME_TEXT:
- res = (chan->tech->send_text == NULL) ? 0 :
- chan->tech->send_text(chan, (char *) fr->data);
+ if (fr->subclass == AST_FORMAT_T140) {
+ res = (chan->tech->write_text == NULL) ? 0 :
+ chan->tech->write_text(chan, fr);
+ } else {
+ res = (chan->tech->send_text == NULL) ? 0 :
+ chan->tech->send_text(chan, (char *) fr->data);
+ }
break;
case AST_FRAME_HTML:
res = (chan->tech->send_html == NULL) ? 0 :
@@ -2898,6 +2903,7 @@ struct ast_channel *ast_request(const char *type, int format, void *data, int *c
int res;
int foo;
int videoformat = format & AST_FORMAT_VIDEO_MASK;
+ int textformat = format & AST_FORMAT_TEXT_MASK;
if (!cause)
cause = &foo;
@@ -2924,7 +2930,7 @@ struct ast_channel *ast_request(const char *type, int format, void *data, int *c
if (!chan->tech->requester)
return NULL;
- if (!(c = chan->tech->requester(type, capabilities | videoformat, data, cause)))
+ if (!(c = chan->tech->requester(type, capabilities | videoformat | textformat, data, cause)))
return NULL;
/* no need to generate a Newchannel event here; it is done in the channel_alloc call */