[svn-commits] irroot: branch irroot/app_queue_skill r335674 - in /team/irroot/app_queue_ski...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Sep 13 14:21:56 CDT 2011


Author: irroot
Date: Tue Sep 13 14:21:43 2011
New Revision: 335674

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=335674
Log:
Merge with trunk and re enable automerge

Modified:
    team/irroot/app_queue_skill/   (props changed)
    team/irroot/app_queue_skill/CHANGES
    team/irroot/app_queue_skill/CREDITS
    team/irroot/app_queue_skill/UPGRADE.txt
    team/irroot/app_queue_skill/addons/chan_mobile.c
    team/irroot/app_queue_skill/addons/chan_ooh323.c
    team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.c
    team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.h
    team/irroot/app_queue_skill/addons/ooh323c/src/ooGkClient.c
    team/irroot/app_queue_skill/addons/ooh323c/src/oochannels.c
    team/irroot/app_queue_skill/addons/ooh323c/src/ooh323.c
    team/irroot/app_queue_skill/addons/ooh323c/src/ooq931.c
    team/irroot/app_queue_skill/apps/app_dial.c
    team/irroot/app_queue_skill/apps/app_queue.c
    team/irroot/app_queue_skill/apps/app_readexten.c
    team/irroot/app_queue_skill/apps/app_voicemail.c
    team/irroot/app_queue_skill/cdr/cdr_csv.c
    team/irroot/app_queue_skill/cel/cel_odbc.c   (props changed)
    team/irroot/app_queue_skill/channels/chan_agent.c
    team/irroot/app_queue_skill/channels/chan_alsa.c
    team/irroot/app_queue_skill/channels/chan_console.c
    team/irroot/app_queue_skill/channels/chan_dahdi.c
    team/irroot/app_queue_skill/channels/chan_h323.c
    team/irroot/app_queue_skill/channels/chan_iax2.c
    team/irroot/app_queue_skill/channels/chan_mgcp.c
    team/irroot/app_queue_skill/channels/chan_misdn.c
    team/irroot/app_queue_skill/channels/chan_oss.c
    team/irroot/app_queue_skill/channels/chan_sip.c
    team/irroot/app_queue_skill/channels/chan_skinny.c
    team/irroot/app_queue_skill/channels/chan_unistim.c
    team/irroot/app_queue_skill/channels/chan_usbradio.c
    team/irroot/app_queue_skill/channels/sig_pri.c
    team/irroot/app_queue_skill/channels/sig_ss7.c
    team/irroot/app_queue_skill/channels/sip/include/sip.h
    team/irroot/app_queue_skill/configs/cel_odbc.conf.sample   (props changed)
    team/irroot/app_queue_skill/configs/iax.conf.sample
    team/irroot/app_queue_skill/configs/sip.conf.sample
    team/irroot/app_queue_skill/contrib/realtime/mysql/iaxfriends.sql
    team/irroot/app_queue_skill/contrib/realtime/mysql/sipfriends.sql
    team/irroot/app_queue_skill/contrib/realtime/postgresql/realtime.sql
    team/irroot/app_queue_skill/funcs/func_dialplan.c
    team/irroot/app_queue_skill/funcs/func_frame_trace.c
    team/irroot/app_queue_skill/include/asterisk/channel.h
    team/irroot/app_queue_skill/include/asterisk/config.h
    team/irroot/app_queue_skill/include/asterisk/event.h
    team/irroot/app_queue_skill/include/asterisk/frame.h
    team/irroot/app_queue_skill/include/asterisk/indications.h
    team/irroot/app_queue_skill/main/cdr.c
    team/irroot/app_queue_skill/main/channel.c
    team/irroot/app_queue_skill/main/config.c
    team/irroot/app_queue_skill/main/dial.c
    team/irroot/app_queue_skill/main/dnsmgr.c
    team/irroot/app_queue_skill/main/event.c
    team/irroot/app_queue_skill/main/features.c
    team/irroot/app_queue_skill/main/frame.c
    team/irroot/app_queue_skill/main/logger.c
    team/irroot/app_queue_skill/main/pbx.c
    team/irroot/app_queue_skill/res/ais/evt.c
    team/irroot/app_queue_skill/res/res_config_odbc.c
    team/irroot/app_queue_skill/res/res_fax.c
    team/irroot/app_queue_skill/res/res_fax_spandsp.c
    team/irroot/app_queue_skill/res/res_jabber.c
    team/irroot/app_queue_skill/res/res_musiconhold.c
    team/irroot/app_queue_skill/sounds/Makefile   (props changed)

Propchange: team/irroot/app_queue_skill/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/irroot/app_queue_skill/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Propchange: team/irroot/app_queue_skill/
            ('svn:mergeinfo' removed)

Propchange: team/irroot/app_queue_skill/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Sep 13 14:21:43 2011
@@ -1,1 +1,1 @@
-/trunk:1-333439
+/trunk:1-335571

Modified: team/irroot/app_queue_skill/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/CHANGES?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/CHANGES (original)
+++ team/irroot/app_queue_skill/CHANGES Tue Sep 13 14:21:43 2011
@@ -23,6 +23,13 @@
 ------------------
  * Added a manager event "LocalBridge" for local channel call bridges between
    the two pseudo-channels created.
