aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-31 01:59:02 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-31 01:59:02 +0000
commit3f22aa53af0a7bb3efb280a1adda11f00a7f68fc (patch)
tree95a924d57b906428b26d398758facf98b92bdcb2 /channels/chan_local.c
parent0fcb352fba60344329a582f891ddd4433f48c6fa (diff)
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: http://svn.digium.com/svn/asterisk/trunk@41507 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c27
1 files changed, 23 insertions, 4 deletions
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;
}