From c6977b9983db4f58446bfbc65a5b028cda8244ee Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Thu, 31 Aug 2006 01:59:02 +0000 Subject: Merge in VLDTMF support with Zaptel/Core done by the ever great Darumkilla Russell Bryant and the RTP portion done by myself, Muffinlicious Joshua Colp. This has gone through so many discussions/revisions it's not funny but we finally have it! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41507 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_local.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'channels/chan_local.c') diff --git a/channels/chan_local.c b/channels/chan_local.c index a9b0582f9..fec9c6273 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -67,7 +67,8 @@ static const char tdesc[] = "Local Proxy Channel Driver"; #define IS_OUTBOUND(a,b) (a == b->chan ? 1 : 0) static struct ast_channel *local_request(const char *type, int format, void *data, int *cause); -static int local_digit(struct ast_channel *ast, char digit); +static int local_digit_begin(struct ast_channel *ast, char digit); +static int local_digit_end(struct ast_channel *ast, char digit); static int local_call(struct ast_channel *ast, char *dest, int timeout); static int local_hangup(struct ast_channel *ast); static int local_answer(struct ast_channel *ast); @@ -85,7 +86,8 @@ static const struct ast_channel_tech local_tech = { .description = tdesc, .capabilities = -1, .requester = local_request, - .send_digit = local_digit, + .send_digit_begin = local_digit_begin, + .send_digit_end = local_digit_end, .call = local_call, .hangup = local_hangup, .answer = local_answer, @@ -327,11 +329,11 @@ static int local_indicate(struct ast_channel *ast, int condition, const void *da return res; } -static int local_digit(struct ast_channel *ast, char digit) +static int local_digit_begin(struct ast_channel *ast, char digit) { struct local_pvt *p = ast->tech_pvt; int res = -1; - struct ast_frame f = { AST_FRAME_DTMF, }; + struct ast_frame f = { AST_FRAME_DTMF_BEGIN, }; int isoutbound; ast_mutex_lock(&p->lock); @@ -339,6 +341,23 @@ static int local_digit(struct ast_channel *ast, char digit) f.subclass = digit; res = local_queue_frame(p, isoutbound, &f, ast); ast_mutex_unlock(&p->lock); + + return res; +} + +static int local_digit_end(struct ast_channel *ast, char digit) +{ + struct local_pvt *p = ast->tech_pvt; + int res = -1; + struct ast_frame f = { AST_FRAME_DTMF_END, }; + int isoutbound; + + ast_mutex_lock(&p->lock); + isoutbound = IS_OUTBOUND(ast, p); + f.subclass = digit; + res = local_queue_frame(p, isoutbound, &f, ast); + ast_mutex_unlock(&p->lock); + return res; } -- cgit v1.2.3