[asterisk-commits] mjordan: branch 1.8 r379825 - /branches/1.8/apps/app_meetme.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 22 08:43:09 CST 2013


Author: mjordan
Date: Tue Jan 22 08:43:05 2013
New Revision: 379825

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379825
Log:
Fix station ringback; trunk hangup issues in SLA

This patch fixes two bugs:
 * If an outbound call is made from a SLA phone using SLAStation, then there is
   no ringtone audible to the phone that originates the call. The indication of
   the ringing was not being passed to the SLA station; this patch fixes that
   by passing through the progress indications.
 * If an SLA station hangs up before the called party answers, then the channel
   to the called party continues to ring until a timeout occurs. If the called
   party manages to answer, Asterisk attempts to connect the called party to
   a non-existant MeetMe room. This patch corrects the behavior by abandoning
   the call attempt if it detects that the SLA station is no longer in use
   while attempting to call the called party.

Review: https://reviewboard.asterisk.org/r/2275/

(closes issue ASTERISK-20462)
Reported by: dkerr
patches:
  asterisk-11-bugid20440+20462.patch uploaded by dkerr (license 5558)
  asterisk-11-bugid20462.patch uploaded by dkerr (license 5558)

(closes issue ASTERISK-20440)
Reported by: dkerr
patches:
  asterisk-11-bugid20440.patch uploaded by dkerr (license 5558)
  asterisk-11-bugid20440+20462.patch uploaded by dkerr (license 5558)


Modified:
    branches/1.8/apps/app_meetme.c

Modified: branches/1.8/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_meetme.c?view=diff&rev=379825&r1=379824&r2=379825
==============================================================================
--- branches/1.8/apps/app_meetme.c (original)
+++ branches/1.8/apps/app_meetme.c Tue Jan 22 08:43:05 2013
@@ -6136,6 +6136,8 @@
 	struct sla_trunk_ref *trunk_ref = args->trunk_ref;
 	int caller_is_saved;
 	struct ast_party_caller caller;
+	int last_state = 0;
+	int current_state = 0;
 
 	if (!(dial = ast_dial_create())) {
 		ast_mutex_lock(args->cond_lock);
@@ -6189,14 +6191,35 @@
 		case AST_DIAL_RESULT_TIMEOUT:
 		case AST_DIAL_RESULT_UNANSWERED:
 			done = 1;
+			break;
 		case AST_DIAL_RESULT_TRYING:
+			current_state = AST_CONTROL_PROGRESS;
+			break;
 		case AST_DIAL_RESULT_RINGING:
 		case AST_DIAL_RESULT_PROGRESS:
 		case AST_DIAL_RESULT_PROCEEDING:
+			current_state = AST_CONTROL_RINGING;
 			break;
 		}
 		if (done)
 			break;
+
+		/* check that SLA station that originated trunk call is still alive */
+		if (args->station && ast_device_state(args->station->device) == AST_DEVICE_NOT_INUSE) {
+			ast_debug(3, "Originating station device %s no longer active\n", args->station->device);
+			trunk_ref->trunk->chan = NULL;
+			break;
+		}
+
+		/* If trunk line state changed, send indication back to originating SLA Station channel */
+		if (current_state != last_state) {
+			ast_debug(3, "Indicating State Change %d to channel %s\n", current_state, trunk_ref->chan->name);
+			ast_indicate(trunk_ref->chan, current_state);
+			last_state = current_state;
+		}
+
+		/* avoid tight loop... sleep for 1/10th second */
+		ast_safe_sleep(trunk_ref->chan, 100);
 	}
 
 	if (!trunk_ref->trunk->chan) {




More information about the asterisk-commits mailing list