[svn-commits] schmidts: branch schmidts/unleash-the-beast r348786 - in /team/schmidts/unlea...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Dec 21 09:15:03 CST 2011


Author: schmidts
Date: Wed Dec 21 09:14:45 2011
New Revision: 348786

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=348786
Log:
reinitialise automerge


Modified:
    team/schmidts/unleash-the-beast/   (props changed)
    team/schmidts/unleash-the-beast/CHANGES
    team/schmidts/unleash-the-beast/UPGRADE.txt
    team/schmidts/unleash-the-beast/addons/chan_ooh323.c
    team/schmidts/unleash-the-beast/addons/ooh323c/src/oochannels.c
    team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh245.c
    team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh323.c
    team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.c
    team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.h
    team/schmidts/unleash-the-beast/addons/ooh323c/src/ootypes.h
    team/schmidts/unleash-the-beast/apps/app_authenticate.c
    team/schmidts/unleash-the-beast/apps/app_confbridge.c
    team/schmidts/unleash-the-beast/apps/app_followme.c
    team/schmidts/unleash-the-beast/apps/app_meetme.c
    team/schmidts/unleash-the-beast/apps/app_parkandannounce.c
    team/schmidts/unleash-the-beast/apps/app_queue.c
    team/schmidts/unleash-the-beast/apps/app_voicemail.c
    team/schmidts/unleash-the-beast/bridges/bridge_builtin_features.c
    team/schmidts/unleash-the-beast/channels/chan_dahdi.c
    team/schmidts/unleash-the-beast/channels/chan_gtalk.c
    team/schmidts/unleash-the-beast/channels/chan_h323.c
    team/schmidts/unleash-the-beast/channels/chan_iax2.c
    team/schmidts/unleash-the-beast/channels/chan_jingle.c
    team/schmidts/unleash-the-beast/channels/chan_misdn.c
    team/schmidts/unleash-the-beast/channels/chan_sip.c
    team/schmidts/unleash-the-beast/channels/chan_skinny.c
    team/schmidts/unleash-the-beast/channels/sig_analog.c
    team/schmidts/unleash-the-beast/channels/sig_analog.h
    team/schmidts/unleash-the-beast/channels/sig_pri.c
    team/schmidts/unleash-the-beast/channels/sip/include/reqresp_parser.h
    team/schmidts/unleash-the-beast/channels/sip/include/sip.h
    team/schmidts/unleash-the-beast/channels/sip/reqresp_parser.c
    team/schmidts/unleash-the-beast/configs/features.conf.sample
    team/schmidts/unleash-the-beast/configs/queues.conf.sample
    team/schmidts/unleash-the-beast/configs/res_stun_monitor.conf.sample
    team/schmidts/unleash-the-beast/configs/sip.conf.sample
    team/schmidts/unleash-the-beast/configure
    team/schmidts/unleash-the-beast/configure.ac
    team/schmidts/unleash-the-beast/formats/format_wav.c
    team/schmidts/unleash-the-beast/funcs/func_cdr.c
    team/schmidts/unleash-the-beast/include/asterisk/acl.h
    team/schmidts/unleash-the-beast/include/asterisk/cdr.h
    team/schmidts/unleash-the-beast/include/asterisk/dnsmgr.h
    team/schmidts/unleash-the-beast/include/asterisk/jabber.h
    team/schmidts/unleash-the-beast/include/asterisk/logger.h
    team/schmidts/unleash-the-beast/include/asterisk/stringfields.h
    team/schmidts/unleash-the-beast/include/asterisk/strings.h
    team/schmidts/unleash-the-beast/include/asterisk/stun.h
    team/schmidts/unleash-the-beast/include/asterisk/tcptls.h
    team/schmidts/unleash-the-beast/include/asterisk/utils.h
    team/schmidts/unleash-the-beast/main/acl.c
    team/schmidts/unleash-the-beast/main/channel.c
    team/schmidts/unleash-the-beast/main/cli.c
    team/schmidts/unleash-the-beast/main/db.c
    team/schmidts/unleash-the-beast/main/dnsmgr.c
    team/schmidts/unleash-the-beast/main/features.c
    team/schmidts/unleash-the-beast/main/file.c
    team/schmidts/unleash-the-beast/main/manager.c
    team/schmidts/unleash-the-beast/main/pbx.c
    team/schmidts/unleash-the-beast/main/stun.c
    team/schmidts/unleash-the-beast/main/tcptls.c
    team/schmidts/unleash-the-beast/main/utils.c
    team/schmidts/unleash-the-beast/pbx/pbx_config.c
    team/schmidts/unleash-the-beast/res/res_agi.c
    team/schmidts/unleash-the-beast/res/res_fax.c
    team/schmidts/unleash-the-beast/res/res_jabber.c
    team/schmidts/unleash-the-beast/res/res_jabber.exports.in
    team/schmidts/unleash-the-beast/res/res_monitor.c
    team/schmidts/unleash-the-beast/res/res_musiconhold.c
    team/schmidts/unleash-the-beast/res/res_srtp.c
    team/schmidts/unleash-the-beast/res/res_stun_monitor.c
    team/schmidts/unleash-the-beast/tests/test_netsock2.c

Propchange: team/schmidts/unleash-the-beast/
------------------------------------------------------------------------------
Binary property 'branch-1.6.2-merged' - no diff available.

Propchange: team/schmidts/unleash-the-beast/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Dec 21 09:14:45 2011
@@ -1,1 +1,1 @@
-/branches/1.8:1-343793
+/branches/1.8:1-348785