+
+Codec changes
+-------------
+ * Codec lists may now be modified by the '!' character, to allow succinct
+   specification of a list of codecs allowed and disallowed, without the
+   requirement to use two different keywords.  For example, to specify all
+   codecs except g729 and g723, one need only specify allow=all,!g729,!g723.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.8 to Asterisk 10 -------------------
@@ -40,6 +47,10 @@
    The MESSAGE() dialplan function and MessageSend() application have been
    added to go along with this functionality.  More detailed usage information
    can be found on the Asterisk wiki (http://wiki.asterisk.org/).
+ * If real-time text support (T.140) is negotiated, it will be preferred for
+   sending text via the SendText application. For example, via SIP, messages
+   that were once sent via the SIP MESSAGE request would be sent via RTP if
+   T.140 text is negotiated for a call.
 
 Parking
 -------
@@ -134,6 +145,7 @@
    for a given string to replace with another string as many times as the
    user specifies or just throughout the whole string.
  * Added option to CHANNEL(pickupgroup) allow reading and setting the pickupgroup of channel.
+ * Mark VALID_EXTEN() deprecated in favor of DIALPLAN_EXISTS()
 
 libpri channel driver (chan_dahdi) DAHDI changes
 --------------------------
@@ -231,6 +243,11 @@
 ----------------
  * Modules marked as deprecated are no longer marked as building by default. Enabling
    these modules is still available via menuselect.
+
+IAX2 Changes
+------------
+* authdebug is now disabled by default. To enable this functionaility again
+   set authdebug = yes in iax.conf.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.2 to Asterisk 1.8 ----------------
@@ -508,7 +525,7 @@
  * A new option, 'I' has been added to both app_queue and app_dial.
    By setting this option, Asterisk will not update the caller with
    connected line changes or redirecting party changes when they occur.
- * A 'relative-peroidic-announce' option has been added to queues.conf.  When
+ * A 'relative-periodic-announce' option has been added to queues.conf.  When
    enabled, this option will cause periodic announce times to be calculated
    from the end of announcements rather than from the beginning.
  * The autopause option in queues.conf can be passed a new value, "all." The

Modified: team/irroot/app_queue_skill/CREDITS
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/CREDITS?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/CREDITS (original)
+++ team/irroot/app_queue_skill/CREDITS Tue Sep 13 14:21:43 2011
@@ -22,6 +22,8 @@
 
 Omnitor AB, Gunnar Hellström, for funding work with videocaps, T.140 RED,
 originate with video/text and many more contributions.
+
+ClearIT AB for work with RTCP, manager and tonezones
 
 === WISHLIST CONTRIBUTERS ===
 Jeremy McNamara - SpeeX support

Modified: team/irroot/app_queue_skill/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/UPGRADE.txt?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/UPGRADE.txt (original)
+++ team/irroot/app_queue_skill/UPGRADE.txt Tue Sep 13 14:21:43 2011
@@ -26,6 +26,19 @@
  - ENUM query functions now return a count of -1 on lookup error to
    differentiate between a failed query and a successful query with 0 results
    matching the specified type.
+
+Configuration Files:
+ - Files listed below have been updated to be more consistent with how Asterisk
+   parses configuration files.  This makes configuration files more consistent
+   with what is expected across modules.
+
+   - cdr.conf: [general] and [csv] sections
+   - dnsmgr.conf
+
+SIP
+===
+ - A new option "tonezone" for setting default tonezone for the channel driver
+   or individual devices
 
 From 1.8 to 10:
 

Modified: team/irroot/app_queue_skill/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/addons/chan_mobile.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/addons/chan_mobile.c (original)
+++ team/irroot/app_queue_skill/addons/chan_mobile.c Tue Sep 13 14:21:43 2011
@@ -1318,21 +1318,10 @@
 
 static int mbl_ast_hangup(struct mbl_pvt *pvt)
 {
-	int res = 0;
-	for (;;) {
-		if (pvt->owner) {
-			if (ast_channel_trylock(pvt->owner)) {
-				DEADLOCK_AVOIDANCE(&pvt->lock);
-			} else {
-				res = ast_hangup(pvt->owner);
-				/* no need to unlock, ast_hangup() frees the
-				 * channel */
-				break;
-			}
-		} else
-			break;
-	}
-	return res;
+	if (pvt->owner) {
+		ast_hangup(pvt->owner);
+	}
+	return 0;
 }
 
 /*!

Modified: team/irroot/app_queue_skill/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/addons/chan_ooh323.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/addons/chan_ooh323.c (original)
+++ team/irroot/app_queue_skill/addons/chan_ooh323.c Tue Sep 13 14:21:43 2011
@@ -1243,21 +1243,24 @@
 	 
    	ast_mutex_lock(&p->lock);
 	switch (condition) {
+	case AST_CONTROL_INCOMPLETE:
+		/* While h323 does support overlapped dialing, this channel driver does not
+		 * at this time.  Treat a response of Incomplete as if it were congestion.
+		 */
 	case AST_CONTROL_CONGESTION:
 		if (!ast_test_flag(p, H323_ALREADYGONE)) {
-            		ooHangCall(callToken, OO_REASON_LOCAL_CONGESTED, 
-						AST_CAUSE_SWITCH_CONGESTION);
+			ooHangCall(callToken, OO_REASON_LOCAL_CONGESTED, AST_CAUSE_SWITCH_CONGESTION);
 			ast_set_flag(p, H323_ALREADYGONE);
 		}
 		break;
 	case AST_CONTROL_BUSY:
 		if (!ast_test_flag(p, H323_ALREADYGONE)) {
-            		ooHangCall(callToken, OO_REASON_LOCAL_BUSY, AST_CAUSE_USER_BUSY);
+			ooHangCall(callToken, OO_REASON_LOCAL_BUSY, AST_CAUSE_USER_BUSY);
 			ast_set_flag(p, H323_ALREADYGONE);
 		}
 		break;
 	case AST_CONTROL_HOLD:
-		ast_moh_start(ast, data, NULL);		
+		ast_moh_start(ast, data, NULL);
 		break;
 	case AST_CONTROL_UNHOLD:
 		ast_moh_stop(ast);

Modified: team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.c (original)
+++ team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.c Tue Sep 13 14:21:43 2011
@@ -63,6 +63,7 @@
    } 
    memset(call, 0, sizeof(OOH323CallData));
    ast_cond_init(&call->gkWait, NULL);
