summaryrefslogtreecommitdiffstats
path: root/chan_lcr.c
diff options
context:
space:
mode:
authorAndreas Eversberg2010-05-28 08:36:00 +0200
committerAndreas Eversberg2010-05-28 08:36:00 +0200
commit6d4a65705a4462cf553d8d2755b0677c86200fb6 (patch)
tree1437b80f47999d0c5292bb9a1a3577477a4b088b /chan_lcr.c
parentFix for redirection number. Thanx to Dennis for this bugfix. (diff)
downloadlcr-6d4a65705a4462cf553d8d2755b0677c86200fb6.tar.gz
lcr-6d4a65705a4462cf553d8d2755b0677c86200fb6.tar.xz
lcr-6d4a65705a4462cf553d8d2755b0677c86200fb6.zip
Added patch to play ringing tone when connected but the call is forwarded
and ringing again. Thanx to Jacek for this patch.
Diffstat (limited to 'chan_lcr.c')
-rw-r--r--chan_lcr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/chan_lcr.c b/chan_lcr.c
index ca6b026..9c62447 100644
--- a/chan_lcr.c
+++ b/chan_lcr.c
@@ -2247,6 +2247,7 @@ static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz
union parameter newparam;
int res = 0;
struct chan_call *call;
+ const struct tone_zone_sound *ts = NULL;
ast_mutex_lock(&chan_lock);
call = ast->tech_pvt;
@@ -2268,6 +2269,9 @@ static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz
send_message(MESSAGE_DISCONNECT, call->ref, &newparam);
/* change state */
call->state = CHAN_LCR_STATE_OUT_DISCONNECT;
+ } else {
+ CDEBUG(call, ast, "Using Asterisk 'busy' indication\n");
+ ts = ast_get_indication_tone(ast->zone, "busy");
}
break;
case AST_CONTROL_CONGESTION:
@@ -2280,6 +2284,9 @@ static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz
send_message(MESSAGE_DISCONNECT, call->ref, &newparam);
/* change state */
call->state = CHAN_LCR_STATE_OUT_DISCONNECT;
+ } else {
+ CDEBUG(call, ast, "Using Asterisk 'congestion' indication\n");
+ ts = ast_get_indication_tone(ast->zone, "congestion");
}
break;
case AST_CONTROL_PROCEEDING:
@@ -2304,6 +2311,9 @@ static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz
send_message(MESSAGE_ALERTING, call->ref, &newparam);
/* change state */
call->state = CHAN_LCR_STATE_IN_ALERTING;
+ } else {
+ CDEBUG(call, ast, "Using Asterisk 'ring' indication\n");
+ ts = ast_get_indication_tone(ast->zone, "ring");
}
break;
case AST_CONTROL_PROGRESS:
@@ -2318,6 +2328,7 @@ static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz
break;
case -1:
CDEBUG(call, ast, "Received indicate -1.\n");
+ ast_playtones_stop(ast);
res = -1;
break;
@@ -2367,6 +2378,10 @@ static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz
break;
}
+ if (ts && ts->data[0]) {
+ ast_playtones_start(ast, 0, ts->data, 1);
+ }
+
/* return */
ast_mutex_unlock(&chan_lock);
return res;