Modified: team/schmidts/unleash-the-beast/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/CHANGES?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/CHANGES (original)
+++ team/schmidts/unleash-the-beast/CHANGES Wed Dec 21 09:14:45 2011
@@ -7,6 +7,18 @@
 === and the other UPGRADE files for older releases.
 ===
 ======================================================================
+
+------------------------------------------------------------------------------
+--- Functionality changes since Asterisk 1.8.7.1 -----------------------------
+------------------------------------------------------------------------------
+
+SIP Changes
+-----------
+    * Due to potential username discovery vulnerabilities, the 'nat' setting in sip.conf
+      now defaults to force_rport. It is very important that phones requiring nat=no be
+      specifically set as such instead of relying on the default setting. If at all
+      possible, all devices should have nat settings configured in the general section as
+      opposed to configuring nat per-device.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.2 to Asterisk 1.8 ----------------

Modified: team/schmidts/unleash-the-beast/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/UPGRADE.txt?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/UPGRADE.txt (original)
+++ team/schmidts/unleash-the-beast/UPGRADE.txt Wed Dec 21 09:14:45 2011
@@ -162,6 +162,10 @@
 * The 'sipusers' realtime table has been removed completely. Use the 'sippeers'
   table with type 'user' for user type objects.
 
+* The sip.conf allowoverlap option now accepts 'dtmf' as a value.  If you
+  are using the early media DTMF overlap dialing method you now need to set
+  allowoverlap=dtmf.
+
 From 1.6.1 to 1.6.2:
 
 * SIP no longer sends the 183 progress message for early media by

Modified: team/schmidts/unleash-the-beast/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/addons/chan_ooh323.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/addons/chan_ooh323.c (original)
+++ team/schmidts/unleash-the-beast/addons/chan_ooh323.c Wed Dec 21 09:14:45 2011
@@ -4286,7 +4286,7 @@
 		f = &null_frame;
 	}
 
-	if (p->owner) {
+	if (f && p->owner) {
 		/* We already hold the channel lock */
 		if (f->frametype == AST_FRAME_VOICE && !p->faxmode) {
 			if (f->subclass.codec != p->owner->nativeformats) {

Modified: team/schmidts/unleash-the-beast/addons/ooh323c/src/oochannels.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/addons/ooh323c/src/oochannels.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/addons/ooh323c/src/oochannels.c (original)
+++ team/schmidts/unleash-the-beast/addons/ooh323c/src/oochannels.c Wed Dec 21 09:14:45 2011
@@ -1576,6 +1576,10 @@
       /* if(gH323ep.h323Callbacks.onAlerting && call->callState < OO_CALL_CLEAR)
          gH323ep.h323Callbacks.onAlerting(call); */
       break;
+   case OOStatus:
+      OOTRACEINFO3("Sent Message - Status (%s, %s) \n", call->callType,
+                    call->callToken);
+      break;
    case OOConnect:
       OOTRACEINFO3("Sent Message - Connect (%s, %s)\n", call->callType,
                     call->callToken);

Modified: team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh245.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh245.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh245.c (original)
+++ team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh245.c Wed Dec 21 09:14:45 2011
@@ -16,6 +16,7 @@
 #include "asterisk.h"
 #include "asterisk/lock.h"
 #include "ooh245.h"
+#include "ooq931.h"
 #include "ooCalls.h"
 #include "printHandler.h"
 #include "ooh323ep.h"
@@ -957,6 +958,9 @@
             /*Since Cap exchange and MasterSlave Procedures are done */
             if(gH323ep.h323Callbacks.openLogicalChannels)
                gH323ep.h323Callbacks.openLogicalChannels(call);
+
+   	    /* ooSendStatusInquiry(call); */
+
             if(!ooGetTransmitLogicalChannel(call))
                ooOpenLogicalChannels(call);
 #if 0
@@ -2121,6 +2125,9 @@
    {
       if(gH323ep.h323Callbacks.openLogicalChannels)
          gH323ep.h323Callbacks.openLogicalChannels(call);
+
+      /* ooSendStatusInquiry(call); */
+      
       if(!ooGetTransmitLogicalChannel(call))
          ooOpenLogicalChannels(call);
 #if 0
@@ -3069,7 +3076,12 @@
    we can accept new capability set only. We must remember also that new join caps
    will be previously joined caps with new cap set.
  */
-   if(call->remoteTermCapSeqNo == tcs->sequenceNumber)
+
+/* 20111103 */
+/* for addition for previous we must check repeated tcs if it's not first 
+   tcs i.e. SeqNo is not null */
+
+   if(call->remoteTermCapSeqNo && call->remoteTermCapSeqNo == tcs->sequenceNumber)
     call->localTermCapState = OO_LocalTermCapExchange_Idle;
    }
   
@@ -3156,6 +3168,9 @@
  
    if(gH323ep.h323Callbacks.openLogicalChannels)
       gH323ep.h323Callbacks.openLogicalChannels(call);
+
+   /* ooSendStatusInquiry(call); */
+
    if(!ooGetTransmitLogicalChannel(call))
       ooOpenLogicalChannels(call);
 #if 0

Modified: team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh323.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh323.c (original)
+++ team/schmidts/unleash-the-beast/addons/ooh323c/src/ooh323.c Wed Dec 21 09:14:45 2011
@@ -1792,6 +1792,7 @@
       case Q931StatusEnquiryMsg:
          OOTRACEINFO3("H.225 Status Inquiry message Received (%s, %s)\n",
                        call->callType, call->callToken);
+	 ooSendStatus(call);
          ooFreeQ931Message(call->msgctxt, q931Msg);
          break;
       case Q931SetupAckMsg:

Modified: team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.c (original)
+++ team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.c Wed Dec 21 09:14:45 2011
@@ -233,6 +233,15 @@
          msg->causeIE = ie;
          OOTRACEDBGB1("   Cause IE = {\n");
          OOTRACEDBGB2("      %s\n", ooGetQ931CauseValueText(ie->data[1]&0x7f));
+         OOTRACEDBGB1("   }\n");
+      }
+
+      /* Handle CallState ie */
+      if(ie->discriminator == Q931CallStateIE)
+      {
+         msg->causeIE = ie;
+         OOTRACEDBGB1("   CallState IE = {\n");
+         OOTRACEDBGB2("      %d\n", ie->data[0]);
          OOTRACEDBGB1("   }\n");
       }
 
@@ -403,6 +412,7 @@
       (*q931msg)->callingPartyNumberIE = NULL;
       (*q931msg)->calledPartyNumberIE = NULL;
       (*q931msg)->causeIE = NULL;
+      (*q931msg)->callstateIE = NULL;
       return OO_OK;
    }
 }
@@ -680,6 +690,10 @@
    }
    else if(pq931Msg->messageType == Q931InformationMsg){
       msgbuf[i++] = OOInformationMessage;
+   }
+   else if(pq931Msg->messageType == Q931StatusMsg ||
+           pq931Msg->messageType == Q931StatusEnquiryMsg){
+      msgbuf[i++] = OOStatus;
    }
    else if(pq931Msg->messageType == Q931FacilityMsg){
       msgbuf[i++] = OOFacility;
@@ -751,8 +765,8 @@
       msgbuf[i++] = 0x88;
   }*/
 
