[asterisk-commits] may: branch may/ooh323_qsig r337962 - in /team/may/ooh323_qsig: ./ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 24 10:12:03 CDT 2011


Author: may
Date: Sat Sep 24 10:11:59 2011
New Revision: 337962

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=337962
Log:
Merged revisions 336571 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r336571 | rmudgett | 2011-09-19 19:36:39 +0400 (Mon, 19 Sep 2011) | 18 lines
  
  Merged revisions 336570 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/10
  
  ................
    r336570 | rmudgett | 2011-09-19 10:32:00 -0500 (Mon, 19 Sep 2011) | 11 lines
    
    Merged revisions 336569 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.8
    
    ........
      r336569 | rmudgett | 2011-09-19 10:25:34 -0500 (Mon, 19 Sep 2011) | 4 lines
      
      Rework sig_pri_hangup() to be simpler and clearer.
      
      JIRA AST-675
    ........
  ................
................

Modified:
    team/may/ooh323_qsig/   (props changed)
    team/may/ooh323_qsig/channels/sig_pri.c

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Sep 24 10:11:59 2011
@@ -1,1 +1,1 @@
-/trunk:1-336529,336600
+/trunk:1-336529,336571,336600

Modified: team/may/ooh323_qsig/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/channels/sig_pri.c?view=diff&rev=337962&r1=337961&r2=337962
==============================================================================
--- team/may/ooh323_qsig/channels/sig_pri.c (original)
+++ team/may/ooh323_qsig/channels/sig_pri.c Sat Sep 24 10:11:59 2011
@@ -7124,10 +7124,6 @@
 
 int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast)
 {
-#ifdef SUPPORT_USERUSER
-	const char *useruser = pbx_builtin_getvar_helper(ast, "USERUSERINFO");
-#endif
-
 	ast_debug(1, "%s %d\n", __FUNCTION__, p->channel);
 	if (!ast->tech_pvt) {
 		ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
@@ -7151,43 +7147,43 @@
 	p->exten[0] = '\0';
 	sig_pri_set_dialing(p, 0);
 
-	/* Make sure we have a call (or REALLY have a call in the case of a PRI) */
+	/* Make sure we really have a call */
 	pri_grab(p, p->pri);
 	sig_pri_moh_fsm_event(ast, p, SIG_PRI_MOH_EVENT_RESET);
 	if (p->call) {
+#if defined(SUPPORT_USERUSER)
+		const char *useruser = pbx_builtin_getvar_helper(ast, "USERUSERINFO");
+
+		if (!ast_strlen_zero(useruser)) {
+			pri_call_set_useruser(p->call, useruser);
+		}
+#endif	/* defined(SUPPORT_USERUSER) */
+
+#if defined(HAVE_PRI_AOC_EVENTS)
+		if (p->holding_aoce) {
+			pri_aoc_e_send(p->pri->pri, p->call, &p->aoc_e);
+		}
+#endif	/* defined(HAVE_PRI_AOC_EVENTS) */
+
 		if (p->alreadyhungup) {
 			ast_debug(1, "Already hungup...  Calling hangup once, and clearing call\n");
 
-#ifdef SUPPORT_USERUSER
-			pri_call_set_useruser(p->call, useruser);
-#endif
-
-#if defined(HAVE_PRI_AOC_EVENTS)
-			if (p->holding_aoce) {
-				pri_aoc_e_send(p->pri->pri, p->call, &p->aoc_e);
-			}
-#endif	/* defined(HAVE_PRI_AOC_EVENTS) */
 			pri_hangup(p->pri->pri, p->call, -1);
 			p->call = NULL;
 		} else {
 			const char *cause = pbx_builtin_getvar_helper(ast,"PRI_CAUSE");
 			int icause = ast->hangupcause ? ast->hangupcause : -1;
-			ast_debug(1, "Not yet hungup...  Calling hangup once with icause, and clearing call\n");
-
-#ifdef SUPPORT_USERUSER
-			pri_call_set_useruser(p->call, useruser);
-#endif
 
 			p->alreadyhungup = 1;
-			if (cause) {
-				if (atoi(cause))
+			if (!ast_strlen_zero(cause)) {
+				if (atoi(cause)) {
 					icause = atoi(cause);
+				}
 			}
-#if defined(HAVE_PRI_AOC_EVENTS)
-			if (p->holding_aoce) {
-				pri_aoc_e_send(p->pri->pri, p->call, &p->aoc_e);
-			}
-#endif	/* defined(HAVE_PRI_AOC_EVENTS) */
+			ast_debug(1,
+				"Not yet hungup...  Calling hangup with cause %d, and clearing call\n",
+				icause);
+
 			pri_hangup(p->pri->pri, p->call, icause);
 		}
 	}




More information about the asterisk-commits mailing list