[asterisk-commits] may: trunk r321529 - in /trunk: ./ addons/ addons/ooh323c/src/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 1 05:45:18 CDT 2011


Author: may
Date: Wed Jun  1 05:45:12 2011
New Revision: 321529

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321529
Log:
Merged revisions 321528 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r321528 | may | 2011-06-01 14:40:19 +0400 (Wed, 01 Jun 2011) | 14 lines
  
  Fix double alerting, add forced alerting before answer
  
  Fix double alerting (it wasn't fixed here by issue #18542)
  Add forced alerting before connect (if it wasn't before)
  Try to send all packets from outgoing queue rather than one only
  Call goes into clearing state when disconnect command is received
  
  (closes issue #19361)
  Reported by: vmikhelson
  Patches: 
        issue19361-3.patch uploaded by may213 (license 454)
  Tested by: vmikhelson
........

Modified:
    trunk/   (props changed)
    trunk/addons/chan_ooh323.c
    trunk/addons/ooh323c/src/oochannels.c
    trunk/addons/ooh323c/src/ooh245.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.c?view=diff&rev=321529&r1=321528&r2=321529
==============================================================================
--- trunk/addons/chan_ooh323.c (original)
+++ trunk/addons/chan_ooh323.c Wed Jun  1 05:45:12 2011
@@ -1044,6 +1044,7 @@
 static int ooh323_answer(struct ast_channel *ast)
 {
 	struct ooh323_pvt *p = ast->tech_pvt;
+	char *callToken = (char *)NULL;
 
 	if (gH323Debug)
 		ast_verbose("--- ooh323_answer\n");
@@ -1051,8 +1052,18 @@
 	if (p) {
 
 		ast_mutex_lock(&p->lock);
+		callToken = (p->callToken ? strdup(p->callToken) : NULL);
 		if (ast->_state != AST_STATE_UP) {
 			ast_channel_lock(ast);
+			if (!p->alertsent) {
+	    			if (gH323Debug) {
+					ast_debug(1, "Sending forced ringback for %s, res = %d\n", 
+						callToken, ooManualRingback(callToken));
+				} else {
+	    				ooManualRingback(callToken);
+				}
+				p->alertsent = 1;
+			}
 			ast_setstate(ast, AST_STATE_UP);
       			if (option_debug)
 				ast_debug(1, "ooh323_answer(%s)\n", ast->name);
@@ -1220,6 +1231,7 @@
 				}
 				p->alertsent = 1;
 			}
+			p->alertsent = 1;
 		}
 	 break;
 	case AST_CONTROL_SRCUPDATE:

Modified: trunk/addons/ooh323c/src/oochannels.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/oochannels.c?view=diff&rev=321529&r1=321528&r2=321529
==============================================================================
--- trunk/addons/ooh323c/src/oochannels.c (original)
+++ trunk/addons/ooh323c/src/oochannels.c Wed Jun  1 05:45:12 2011
@@ -682,10 +682,11 @@
 
     if (0 != call->pH245Channel && 0 != call->pH245Channel->sock)
     {
-     if(call->pH245Channel->outQueue.count>0)
-     {                           
-      if(ooPDWrite(pfds, nfds, call->pH245Channel->sock))
-       ooSendMsg(call, OOH245MSG);
+     if(ooPDWrite(pfds, nfds, call->pH245Channel->sock)) {
+      while (call->pH245Channel->outQueue.count>0) {
+       if (ooSendMsg(call, OOH245MSG) != OO_OK)
+	break;
+      }
      }
     }
     else if(call->h245listener)
@@ -702,20 +703,23 @@
     {
      if(ooPDWrite(pfds, nfds, call->pH225Channel->sock))
      {
-      if(call->pH225Channel->outQueue.count>0)
+      while (call->pH225Channel->outQueue.count>0)
       {
        OOTRACEDBGC3("Sending H225 message (%s, %s)\n", 
                         call->callType, call->callToken);
-       ooSendMsg(call, OOQ931MSG);
+       if (ooSendMsg(call, OOQ931MSG) != OO_OK)
+	break;
       }
       if(call->pH245Channel && 
          call->pH245Channel->outQueue.count>0 && 
-        OO_TESTFLAG (call->flags, OO_M_TUNNELING))
-      {
+        OO_TESTFLAG (call->flags, OO_M_TUNNELING)) {
+       while (call->pH245Channel->outQueue.count>0) {
         OOTRACEDBGC3("H245 message needs to be tunneled. "
                           "(%s, %s)\n", call->callType, 
                                call->callToken);
-        ooSendMsg(call, OOH245MSG);
+        if (ooSendMsg(call, OOH245MSG) != OO_OK)
+	 break;
+       }
       }
      }                                
     }
@@ -1330,7 +1334,7 @@
    {
       OOTRACEDBGA3("Warning:Call marked for cleanup. Can not send message."
                    "(%s, %s)\n", call->callType, call->callToken);
-      return OO_OK;
+      return OO_FAILED;
    }
 
    if(type == OOQ931MSG)

Modified: trunk/addons/ooh323c/src/ooh245.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323c/src/ooh245.c?view=diff&rev=321529&r1=321528&r2=321529
==============================================================================
--- trunk/addons/ooh323c/src/ooh245.c (original)
+++ trunk/addons/ooh323c/src/ooh245.c Wed Jun  1 05:45:12 2011
@@ -2126,6 +2126,8 @@
                ooClearAllLogicalChannels(call);
             }
             ooSendEndSessionCommand(call);
+	    if (call->callState < OO_CALL_CLEAR)
+	        call->callState = OO_CALL_CLEAR;
          }
             
             




More information about the asterisk-commits mailing list