-   /*Add display ie. */
-   if(!ooUtilsIsStrEmpty(call->ourCallerId))
+   /*Add display ie. for all but Status message as per ASTERISK-18748 */
+   if(!ooUtilsIsStrEmpty(call->ourCallerId) && (pq931Msg->messageType != Q931StatusMsg))
    {
       msgbuf[i++] = Q931DisplayIE;
       ieLen = strlen(call->ourCallerId)+1;
@@ -789,6 +803,13 @@
       msgbuf[i++] = pq931Msg->keypadIE->length;
       memcpy(msgbuf+i, pq931Msg->keypadIE->data, pq931Msg->keypadIE->length);
       i += pq931Msg->keypadIE->length;
+   }
+
+   if(pq931Msg->callstateIE) {
+      msgbuf[i++] = Q931CallStateIE;
+      msgbuf[i++] = pq931Msg->callstateIE->length;
+      memcpy(msgbuf+i, pq931Msg->callstateIE->data, pq931Msg->callstateIE->length);
+      i += pq931Msg->callstateIE->length;
    }
 
    /* Note: Have to fix this, though it works. Need to get rid of ie list. 
@@ -1703,6 +1724,138 @@
    return ret;
 }
 
+/*
+
+*/
+
+int ooSendStatus(OOH323CallData *call)
+{
+   int ret;    
+   H225Status_UUIE *status;
+   Q931Message *q931msg=NULL;
+   /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+   OOCTXT *pctxt = call->msgctxt;
+
+   OOTRACEDBGC3("Building StatusMsg (%s, %s)\n", call->callType, 
+                 call->callToken);
+   ret = ooCreateQ931Message(pctxt, &q931msg, Q931StatusMsg);
+   if(ret != OO_OK)
+   {      
+      OOTRACEERR1("Error: In allocating memory for - H225 Status "
+                           "message\n");
+      return OO_FAILED;
+   }
+   
+   q931msg->callReference = call->callReference;
+
+   q931msg->userInfo = (H225H323_UserInformation*)memAllocZ(pctxt,
+                             sizeof(H225H323_UserInformation));
+   if(!q931msg->userInfo)
+   {
+      OOTRACEERR1("ERROR:Memory - ooSendStatus - userInfo\n");
+      return OO_FAILED;
+   }
+   q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; 
+   q931msg->userInfo->h323_uu_pdu.h245Tunneling = 
+                                   OO_TESTFLAG(call->flags, OO_M_TUNNELING); 
+   q931msg->userInfo->h323_uu_pdu.h323_message_body.t = 
+         T_H225H323_UU_PDU_h323_message_body_status;
+   
+   status = (H225Status_UUIE*)memAllocZ(pctxt,
+                                             sizeof(H225Status_UUIE));
+   if(!status)
+   {
+      OOTRACEERR1("ERROR:Memory - ooSendStatus \n");
+      return OO_FAILED;
+   }
+   q931msg->userInfo->h323_uu_pdu.h323_message_body.u.status = status;
+
+   status->callIdentifier.guid.numocts = 
+                                   call->callIdentifier.guid.numocts;
+   memcpy(status->callIdentifier.guid.data, 
+          call->callIdentifier.guid.data, 
+          call->callIdentifier.guid.numocts);
+   status->protocolIdentifier = gProtocolID;  
+
+   ooQ931SetCauseIE(pctxt, q931msg, Q931StatusEnquiryResponse, 0, 0);
+   ooQ931SetCallStateIE(pctxt, q931msg, 10);
+
+   OOTRACEDBGA3("Built Status (%s, %s)\n", call->callType, 
+                 call->callToken);   
+   ret = ooSendH225Msg(call, q931msg);
+   if(ret != OO_OK)
+   {
+      OOTRACEERR3("Error:Failed to enqueue Status message to outbound queue.(%s, %s)\n", call->callType, call->callToken);
+   }
+
+   /* memReset(&gH323ep.msgctxt); */
+   memReset(call->msgctxt);
+
+   return ret;
+}
+
+int ooSendStatusInquiry(OOH323CallData *call)
+{
+   int ret;    
+   H225StatusInquiry_UUIE *statusInq;
+   Q931Message *q931msg=NULL;
+   /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+   OOCTXT *pctxt = call->msgctxt;
+
+   OOTRACEDBGC3("Building StatusInquryMsg (%s, %s)\n", call->callType, 
+                 call->callToken);
+   ret = ooCreateQ931Message(pctxt, &q931msg, Q931StatusEnquiryMsg);
+   if(ret != OO_OK)
+   {      
+      OOTRACEERR1("Error: In allocating memory for - H225 Status "
+                           "message\n");
+      return OO_FAILED;
+   }
+   
+   q931msg->callReference = call->callReference;
+
+   q931msg->userInfo = (H225H323_UserInformation*)memAllocZ(pctxt,
+                             sizeof(H225H323_UserInformation));
+   if(!q931msg->userInfo)
+   {
+      OOTRACEERR1("ERROR:Memory - ooSendStatus - userInfo\n");
+      return OO_FAILED;
+   }
+   q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; 
+   q931msg->userInfo->h323_uu_pdu.h245Tunneling = 
+                                   OO_TESTFLAG(call->flags, OO_M_TUNNELING); 
+   q931msg->userInfo->h323_uu_pdu.h323_message_body.t = 
+         T_H225H323_UU_PDU_h323_message_body_statusInquiry;
+   
+   statusInq = (H225StatusInquiry_UUIE*)memAllocZ(pctxt,
+                                             sizeof(H225StatusInquiry_UUIE));
+   if(!statusInq)
+   {
+      OOTRACEERR1("ERROR:Memory - ooSendStatusInquiry \n");
+      return OO_FAILED;
+   }
+   q931msg->userInfo->h323_uu_pdu.h323_message_body.u.statusInquiry = statusInq;
+
+   statusInq->callIdentifier.guid.numocts = 
+                                   call->callIdentifier.guid.numocts;
+   memcpy(statusInq->callIdentifier.guid.data, 
+          call->callIdentifier.guid.data, 
+          call->callIdentifier.guid.numocts);
+   statusInq->protocolIdentifier = gProtocolID;  
+
+   OOTRACEDBGA3("Built StatusInquiry (%s, %s)\n", call->callType, 
+                 call->callToken);   
+   ret = ooSendH225Msg(call, q931msg);
+   if(ret != OO_OK)
+   {
+      OOTRACEERR3("Error:Failed to enqueue Status message to outbound queue.(%s, %s)\n", call->callType, call->callToken);
+   }
+
+   /* memReset(&gH323ep.msgctxt); */
+   memReset(call->msgctxt);
+
+   return ret;
+}
 int ooSendReleaseComplete(OOH323CallData *call)
 {
    int ret;   
@@ -3125,6 +3278,28 @@
    pmsg->calledPartyNumberIE->data[0] = (0x80|((type&7)<<4)|(plan&15));
    memcpy(pmsg->calledPartyNumberIE->data+1, number, len);
 
+   return OO_OK;
+}
+
+int ooQ931SetCallStateIE
+   (OOCTXT* pctxt, Q931Message *pmsg, unsigned char callstate)
+{
+   if(pmsg->callstateIE){
+      memFreePtr(pctxt, pmsg->callstateIE);
+      pmsg->callstateIE = NULL;
+   }
+
+   pmsg->callstateIE = (Q931InformationElement*) 
+                      memAllocZ(pctxt, sizeof(Q931InformationElement));
+   if(!pmsg->callstateIE)
+   {
+      OOTRACEERR1("Error:Memory - ooQ931SetCallstateIE - causeIE\n");
+      return OO_FAILED;
+   }
+   pmsg->callstateIE->discriminator = Q931CallStateIE;
+   pmsg->callstateIE->length = 1;
+   pmsg->callstateIE->data[0] = callstate;
+  
    return OO_OK;
 }
 

