aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-19 00:08:43 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-19 00:08:43 +0000
commitdef55d969535d0222f2720ae1e452c813b7c1dcc (patch)
tree7f8db309185d7b963a18ce9c39517947870c5ba3 /apps/app_dial.c
parentd77ee3cf27ab92f07f21276e2a0dfdf23c482d51 (diff)
Remember when we started/stopped ringing so that ringing twice works as expected
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2462 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rwxr-xr-xapps/app_dial.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index eb5419bcf..35221aa93 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -139,6 +139,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
ast_moh_start(in, NULL);
} else if (outgoing->ringbackonly) {
ast_indicate(in, AST_CONTROL_RINGING);
+ sentringing++;
}
}
@@ -172,7 +173,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
/* if no one available we'd better stop MOH/ringing to */
if (moh) {
ast_moh_stop(in);
- } else if (ringind) {
+ } else if (sentringing) {
ast_indicate(in, -1);
}
return NULL;
@@ -281,7 +282,6 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
if (!sentringing && !moh) {
ast_indicate(in, AST_CONTROL_RINGING);
sentringing++;
- ringind++;
}
break;
case AST_CONTROL_PROGRESS:
@@ -293,9 +293,12 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
/* Ignore going off hook */
break;
case -1:
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "%s stopped sounds\n", o->chan->name);
- ast_indicate(in, -1);
+ if (!ringind && !moh) {
+ if (option_verbose > 2)
+ ast_verbose( VERBOSE_PREFIX_3 "%s stopped sounds\n", o->chan->name);
+ ast_indicate(in, -1);
+ sentringing = 0;
+ }
break;
default:
ast_log(LOG_DEBUG, "Dunno what to do with control type %d\n", f->subclass);
@@ -350,7 +353,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
}
if (moh) {
ast_moh_stop(in);
- } else if (ringind) {
+ } else if (sentringing) {
ast_indicate(in, -1);
}