From: Mark Spencer Date: Mon, 1 Nov 2004 02:04:05 +0000 (+0000) Subject: Add TALK_DETECTED variable (bug #2628) X-Git-Tag: 1.2.0-beta1~1910 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37b375c21a7a57c7cb3bf1defcf19a7a65ee620b;p=thirdparty%2Fasterisk.git Add TALK_DETECTED variable (bug #2628) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4139 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c index 5d15d94d8a..3fd682eb20 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; diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 71e29c42d7..be35003ee9 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2638,7 +2638,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) p->novideo = 1; while ((m = get_sdp_iterate(&iterator, req, "m"))[0] != '\0') { if ((sscanf(m, "audio %d RTP/AVP %n", &x, &len) == 1) || - (sscanf(m, "audio %d/%d RTP/AVP %n", &x, &y, &len) == 1)) { + (sscanf(m, "audio %d/%d RTP/AVP %n", &x, &y, &len) == 2)) { portno = x; /* Scan through the RTP payload types specified in a "m=" line: */ ast_rtp_pt_clear(p->rtp);