Modified: team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.h
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.h?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.h (original)
+++ team/schmidts/unleash-the-beast/addons/ooh323c/src/ooq931.h Wed Dec 21 09:14:45 2011
@@ -246,6 +246,7 @@
    Q931InformationElement *calledPartyNumberIE;
    Q931InformationElement *causeIE;
    Q931InformationElement *keypadIE;
+   Q931InformationElement *callstateIE;
    H225H323_UserInformation *userInfo;
 } Q931Message;
 
@@ -468,6 +469,10 @@
 EXTERN int ooSendAlerting(struct OOH323CallData *call);
 
 EXTERN int ooSendProgress(struct OOH323CallData *call);
+
+EXTERN int ooSendStatus(struct OOH323CallData *call);
+
+EXTERN int ooSendStatusInquiry(struct OOH323CallData *call);
 
 /**
  * This function is invoked to send Facility message.
@@ -714,6 +719,9 @@
    (OOCTXT *pctxt, Q931Message *pmsg,enum Q931CauseValues cause, unsigned coding, 
     unsigned location);
 
+EXTERN int ooQ931SetCallStateIE
+    (OOCTXT *pctxt, Q931Message *pmsg, unsigned char callstate);
+
 /**
  * This function is used to convert a call clear reason to cause and 
  * reason code. It is used when local user is endoing the call and 

Modified: team/schmidts/unleash-the-beast/addons/ooh323c/src/ootypes.h
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/addons/ooh323c/src/ootypes.h?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/addons/ooh323c/src/ootypes.h (original)
+++ team/schmidts/unleash-the-beast/addons/ooh323c/src/ootypes.h Wed Dec 21 09:14:45 2011
@@ -190,8 +190,9 @@
 #define OORequestMode			   133
 #define OORequestDelayResponse		   134
 #define OORequestDelayRequest		   135
-
-#define OO_MSGTYPE_MAX                     135
+#define OOStatus			   136
+
+#define OO_MSGTYPE_MAX                     136
 
 /* Timer types */
 #define OO_CALLESTB_TIMER  (1<<0)