+   ast_mutex_init(&call->GkLock);
    ast_mutex_init(&call->Lock);
    call->pctxt = pctxt;
    call->msgctxt = msgctxt;

Modified: team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.h
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.h?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.h (original)
+++ team/irroot/app_queue_skill/addons/ooh323c/src/ooCalls.h Tue Sep 13 14:21:43 2011
@@ -151,6 +151,7 @@
    OOCTXT               *msgctxt;
    pthread_t		callThread;
    ast_cond_t		gkWait;
+   ast_mutex_t		GkLock;
    ast_mutex_t		Lock;
    OOBOOL 		Monitor;
    OOBOOL		fsSent;

Modified: team/irroot/app_queue_skill/addons/ooh323c/src/ooGkClient.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/addons/ooh323c/src/ooGkClient.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/addons/ooh323c/src/ooGkClient.c (original)
+++ team/irroot/app_queue_skill/addons/ooh323c/src/ooGkClient.c Tue Sep 13 14:21:43 2011
@@ -431,7 +431,7 @@
       if(iRet != OO_OK)
       {
          OOTRACEERR1("Error: Failed to handle received RAS message\n");
-         //pGkClient->state = GkClientFailed;
+         pGkClient->state = GkClientFailed;
       }
       memReset(pctxt);
    }
@@ -1921,6 +1921,8 @@
    OOTimer *pTimer = NULL;
    char ip[20];
 
+   ast_mutex_lock(&pGkClient->Lock);
+
    /* Search call in pending calls list */
    for(x=0 ; x<pGkClient->callsPendingList.count; x++)
    {
@@ -1931,6 +1933,9 @@
          OOTRACEDBGC3("Found Pending call(%s, %s)\n", 
                       pCallAdmInfo->call->callType, 
                       pCallAdmInfo->call->callToken);
+
+         ast_mutex_lock(&pCallAdmInfo->call->GkLock);
+
          /* Populate Remote IP */
          if(pAdmissionConfirm->destCallSignalAddress.t != 
                                       T_H225TransportAddress_ipAddress)
@@ -1939,6 +1944,9 @@
                         "Gatekeeper is not an IPv4 address\n");
             OOTRACEINFO1("Ignoring ACF, will wait for timeout and retransmit "
                          "ARQ\n");
+            ast_mutex_unlock(&pCallAdmInfo->call->GkLock);
+            ast_mutex_unlock(&pGkClient->Lock);
+            ast_cond_signal(&pCallAdmInfo->call->gkWait);
             return OO_FAILED;
          }
          ipAddress = pAdmissionConfirm->destCallSignalAddress.u.ipAddress;
@@ -2000,15 +2008,15 @@
                        pCallAdmInfo->call->callToken);
 
 	 pCallAdmInfo->call->callState = OO_CALL_CONNECTING;
-         /* ooH323CallAdmitted( pCallAdmInfo->call); */
 
          dListRemove(&pGkClient->callsPendingList, pNode);
          dListAppend(&pGkClient->ctxt, &pGkClient->callsAdmittedList, 
                                                         pNode->data);
          memFreePtr(&pGkClient->ctxt, pNode);
+         ast_mutex_unlock(&pCallAdmInfo->call->GkLock);
+	 ast_mutex_unlock(&pGkClient->Lock);
 	 ast_cond_signal(&pCallAdmInfo->call->gkWait);
          return OO_OK;
-         break;
       }
       else
       {
@@ -2017,6 +2025,7 @@
    }
    OOTRACEERR1("Error: Failed to process ACF as there is no corresponding "
                "pending call\n");
+   ast_mutex_unlock(&pGkClient->Lock);
    return OO_OK;
 }
 
@@ -2029,6 +2038,8 @@
    DListNode *pNode=NULL, *pNode1=NULL;
    OOH323CallData *call=NULL;
    OOTimer *pTimer = NULL;
+
+   ast_mutex_lock(&pGkClient->Lock);
 
    /* Search call in pending calls list */
    for(x=0 ; x<pGkClient->callsPendingList.count; x++)
