projects
/
lcr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added detection of tone_zone_sound structure name. Thanx to Janis for this
[lcr.git]
/
chan_lcr.c
diff --git
a/chan_lcr.c
b/chan_lcr.c
index
2921b83
..
9c62447
100644
(file)
--- a/
chan_lcr.c
+++ b/
chan_lcr.c
@@
-884,7
+884,7
@@
static void lcr_in_setup(struct chan_call *call, int message_type, union paramet
if (param->setup.callerinfo.name[0])
ast->cid.cid_name = strdup(param->setup.callerinfo.name);
if (param->setup.redirinfo.id[0])
if (param->setup.callerinfo.name[0])
ast->cid.cid_name = strdup(param->setup.callerinfo.name);
if (param->setup.redirinfo.id[0])
- ast->cid.cid_
name = strdup(numberrize_callerinfo(param->setup.callerinfo.id, param->setup.calle
rinfo.ntype, options.national, options.international));
+ ast->cid.cid_
rdnis = strdup(numberrize_callerinfo(param->setup.redirinfo.id, param->setup.redi
rinfo.ntype, options.national, options.international));
switch (param->setup.callerinfo.present) {
case INFO_PRESENT_ALLOWED:
ast->cid.cid_pres = AST_PRES_ALLOWED;
switch (param->setup.callerinfo.present) {
case INFO_PRESENT_ALLOWED:
ast->cid.cid_pres = AST_PRES_ALLOWED;
@@
-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;
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;
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;
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:
}
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;
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:
}
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;
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:
}
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");
break;
case -1:
CDEBUG(call, ast, "Received indicate -1.\n");
+ ast_playtones_stop(ast);
res = -1;
break;
res = -1;
break;
@@
-2367,6
+2378,10
@@
static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz
break;
}
break;
}
+ if (ts && ts->data[0]) {
+ ast_playtones_start(ast, 0, ts->data, 1);
+ }
+
/* return */
ast_mutex_unlock(&chan_lock);
return res;
/* return */
ast_mutex_unlock(&chan_lock);
return res;