Modified: team/schmidts/unleash-the-beast/apps/app_authenticate.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/apps/app_authenticate.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/apps/app_authenticate.c (original)
+++ team/schmidts/unleash-the-beast/apps/app_authenticate.c Wed Dec 21 09:14:45 2011
@@ -213,14 +213,20 @@
 						continue;
 					ast_md5_hash(md5passwd, passwd);
 					if (!strcmp(md5passwd, md5secret)) {
-						if (ast_test_flag(&flags,OPT_ACCOUNT))
+						if (ast_test_flag(&flags,OPT_ACCOUNT)) {
+							ast_channel_lock(chan);
 							ast_cdr_setaccount(chan, buf);
+							ast_channel_unlock(chan);
+						}
 						break;
 					}
 				} else {
 					if (!strcmp(passwd, buf)) {
-						if (ast_test_flag(&flags, OPT_ACCOUNT))
+						if (ast_test_flag(&flags, OPT_ACCOUNT)) {
+							ast_channel_lock(chan);
 							ast_cdr_setaccount(chan, buf);
+							ast_channel_unlock(chan);
+						}
 						break;
 					}
 				}
@@ -242,8 +248,11 @@
 	}
 
 	if ((retries < 3) && !res) {
-		if (ast_test_flag(&flags,OPT_ACCOUNT) && !ast_test_flag(&flags,OPT_MULTIPLE))
+		if (ast_test_flag(&flags,OPT_ACCOUNT) && !ast_test_flag(&flags,OPT_MULTIPLE)) {
+			ast_channel_lock(chan);
 			ast_cdr_setaccount(chan, passwd);
+			ast_channel_unlock(chan);
+		}
 		if (!(res = ast_streamfile(chan, "auth-thankyou", chan->language)))
 			res = ast_waitstream(chan, "");
 	} else {

Modified: team/schmidts/unleash-the-beast/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/apps/app_confbridge.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/apps/app_confbridge.c (original)
+++ team/schmidts/unleash-the-beast/apps/app_confbridge.c Wed Dec 21 09:14:45 2011
@@ -86,7 +86,7 @@
                                                 <para>Do not play message when first person enters</para>
                                         </option>
                                         <option name="s">
-                                                <para>Present menu (user or admin) when <literal>*</literal> is received
+                                                <para>Present menu (user or admin) when <literal>#</literal> is received
                                                 (send to menu).</para>
                                         </option>
                                         <option name="w">

Modified: team/schmidts/unleash-the-beast/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/apps/app_followme.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/apps/app_followme.c (original)
+++ team/schmidts/unleash-the-beast/apps/app_followme.c Wed Dec 21 09:14:45 2011
@@ -309,7 +309,6 @@
 	struct number *cur, *nm;
 	char numberstr[90];
 	int timeout;
-	char *timeoutstr;
 	int numorder;
 	const char *takecallstr;
 	const char *declinecallstr;
@@ -427,17 +426,17 @@
 				ast_copy_string(numberstr, var->value, sizeof(numberstr));
 				if ((tmp = strchr(numberstr, ','))) {
 					*tmp++ = '\0';
-					timeoutstr = ast_strdupa(tmp);
-					if ((tmp = strchr(timeoutstr, ','))) {
+					timeout = atoi(tmp);
+					if (timeout < 0) {
+						timeout = 25;
+					}
+					if ((tmp = strchr(tmp, ','))) {
 						*tmp++ = '\0';
 						numorder = atoi(tmp);
 						if (numorder < 0)
 							numorder = 0;
 					} else 
 						numorder = 0;
-					timeout = atoi(timeoutstr);
-					if (timeout < 0) 
-						timeout = 25;
 				} else {
 					timeout = 25;
 					numorder = 0;
@@ -450,7 +449,9 @@
 					numorder = idx;
 				}
 				cur = create_followme_number(numberstr, timeout, numorder);
-				AST_LIST_INSERT_TAIL(&f->numbers, cur, entry);
+				if (cur) {
+					AST_LIST_INSERT_TAIL(&f->numbers, cur, entry);
+				}
 			} else {
 				profile_set_param(f, var->name, var->value, var->lineno, 1);
 				ast_debug(2, "Logging parameter %s with value %s from lineno %d\n", var->name, var->value, var->lineno);
@@ -477,10 +478,12 @@
 
 	if (tmpuser && tmpuser->ochan && tmpuser->state >= 0) {
 		outbound = tmpuser->ochan;
+		ast_channel_lock(outbound);
 		if (!outbound->cdr) {
 			outbound->cdr = ast_cdr_alloc();
-			if (outbound->cdr)
+			if (outbound->cdr) {
 				ast_cdr_init(outbound->cdr, outbound);
+			}
 		}
 		if (outbound->cdr) {
 			char tmp[256];
@@ -491,13 +494,16 @@
 			ast_cdr_start(outbound->cdr);
 			ast_cdr_end(outbound->cdr);
 			/* If the cause wasn't handled properly */
-			if (ast_cdr_disposition(outbound->cdr, outbound->hangupcause))
+			if (ast_cdr_disposition(outbound->cdr, outbound->hangupcause)) {
 				ast_cdr_failed(outbound->cdr);
-		} else
+			}
+		} else {
 			ast_log(LOG_WARNING, "Unable to create Call Detail Record\n");
-		ast_hangup(tmpuser->ochan);
-	}
-
+		}
+		ast_channel_unlock(outbound);
+		ast_hangup(outbound);
+		tmpuser->ochan = NULL;
+	}
 }
 
 static void clear_calling_tree(struct findme_user_listptr *findme_user_list) 
