[asterisk-commits] igorg: trunk r396378 - in /trunk: ./ channels/chan_unistim.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Aug 8 02:05:57 CDT 2013
Author: igorg
Date: Thu Aug 8 02:05:54 2013
New Revision: 396378
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396378
Log:
- Fix different issues with call transfer cancel. In case 3rd party busy or congestion call was not returned.
- Fix displaying soft button 'Redial' in case of no redial number exists
........
Merged revisions 396377 from http://svn.asterisk.org/svn/asterisk/branches/11
Modified:
trunk/ (props changed)
trunk/channels/chan_unistim.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Modified: trunk/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_unistim.c?view=diff&rev=396378&r1=396377&r2=396378
==============================================================================
--- trunk/channels/chan_unistim.c (original)
+++ trunk/channels/chan_unistim.c Thu Aug 8 02:05:54 2013
@@ -2871,7 +2871,11 @@
send_text(TEXT_LINE0, TEXT_NORMAL, pte, ustmtext("Enter the number to dial", pte));
send_text(TEXT_LINE1, TEXT_NORMAL, pte, ustmtext("and press Call", pte));
}
- send_text_status(pte, ustmtext("Call Redial BackSp Erase", pte));
+ if (ast_strlen_zero(pte->device->redial_number)) {
+ send_text_status(pte, ustmtext("Call BackSp Erase", pte));
+ } else {
+ send_text_status(pte, ustmtext("Call Redial BackSp Erase", pte));
+ }
}
pte->device->size_phone_number = 0;
@@ -3274,6 +3278,8 @@
static void key_call(struct unistimsession *pte, char keycode)
{
struct unistim_subchannel *sub = get_sub(pte->device, SUB_REAL);
+ struct unistim_subchannel *sub_3way = get_sub(pte->device, SUB_THREEWAY);
+
if ((keycode >= KEY_0) && (keycode <= KEY_SHARP)) {
if (keycode == KEY_SHARP) {
keycode = '#';
@@ -3288,22 +3294,21 @@
switch (keycode) {
case KEY_FUNC1:
if (ast_channel_state(sub->owner) == AST_STATE_UP) {
- if (get_sub(pte->device, SUB_THREEWAY)) {
+ if (sub_3way) {
close_call(pte);
}
}
break;
case KEY_FUNC2:
- if (ast_channel_state(sub->owner) == AST_STATE_RING) {
+ if (sub_3way) {
transfer_cancel_step2(pte);
- }
- if (ast_channel_state(sub->owner) == AST_STATE_UP) {
+ } else if (ast_channel_state(sub->owner) == AST_STATE_UP) {
transfer_call_step1(pte);
}
break;
case KEY_HANGUP:
case KEY_FUNC4:
- if (!get_sub(pte->device, SUB_THREEWAY)) {
+ if (!sub_3way) {
close_call(pte);
}
break;
@@ -3981,13 +3986,24 @@
send_text(TEXT_LINE1, TEXT_NORMAL, pte, pte->device->call_forward);
}
send_icon(TEXT_LINE0, FAV_ICON_REFLECT + FAV_BLINK_SLOW, pte);
- send_text_status(pte, ustmtext("Dial Redial NoFwd ", pte));
+ if (ast_strlen_zero(pte->device->redial_number)) {
+ send_text_status(pte, ustmtext("Dial NoFwd ", pte));
+ } else {
+ send_text_status(pte, ustmtext("Dial Redial NoFwd ", pte));
+ }
} else {
- if ((pte->device->extension == EXTENSION_ASK) ||
- (pte->device->extension == EXTENSION_TN)) {
- send_text_status(pte, ustmtext("Dial Redial Fwd Unregis", pte));
+ if ((pte->device->extension == EXTENSION_ASK) || (pte->device->extension == EXTENSION_TN)) {
+ if (ast_strlen_zero(pte->device->redial_number)) {
+ send_text_status(pte, ustmtext("Dial Fwd Unregis", pte));
+ } else {
+ send_text_status(pte, ustmtext("Dial Redial Fwd Unregis", pte));
+ }
} else {
- send_text_status(pte, ustmtext("Dial Redial Fwd Pickup", pte));
+ if (ast_strlen_zero(pte->device->redial_number)) {
+ send_text_status(pte, ustmtext("Dial Fwd Pickup", pte));
+ } else {
+ send_text_status(pte, ustmtext("Dial Redial Fwd Pickup", pte));
+ }
}
send_text(TEXT_LINE1, TEXT_NORMAL, pte, pte->device->maintext1);
if (pte->device->missed_call == 0) {
@@ -4773,8 +4789,8 @@
ast_verb(0, "unistim_hangup(%s) on %s@%s (STATE_%s)\n", ast_channel_name(ast), l->name, l->parent->name, ptestate_tostr(s->state));
}
sub_trans = get_sub(d, SUB_THREEWAY);
- if (sub_trans && (sub_trans->owner) && (sub->subtype == SUB_REAL) &&
- (sub->alreadygone == 0)) {
+ sub_real = get_sub(d, SUB_REAL);
+ if (sub_trans && (sub_trans->owner) && (sub->subtype == SUB_REAL)) { /* 3rd party busy or congested and transfer_cancel_step2 does not called */
if (unistimdebug) {
ast_verb(0, "Threeway call disconnected, switching to real call\n");
}
@@ -4782,16 +4798,13 @@
sub_trans->moh = 0;
sub_trans->subtype = SUB_REAL;
swap_subs(sub_trans, sub);
-
send_text_status(s, ustmtext(" Transf Hangup", s));
send_callerid_screen(s, sub_trans);
unistim_hangup_clean(ast, sub);
unistim_unalloc_sub(d, sub);
return 0;
}
- sub_real = get_sub(d, SUB_REAL);
- if (sub_real && (sub_real->owner) && (sub->subtype == SUB_THREEWAY) &&
- (sub->alreadygone == 0)) {
+ if (sub_real && (sub_real->owner) && (sub->subtype == SUB_THREEWAY)) { /* 3way call cancelled by softkey pressed */
if (unistimdebug) {
ast_verb(0, "Real call disconnected, stay in call\n");
}
More information about the asterisk-commits
mailing list