@@ -2046,6 +2057,7 @@
       OOTRACEWARN2("Received admission reject with request number %d can not"
                    " be matched with any pending call.\n", 
                    pAdmissionReject->requestSeqNum);
+      ast_mutex_unlock(&pGkClient->Lock);
       return OO_OK;
    }
    else{
@@ -2054,6 +2066,7 @@
       memFreePtr(&pGkClient->ctxt, pCallAdmInfo);
       memFreePtr(&pGkClient->ctxt, pNode);
    }
+   ast_mutex_lock(&pCallAdmInfo->call->GkLock);
 
    /* Delete ARQ timer */
    for(y=0; y<pGkClient->timerList.count; y++)
@@ -2118,6 +2131,8 @@
          break;
    }
 
+   ast_mutex_unlock(&pCallAdmInfo->call->GkLock);
+   ast_mutex_unlock(&pGkClient->Lock);
    ast_cond_signal(&pCallAdmInfo->call->gkWait);
    return OO_OK;   
 }

Modified: team/irroot/app_queue_skill/addons/ooh323c/src/oochannels.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/addons/ooh323c/src/oochannels.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/addons/ooh323c/src/oochannels.c (original)
+++ team/irroot/app_queue_skill/addons/ooh323c/src/oochannels.c Tue Sep 13 14:21:43 2011
@@ -960,6 +960,7 @@
    ast_mutex_lock(&call->Lock);
    ast_mutex_unlock(&call->Lock);
    ast_mutex_destroy(&call->Lock);
+   ast_mutex_destroy(&call->GkLock);
    ast_cond_destroy(&call->gkWait);
    pctxt = call->pctxt;
    freeContext(pctxt);

Modified: team/irroot/app_queue_skill/addons/ooh323c/src/ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/addons/ooh323c/src/ooh323.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/addons/ooh323c/src/ooh323.c (original)
+++ team/irroot/app_queue_skill/addons/ooh323c/src/ooh323.c Tue Sep 13 14:21:43 2011
@@ -371,7 +371,7 @@
    H225TransportAddress_ip6Address_ip *ip6 = NULL;
    Q931InformationElement* pDisplayIE=NULL;
    OOAliases *pAlias=NULL;
-   char remoteIP[2+8*4+7];
+   char remoteIP[2+8*4+7] = "";
 
    call->callReference = q931Msg->callReference;
  
@@ -529,6 +529,7 @@
      OOTRACEERR5("ERROR: Security denial remote sig IP isn't a socket ip, %s not %s "
 		     "(%s, %s)\n", remoteIP, call->remoteIP, call->callType, 
 		     call->callToken);
+     return OO_FAILED;
    }
    
    /* check for fast start */
@@ -1638,12 +1639,15 @@
       case Q931SetupMsg: /* SETUP message is received */
          OOTRACEINFO3("Received SETUP message (%s, %s)\n", call->callType,
                        call->callToken);
-         ooOnReceivedSetup(call, q931Msg);
-
+         ret = ooOnReceivedSetup(call, q931Msg);
+         if (ret != OO_OK) {
+           call->callState = OO_CALL_CLEAR;
+         } else {
+           
          /* H225 message callback */
-         if(gH323ep.h225Callbacks.onReceivedSetup)
-            ret = gH323ep.h225Callbacks.onReceivedSetup(call, q931Msg);
-
+            if(gH323ep.h225Callbacks.onReceivedSetup)
+               ret = gH323ep.h225Callbacks.onReceivedSetup(call, q931Msg);
+         }
          /* Free up the mem used by the received message, as it's processing 
             is done. 
          */
@@ -1661,23 +1665,24 @@
             if(gH323ep.gkClient->state == GkClientRegistered)
             {
                call->callState = OO_CALL_WAITING_ADMISSION;
-	       ast_mutex_lock(&call->Lock);
                ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call, 
                                                     FALSE);
-				tv = ast_tvnow();
+		tv = ast_tvnow();
                 ts.tv_sec = tv.tv_sec + 24;
-				ts.tv_nsec = tv.tv_usec * 1000;
-                ast_cond_timedwait(&call->gkWait, &call->Lock, &ts);
+		ts.tv_nsec = tv.tv_usec * 1000;
+	        ast_mutex_lock(&call->GkLock);
+		if (call->callState == OO_CALL_WAITING_ADMISSION)
+                   ast_cond_timedwait(&call->gkWait, &call->GkLock, &ts);
                 if (call->callState == OO_CALL_WAITING_ADMISSION)
 			call->callState = OO_CALL_CLEAR;