@@ -510,7 +516,18 @@
 	}
 }
 
-
+static void destroy_calling_tree(struct findme_user_listptr *findme_user_list)
+{
+	struct findme_user *fmuser;
+
+	while ((fmuser = AST_LIST_REMOVE_HEAD(findme_user_list, entry))) {
+		if (!fmuser->cleared) {
+			clear_caller(fmuser);
+		}
+		ast_free(fmuser);
+	}
+	ast_free(findme_user_list);
+}
 
 static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_user_list, struct number *nm, struct ast_channel *caller, char *namerecloc, int *status, struct fm_args *tpargs) 
 {
@@ -787,6 +804,7 @@
 	struct ast_channel *caller;
 	struct ast_channel *winner = NULL;
 	char dialarg[512];
+	char num[512];
 	int dg, idx;
 	char *rest, *number;
 	struct findme_user *tmpuser;
@@ -799,132 +817,123 @@
 
 	/* We're going to figure out what the longest possible string of digits to collect is */
 	ynlongest = 0;
-	if (strlen(tpargs->takecall) > ynlongest)
+	if (strlen(tpargs->takecall) > ynlongest) {
 		ynlongest = strlen(tpargs->takecall);
-	if (strlen(tpargs->nextindp) > ynlongest)
+	}
+	if (strlen(tpargs->nextindp) > ynlongest) {
 		ynlongest = strlen(tpargs->nextindp);
-
-	idx = 1;
+	}
+
 	caller = tpargs->chan;
-	AST_LIST_TRAVERSE(&tpargs->cnumbers, nm, entry)
-		if (nm->order == idx)
+	for (idx = 1; !winner && !ast_check_hangup(caller); ++idx) {
+		/* Find next followme numbers to dial. */
+		AST_LIST_TRAVERSE(&tpargs->cnumbers, nm, entry) {
+			if (nm->order == idx) {
+				break;
+			}
+		}
+		if (!nm) {
 			break;
-
-	while (nm) {
+		}
+
 		ast_debug(2, "Number %s timeout %ld\n", nm->number,nm->timeout);
 
-		number = ast_strdupa(nm->number);
-		ast_debug(3, "examining %s\n", number);
-		do {
+		ast_copy_string(num, nm->number, sizeof(num));
+		for (number = num; number; number = rest) {
 			rest = strchr(number, '&');
 			if (rest) {
-				*rest = 0;
-				rest++;
+				*rest++ = 0;
 			}
 
-			/* We check if that context exists, before creating the ast_channel struct needed */
+			/* We check if the extension exists, before creating the ast_channel struct */
 			if (!ast_exists_extension(caller, tpargs->context, number, 1, S_COR(caller->caller.id.number.valid, caller->caller.id.number.str, NULL))) {
-				/* XXX Should probably restructure to simply skip this item, instead of returning. XXX */
 				ast_log(LOG_ERROR, "Extension '%s@%s' doesn't exist\n", number, tpargs->context);
-				free(findme_user_list);
-				return;
+				continue;
 			}
 
-			if (!strcmp(tpargs->context, ""))
+			if (!strcmp(tpargs->context, "")) {
 				snprintf(dialarg, sizeof(dialarg), "%s", number);
-			else
+			} else {
 				snprintf(dialarg, sizeof(dialarg), "%s@%s", number, tpargs->context);
+			}
 
 			tmpuser = ast_calloc(1, sizeof(*tmpuser));
 			if (!tmpuser) {
-				ast_free(findme_user_list);
-				return;
+				continue;
 			}
 
 			outbound = ast_request("Local", ast_best_codec(caller->nativeformats), caller, dialarg, &dg);
 			if (outbound) {
-				ast_set_callerid(outbound,
-					S_COR(caller->caller.id.number.valid, caller->caller.id.number.str, NULL),
-					S_COR(caller->caller.id.name.valid, caller->caller.id.name.str, NULL),
-					S_COR(caller->caller.id.number.valid, caller->caller.id.number.str, NULL));
-				ast_channel_inherit_variables(tpargs->chan, outbound);
-				ast_channel_datastore_inherit(tpargs->chan, outbound);
-				ast_string_field_set(outbound, language, tpargs->chan->language);
-				ast_string_field_set(outbound, accountcode, tpargs->chan->accountcode);
-				ast_string_field_set(outbound, musicclass, tpargs->chan->musicclass);
-				ast_verb(3, "calling %s\n", dialarg);
-				if (!ast_call(outbound,dialarg,0)) {
+				ast_channel_lock_both(caller, outbound);
+				ast_connected_line_copy_from_caller(&outbound->connected, &caller->caller);
+				ast_channel_inherit_variables(caller, outbound);
+				ast_channel_datastore_inherit(caller, outbound);
+				ast_string_field_set(outbound, language, caller->language);
+				ast_string_field_set(outbound, accountcode, caller->accountcode);
+				ast_string_field_set(outbound, musicclass, caller->musicclass);
+				ast_channel_unlock(outbound);
+				ast_channel_unlock(caller);
+				ast_verb(3, "calling Local/%s\n", dialarg);
+				if (!ast_call(outbound, dialarg, 0)) {
 					tmpuser->ochan = outbound;
 					tmpuser->state = 0;
 					tmpuser->cleared = 0;
 					ast_copy_string(tmpuser->dialarg, dialarg, sizeof(dialarg));
 					AST_LIST_INSERT_TAIL(findme_user_list, tmpuser, entry);
 				} else {
-					ast_verb(3, "couldn't reach at this number.\n"); 
-					if (outbound) {
-						if (!outbound->cdr) 
-							outbound->cdr = ast_cdr_alloc();
-						if (outbound->cdr) {
-							char tmp[256];
-
-							ast_cdr_init(outbound->cdr, outbound);
-							snprintf(tmp, sizeof(tmp), "%s/%s", "Local", dialarg);
-							ast_cdr_setapp(outbound->cdr, "FollowMe", tmp);
-							ast_cdr_update(outbound);
-							ast_cdr_start(outbound->cdr);
-							ast_cdr_end(outbound->cdr);
-							/* If the cause wasn't handled properly */
-							if (ast_cdr_disposition(outbound->cdr,outbound->hangupcause))
-								ast_cdr_failed(outbound->cdr);
-						} else {
-							ast_log(LOG_ERROR, "Unable to create Call Detail Record\n");
-							ast_hangup(outbound);
-							outbound = NULL;
+					ast_verb(3, "couldn't reach at this number.\n");
+					ast_channel_lock(outbound);
+					if (!outbound->cdr) {
+						outbound->cdr = ast_cdr_alloc();
+					}
+					if (outbound->cdr) {
+						char tmp[256];
+
+						ast_cdr_init(outbound->cdr, outbound);
+						snprintf(tmp, sizeof(tmp), "%s/%s", "Local", dialarg);
+						ast_cdr_setapp(outbound->cdr, "FollowMe", tmp);
+						ast_cdr_update(outbound);
+						ast_cdr_start(outbound->cdr);
+						ast_cdr_end(outbound->cdr);
+						/* If the cause wasn't handled properly */
+						if (ast_cdr_disposition(outbound->cdr, outbound->hangupcause)) {
+							ast_cdr_failed(outbound->cdr);
 						}
+					} else {
+						ast_log(LOG_ERROR, "Unable to create Call Detail Record\n");
 					}
+					ast_channel_unlock(outbound);
+					ast_hangup(outbound);
+					ast_free(tmpuser);
 				}
-			} else 
+			} else {
 				ast_log(LOG_WARNING, "Unable to allocate a channel for Local/%s cause: %s\n", dialarg, ast_cause2str(dg));
-
-			number = rest;
-		} while (number);
+				ast_free(tmpuser);
+			}
+		}
+
+		if (AST_LIST_EMPTY(findme_user_list)) {
+			continue;
+		}
 
 		status = 0;
-		if (!AST_LIST_EMPTY(findme_user_list))
-			winner = wait_for_winner(findme_user_list, nm, caller, tpargs->namerecloc, &status, tpargs);
-
+		winner = wait_for_winner(findme_user_list, nm, caller, tpargs->namerecloc, &status, tpargs);
+
+		/* Clean up all calls but winner. */
 		while ((fmuser = AST_LIST_REMOVE_HEAD(findme_user_list, entry))) {
-			if (!fmuser->cleared && fmuser->ochan != winner)
+			if (!fmuser->cleared && fmuser->ochan != winner) {
 				clear_caller(fmuser);
+			}
 			ast_free(fmuser);
 		}
-
-		fmuser = NULL;
-		tmpuser = NULL;
-		if (winner)
-			break;
-
-		if (!caller || ast_check_hangup(caller)) {
-			tpargs->status = 1;
-			ast_free(findme_user_list);
-			return;
-		}
-
-		idx++;
-		AST_LIST_TRAVERSE(&tpargs->cnumbers, nm, entry) {
-			if (nm->order == idx)
-				break;
-		}
-	}
-	ast_free(findme_user_list);
-	if (!winner) 
+	}
+	destroy_calling_tree(findme_user_list);
+	if (!winner) {
 		tpargs->status = 1;
-	else {
+	} else {
 		tpargs->status = 100;
 		tpargs->outbound = winner;
 	}
-
-	return;
 }
 
 static struct call_followme *find_realtime(const char *name)
@@ -1035,10 +1044,7 @@
 		return -1;
 	}
 
-	if (!(argstr = ast_strdupa((char *)data))) {
-		ast_log(LOG_ERROR, "Out of memory!\n");
-		return -1;
-	}
+	argstr = ast_strdupa((char *) data);
 
 	AST_STANDARD_APP_ARGS(args, argstr);
 
@@ -1086,7 +1092,9 @@
 	AST_LIST_HEAD_INIT_NOLOCK(&targs.cnumbers);
 	AST_LIST_TRAVERSE(&f->numbers, nm, entry) {
 		newnm = create_followme_number(nm->number, nm->timeout, nm->order);
-		AST_LIST_INSERT_TAIL(&targs.cnumbers, newnm, entry);
+		if (newnm) {
+			AST_LIST_INSERT_TAIL(&targs.cnumbers, newnm, entry);
+		}
 	}
 	ast_mutex_unlock(&f->lock);
 
@@ -1156,11 +1164,10 @@
 			goto outrun;
 		}
 		res = ast_bridge_call(caller, outbound, &config);
-		if (outbound)
-			ast_hangup(outbound);
-	}
-
-	outrun:
+		ast_hangup(outbound);
+	}
+
+outrun:
 
 	if (f->realtime) {
 		/* Not in list */

Modified: team/schmidts/unleash-the-beast/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/apps/app_meetme.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/apps/app_meetme.c (original)
+++ team/schmidts/unleash-the-beast/apps/app_meetme.c Wed Dec 21 09:14:45 2011
@@ -3927,8 +3927,12 @@
 			cnf->useropts = ast_strdup(useropts);
 			cnf->adminopts = ast_strdup(adminopts);
 			cnf->bookid = ast_strdup(bookid);
-			cnf->recordingfilename = ast_strdup(recordingfilename);
-			cnf->recordingformat = ast_strdup(recordingformat);
+			if (!ast_strlen_zero(recordingfilename)) {
+				cnf->recordingfilename = ast_strdup(recordingfilename);
+			}
+			if (!ast_strlen_zero(recordingformat)) {
+				cnf->recordingformat = ast_strdup(recordingformat);
+			}
 
 			/* Parse the other options into confflags -- need to do this in two
 			 * steps, because the parse_options routine zeroes the buffer. */
@@ -4342,13 +4346,27 @@
 					res = -1;
 				}
 			} else {
-				/* Check to see if the conference requires a pin
-				 * and we ALWAYS prompt or no pin was provided */
-				if ((!ast_strlen_zero(cnf->pin) ||
+				/* Conference requires a pin for specified access level */
+				int req_pin = !ast_strlen_zero(cnf->pin) ||
 					(!ast_strlen_zero(cnf->pinadmin) &&
-						ast_test_flag64(&confflags, CONFFLAG_ADMIN))) &&
-				    (ast_test_flag64(&confflags, CONFFLAG_ALWAYSPROMPT) ||
-						ast_strlen_zero(args.pin))) {
+						ast_test_flag64(&confflags, CONFFLAG_ADMIN));
+				/* The following logic was derived from a
+				 * 4 variable truth table and defines which
+				 * circumstances are not exempt from pin
+				 * checking.
+				 * If this needs to be modified, write the
+				 * truth table back out from the boolean
+				 * expression AB+A'D+C', change the erroneous
+				 * result, and rederive the expression.
+				 * Variables:
+				 *  A: pin provided?
+				 *  B: always prompt?
+				 *  C: dynamic?
+				 *  D: has users? */
+				int not_exempt = !cnf->isdynamic;
+				not_exempt = not_exempt || (!ast_strlen_zero(args.pin) && ast_test_flag64(&confflags, CONFFLAG_ALWAYSPROMPT));
+				not_exempt = not_exempt || (ast_strlen_zero(args.pin) && cnf->users);
+				if (req_pin && not_exempt) {
 					char pin[MAX_PIN] = "";
 					int j;
 

Modified: team/schmidts/unleash-the-beast/apps/app_parkandannounce.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/apps/app_parkandannounce.c?view=diff&rev=348786&r1=348785&r2=348786
==============================================================================
--- team/schmidts/unleash-the-beast/apps/app_parkandannounce.c (original)
+++ team/schmidts/unleash-the-beast/apps/app_parkandannounce.c Wed Dec 21 09:14:45 2011
@@ -96,6 +96,7 @@
 	char *dialtech, *tmp[100], buf[13];
 	int looptemp, i;
 	char *s;
+	struct ast_party_id caller_id;
 
 	struct ast_channel *dchan;
 	struct outgoing_helper oh = { 0, };
@@ -107,7 +108,7 @@
 		AST_APP_ARG(return_context);
 	);
 	if (ast_strlen_zero(data)) {
-		ast_log(LOG_WARNING, "ParkAndAnnounce requires arguments: (announce:template|timeout|dial|[return_context])\n");
+		ast_log(LOG_WARNING, "ParkAndAnnounce requires arguments: (announce_template,timeout,dial,[return_context])\n");
 		return -1;
 	}
   
@@ -138,16 +139,23 @@
 		ast_verb(3, "Warning: Return Context Invalid, call will return to default|s\n");
 	}
 
