diff options
author | Igor Goncharovskiy <igor.goncharovsky@gmail.com> | 2013-06-11 10:24:04 +0000 |
---|---|---|
committer | Igor Goncharovskiy <igor.goncharovsky@gmail.com> | 2013-06-11 10:24:04 +0000 |
commit | 2053fc31594d4069cb178e591ab2b4e0df08b268 (patch) | |
tree | e78e29d132feb776fc2a0584deac40c237d7f666 | |
parent | b0143074fa690b09bd8cad7f59dc870ecc57eb86 (diff) |
Fix issue with no sound in both way in case of previous call to chan_unistim phone was canceled.
(related to ASTERISK-20183)
........
Merged revisions 391379 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_unistim.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c index 28d332f62..fbc6adda2 100644 --- a/channels/chan_unistim.c +++ b/channels/chan_unistim.c @@ -4792,7 +4792,7 @@ static int unistim_hangup(struct ast_channel *ast) struct unistim_line *l; struct unistim_device *d; struct unistimsession *s; - int i; + int i,end_call = 1; s = channel_to_session(ast); sub = ast_channel_tech_pvt(ast); @@ -4835,10 +4835,8 @@ static int unistim_hangup(struct ast_channel *ast) unistim_unalloc_sub(d, sub); return 0; } - if (sub->subtype == SUB_REAL) { sub_stop_silence(s, sub); - send_end_call(s); /* Send end call packet only if ending active call, in other way sound should be loosed */ } else if (sub->subtype == SUB_RING) { send_no_ring(s); for (i = 0; i < FAVNUM; i++) { @@ -4849,9 +4847,17 @@ static int unistim_hangup(struct ast_channel *ast) if (is_key_line(d, i) && !strcmp(l->name, d->sline[i]->name)) { send_favorite_short(i, FAV_LINE_ICON, s); d->ssub[i] = NULL; + continue; + } + if (d->ssub[i] != NULL) { /* Found other subchannel active other then hangup'ed one */ + ast_log(LOG_WARNING, "There is not only one call here %p %p %i\n",d->ssub[i], sub, i); + end_call = 0; } } } + if (end_call) { + send_end_call(s); /* Send end call packet only if ending active call, in other way sound should be loosed */ + } sub->moh = 0; if (sub->softkey >= 0) { send_favorite_short(sub->softkey, FAV_LINE_ICON, s); @@ -6141,7 +6147,7 @@ static int parse_bookmark(const char *text, struct unistim_device *d) return 0; } if (d->softkeyicon[p] != 0) { - ast_log(LOG_WARNING, "Invalid position %d for bookmark : already used\n:", p); + ast_log(LOG_WARNING, "Invalid position %d for bookmark : already used:\n", p); return 0; } memmove(line, line + 2, sizeof(line) - 2); |