-                ast_mutex_unlock(&call->Lock);
+                ast_mutex_unlock(&call->GkLock);
 
             }
             else {
-               /* TODO: Should send Release complete with reject reason */
                OOTRACEERR1("Error:Ignoring incoming call as not yet"
                            "registered with Gk\n");
 	       call->callState = OO_CALL_CLEAR;
+               call->callEndReason = OO_REASON_GK_UNREACHABLE;
             }
          }
 	 if (call->callState < OO_CALL_CLEAR) {

Modified: team/irroot/app_queue_skill/addons/ooh323c/src/ooq931.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/addons/ooh323c/src/ooq931.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/addons/ooh323c/src/ooq931.c (original)
+++ team/irroot/app_queue_skill/addons/ooh323c/src/ooq931.c Tue Sep 13 14:21:43 2011
@@ -2266,19 +2266,24 @@
 
    if(gH323ep.gkClient && !OO_TESTFLAG(call->flags, OO_M_DISABLEGK))
    {
-     /* No need to check registration status here as it is already checked for
-        MakeCall command */
-
-     call->callState = OO_CALL_WAITING_ADMISSION;
-     ast_mutex_lock(&call->Lock);
-     ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call, FALSE);
-	 tv = ast_tvnow();
-     ts.tv_sec = tv.tv_sec + 24;
-	 ts.tv_nsec = tv.tv_usec * 1000;
-     ast_cond_timedwait(&call->gkWait, &call->Lock, &ts);
-     if (call->callState == OO_CALL_WAITING_ADMISSION)
+     if(gH323ep.gkClient->state == GkClientRegistered) {
+       call->callState = OO_CALL_WAITING_ADMISSION;
+       ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call, FALSE);
+       tv = ast_tvnow();
+       ts.tv_sec = tv.tv_sec + 24;
+       ts.tv_nsec = tv.tv_usec * 1000;
+       ast_mutex_lock(&call->GkLock);
+       if (call->callState == OO_CALL_WAITING_ADMISSION)
+          ast_cond_timedwait(&call->gkWait, &call->GkLock, &ts);
+       if (call->callState == OO_CALL_WAITING_ADMISSION)
 		call->callState = OO_CALL_CLEAR;
-     ast_mutex_unlock(&call->Lock);
+       ast_mutex_unlock(&call->GkLock);
+     } else {
+       OOTRACEERR1("Error:Aborting outgoing call as not yet"
+                   "registered with Gk\n");
+       call->callState = OO_CALL_CLEAR;
+       call->callEndReason = OO_REASON_GK_UNREACHABLE;
+     }
 
    }
 

Modified: team/irroot/app_queue_skill/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/apps/app_dial.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/apps/app_dial.c (original)
+++ team/irroot/app_queue_skill/apps/app_dial.c Tue Sep 13 14:21:43 2011
@@ -1351,7 +1351,7 @@
 				case AST_FRAME_VOICE:
 				case AST_FRAME_IMAGE:
 				case AST_FRAME_TEXT:
-					if (ast_write(in, f)) {
+					if (!ast_test_flag64(outgoing, OPT_RINGBACK | OPT_MUSICBACK) && ast_write(in, f)) {
 						ast_log(LOG_WARNING, "Unable to write frametype: %d\n",
 							f->frametype);
 					}
@@ -2423,14 +2423,6 @@
 		} else { /* Nobody answered, next please? */
 			res = 0;
 		}
-
-		/* SIP, in particular, sends back this error code to indicate an
-		 * overlap dialled number needs more digits. */
-		if (chan->hangupcause == AST_CAUSE_INVALID_NUMBER_FORMAT) {
-			res = AST_PBX_INCOMPLETE;
-		}
-
-		/* almost done, although the 'else' block is 400 lines */
 	} else {
 		const char *number;
 

Modified: team/irroot/app_queue_skill/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/apps/app_queue.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/apps/app_queue.c (original)
+++ team/irroot/app_queue_skill/apps/app_queue.c Tue Sep 13 14:21:43 2011
@@ -4439,7 +4439,7 @@
 	return 0;
 }
 