+	/* Save the CallerID because the masquerade turns chan into a ZOMBIE. */
+	ast_channel_lock(chan);
+	ast_party_id_copy(&caller_id, &chan->caller.id);
+	ast_channel_unlock(chan);
+
 	/* we are using masq_park here to protect * from touching the channel once we park it.  If the channel comes out of timeout
 	before we are done announcing and the channel is messed with, Kablooeee.  So we use Masq to prevent this.  */
 
 	res = ast_masq_park_call(chan, NULL, timeout, &lot);
 	if (res) {
 		/* Parking failed. */
+		ast_party_id_free(&caller_id);
 		return -1;
 	}
 
-	ast_verb(3, "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, args.return_context);
+	ast_verb(3, "Call parked in space: %d, timeout: %d, return-context: %s\n",
+		lot, timeout, args.return_context ? args.return_context : "");
 
 	/* Now place the call to the extension */
 
@@ -156,9 +164,11 @@
 	oh.vars = ast_variable_new("_PARKEDAT", buf, "");
 	dchan = __ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, chan, args.dial, 30000,
 		&outstate,
-		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL),
-		S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, NULL),
+		S_COR(caller_id.number.valid, caller_id.number.str, NULL),
+		S_COR(caller_id.name.valid, caller_id.name.str, NULL),
 		&oh);
+	ast_variables_destroy(oh.vars);
+	ast_party_id_free(&caller_id);
 	if (dchan) {
 		if (dchan->_state == AST_STATE_UP) {
 			ast_verb(4, "Channel %s was answered.\n", dchan->name);
@@ -196,7 +206,6 @@

[... 7377 lines stripped ...]



More information about the svn-commits mailing list