[asterisk-commits] igorg: branch 12 r409762 - in /branches/12: ./ channels/chan_unistim.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 5 00:30:27 CST 2014


Author: igorg
Date: Wed Mar  5 00:30:25 2014
New Revision: 409762

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=409762
Log:
Correct RTP handling in chan_unistim and fix transfer process broken in previous fix:
- Fixed too early RTP setup with phone, that cause no ringback tone on caller side
- Handle call transfer cancel only in STATE_CALL case (related to ASTERISK-23073)

(Reported by: Németh Tamás, niurkin sil)
........

Merged revisions 409761 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/12/   (props changed)
    branches/12/channels/chan_unistim.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_unistim.c?view=diff&rev=409762&r1=409761&r2=409762
==============================================================================
--- branches/12/channels/chan_unistim.c (original)
+++ branches/12/channels/chan_unistim.c Wed Mar  5 00:30:25 2014
@@ -3169,6 +3169,11 @@
 		ast_verb(0, "Handle Call Incoming for %s@%s\n", sub->parent->name,
 					s->device->name);
 	}
+	start_rtp(sub);
+	if (!sub->rtp) {
+		ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", sub->parent->name, s->device->name);
+		return;
+	}
 	if (sub->owner) {
 		ast_queue_control(sub->owner, AST_CONTROL_ANSWER);
 	}
@@ -4404,7 +4409,7 @@
 	}
 	if (memcmp(buf + SIZE_HEADER, packet_recv_pick_up, sizeof(packet_recv_pick_up)) == 0) {
 		if (unistimdebug) {
-			ast_verb(0, "Handset off hook\n");
+			ast_verb(0, "Handset off hook, current state: %s\n", ptestate_tostr(pte->state));
 		}
 		if (!pte->device) {	       /* We are not yet registered (asking for a TN in AUTOPROVISIONING_TN) */
 			return;
@@ -4430,7 +4435,7 @@
 	}
 	if (memcmp(buf + SIZE_HEADER, packet_recv_hangup, sizeof(packet_recv_hangup)) == 0) {
 		if (unistimdebug) {
-			ast_verb(0, "Handset on hook\n");
+			ast_verb(0, "Handset on hook, current state: %s\n", ptestate_tostr(pte->state));
 		}
 		if (!pte->device) {
 			return;
@@ -4805,7 +4810,7 @@
 		unistim_unalloc_sub(d, sub);
 		return 0;
 	}
-	if (sub_real && (sub_real->owner) && (sub->subtype == SUB_THREEWAY)) { /* 3way call cancelled by softkey pressed */
+	if (sub_real && (sub_real->owner) && (sub->subtype == SUB_THREEWAY) && (s->state == STATE_CALL)) { /* 3way call cancelled by softkey pressed */
 		if (unistimdebug) {
 			ast_verb(0, "Real call disconnected, stay in call\n");
 		}
@@ -4893,9 +4898,6 @@
 	l = sub->parent;
 	d = l->parent;
 
-	if ((!sub->rtp) && (!get_sub(d, SUB_THREEWAY))) {
-		start_rtp(sub);
-	}
 	if (unistimdebug) {
 		ast_verb(0, "unistim_answer(%s) on %s@%s-%d\n", ast_channel_name(ast), l->name,
 					l->parent->name, sub->softkey);
@@ -5224,7 +5226,9 @@
 	case AST_CONTROL_UPDATE_RTP_PEER:
 		break;
 	case AST_CONTROL_SRCCHANGE:
-		ast_rtp_instance_change_source(sub->rtp);
+		if (sub->rtp) {
+			ast_rtp_instance_change_source(sub->rtp);
+		}
 		break;
 	default:
 		ast_log(LOG_WARNING, "Don't know how to indicate condition %d\n", ind);
@@ -5836,14 +5840,7 @@
 	if (unistimdebug) {
 		ast_verb(0, "unistim_request owner = %p\n", sub->owner);
 	}
-	start_rtp(sub);
-	if (!sub->rtp) {
-		ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", sub->parent->name, d->name);
-                                    return NULL;
-	}
-
 	restart_monitor();
-
 	/* and finish */
 	return tmpc;
 }




More information about the asterisk-commits mailing list