-/*! \brief Playback announcement to queued members if peroid has elapsed */
+/*! \brief Playback announcement to queued members if period has elapsed */
 static int say_periodic_announcement(struct queue_ent *qe, int ringing)
 {
 	int res = 0;

Modified: team/irroot/app_queue_skill/apps/app_readexten.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/apps/app_readexten.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/apps/app_readexten.c (original)
+++ team/irroot/app_queue_skill/apps/app_readexten.c Tue Sep 13 14:21:43 2011
@@ -96,24 +96,6 @@
 			</variablelist>
 		</description>
 	</application>
-	<function name="VALID_EXTEN" language="en_US">
-		<synopsis>
-			Determine whether an extension exists or not.
-		</synopsis>
-		<syntax>
-			<parameter name="context">
-				<para>Defaults to the current context</para>
-			</parameter>
-			<parameter name="extension" required="true" />
-			<parameter name="priority">
-				<para>Priority defaults to <literal>1</literal>.</para>
-			</parameter>
-		</syntax>
-		<description>
-			<para>Returns a true value if the indicated <replaceable>context</replaceable>,
-			<replaceable>extension</replaceable>, and <replaceable>priority</replaceable> exist.</para>
-		</description>
-	</function>
  ***/
 
 enum readexten_option_flags {
@@ -280,57 +262,15 @@
 	return status[0] == 'H' ? -1 : 0;
 }
 
-static int acf_isexten_exec(struct ast_channel *chan, const char *cmd, char *parse, char *buffer, size_t buflen)
-{
-	int priority_int;
-	AST_DECLARE_APP_ARGS(args,
-		AST_APP_ARG(context);
-		AST_APP_ARG(extension);
-		AST_APP_ARG(priority);
-	);
-
-	AST_STANDARD_APP_ARGS(args, parse);
-
-	if (ast_strlen_zero(args.context))
-		args.context = chan->context;
-
-	if (ast_strlen_zero(args.extension)) {
-		ast_log(LOG_WARNING, "Syntax: VALID_EXTEN([<context>],<extension>[,<priority>]) - missing argument <extension>!\n");
-		return -1;
-	}
-
-	if (ast_strlen_zero(args.priority))
-		priority_int = 1;
-	else
-		priority_int = atoi(args.priority);
-
-	if (ast_exists_extension(chan, args.context, args.extension, priority_int,
-		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
-	    ast_copy_string(buffer, "1", buflen);
-	} else {
-	    ast_copy_string(buffer, "0", buflen);
-	}
-
-	return 0;
-}
-
-static struct ast_custom_function acf_isexten = {
-	.name = "VALID_EXTEN",
-	.read = acf_isexten_exec,
-};
-
 static int unload_module(void)
 {
 	int res = ast_unregister_application(app);
-	res |= ast_custom_function_unregister(&acf_isexten);
-
-	return res;	
+	return res;
 }
 
 static int load_module(void)
 {
 	int res = ast_register_application_xml(app, readexten_exec);
-	res |= ast_custom_function_register(&acf_isexten);
 	return res;
 }
 

Modified: team/irroot/app_queue_skill/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/apps/app_voicemail.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/apps/app_voicemail.c (original)
+++ team/irroot/app_queue_skill/apps/app_voicemail.c Tue Sep 13 14:21:43 2011
@@ -3483,7 +3483,7 @@
 	struct odbc_obj *obj;
 	obj = ast_odbc_request_obj(odbc_database, 0);
 	if (obj) {
-		snprintf(sql, sizeof(sql), "SELECT msgnum FROM %s WHERE dir=? order by msgnum desc limit 1", odbc_table);
+		snprintf(sql, sizeof(sql), "SELECT msgnum FROM %s WHERE dir=? order by msgnum desc", odbc_table);
 
 		stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
 		if (!stmt) {
@@ -10108,7 +10108,7 @@
 		}
 #endif
 
-	ast_test_suite_event_notify("INTRO", "playing intro menu");
+	ast_test_suite_event_notify("INTRO", "Message: playing intro menu");
 	if (play_auto) {
 		cmd = '1';
 	} else {

Modified: team/irroot/app_queue_skill/cdr/cdr_csv.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/cdr/cdr_csv.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/cdr/cdr_csv.c (original)
+++ team/irroot/app_queue_skill/cdr/cdr_csv.c Tue Sep 13 14:21:43 2011
@@ -50,7 +50,7 @@
 #define DATE_FORMAT "%Y-%m-%d %T"
 
 static int usegmtime = 0;
-static int accountlogs;
+static int accountlogs = 1;
 static int loguniqueid = 0;
 static int loguserfield = 0;
 static int loaded = 0;
@@ -95,52 +95,38 @@
 static int load_config(int reload)
 {
 	struct ast_config *cfg;
-	struct ast_variable *var;
-	const char *tmp;
+	struct ast_variable *v;
 	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
 
 	if (!(cfg = ast_config_load(config, config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) {
 		ast_log(LOG_WARNING, "unable to load config: %s\n", config);
 		return 0;
-	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
 		return 1;
+	}
 
 	accountlogs = 1;
 	usegmtime = 0;
 	loguniqueid = 0;
 	loguserfield = 0;
 
-	if (!(var = ast_variable_browse(cfg, "csv"))) {
+	if (!(v = ast_variable_browse(cfg, "csv"))) {
 		ast_config_destroy(cfg);
 		return 0;
 	}
 
-	if ((tmp = ast_variable_retrieve(cfg, "csv", "usegmtime"))) {
-		usegmtime = ast_true(tmp);
-		if (usegmtime)
-			ast_debug(1, "logging time in GMT\n");
-	}
-
-	/* Turn on/off separate files per accountcode. Default is on (as before) */
-	if ((tmp = ast_variable_retrieve(cfg, "csv", "accountlogs"))) {
- 		accountlogs = ast_true(tmp);
- 		if (accountlogs) {
-			ast_debug(1, "logging in separate files per accountcode\n");
- 		}
- 	}
-
-	if ((tmp = ast_variable_retrieve(cfg, "csv", "loguniqueid"))) {
-		loguniqueid = ast_true(tmp);
-		if (loguniqueid)
-			ast_debug(1, "logging CDR field UNIQUEID\n");
-	}
-
-	if ((tmp = ast_variable_retrieve(cfg, "csv", "loguserfield"))) {
-		loguserfield = ast_true(tmp);
-		if (loguserfield)
-			ast_debug(1, "logging CDR user-defined field\n");
-	}
-
+	for (; v; v = v->next) {
+		if (!strcasecmp(v->name, "usegmtime")) {
+			usegmtime = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "accountlogs")) {
+			/* Turn on/off separate files per accountcode. Default is on (as before) */
+			accountlogs = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "loguniqueid")) {
+			loguniqueid = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "loguserfield")) {
+			loguserfield = ast_true(v->value);
+		}
+	}
 	ast_config_destroy(cfg);
 	return 1;
 }
@@ -337,8 +323,9 @@
 {
 	int res;
 
-	if(!load_config(0))
+	if (!load_config(0)) {
 		return AST_MODULE_LOAD_DECLINE;
+	}
 
 	if ((res = ast_cdr_register(name, ast_module_info->description, csv_log))) {
 		ast_log(LOG_ERROR, "Unable to register CSV CDR handling\n");

Propchange: team/irroot/app_queue_skill/cel/cel_odbc.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 13 14:21:43 2011
@@ -1,2 +1,2 @@
 /be/branches/C.3/cel/cel_adaptive_odbc.c:256426
-/trunk/cel/cel_odbc.c:322065-333565
+/trunk/cel/cel_odbc.c:322065-335571

Modified: team/irroot/app_queue_skill/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/channels/chan_agent.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/channels/chan_agent.c (original)
+++ team/irroot/app_queue_skill/channels/chan_agent.c Tue Sep 13 14:21:43 2011
@@ -1301,10 +1301,8 @@
 				ast_setstate(parent, AST_STATE_UP);
 				ast_setstate(chan, AST_STATE_UP);
 				ast_copy_string(parent->context, chan->context, sizeof(parent->context));
-				/* Go ahead and mark the channel as a zombie so that masquerade will
-				   destroy it for us, and we need not call ast_hangup */
-				ast_set_flag(chan, AST_FLAG_ZOMBIE);
 				ast_channel_masquerade(parent, chan);
+				ast_hangup(chan);
 				p->abouttograb = 0;
 			} else {
 				ast_debug(1, "Sneaky, parent disappeared in the mean time...\n");

Modified: team/irroot/app_queue_skill/channels/chan_alsa.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/channels/chan_alsa.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/channels/chan_alsa.c (original)
+++ team/irroot/app_queue_skill/channels/chan_alsa.c Tue Sep 13 14:21:43 2011
@@ -536,6 +536,7 @@
 	case AST_CONTROL_BUSY:
 	case AST_CONTROL_CONGESTION:
 	case AST_CONTROL_RINGING:
+	case AST_CONTROL_INCOMPLETE:
 	case -1:
 		res = -1;  /* Ask for inband indications */
 		break;

Modified: team/irroot/app_queue_skill/channels/chan_console.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/channels/chan_console.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/channels/chan_console.c (original)
+++ team/irroot/app_queue_skill/channels/chan_console.c Tue Sep 13 14:21:43 2011
@@ -602,6 +602,7 @@
 	case AST_CONTROL_BUSY:
 	case AST_CONTROL_CONGESTION:
 	case AST_CONTROL_RINGING:
+	case AST_CONTROL_INCOMPLETE:
 	case -1:
 		res = -1;  /* Ask for inband indications */
 		break;

Modified: team/irroot/app_queue_skill/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/channels/chan_dahdi.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/channels/chan_dahdi.c (original)
+++ team/irroot/app_queue_skill/channels/chan_dahdi.c Tue Sep 13 14:21:43 2011
@@ -9398,13 +9398,18 @@
 				ast_setstate(chan, AST_STATE_RINGING);
 			}
 			break;
+		case AST_CONTROL_INCOMPLETE:
+			ast_debug(1, "Received AST_CONTROL_INCOMPLETE on %s\n", chan->name);
+			/* act as a progress or proceeding, allowing the caller to enter additional numbers */
+			res = 0;
+			break;
 		case AST_CONTROL_PROCEEDING:
-			ast_debug(1,"Received AST_CONTROL_PROCEEDING on %s\n",chan->name);
+			ast_debug(1, "Received AST_CONTROL_PROCEEDING on %s\n", chan->name);
 			/* don't continue in ast_indicate */
 			res = 0;
 			break;
 		case AST_CONTROL_PROGRESS:
-			ast_debug(1,"Received AST_CONTROL_PROGRESS on %s\n",chan->name);
+			ast_debug(1, "Received AST_CONTROL_PROGRESS on %s\n", chan->name);
 			/* don't continue in ast_indicate */
 			res = 0;
 			break;
@@ -18216,23 +18221,56 @@
 	int trunkgroup;
 	int dchannels[SIG_PRI_NUM_DCHANS];
 #endif
+	int have_cfg_now;
+	static int had_cfg_before = 1;/* So initial load will complain if we don't have cfg. */
 
 	cfg = ast_config_load(config, config_flags);
-
-	/* Error if we have no config file */
+	have_cfg_now = !!cfg;
 	if (!cfg) {
-		ast_log(LOG_ERROR, "Unable to load config %s\n", config);
-		return 0;
+		/* Error if we have no config file */
+		if (had_cfg_before) {
+			ast_log(LOG_ERROR, "Unable to load config %s\n", config);
+			ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
+		}
+		cfg = ast_config_new();/* Dummy config */
+		if (!cfg) {
+			return 0;
+		}
+		ucfg = ast_config_load("users.conf", config_flags);
+		if (ucfg == CONFIG_STATUS_FILEUNCHANGED) {
+			ast_config_destroy(cfg);
+			return 0;
+		}
+		if (ucfg == CONFIG_STATUS_FILEINVALID) {
+			ast_log(LOG_ERROR, "File users.conf cannot be parsed.  Aborting.\n");
+			ast_config_destroy(cfg);
+			return 0;
+		}
 	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
 		ucfg = ast_config_load("users.conf", config_flags);
 		if (ucfg == CONFIG_STATUS_FILEUNCHANGED) {
 			return 0;
-		} else if (ucfg == CONFIG_STATUS_FILEINVALID) {
+		}
+		if (ucfg == CONFIG_STATUS_FILEINVALID) {
 			ast_log(LOG_ERROR, "File users.conf cannot be parsed.  Aborting.\n");
 			return 0;
 		}
 		ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
-		if ((cfg = ast_config_load(config, config_flags)) == CONFIG_STATUS_FILEINVALID) {
+		cfg = ast_config_load(config, config_flags);
+		have_cfg_now = !!cfg;
+		if (!cfg) {
+			if (had_cfg_before) {
+				/* We should have been able to load the config. */
+				ast_log(LOG_ERROR, "Bad. Unable to load config %s\n", config);
+				ast_config_destroy(ucfg);
+				return 0;
+			}
+			cfg = ast_config_new();/* Dummy config */
+			if (!cfg) {
+				ast_config_destroy(ucfg);
+				return 0;
+			}
+		} else if (cfg == CONFIG_STATUS_FILEINVALID) {
 			ast_log(LOG_ERROR, "File %s cannot be parsed.  Aborting.\n", config);
 			ast_config_destroy(ucfg);
 			return 0;
@@ -18242,12 +18280,14 @@
 		return 0;
 	} else {
 		ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
-		if ((ucfg = ast_config_load("users.conf", config_flags)) == CONFIG_STATUS_FILEINVALID) {
+		ucfg = ast_config_load("users.conf", config_flags);
+		if (ucfg == CONFIG_STATUS_FILEINVALID) {
 			ast_log(LOG_ERROR, "File users.conf cannot be parsed.  Aborting.\n");
 			ast_config_destroy(cfg);
 			return 0;
 		}
 	}
+	had_cfg_before = have_cfg_now;
 
 	/* It's a little silly to lock it, but we might as well just to be sure */
 	ast_mutex_lock(&iflock);

Modified: team/irroot/app_queue_skill/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/channels/chan_h323.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/channels/chan_h323.c (original)
+++ team/irroot/app_queue_skill/channels/chan_h323.c Tue Sep 13 14:21:43 2011
@@ -910,6 +910,10 @@
 			res = 0;
 		}
 		break;
+	case AST_CONTROL_INCOMPLETE:
+		/* While h323 does support overlapped dialing, this channel driver does not
+		 * at this time.  Treat a response of Incomplete as if it were congestion.
+		 */
 	case AST_CONTROL_CONGESTION:
 		if (c->_state != AST_STATE_UP) {
 			h323_answering_call(token, 1);

Modified: team/irroot/app_queue_skill/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/app_queue_skill/channels/chan_iax2.c?view=diff&rev=335674&r1=335673&r2=335674
==============================================================================
--- team/irroot/app_queue_skill/channels/chan_iax2.c (original)
+++ team/irroot/app_queue_skill/channels/chan_iax2.c Tue Sep 13 14:21:43 2011
@@ -287,7 +287,7 @@
 static int trunkfreq = 20;
 static int trunkmaxsize = MAX_TRUNKDATA;
 
-static int authdebug = 1;
+static int authdebug = 0;
 static int autokill = 0;
 static int iaxcompat = 0;
 static int last_authmethod = 0;
@@ -8513,12 +8513,15 @@
 	struct sockaddr_in reg_addr;
 
 	memset(&us, 0, sizeof(us));
-	if (ies->apparent_addr)
+	if (ies->apparent_addr) {
 		memmove(&us, ies->apparent_addr, sizeof(us));
-	if (ies->username)
+	}
+	if (ies->username) {
 		ast_copy_string(peer, ies->username, sizeof(peer));
-	if (ies->refresh)
+	}
+	if (ies->refresh) {
 		refresh = ies->refresh;
+	}
 	if (ies->calling_number) {
 		/* We don't do anything with it really, but maybe we should */
 	}
@@ -8535,24 +8538,26 @@
 		return -1;
 	}
 	memcpy(&reg->us, &us, sizeof(reg->us));
-	if (ies->msgcount >= 0)
+	if (ies->msgcount >= 0) {
 		reg->messages = ies->msgcount & 0xffff;		/* only low 16 bits are used in the transmission of the IE */
+	}
 	/* always refresh the registration at the interval requested by the server
 	   we are registering to
 	*/
 	reg->refresh = refresh;
-	reg->expire = iax2_sched_replace(reg->expire, sched, 
+	reg->expire = iax2_sched_replace(reg->expire, sched,
 		(5 * reg->refresh / 6) * 1000, iax2_do_register_s, reg);
 	if (inaddrcmp(&oldus, &reg->us) || (reg->messages != oldmsgs)) {
-			if (reg->messages > 255)
-				snprintf(msgstatus, sizeof(msgstatus), " with %d new and %d old messages waiting", reg->messages & 0xff, reg->messages >> 8);
-			else if (reg->messages > 1)
-				snprintf(msgstatus, sizeof(msgstatus), " with %d new messages waiting\n", reg->messages);
-			else if (reg->messages > 0)
-				ast_copy_string(msgstatus, " with 1 new message waiting\n", sizeof(msgstatus));
-			else
-				ast_copy_string(msgstatus, " with no messages waiting\n", sizeof(msgstatus));
-			snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(reg->us.sin_addr), ntohs(reg->us.sin_port));
+		if (reg->messages > 255) {

[... 3251 lines stripped ...]



More information about the svn-commits mailing list