diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-11-01 02:04:05 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-11-01 02:04:05 +0000 |
commit | c1fa5359a3584c2cd000c8f129907bd102615fbb (patch) | |
tree | b8ccc17cc53b0590846f5fba458fba6c562f478b /apps/app_talkdetect.c | |
parent | 563b2abe0aeb1c4eba3f5e77427581c97eeefff4 (diff) |
Add TALK_DETECTED variable (bug #2628)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4139 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_talkdetect.c')
-rwxr-xr-x | apps/app_talkdetect.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c index 5d15d94d8..3fd682eb2 100755 --- a/apps/app_talkdetect.c +++ b/apps/app_talkdetect.c @@ -145,7 +145,13 @@ static int background_detect_exec(struct ast_channel *chan, void *data) if (ms < 0) ms = 0; if ((ms > min) && ((max < 0) || (ms < max))) { + char ms_str[10]; ast_log(LOG_DEBUG, "Found qualified token of %d ms\n", ms); + + /* Save detected talk time (in milliseconds) */ + sprintf(ms_str, "%d", ms ); + pbx_builtin_setvar_helper(chan, "TALK_DETECTED", ms_str); + if (ast_exists_extension(chan, chan->context, "talk", 1, chan->cid.cid_num)) { strncpy(chan->exten, "talk", sizeof(chan->exten) -1 ); chan->priority = 0; |