[Freeswitch-trunk] [GIT]FreeSWITCH branch master updated. git2svn-syncpoint-master-1668-g1623e5d

git at svn.freeswitch.org git at svn.freeswitch.org
Mon Jan 31 23:17:05 MSK 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FreeSWITCH".

The branch, master has been updated
       via  1623e5d2952d63e2e49d454cd6fdf921a8516227 (commit)
       via  256a82dbf2d7f4b4e1d7527f1e6a15d8d0d38a21 (commit)
       via  c8f5c66c3520ecda8f8dbc07dc01f1d4035058e4 (commit)
       via  2ad81ac82f3c3c989e4d7d11f788c43c2c6f20d8 (commit)
       via  49a5effcdf2cea9e0ddcf146cf3fe85d1872e654 (commit)
       via  be3483b924a674e4c4f0f05734e7e4917634f3ca (commit)
       via  e6e4bcea734fbfb54b901ff8b1107ddfe76b7010 (commit)
       via  068d36a5c95c5a4143f423b7c36cbe6d5cea36d5 (commit)
       via  9986f4ebf2a0c40cc99bc7f9f03f2dec6ae74645 (commit)
       via  6d3abd41cadef3a2bff8175487c094c80d7d9cf7 (commit)
       via  b3ac44f555a80f8278c5f915cfb36766903905a4 (commit)
       via  9e6503a482ff533ff214b01a07c3432be14ff1ce (commit)
       via  97a2b4f9025099bdab5718a13ee36d15a6152411 (commit)
       via  68b2756970bd4280eba700b7439afdff374fd9e3 (commit)
       via  9b0c16b5d48a7b9d0ea15ac429a8ca4c8eef8693 (commit)
       via  f05fe55594ffca6edc8f4e74204650aa219ed1ac (commit)
       via  08f494b80802aacf101705382f149ca4b028eb57 (commit)
       via  daa28cfccae9b171221408f3af4f8c10283e67b3 (commit)
       via  c64b78577f65b586ff6d7af711c79d0427fc61c5 (commit)
       via  9ade16e9291aa74b4483bb9b9d9db266e082f7cc (commit)
       via  314a2a1e2061ef321fa5f9b32a9c70ef0040cdb8 (commit)
       via  48c02b7cd2770f6aee1d6e89f5ecfe207231f398 (commit)
       via  f954d21ab8f84ea3518525d6f8a5a25c5cd39d6b (commit)
       via  f8254f81607c9b2fe8ece3c48cb6dff700bcbead (commit)
       via  608be370bcca24023ee9d05ee4a99c133044f0d3 (commit)
       via  4b941542a309a8c7f7ad5d01cfef9d1c487376a8 (commit)
       via  b889b44f1d632810662359f6becce869056a076c (commit)
       via  22c05ad542e3a36dd7dbb71bef5aca5ff009b1b9 (commit)
       via  008e527c0f5c86e20521c4ebacf69adcb269b08a (commit)
       via  425df0c78389d30561a7f025a1a3e3b2fbc5e413 (commit)
       via  a01814794c1fb49b77a6015edc8e1ad6c925bae3 (commit)
       via  9ffca057f109725986b741cb6019dce620c056b7 (commit)
       via  6f58e6aa425283137effa286d7f8638aa035aff4 (commit)
      from  02082c930cc08cd65b3ac51d2e8231e502bd8f31 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1623e5d2952d63e2e49d454cd6fdf921a8516227
Merge: 256a82d 02082c9
Author: Brian West <brian at freeswitch.org>
Date:   Mon Jan 31 14:13:03 2011 -0600

    Merge branch 'openmethods-merged-dtmf-20110126' of git://scm.dashjr.org/var/scmroot/git/freeswitch


commit 256a82dbf2d7f4b4e1d7527f1e6a15d8d0d38a21
Author: Jeff Lenk <jeff at jefflenk.com>
Date:   Mon Jan 31 10:12:28 2011 -0600

    OPENZAP-140 VS2010 build cleanup

diff --git a/libs/freetdm/msvc/testboost/testboost.2010.vcxproj b/libs/freetdm/msvc/testboost/testboost.2010.vcxproj
index 6206148..314440b 100644
--- a/libs/freetdm/msvc/testboost/testboost.2010.vcxproj
+++ b/libs/freetdm/msvc/testboost/testboost.2010.vcxproj
@@ -105,7 +105,7 @@
       <DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\debug\freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Console</SubSystem>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -162,7 +162,7 @@
       <DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Console</SubSystem>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -199,7 +199,7 @@
       <DataExecutionPrevention>
       </DataExecutionPrevention>
       <TargetMachine>MachineX64</TargetMachine>
-      <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
diff --git a/libs/freetdm/msvc/testboost/testsangomaboost.2010.vcxproj b/libs/freetdm/msvc/testboost/testsangomaboost.2010.vcxproj
index 5994da6..4077a60 100644
--- a/libs/freetdm/msvc/testboost/testsangomaboost.2010.vcxproj
+++ b/libs/freetdm/msvc/testboost/testsangomaboost.2010.vcxproj
@@ -105,7 +105,7 @@
       <DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\debug\freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Console</SubSystem>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -162,7 +162,7 @@
       <DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Console</SubSystem>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -199,7 +199,7 @@
       <DataExecutionPrevention>
       </DataExecutionPrevention>
       <TargetMachine>MachineX64</TargetMachine>
-      <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.2010.vcxproj b/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.2010.vcxproj
index 78689c3..684e432 100644
--- a/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.2010.vcxproj
+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.2010.vcxproj
@@ -61,11 +61,11 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
@@ -102,7 +102,7 @@
       <DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
@@ -151,7 +151,7 @@
       <DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
diff --git a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj
index 40d0a73..a21be22 100644
--- a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj
+++ b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj
@@ -61,14 +61,14 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>

commit c8f5c66c3520ecda8f8dbc07dc01f1d4035058e4
Author: Daniel Swarbrick <daniel at seventhsignal.de>
Date:   Mon Jan 31 15:41:58 2011 +0100

    mostly complete implementation of channel list via SNMP

diff --git a/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB
index 11c3999..8448526 100644
--- a/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB
+++ b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB
@@ -3,11 +3,14 @@ FREESWITCH-MIB DEFINITIONS ::= BEGIN
 IMPORTS
     OBJECT-TYPE, MODULE-IDENTITY,
     Integer32, Gauge32, Counter32, Counter64, TimeTicks,
-    enterprises,
+    enterprises
         FROM SNMPv2-SMI
 
-    DisplayString
+    DisplayString, DateAndTime
         FROM SNMPv2-TC
+
+    InetAddressType, InetAddress
+        FROM INET-ADDRESS-MIB
 ;
 
 
@@ -109,13 +112,27 @@ maxSessionsPerSecond OBJECT-TYPE
 
 
 ChannelEntry ::= SEQUENCE {
-    chanUUID        DisplayString,
-    chanDirection   DisplayString,
-    chanCreated     DisplayString,
-    chanName        DisplayString,
-    chanState       DisplayString,
-    chanCIDName     DisplayString,
-    chanCIDNum      DisplayString
+    chanIndex           Integer32,
+    chanUUID            DisplayString,
+    chanDirection       DisplayString,
+    chanCreated         DateAndTime,
+    chanName            DisplayString,
+    chanState           DisplayString,
+    chanCIDName         DisplayString,
+    chanCIDNum          DisplayString,
+    chanInetAddressType InetAddressType,
+    chanInetAddress     InetAddress,
+    chanDest            DisplayString,
+    chanApplication     DisplayString,
+    chanAppData         DisplayString,
+    chanDialplan        DisplayString,
+    chanContext         DisplayString,
+    chanReadCodec       DisplayString,
+    chanReadRate        Gauge32,
+    chanReadBitRate     Gauge32,
+    chanWriteCodec      DisplayString,
+    chanWriteRate       Gauge32,
+    chanWriteBitRate    Gauge32
 }
 
 channelList OBJECT-TYPE
@@ -135,60 +152,172 @@ channelEntry OBJECT-TYPE
     INDEX { chanIndex }
     ::= { channelList 1 }
 
+chanIndex OBJECT-TYPE
+    SYNTAX      Integer32
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel SNMP index."
+    ::= { channelEntry 1 }
+
 chanUUID OBJECT-TYPE
     SYNTAX      DisplayString
     MAX-ACCESS  read-only
     STATUS      current
     DESCRIPTION
-        "The channel UUID."
-    ::= { channelEntry 1 }
+        "Channel UUID."
+    ::= { channelEntry 2 }
 
 chanDirection OBJECT-TYPE
     SYNTAX      DisplayString
     MAX-ACCESS  read-only
     STATUS      current
     DESCRIPTION
-        "The channel direction."
-    ::= { channelEntry 2 }
+        "Channel direction."
+    ::= { channelEntry 3 }
 
 chanCreated OBJECT-TYPE
-    SYNTAX      DisplayString
+    SYNTAX      DateAndTime
     MAX-ACCESS  read-only
     STATUS      current
     DESCRIPTION
         "Channel creation timestamp."
-    ::= { channelEntry 3 }
+    ::= { channelEntry 4 }
 
 chanName OBJECT-TYPE
     SYNTAX      DisplayString
     MAX-ACCESS  read-only
     STATUS      current
     DESCRIPTION
-        "The channel name."
-    ::= { channelEntry 4 }
+        "Channel name."
+    ::= { channelEntry 5 }
 
 chanState OBJECT-TYPE
     SYNTAX      DisplayString
     MAX-ACCESS  read-only
     STATUS      current
     DESCRIPTION
-        "The channel state."
-    ::= { channelEntry 5 }
+        "Channel state."
+    ::= { channelEntry 6 }
 
 chanCIDName OBJECT-TYPE
     SYNTAX      DisplayString
     MAX-ACCESS  read-only
     STATUS      current
     DESCRIPTION
-        "The channel caller ID name."
-    ::= { channelEntry 6 }
+        "Channel caller ID name."
+    ::= { channelEntry 7 }
 
 chanCIDNum OBJECT-TYPE
     SYNTAX      DisplayString
     MAX-ACCESS  read-only
     STATUS      current
     DESCRIPTION
-        "The channel caller ID number."
-    ::= { channelEntry 7 }
+        "Channel caller ID number."
+    ::= { channelEntry 8 }
+
+chanInetAddressType OBJECT-TYPE
+    SYNTAX      InetAddressType
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel originator's IP address type (IPv4 or IPv6)."
+    ::= { channelEntry 9 }
+
+chanInetAddress OBJECT-TYPE
+    SYNTAX      InetAddress
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel originator's IP address."
+    ::= { channelEntry 10 }
+
+chanDest OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel destination."
+    ::= { channelEntry 11 }
+
+chanApplication OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel application."
+    ::= { channelEntry 12 }
+
+chanAppData OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel application data."
+    ::= { channelEntry 13 }
+
+chanDialplan OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel dialplan."
+    ::= { channelEntry 14 }
+
+chanContext OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel dialplan context."
+    ::= { channelEntry 15 }
+
+chanReadCodec OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel read codec."
+    ::= { channelEntry 16 }
+
+chanReadRate OBJECT-TYPE
+    SYNTAX      Gauge32
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel read samples per second."
+    ::= { channelEntry 17 }
+
+chanReadBitRate OBJECT-TYPE
+    SYNTAX      Gauge32
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel read bits per second."
+    ::= { channelEntry 18 }
+
+chanWriteCodec OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel write codec."
+    ::= { channelEntry 19 }
+
+chanWriteRate OBJECT-TYPE
+    SYNTAX      Gauge32
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel write samples per second."
+    ::= { channelEntry 20 }
+
+chanWriteBitRate OBJECT-TYPE
+    SYNTAX      Gauge32
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel write bits per second."
+    ::= { channelEntry 21 }
 
 END
diff --git a/src/mod/event_handlers/mod_snmp/subagent.c b/src/mod/event_handlers/mod_snmp/subagent.c
index 7b9faa7..43975ee 100644
--- a/src/mod/event_handlers/mod_snmp/subagent.c
+++ b/src/mod/event_handlers/mod_snmp/subagent.c
@@ -42,6 +42,17 @@ netsnmp_handler_registration *ch_reginfo;
 uint32_t idx;
 
 
+static void time_t_to_datetime(time_t epoch, char *buf, switch_size_t buflen)
+{
+	struct tm *dt;
+	uint16_t year;
+
+	dt = gmtime(&epoch);
+	year = dt->tm_year + 1900;
+	switch_snprintf(buf, buflen, "%c%c%c%c%c%c%c%c+%c%c", year >> 8, year & 0xff, dt->tm_mon + 1, dt->tm_mday, dt->tm_hour, dt->tm_min, dt->tm_sec, 0, 0, 0);
+}
+
+
 static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)
 {
 	uint32_t *count = (uint32_t *) pArg;
@@ -69,11 +80,31 @@ static int channelList_callback(void *pArg, int argc, char **argv, char **column
 	entry->idx = idx++;
 	strncpy(entry->uuid, argv[0], sizeof(entry->uuid));
 	strncpy(entry->direction, argv[1], sizeof(entry->direction));
-	strncpy(entry->created, argv[2], sizeof(entry->created));
+	entry->created_epoch = atoi(argv[3]);
 	strncpy(entry->name, argv[4], sizeof(entry->name));
 	strncpy(entry->state, argv[5], sizeof(entry->state));
 	strncpy(entry->cid_name, argv[6], sizeof(entry->cid_name));
 	strncpy(entry->cid_num, argv[7], sizeof(entry->cid_num));
+	strncpy(entry->dest, argv[9], sizeof(entry->dest));
+	strncpy(entry->application, argv[10], sizeof(entry->application));
+	strncpy(entry->application_data, argv[11], sizeof(entry->application_data));
+	strncpy(entry->dialplan, argv[12], sizeof(entry->dialplan));
+	strncpy(entry->context, argv[13], sizeof(entry->context));
+	strncpy(entry->read_codec, argv[14], sizeof(entry->read_codec));
+	entry->read_rate = atoi(argv[15]);
+	entry->read_bitrate = atoi(argv[16]);
+	strncpy(entry->write_codec, argv[17], sizeof(entry->write_codec));
+	entry->write_rate = atoi(argv[18]);
+	entry->write_bitrate = atoi(argv[19]);
+
+	memset(&entry->ip_addr, 0, sizeof(entry->ip_addr));
+	if (strchr(argv[8], ':')) {
+		switch_inet_pton(AF_INET6, argv[8], &entry->ip_addr);
+		entry->addr_family = AF_INET6;
+	} else {
+		switch_inet_pton(AF_INET, argv[8], &entry->ip_addr);
+		entry->addr_family = AF_INET;
+	}
 
 	netsnmp_tdata_row_add_index(row, ASN_INTEGER, &entry->idx, sizeof(entry->idx));
 	netsnmp_tdata_add_row(ch_table, row);
@@ -128,9 +159,9 @@ void init_subagent(switch_memory_pool_t *pool)
 	netsnmp_register_scalar_group(netsnmp_create_handler_registration("systemStats", handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY), 1, 7);
 
 	ch_table_info = switch_core_alloc(pool, sizeof(netsnmp_table_registration_info));
-	netsnmp_table_helper_add_index(ch_table_info, ASN_INTEGER);
-	ch_table_info->min_column = 1;
-	ch_table_info->max_column = 7;
+	netsnmp_table_helper_add_indexes(ch_table_info, ASN_INTEGER, 0);
+	ch_table_info->min_column = CH_INDEX;
+	ch_table_info->max_column = CH_WRITE_BITRATE;
 	ch_table = netsnmp_tdata_create_table("channelList", 0);
 	ch_reginfo = netsnmp_create_handler_registration("channelList", handle_channelList, channelList_oid, OID_LENGTH(channelList_oid), HANDLER_CAN_RONLY);
 	netsnmp_tdata_register(ch_reginfo, ch_table, ch_table_info);
@@ -191,15 +222,15 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 			break;
 		case SS_SESSIONS_SINCE_STARTUP:
 			int_val = switch_core_session_id() - 1;
-			snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER, (u_char *) &int_val, sizeof(int_val));
+			snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER, int_val);
 			break;
 		case SS_CURRENT_SESSIONS:
 			int_val = switch_core_session_count();
-			snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
+			snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
 			break;
 		case SS_MAX_SESSIONS:
 			switch_core_session_ctl(SCSC_MAX_SESSIONS, &int_val);
-			snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
+			snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
 			break;
 		case SS_CURRENT_CALLS:
 			{
@@ -213,17 +244,17 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 			gethostname(hostname, sizeof(hostname));
 			sprintf(sql, "SELECT COUNT(*) FROM calls WHERE hostname='%s'", hostname);
 			switch_cache_db_execute_sql_callback(dbh, sql, sql_count_callback, &int_val, NULL);
-			snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
+			snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
 			switch_cache_db_release_db_handle(&dbh);
 			}
 			break;
 		case SS_SESSIONS_PER_SECOND:
 			switch_core_session_ctl(SCSC_LAST_SPS, &int_val);
-			snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
+			snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
 			break;
 		case SS_MAX_SESSIONS_PER_SECOND:
 			switch_core_session_ctl(SCSC_SPS, &int_val);
-			snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
+			snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
 			break;
 		default:
 			snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", (int) subid);
@@ -246,6 +277,7 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 	netsnmp_request_info *request;
 	netsnmp_table_request_info *table_info;
 	chan_entry_t *entry;
+	char dt_str[12];
 
 	switch (reqinfo->mode) {
 	case MODE_GET:
@@ -254,6 +286,9 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 			entry = (chan_entry_t *) netsnmp_tdata_extract_entry(request);
 
 			switch (table_info->colnum) {
+			case CH_INDEX:
+				snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, entry->idx);
+				break;
 			case CH_UUID:
 				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->uuid, strlen(entry->uuid));
 				break;
@@ -261,7 +296,8 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->direction, strlen(entry->direction));
 				break;
 			case CH_CREATED:
-				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->created, strlen(entry->created));
+				time_t_to_datetime(entry->created_epoch, (char *) &dt_str, sizeof(dt_str));
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) &dt_str, sizeof(dt_str));
 				break;
 			case CH_NAME:
 				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->name, strlen(entry->name));
@@ -275,6 +311,53 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 			case CH_CID_NUM:
 				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->cid_num, strlen(entry->cid_num));
 				break;
+			case CH_IP_ADDR_TYPE:
+				if (entry->addr_family == AF_INET6) {
+					snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, INETADDRESSTYPE_IPV6);
+				} else {
+					snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, INETADDRESSTYPE_IPV4);
+				}
+				break;
+			case CH_IP_ADDR:
+				if (entry->addr_family == AF_INET6) {
+					snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) &entry->ip_addr.v6, sizeof(entry->ip_addr.v6));
+				} else {
+					snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) &entry->ip_addr.v4, sizeof(entry->ip_addr.v4));
+				}
+				break;
+			case CH_DEST:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->dest, strlen(entry->dest));
+				break;
+			case CH_APPLICATION:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->application, strlen(entry->application));
+				break;
+			case CH_APPLICATION_DATA:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->application_data, strlen(entry->application_data));
+				break;
+			case CH_DIALPLAN:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->dialplan, strlen(entry->dialplan));
+				break;
+			case CH_CONTEXT:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->context, strlen(entry->context));
+				break;
+			case CH_READ_CODEC:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->read_codec, strlen(entry->read_codec));
+				break;
+			case CH_READ_RATE:
+				snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->read_rate, sizeof(entry->read_rate));
+				break;
+			case CH_READ_BITRATE:
+				snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->read_bitrate, sizeof(entry->read_bitrate));
+				break;
+			case CH_WRITE_CODEC:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->write_codec, strlen(entry->write_codec));
+				break;
+			case CH_WRITE_RATE:
+				snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->write_rate, sizeof(entry->write_rate));
+				break;
+			case CH_WRITE_BITRATE:
+				snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->write_bitrate, sizeof(entry->write_bitrate));
+				break;
 			default:
 				snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", table_info->colnum);
 				netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
diff --git a/src/mod/event_handlers/mod_snmp/subagent.h b/src/mod/event_handlers/mod_snmp/subagent.h
index 0070b2c..5da87a6 100644
--- a/src/mod/event_handlers/mod_snmp/subagent.h
+++ b/src/mod/event_handlers/mod_snmp/subagent.h
@@ -15,23 +15,58 @@
 #define SS_MAX_SESSIONS_PER_SECOND	7
 
 /* .1.3.6.1.4.1.27880.1.9 */
-#define CH_UUID				1
-#define CH_DIRECTION			2
-#define CH_CREATED			3
-#define CH_NAME				4
-#define CH_STATE			5
-#define CH_CID_NAME			6
-#define CH_CID_NUM			7
+#define CH_INDEX			1
+#define CH_UUID				2
+#define CH_DIRECTION			3
+#define CH_CREATED			4
+#define CH_NAME				5
+#define CH_STATE			6
+#define CH_CID_NAME			7
+#define CH_CID_NUM			8
+#define CH_IP_ADDR_TYPE			9
+#define CH_IP_ADDR			10
+#define CH_DEST				11
+#define CH_APPLICATION			12
+#define CH_APPLICATION_DATA		13
+#define CH_DIALPLAN			14
+#define CH_CONTEXT			15
+#define CH_READ_CODEC			16
+#define CH_READ_RATE			17
+#define CH_READ_BITRATE			18
+#define CH_WRITE_CODEC			19
+#define CH_WRITE_RATE			20
+#define CH_WRITE_BITRATE		21
+
+/* Why aren't these in net-snmp-includes.h ? */
+#define INETADDRESSTYPE_UNKNOWN		0
+#define INETADDRESSTYPE_IPV4		1
+#define INETADDRESSTYPE_IPV6		2
+#define INETADDRESSTYPE_IPV4Z		3
+#define INETADDRESSTYPE_IPV6Z		4
+#define INETADDRESSTYPE_DNS		16
 
 typedef struct {
 	uint32_t idx;
 	char uuid[38];
 	char direction[32];
-	char created[128];
+	time_t created_epoch;
 	char name[1024];
 	char state[64];
 	char cid_name[1024];
 	char cid_num[256];
+	ip_t ip_addr;
+	uint8_t addr_family;
+	char dest[1024];
+	char application[128];
+	char application_data[4096];
+	char dialplan[128];
+	char context[128];
+	char read_codec[128];
+	uint32_t read_rate;
+	uint32_t read_bitrate;
+	char write_codec[128];
+	uint32_t write_rate;
+	uint32_t write_bitrate;
 } chan_entry_t;
 
 void init_subagent(switch_memory_pool_t *pool);

commit 2ad81ac82f3c3c989e4d7d11f788c43c2c6f20d8
Author: Anthony Minessale <anthm at freeswitch.org>
Date:   Sat Jan 29 13:43:59 2011 -0600

    fix || where it should be or in sql stmt that may cause stray records in the calls table

diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c
index 4167b4a..35311c9 100644
--- a/src/switch_core_sqldb.c
+++ b/src/switch_core_sqldb.c
@@ -1160,15 +1160,14 @@ static void core_event_handler(switch_event_t *event)
 	case SWITCH_EVENT_CHANNEL_DESTROY:
 		{
 			const char *uuid = switch_event_get_header(event, "unique-id");
-			const char *sig = switch_event_get_header(event, "signal_bridge");
 			
 			if (uuid) {
 				new_sql() = switch_mprintf("delete from channels where uuid='%q' and hostname='%q'",
 										   uuid, switch_core_get_variable("hostname"));
-				if (switch_true(sig)) {
-					new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' || callee_uuid='%q') and hostname='%q'",
-											   uuid, uuid, switch_core_get_variable("hostname"));
-				}
+
+				new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",
+										   uuid, uuid, switch_core_get_variable("hostname"));
+
 			}
 		}
 		break;
@@ -1410,7 +1409,7 @@ static void core_event_handler(switch_event_t *event)
 		}
 		break;
 	case SWITCH_EVENT_CHANNEL_UNBRIDGE:
-		new_sql() = switch_mprintf("delete from calls where caller_uuid='%s' and hostname='%q'",
+		new_sql() = switch_mprintf("delete from calls where (caller_uuid='%s' or callee_uuid='%q') and hostname='%q'",
 								   switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_variable("hostname"));
 		break;
 	case SWITCH_EVENT_SHUTDOWN:

commit 49a5effcdf2cea9e0ddcf146cf3fe85d1872e654
Author: Marc Olivier Chouinard <mochouinard at moctel.com>
Date:   Sat Jan 29 03:09:06 2011 -0500

    mod_callcenter: Add error response for queue load and queue reload (FS-2988)

diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c
index d1de632..61305bb 100644
--- a/src/mod/applications/mod_callcenter/mod_callcenter.c
+++ b/src/mod/applications/mod_callcenter/mod_callcenter.c
@@ -2625,8 +2625,10 @@ SWITCH_STANDARD_API(cc_config_api_function)
 				cc_queue_t *queue = NULL;
 				if ((queue = get_queue(queue_name))) {
 					queue_rwunlock(queue);
+					stream->write_function(stream, "%s", "+OK\n");
+				} else {
+					stream->write_function(stream, "%s", "-ERR Invalid Queue not found!\n");
 				}
-				stream->write_function(stream, "%s", "+OK\n");
 			}
 		} else if (action && !strcasecmp(action, "unload")) {
 			if (argc-initial_argc < 1) {
@@ -2648,8 +2650,10 @@ SWITCH_STANDARD_API(cc_config_api_function)
 				destroy_queue(queue_name, SWITCH_FALSE);
 				if ((queue = get_queue(queue_name))) {
 					queue_rwunlock(queue);
+					stream->write_function(stream, "%s", "+OK\n");
+				} else {
+					stream->write_function(stream, "%s", "-ERR Invalid Queue not found!\n");
 				}
-				stream->write_function(stream, "%s", "+OK\n");
 			}
 		} else if (action && !strcasecmp(action, "list")) {
 			if (argc-initial_argc < 1) {
@@ -2671,7 +2675,6 @@ SWITCH_STANDARD_API(cc_config_api_function)
 				goto done;
 			} else {
 				const char *queue_name = argv[0 + initial_argc];
-
 				struct list_result cbt;
 				cbt.row_process = 0;
 				cbt.stream = stream;

commit be3483b924a674e4c4f0f05734e7e4917634f3ca
Merge: e6e4bce 068d36a
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Fri Jan 28 16:42:20 2011 -0500

    Merge branch 'master' of fs-git:freeswitch


commit e6e4bcea734fbfb54b901ff8b1107ddfe76b7010
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Fri Jan 28 16:42:15 2011 -0500

    TEST-002

diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml
index 5fc9402..6914128 100644
--- a/conf/freeswitch.xml
+++ b/conf/freeswitch.xml
@@ -61,5 +61,4 @@
       <X-PRE-PROCESS cmd="include" data="lang/ru/*.xml"/>
     </macros>
   </section>
-
 </document>

commit 068d36a5c95c5a4143f423b7c36cbe6d5cea36d5
Author: Daniel Swarbrick <daniel at seventhsignal.de>
Date:   Fri Jan 28 22:32:14 2011 +0100

    partial implementation of channel list via snmp

diff --git a/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB
index 9584c8b..11c3999 100644
--- a/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB
+++ b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB
@@ -107,4 +107,88 @@ maxSessionsPerSecond OBJECT-TYPE
         "Maximum permissible sessions per second"
     ::= { systemStats 7 }
 
+
+ChannelEntry ::= SEQUENCE {
+    chanUUID        DisplayString,
+    chanDirection   DisplayString,
+    chanCreated     DisplayString,
+    chanName        DisplayString,
+    chanState       DisplayString,
+    chanCIDName     DisplayString,
+    chanCIDNum      DisplayString
+}
+
+channelList OBJECT-TYPE
+    SYNTAX      SEQUENCE OF ChannelEntry
+    MAX-ACCESS  not-accessible
+    STATUS      current
+    DESCRIPTION
+        "A table containing a list of active channels"
+    ::= { core 9 }
+
+channelEntry OBJECT-TYPE
+    SYNTAX      ChannelEntry
+    MAX-ACCESS  not-accessible
+    STATUS      current
+    DESCRIPTION
+        "A channel entry"
+    INDEX { chanIndex }
+    ::= { channelList 1 }
+
+chanUUID OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The channel UUID."
+    ::= { channelEntry 1 }
+
+chanDirection OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The channel direction."
+    ::= { channelEntry 2 }
+
+chanCreated OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "Channel creation timestamp."
+    ::= { channelEntry 3 }
+
+chanName OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The channel name."
+    ::= { channelEntry 4 }
+
+chanState OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The channel state."
+    ::= { channelEntry 5 }
+
+chanCIDName OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The channel caller ID name."
+    ::= { channelEntry 6 }
+
+chanCIDNum OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+        "The channel caller ID number."
+    ::= { channelEntry 7 }
+
 END
diff --git a/src/mod/event_handlers/mod_snmp/mod_snmp.c b/src/mod/event_handlers/mod_snmp/mod_snmp.c
index 56c7be1..d415d4f 100644
--- a/src/mod/event_handlers/mod_snmp/mod_snmp.c
+++ b/src/mod/event_handlers/mod_snmp/mod_snmp.c
@@ -109,7 +109,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)
 	 */
 	netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 2);
 
-	init_subagent();  
+	init_subagent(pool);
 	init_snmp("mod_snmp");
 
 	return status;
diff --git a/src/mod/event_handlers/mod_snmp/subagent.c b/src/mod/event_handlers/mod_snmp/subagent.c
index bad3dc6..7b9faa7 100644
--- a/src/mod/event_handlers/mod_snmp/subagent.c
+++ b/src/mod/event_handlers/mod_snmp/subagent.c
@@ -36,27 +36,108 @@
 #include <net-snmp/agent/net-snmp-agent-includes.h>
 #include "subagent.h"
 
+netsnmp_table_registration_info *ch_table_info;
+netsnmp_tdata *ch_table;
+netsnmp_handler_registration *ch_reginfo;
+uint32_t idx;
 
-void init_subagent(void)
+
+static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)
 {
-	static oid identity_oid[] = { 1,3,6,1,4,1,27880,1,1 };
-	static oid systemStats_oid[] = { 1,3,6,1,4,1,27880,1,2 };
+	uint32_t *count = (uint32_t *) pArg;
+	*count = atoi(argv[0]);
+	return 0;
+}
 
-	DEBUGMSGTL(("init_subagent", "Initializing\n"));
 
-	netsnmp_register_scalar_group(netsnmp_create_handler_registration("identity", handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY), 1, 2);
-	netsnmp_register_scalar_group(netsnmp_create_handler_registration("systemStats", handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY), 1, 7);
+static int channelList_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+	chan_entry_t *entry;
+	netsnmp_tdata_row *row;
+
+	switch_zmalloc(entry, sizeof(chan_entry_t));
+	if (!entry)
+		return 0;
+
+	row = netsnmp_tdata_create_row();
+	if (!row) {
+		switch_safe_free(entry);
+		return 0;
+	}
+	row->data = entry;
+
+	entry->idx = idx++;
+	strncpy(entry->uuid, argv[0], sizeof(entry->uuid));
+	strncpy(entry->direction, argv[1], sizeof(entry->direction));
+	strncpy(entry->created, argv[2], sizeof(entry->created));
+	strncpy(entry->name, argv[4], sizeof(entry->name));
+	strncpy(entry->state, argv[5], sizeof(entry->state));
+	strncpy(entry->cid_name, argv[6], sizeof(entry->cid_name));
+	strncpy(entry->cid_num, argv[7], sizeof(entry->cid_num));
+
+	netsnmp_tdata_row_add_index(row, ASN_INTEGER, &entry->idx, sizeof(entry->idx));
+	netsnmp_tdata_add_row(ch_table, row);
+	return 0;
 }
 
 
-static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)
+void channelList_free(netsnmp_cache *cache, void *magic)
 {
-	uint32_t *count = (uint32_t *) pArg;
-	*count = atoi(argv[0]);
+	netsnmp_tdata_row *row = netsnmp_tdata_row_first(ch_table);
+
+	/* Delete table rows one by one */
+	while (row) {
+		netsnmp_tdata_remove_and_delete_row(ch_table, row);
+		switch_safe_free(row->data);
+		row = netsnmp_tdata_row_first(ch_table);
+	}
+}
+
+
+int channelList_load(netsnmp_cache *cache, void *vmagic)
+{
+	switch_cache_db_handle_t *dbh;
+	char sql[1024] = "", hostname[256] = "";
+
+	channelList_free(cache, NULL);
+
+	if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
+		return 0;
+	}
+
+	idx = 1;
+	gethostname(hostname, sizeof(hostname));
+	sprintf(sql, "SELECT * FROM channels WHERE hostname='%s' ORDER BY created_epoch", hostname);
+	switch_cache_db_execute_sql_callback(dbh, sql, channelList_callback, NULL, NULL);
+
+	switch_cache_db_release_db_handle(&dbh);
+
 	return 0;
 }
 
 
+void init_subagent(switch_memory_pool_t *pool)
+{
+	static oid identity_oid[] = { 1,3,6,1,4,1,27880,1,1 };
+	static oid systemStats_oid[] = { 1,3,6,1,4,1,27880,1,2 };
+	static oid channelList_oid[] = { 1,3,6,1,4,1,27880,1,9 };
+
+	DEBUGMSGTL(("init_subagent", "mod_snmp subagent initializing\n"));
+
+	netsnmp_register_scalar_group(netsnmp_create_handler_registration("identity", handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY), 1, 2);
+	netsnmp_register_scalar_group(netsnmp_create_handler_registration("systemStats", handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY), 1, 7);
+
+	ch_table_info = switch_core_alloc(pool, sizeof(netsnmp_table_registration_info));
+	netsnmp_table_helper_add_index(ch_table_info, ASN_INTEGER);
+	ch_table_info->min_column = 1;
+	ch_table_info->max_column = 7;
+	ch_table = netsnmp_tdata_create_table("channelList", 0);
+	ch_reginfo = netsnmp_create_handler_registration("channelList", handle_channelList, channelList_oid, OID_LENGTH(channelList_oid), HANDLER_CAN_RONLY);
+	netsnmp_tdata_register(ch_reginfo, ch_table, ch_table_info);
+	netsnmp_inject_handler(ch_reginfo, netsnmp_get_cache_handler(5, channelList_load, channelList_free, channelList_oid, OID_LENGTH(channelList_oid)));
+}
+
+
 int handle_identity(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
 {
 	netsnmp_request_info *request = NULL;
@@ -97,7 +178,7 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 	netsnmp_request_info *request = NULL;
 	oid subid;
 	switch_time_t uptime;
-	uint32_t int_val;
+	uint32_t int_val = 0;
 
 	switch(reqinfo->mode) {
 	case MODE_GET:
@@ -160,6 +241,55 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 }
 
 
+int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
+{
+	netsnmp_request_info *request;
+	netsnmp_table_request_info *table_info;
+	chan_entry_t *entry;
+
+	switch (reqinfo->mode) {
+	case MODE_GET:
+		for (request = requests; request; request = request->next) {
+			table_info = netsnmp_extract_table_info(request);
+			entry = (chan_entry_t *) netsnmp_tdata_extract_entry(request);
+
+			switch (table_info->colnum) {
+			case CH_UUID:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->uuid, strlen(entry->uuid));
+				break;
+			case CH_DIRECTION:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->direction, strlen(entry->direction));
+				break;
+			case CH_CREATED:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->created, strlen(entry->created));
+				break;
+			case CH_NAME:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->name, strlen(entry->name));
+				break;
+			case CH_STATE:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->state, strlen(entry->state));
+				break;
+			case CH_CID_NAME:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->cid_name, strlen(entry->cid_name));
+				break;
+			case CH_CID_NUM:
+				snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->cid_num, strlen(entry->cid_num));
+				break;
+			default:
+				snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", table_info->colnum);
+				netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+			}
+		}
+		break;
+	default:
+		/* we should never get here, so this is a really bad error */
+		snmp_log(LOG_ERR, "Unknown mode (%d) in handle_foo\n", reqinfo->mode );
+		return SNMP_ERR_GENERR;
+	}
+
+	return SNMP_ERR_NOERROR;
+}
+
 
 /* For Emacs:
  * Local Variables:
diff --git a/src/mod/event_handlers/mod_snmp/subagent.h b/src/mod/event_handlers/mod_snmp/subagent.h
index 3315378..0070b2c 100644
--- a/src/mod/event_handlers/mod_snmp/subagent.h
+++ b/src/mod/event_handlers/mod_snmp/subagent.h
@@ -14,9 +14,29 @@
 #define SS_SESSIONS_PER_SECOND		6
 #define SS_MAX_SESSIONS_PER_SECOND	7
 
+/* .1.3.6.1.4.1.27880.1.9 */
+#define CH_UUID				1
+#define CH_DIRECTION			2
+#define CH_CREATED			3
+#define CH_NAME				4
+#define CH_STATE			5
+#define CH_CID_NAME			6
+#define CH_CID_NUM			7
 
-void init_subagent(void);
+typedef struct {
+	uint32_t idx;
+	char uuid[38];
+	char direction[32];
+	char created[128];
+	char name[1024];
+	char state[64];
+	char cid_name[1024];
+	char cid_num[256];
+} chan_entry_t;
+
+void init_subagent(switch_memory_pool_t *pool);
 Netsnmp_Node_Handler handle_identity;
 Netsnmp_Node_Handler handle_systemStats;
+Netsnmp_Node_Handler handle_channelList;
 
 #endif /* subagent_H */

commit 9986f4ebf2a0c40cc99bc7f9f03f2dec6ae74645
Merge: 6d3abd4 b3ac44f
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Fri Jan 28 16:12:07 2011 -0500

    Merge branch 'master' of fs-git:freeswitch


commit 6d3abd41cadef3a2bff8175487c094c80d7d9cf7
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Fri Jan 28 16:11:55 2011 -0500

    TEST-001

diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml
index 6ed99ef..5fc9402 100644
--- a/conf/freeswitch.xml
+++ b/conf/freeswitch.xml
@@ -63,4 +63,3 @@
   </section>
 
 </document>
-

commit b3ac44f555a80f8278c5f915cfb36766903905a4
Author: Daniel Swarbrick <daniel at seventhsignal.de>
Date:   Fri Jan 28 20:36:06 2011 +0100

    add support for getting current call count

diff --git a/src/mod/event_handlers/mod_snmp/subagent.c b/src/mod/event_handlers/mod_snmp/subagent.c
index 8f08baf..bad3dc6 100644
--- a/src/mod/event_handlers/mod_snmp/subagent.c
+++ b/src/mod/event_handlers/mod_snmp/subagent.c
@@ -49,6 +49,14 @@ void init_subagent(void)
 }
 
 
+static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+	uint32_t *count = (uint32_t *) pArg;
+	*count = atoi(argv[0]);
+	return 0;
+}
+
+
 int handle_identity(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
 {
 	netsnmp_request_info *request = NULL;
@@ -113,13 +121,20 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 			snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
 			break;
 		case SS_CURRENT_CALLS:
-			/*
-			 * This is zero for now, since there is no convenient way to get total call
-			 * count (not to be confused with session count), without touching the
-			 * database.
-			 */
-			int_val = 0;
+			{
+			switch_cache_db_handle_t *dbh;
+			char sql[1024] = "", hostname[256] = "";
+
+			if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
+				return SNMP_ERR_GENERR;
+			}
+
+			gethostname(hostname, sizeof(hostname));
+			sprintf(sql, "SELECT COUNT(*) FROM calls WHERE hostname='%s'", hostname);
+			switch_cache_db_execute_sql_callback(dbh, sql, sql_count_callback, &int_val, NULL);
 			snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
+			switch_cache_db_release_db_handle(&dbh);
+			}
 			break;
 		case SS_SESSIONS_PER_SECOND:
 			switch_core_session_ctl(SCSC_LAST_SPS, &int_val);

commit 9e6503a482ff533ff214b01a07c3432be14ff1ce
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Fri Jan 28 14:33:30 2011 -0500

    test

diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml
index 80e7728..6ed99ef 100644
--- a/conf/freeswitch.xml
+++ b/conf/freeswitch.xml
@@ -64,4 +64,3 @@
 
 </document>
 
-

commit 97a2b4f9025099bdab5718a13ee36d15a6152411
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Fri Jan 28 14:24:07 2011 -0500

    test

diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml
index 6ed99ef..80e7728 100644
--- a/conf/freeswitch.xml
+++ b/conf/freeswitch.xml
@@ -64,3 +64,4 @@
 
 </document>
 
+

commit 68b2756970bd4280eba700b7439afdff374fd9e3
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Fri Jan 28 14:21:31 2011 -0500

    test

diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml
index 5fc9402..6ed99ef 100644
--- a/conf/freeswitch.xml
+++ b/conf/freeswitch.xml
@@ -63,3 +63,4 @@
   </section>
 
 </document>
+

commit 9b0c16b5d48a7b9d0ea15ac429a8ca4c8eef8693
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Fri Jan 28 14:20:21 2011 -0500

    test

diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml
index 6ed99ef..5fc9402 100644
--- a/conf/freeswitch.xml
+++ b/conf/freeswitch.xml
@@ -63,4 +63,3 @@
   </section>
 
 </document>
-

commit f05fe55594ffca6edc8f4e74204650aa219ed1ac
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Fri Jan 28 14:19:07 2011 -0500

    test

diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml
index 80e7728..6ed99ef 100644
--- a/conf/freeswitch.xml
+++ b/conf/freeswitch.xml
@@ -64,4 +64,3 @@
 
 </document>
 
-

commit 08f494b80802aacf101705382f149ca4b028eb57
Author: Daniel Swarbrick <daniel at seventhsignal.de>
Date:   Fri Jan 28 20:14:10 2011 +0100

    typo

diff --git a/src/mod/event_handlers/mod_snmp/subagent.c b/src/mod/event_handlers/mod_snmp/subagent.c
index 2da9ebe..8f08baf 100644
--- a/src/mod/event_handlers/mod_snmp/subagent.c
+++ b/src/mod/event_handlers/mod_snmp/subagent.c
@@ -109,7 +109,7 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio
 			snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
 			break;
 		case SS_MAX_SESSIONS:
-			switch_core_session_ctl(SCSC_MAX_SESSIONS, &int_val);;
+			switch_core_session_ctl(SCSC_MAX_SESSIONS, &int_val);
 			snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
 			break;
 		case SS_CURRENT_CALLS:

commit daa28cfccae9b171221408f3af4f8c10283e67b3
Author: Jeff Lenk <jeff at jefflenk.com>
Date:   Fri Jan 28 09:19:03 2011 -0600

    add missing files

diff --git a/libs/freetdm/msvc/freetdm.2010.vcxproj b/libs/freetdm/msvc/freetdm.2010.vcxproj
index 71eb6db..aecb9ef 100644
--- a/libs/freetdm/msvc/freetdm.2010.vcxproj
+++ b/libs/freetdm/msvc/freetdm.2010.vcxproj
@@ -188,6 +188,7 @@
     <ClInclude Include="..\src\include\ftdm_os.h" />
     <ClInclude Include="..\src\include\private\ftdm_sched.h" />
     <ClInclude Include="..\src\include\ftdm_threadmutex.h" />
+    <ClInclude Include="..\src\include\private\ftdm_state.h" />
     <ClInclude Include="..\src\include\private\ftdm_types.h" />
     <ClInclude Include="..\src\include\private\g711.h" />
     <ClInclude Include="..\src\include\private\hashtable.h" />
@@ -209,6 +210,7 @@
     <ClCompile Include="..\src\ftdm_io.c" />
     <ClCompile Include="..\src\ftdm_queue.c" />
     <ClCompile Include="..\src\ftdm_sched.c" />
+    <ClCompile Include="..\src\ftdm_state.c" />
     <ClCompile Include="..\src\ftdm_threadmutex.c" />
     <ClCompile Include="..\src\g711.c" />
     <ClCompile Include="..\src\hashtable.c" />
diff --git a/libs/freetdm/msvc/freetdm.2010.vcxproj.filters b/libs/freetdm/msvc/freetdm.2010.vcxproj.filters
index ed642ba..e6dc40d 100644
--- a/libs/freetdm/msvc/freetdm.2010.vcxproj.filters
+++ b/libs/freetdm/msvc/freetdm.2010.vcxproj.filters
@@ -71,6 +71,9 @@
     <ClInclude Include="..\src\include\private\uart.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\src\include\private\ftdm_state.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\src\fsk.c">
@@ -124,5 +127,8 @@
     <ClCompile Include="..\src\uart.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\src\ftdm_state.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file

commit c64b78577f65b586ff6d7af711c79d0427fc61c5
Author: Travis Cross <tc at traviscross.com>
Date:   Fri Jan 28 09:01:47 2011 +0000

    .gitignore compressed files

diff --git a/.gitignore b/.gitignore
index 304b42c..c53d07d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,12 @@
 *.ilk
 *.bsc
 *.pch
+*.tar
+*.gz
+*.tgz
+*.xz
+*.bz2
+*.tbz2
 core.*
 /Path
 /w32/Library/lastversion
@@ -79,7 +85,6 @@ configure.lineno
 /scripts/fsxs
 /scripts/gentls_cert
 /a.out.dSYM
-/freeswitch-sounds-*
 src/mod/applications/mod_easyroute/Makefile
 src/mod/applications/mod_lcr/Makefile
 src/mod/applications/mod_nibblebill/Makefile
diff --git a/src/mod/endpoints/mod_gsmopen/.gitignore b/src/mod/endpoints/mod_gsmopen/.gitignore
index 9fdeeb1..fe8dc68 100644
--- a/src/mod/endpoints/mod_gsmopen/.gitignore
+++ b/src/mod/endpoints/mod_gsmopen/.gitignore
@@ -1,2 +1,4 @@
 !/gsmlib/gsmlib-*/aclocal.m4
 !/gsmlib/gsmlib-*/configure
+!/gsmlib/gsmlib-1.10.tar.gz
+!/gsmlib/gsmlib_1.10-12ubuntu1.diff.gz

commit 9ade16e9291aa74b4483bb9b9d9db266e082f7cc
Author: Brian West <brian at freeswitch.org>
Date:   Thu Jan 27 18:38:16 2011 -0600

    swigall

diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx
index aa2a84f..3ee6ff6 100644
--- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx
+++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx
@@ -7413,6 +7413,20 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_session_get_dmachine(void * jar
 }
 
 
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_set_codec_slin(void * jarg1, void * jarg2) {
+  int jresult ;
+  switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+  switch_slin_data_t *arg2 = (switch_slin_data_t *) 0 ;
+  switch_status_t result;
+  
+  arg1 = (switch_core_session_t *)jarg1; 
+  arg2 = (switch_slin_data_t *)jarg2; 
+  result = (switch_status_t)switch_core_session_set_codec_slin(arg1,arg2);
+  jresult = result; 
+  return jresult;
+}
+
+
 SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_uuid() {
   char * jresult ;
   char *result = 0 ;
@@ -22794,6 +22808,119 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_api_interface(void * jarg1) {
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_slin_data_session_set(void * jarg1, void * jarg2) {
+  switch_slin_data *arg1 = (switch_slin_data *) 0 ;
+  switch_core_session_t *arg2 = (switch_core_session_t *) 0 ;
+  
+  arg1 = (switch_slin_data *)jarg1; 
+  arg2 = (switch_core_session_t *)jarg2; 
+  if (arg1) (arg1)->session = arg2;
+  
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_slin_data_session_get(void * jarg1) {
+  void * jresult ;
+  switch_slin_data *arg1 = (switch_slin_data *) 0 ;
+  switch_core_session_t *result = 0 ;
+  
+  arg1 = (switch_slin_data *)jarg1; 
+  result = (switch_core_session_t *) ((arg1)->session);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_slin_data_write_frame_set(void * jarg1, void * jarg2) {
+  switch_slin_data *arg1 = (switch_slin_data *) 0 ;
+  switch_frame_t *arg2 = (switch_frame_t *) 0 ;
+  
+  arg1 = (switch_slin_data *)jarg1; 
+  arg2 = (switch_frame_t *)jarg2; 
+  if (arg1) (arg1)->write_frame = *arg2;
+  
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_slin_data_write_frame_get(void * jarg1) {
+  void * jresult ;
+  switch_slin_data *arg1 = (switch_slin_data *) 0 ;
+  switch_frame_t *result = 0 ;
+  
+  arg1 = (switch_slin_data *)jarg1; 
+  result = (switch_frame_t *)& ((arg1)->write_frame);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_slin_data_codec_set(void * jarg1, void * jarg2) {
+  switch_slin_data *arg1 = (switch_slin_data *) 0 ;
+  switch_codec_t *arg2 = (switch_codec_t *) 0 ;
+  
+  arg1 = (switch_slin_data *)jarg1; 
+  arg2 = (switch_codec_t *)jarg2; 
+  if (arg1) (arg1)->codec = *arg2;
+  
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_slin_data_codec_get(void * jarg1) {
+  void * jresult ;
+  switch_slin_data *arg1 = (switch_slin_data *) 0 ;
+  switch_codec_t *result = 0 ;
+  
+  arg1 = (switch_slin_data *)jarg1; 
+  result = (switch_codec_t *)& ((arg1)->codec);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_slin_data_frame_data_set(void * jarg1, char * jarg2) {
+  switch_slin_data *arg1 = (switch_slin_data *) 0 ;
+  char *arg2 ;
+  
+  arg1 = (switch_slin_data *)jarg1; 
+  arg2 = (char *)jarg2; 
+  {
+    if (arg2) strncpy((char *)arg1->frame_data, (const char *)arg2, 4096);
+    else arg1->frame_data[0] = 0;
+  }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_slin_data_frame_data_get(void * jarg1) {
+  char * jresult ;
+  switch_slin_data *arg1 = (switch_slin_data *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (switch_slin_data *)jarg1; 
+  result = (char *)(char *) ((arg1)->frame_data);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_slin_data() {
+  void * jresult ;
+  switch_slin_data *result = 0 ;
+  
+  result = (switch_slin_data *)new switch_slin_data();
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_slin_data(void * jarg1) {
+  switch_slin_data *arg1 = (switch_slin_data *) 0 ;
+  
+  arg1 = (switch_slin_data *)jarg1; 
+  delete arg1;
+  
+}
+
+
 SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_timetable_profile_created_set(void * jarg1, void * jarg2) {
   switch_channel_timetable *arg1 = (switch_channel_timetable *) 0 ;
   switch_time_t arg2 ;
diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs
index 5a2188a..48d585e 100644
--- a/src/mod/languages/mod_managed/managed/swig.cs
+++ b/src/mod/languages/mod_managed/managed/swig.cs
@@ -1357,6 +1357,11 @@ public class freeswitch {
     return ret;
   }
 
+  public static switch_status_t switch_core_session_set_codec_slin(SWIGTYPE_p_switch_core_session session, switch_slin_data data) {
+    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_set_codec_slin(SWIGTYPE_p_switch_core_session.getCPtr(session), switch_slin_data.getCPtr(data));
+    return ret;
+  }
+
   public static string switch_core_get_uuid() {
     string ret = freeswitchPINVOKE.switch_core_get_uuid();
     return ret;
@@ -7504,6 +7509,9 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_dmachine")]
   public static extern IntPtr switch_core_session_get_dmachine(HandleRef jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_set_codec_slin")]
+  public static extern int switch_core_session_set_codec_slin(HandleRef jarg1, HandleRef jarg2);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_uuid")]
   public static extern string switch_core_get_uuid();
 
@@ -11188,6 +11196,36 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_api_interface")]
   public static extern void delete_switch_api_interface(HandleRef jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_session_set")]
+  public static extern void switch_slin_data_session_set(HandleRef jarg1, HandleRef jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_session_get")]
+  public static extern IntPtr switch_slin_data_session_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_write_frame_set")]
+  public static extern void switch_slin_data_write_frame_set(HandleRef jarg1, HandleRef jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_write_frame_get")]
+  public static extern IntPtr switch_slin_data_write_frame_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_codec_set")]
+  public static extern void switch_slin_data_codec_set(HandleRef jarg1, HandleRef jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_codec_get")]
+  public static extern IntPtr switch_slin_data_codec_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_frame_data_set")]
+  public static extern void switch_slin_data_frame_data_set(HandleRef jarg1, string jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_frame_data_get")]
+  public static extern string switch_slin_data_frame_data_get(HandleRef jarg1);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_new_switch_slin_data")]
+  public static extern IntPtr new_switch_slin_data();
+
+  [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_slin_data")]
+  public static extern void delete_switch_slin_data(HandleRef jarg1);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_timetable_profile_created_set")]
   public static extern void switch_channel_timetable_profile_created_set(HandleRef jarg1, HandleRef jarg2);
 
@@ -28401,7 +28439,8 @@ public enum switch_rtp_bug_flag_t {
   RTP_BUG_IGNORE_MARK_BIT = (1 << 2),
   RTP_BUG_SEND_LINEAR_TIMESTAMPS = (1 << 3),
   RTP_BUG_START_SEQ_AT_ZERO = (1 << 4),
-  RTP_BUG_NEVER_SEND_MARKER = (1 << 5)
+  RTP_BUG_NEVER_SEND_MARKER = (1 << 5),
+  RTP_BUG_IGNORE_DTMF_DURATION = (1 << 6)
 }
 
 }
@@ -29437,6 +29476,96 @@ public enum switch_signal_t {
 
 namespace FreeSWITCH.Native {
 
+using System;
+using System.Runtime.InteropServices;
+
+public class switch_slin_data : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal switch_slin_data(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(switch_slin_data obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~switch_slin_data() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchPINVOKE.delete_switch_slin_data(swigCPtr);
+      }
+      swigCPtr = new HandleRef(null, IntPtr.Zero);
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public SWIGTYPE_p_switch_core_session session {
+    set {
+      freeswitchPINVOKE.switch_slin_data_session_set(swigCPtr, SWIGTYPE_p_switch_core_session.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_slin_data_session_get(swigCPtr);
+      SWIGTYPE_p_switch_core_session ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_core_session(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_frame write_frame {
+    set {
+      freeswitchPINVOKE.switch_slin_data_write_frame_set(swigCPtr, switch_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_slin_data_write_frame_get(swigCPtr);
+      switch_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_codec codec {
+    set {
+      freeswitchPINVOKE.switch_slin_data_codec_set(swigCPtr, switch_codec.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_slin_data_codec_get(swigCPtr);
+      switch_codec ret = (cPtr == IntPtr.Zero) ? null : new switch_codec(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public string frame_data {
+    set {
+      freeswitchPINVOKE.switch_slin_data_frame_data_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_slin_data_frame_data_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public switch_slin_data() : this(freeswitchPINVOKE.new_switch_slin_data(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 [System.Flags] public enum switch_speech_flag_enum_t {
   SWITCH_SPEECH_FLAG_NONE = 0,
   SWITCH_SPEECH_FLAG_HASTEXT = (1 << 0),
@@ -30146,7 +30275,7 @@ public enum switch_status_t {
   SWITCH_STATUS_FALSE,
   SWITCH_STATUS_TIMEOUT,
   SWITCH_STATUS_RESTART,
-  SWITCH_STATUS_TERM,
+  SWITCH_STATUS_INTR,
   SWITCH_STATUS_NOTIMPL,
   SWITCH_STATUS_MEMERR,
   SWITCH_STATUS_NOOP,
@@ -30163,6 +30292,7 @@ public enum switch_status_t {
   SWITCH_STATUS_TOO_SMALL,
   SWITCH_STATUS_FOUND,
   SWITCH_STATUS_CONTINUE,
+  SWITCH_STATUS_TERM,
   SWITCH_STATUS_NOT_INITALIZED
 }
 

commit 314a2a1e2061ef321fa5f9b32a9c70ef0040cdb8
Author: Brian West <brian at freeswitch.org>
Date:   Thu Jan 27 10:40:49 2011 -0600

    FS-3004

diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c
index 21c6a68..4dd936b 100644
--- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c
+++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c
@@ -40,6 +40,9 @@
 #define MAX_FEC_ENTRIES             4
 #define MAX_FEC_SPAN                4
 
+#define SPANDSP_EVENT_TXFAXRESULT "spandsp::txfaxresult"
+#define SPANDSP_EVENT_RXFAXRESULT "spandsp::rxfaxresult"
+
 /*****************************************************************************
 	OUR DEFINES AND STRUCTS
 *****************************************************************************/
@@ -305,7 +308,14 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
 	switch_core_session_t *session;
 	switch_channel_t *channel;
 	pvt_t *pvt;
-	char *tmp;
+	char *fax_document_transferred_pages = NULL;
+	char *fax_document_total_pages = NULL;
+	char *fax_image_resolution = NULL;
+	char *fax_image_size = NULL;
+	char *fax_bad_rows = NULL;
+	char *fax_transfer_rate = NULL;
+	char *fax_result_code = NULL;
+	switch_event_t *event;
 
 	pvt = (pvt_t *) user_data;
 	switch_assert(pvt);
@@ -353,13 +363,12 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
 	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "==============================================================================\n");
 
 	/*
-	   Set our channel variables
+	   Set our channel variables, variables are also used in event
 	 */
 
-	tmp = switch_mprintf("%i", result);
-	if (tmp) {
-		switch_channel_set_variable(channel, "fax_result_code", tmp);
-		switch_safe_free(tmp);
+	fax_result_code = switch_core_session_sprintf(session, "%i", result);
+	if (fax_result_code) {
+		switch_channel_set_variable(channel, "fax_result_code", fax_result_code);
 	}
 
 	switch_channel_set_variable(channel, "fax_result_text", t30_completion_code_to_str(result));
@@ -368,49 +377,56 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
 	switch_channel_set_variable(channel, "fax_local_station_id", local_ident);
 	switch_channel_set_variable(channel, "fax_remote_station_id", far_ident);
 
-	tmp = switch_mprintf("%i", pvt->app_mode == FUNCTION_TX ? t.pages_tx : t.pages_rx);
-	if (tmp) {
-		switch_channel_set_variable(channel, "fax_document_transferred_pages", tmp);
-		switch_safe_free(tmp);
+	fax_document_transferred_pages = switch_core_session_sprintf(session, "%i", pvt->app_mode == FUNCTION_TX ? t.pages_tx : t.pages_rx);
+	if (fax_document_transferred_pages) {
+		switch_channel_set_variable(channel, "fax_document_transferred_pages", fax_document_transferred_pages);
 	}
 
-	tmp = switch_mprintf("%i", t.pages_in_file);
-	if (tmp) {
-		switch_channel_set_variable(channel, "fax_document_total_pages", tmp);
-		switch_safe_free(tmp);
+	fax_document_total_pages = switch_core_session_sprintf(session, "%i", t.pages_in_file);
+	if (fax_document_total_pages) {
+		switch_channel_set_variable(channel, "fax_document_total_pages", fax_document_total_pages);
 	}
 
-	tmp = switch_mprintf("%ix%i", t.x_resolution, t.y_resolution);
-	if (tmp) {
-		switch_channel_set_variable(channel, "fax_image_resolution", tmp);
-		switch_safe_free(tmp);
+	fax_image_resolution = switch_core_session_sprintf(session, "%ix%i", t.x_resolution, t.y_resolution);
+	if (fax_image_resolution) {
+		switch_channel_set_variable(channel, "fax_image_resolution", fax_image_resolution);
 	}
 
-	tmp = switch_mprintf("%d", t.image_size);
-	if (tmp) {
-		switch_channel_set_variable(channel, "fax_image_size", tmp);
-		switch_safe_free(tmp);
+	fax_image_size = switch_core_session_sprintf(session, "%d", t.image_size);
+	if (fax_image_size) {
+		switch_channel_set_variable(channel, "fax_image_size", fax_image_size);
 	}
 
-	tmp = switch_mprintf("%d", t.bad_rows);
-	if (tmp) {
-		switch_channel_set_variable(channel, "fax_bad_rows", tmp);
-		switch_safe_free(tmp);
+	fax_bad_rows = switch_core_session_sprintf(session, "%d", t.bad_rows);
+	if (fax_bad_rows) {
+		switch_channel_set_variable(channel, "fax_bad_rows", fax_bad_rows);
 	}
 
-	tmp = switch_mprintf("%i", t.bit_rate);
-	if (tmp) {
-		switch_channel_set_variable(channel, "fax_transfer_rate", tmp);
-		switch_safe_free(tmp);
+	fax_transfer_rate = switch_core_session_sprintf(session, "%i", t.bit_rate);
+	if (fax_transfer_rate) {
+		switch_channel_set_variable(channel, "fax_transfer_rate", fax_transfer_rate);
 	}
 
 	/* switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); */
 
 	pvt->done = 1;
 
-	/*
-	   TODO Fire events
-	 */
+	/* Fire event */
+
+	if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, pvt->app_mode == FUNCTION_TX ? SPANDSP_EVENT_TXFAXRESULT : SPANDSP_EVENT_RXFAXRESULT) == SWITCH_STATUS_SUCCESS) {
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-document-transferred-pages", fax_document_transferred_pages);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-document-total-pages", fax_document_total_pages);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-image-resolution", fax_image_resolution);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-image-size", fax_image_size);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-bad-rows", fax_bad_rows);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-transfer-rate", fax_transfer_rate);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-result-code", fax_result_code);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-result-text", t30_completion_code_to_str(result));
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-ecm-used", (t.error_correcting_mode) ? "on" : "off");
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-local-station-id", local_ident);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-remote-station-id", far_ident);
+		switch_core_session_queue_private_event(session, &event, SWITCH_FALSE);
+	}
 }
 
 static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count)
@@ -1026,7 +1042,6 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Fax TX filename not set.\n");
 			goto done;
 		} else if (pvt->app_mode == FUNCTION_RX) {
-			char *fname;
 			const char *prefix;
 			switch_time_t time;
 
@@ -1036,11 +1051,7 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
 				prefix = globals.prepend_string;
 			}
 
-			fname = switch_mprintf("%s/%s-%ld-%ld.tif", globals.spool, prefix, globals.total_sessions, time);
-			if (fname) {
-				pvt->filename = switch_core_session_strdup(session, fname);
-				switch_safe_free(fname);
-			} else {
+			if (!(pvt->filename = switch_core_session_sprintf(session, "%s/%s-%ld-%ld.tif", globals.spool, prefix, globals.total_sessions, time))) {
 				switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot automatically set fax RX destination file\n");
 				goto done;
 			}

commit 48c02b7cd2770f6aee1d6e89f5ecfe207231f398
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Thu Jan 27 16:49:09 2011 -0500

    test

diff --git a/build/modules.conf.in b/build/modules.conf.in
index b46c2ff..84a9e9a 100644
--- a/build/modules.conf.in
+++ b/build/modules.conf.in
@@ -112,4 +112,3 @@ say/mod_say_ru
 
 ## Experimental Modules (don't cry if they're broken)
 #../../contrib/mod/xml_int/mod_xml_odbc
-

commit f954d21ab8f84ea3518525d6f8a5a25c5cd39d6b
Merge: f8254f8 608be37
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Thu Jan 27 16:24:20 2011 -0500

    Merge branch 'master' of fs-git:freeswitch


commit f8254f81607c9b2fe8ece3c48cb6dff700bcbead
Author: Raymond Chandler <intralanman at gmail.com>
Date:   Thu Jan 27 16:24:11 2011 -0500

    test

diff --git a/build/modules.conf.in b/build/modules.conf.in
index 84a9e9a..b46c2ff 100644
--- a/build/modules.conf.in
+++ b/build/modules.conf.in
@@ -112,3 +112,4 @@ say/mod_say_ru
 
 ## Experimental Modules (don't cry if they're broken)
 #../../contrib/mod/xml_int/mod_xml_odbc
+

commit 608be370bcca24023ee9d05ee4a99c133044f0d3
Author: Daniel Swarbrick <daniel at seventhsignal.de>
Date:   Thu Jan 27 21:33:17 2011 +0100

    reduce agentx heartbeat to 2s, add management hook for mutex lock/unlock

diff --git a/src/mod/event_handlers/mod_snmp/mod_snmp.c b/src/mod/event_handlers/mod_snmp/mod_snmp.c
index 0310637..56c7be1 100644
--- a/src/mod/event_handlers/mod_snmp/mod_snmp.c
+++ b/src/mod/event_handlers/mod_snmp/mod_snmp.c
@@ -48,6 +48,20 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime);
 SWITCH_MODULE_DEFINITION(mod_snmp, mod_snmp_load, mod_snmp_shutdown, mod_snmp_runtime);
 
 
+static switch_status_t snmp_manage(char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen)
+{
+	if (action == SMA_GET) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Mutex lock request from relative OID %s.\n", relative_oid);
+		switch_mutex_lock(globals.mutex);
+	} else if (action == SMA_SET) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Mutex unlock request from relative OID %s.\n", relative_oid);
+		switch_mutex_unlock(globals.mutex);
+	}
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
 static int snmp_callback_log(int major, int minor, void *serverarg, void *clientarg)
 {
 	struct snmp_log_message *slm = (struct snmp_log_message *) serverarg;
@@ -71,10 +85,14 @@ static switch_status_t load_config(switch_memory_pool_t *pool)
 SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)
 {
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
+	switch_management_interface_t *management_interface;
 
 	load_config(pool);
 
 	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
+	management_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_MANAGEMENT_INTERFACE);
+	management_interface->relative_oid = "1000";
+	management_interface->management_function = snmp_manage;
 
 	/* Register callback function so we get Net-SNMP logging handled by FreeSWITCH */
 	snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_LOGGING, snmp_callback_log, NULL);
@@ -86,10 +104,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)
 	init_agent("mod_snmp");
 
 	/*
-	 * Override master/subagent ping interval to 5s, to ensure that
+	 * Override master/subagent ping interval to 2s, to ensure that
 	 * agent_check_and_process() never blocks for longer than that.
 	 */
-	netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 5);
+	netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 2);
 
 	init_subagent();  
 	init_snmp("mod_snmp");
@@ -107,6 +125,8 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime)
 		switch_mutex_unlock(globals.mutex);
 	}
 
+	switch_yield(5000);
+
 	return SWITCH_STATUS_SUCCESS;
 }
 

commit 4b941542a309a8c7f7ad5d01cfef9d1c487376a8
Author: Anthony Minessale <anthm at freeswitch.org>
Date:   Thu Jan 27 10:34:05 2011 -0600

    fix out of place parens in logic test

diff --git a/src/switch_channel.c b/src/switch_channel.c
index 918ad82..de472a9 100644
--- a/src/switch_channel.c
+++ b/src/switch_channel.c
@@ -2564,8 +2564,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready_value(swi
 	char *app;
 	switch_event_t *event;
 
-	if (!switch_channel_test_flag(channel, CF_RING_READY) && !switch_channel_test_flag(channel, CF_EARLY_MEDIA &&
-																					   !switch_channel_test_flag(channel, CF_ANSWERED))) {
+	if (!switch_channel_test_flag(channel, CF_RING_READY) && 
+		!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(channel, CF_ANSWERED)) {
 		switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_channel_get_uuid(channel), SWITCH_LOG_NOTICE, "Ring-Ready %s!\n", channel->name);
 		switch_channel_set_flag_value(channel, CF_RING_READY, rv);
 		if (channel->caller_profile && channel->caller_profile->times) {

commit b889b44f1d632810662359f6becce869056a076c
Author: Anthony Minessale <anthm at freeswitch.org>
Date:   Thu Jan 27 10:28:49 2011 -0600

    add channel data to speech events when chosen to fire

diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c
index 4354f0d..0a646b6 100644
--- a/src/switch_ivr_async.c
+++ b/src/switch_ivr_async.c
@@ -3129,6 +3129,7 @@ static void *SWITCH_THREAD_FUNC speech_thread(switch_thread_t *thread, void *obj
 					switch_event_t *dup;
 
 					if (switch_event_dup(&dup, event) == SWITCH_STATUS_SUCCESS) {
+						switch_channel_event_set_data(channel, dup);
 						switch_event_fire(&dup);
 					}
 

commit 22c05ad542e3a36dd7dbb71bef5aca5ff009b1b9
Author: Brian West <brian at freeswitch.org>
Date:   Thu Jan 27 09:41:18 2011 -0600

    fixes from tony

diff --git a/scripts/perl/dhcp-inform.pl b/scripts/perl/dhcp-inform.pl
index 3f977ca..2ca4bb8 100644
--- a/scripts/perl/dhcp-inform.pl
+++ b/scripts/perl/dhcp-inform.pl
@@ -61,12 +61,7 @@ while ($sock->recv($newmsg, 1024)) {
     }
     print "Sending option 66 as $opt_u\n";
 
-    $handle = IO::Socket::INET->new(Proto => 'udp',
-				    PeerPort => '68',
-				    LocalPort => '67',
-				    ReuseAddr => 1,
-				    PeerAddr => $dhcpreq->ciaddr(),
-				   ) or die "socket: $@";
-    $handle->send($dhcpresp->serialize())
+
+    $sock->send($dhcpresp->serialize())
   }
 }

commit 008e527c0f5c86e20521c4ebacf69adcb269b08a
Author: Anthony Minessale <anthm at freeswitch.org>
Date:   Thu Jan 27 08:18:22 2011 -0600

    FS-3012

diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c
index 643b3dd..47f94b1 100644
--- a/src/mod/endpoints/mod_sofia/sofia.c
+++ b/src/mod/endpoints/mod_sofia/sofia.c
@@ -808,6 +808,18 @@ void sofia_event_callback(nua_event_t event,
 		}
 	}
 	
+	if ((event == nua_i_invite) && (!session)) {
+		uint32_t sess_count = switch_core_session_count();
+		uint32_t sess_max = switch_core_session_limit(0);
+		
+		if (sess_count >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready()) {
+			nua_respond(nh, 503, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), TAG_END());
+
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "No more sessions allowed at this time.\n");
+
+			goto done;
+		}
+	}
 	
 	if (sofia_test_pflag(profile, PFLAG_AUTH_ALL) && tech_pvt && tech_pvt->key && sip) {
 		sip_authorization_t const *authorization = NULL;

commit 425df0c78389d30561a7f025a1a3e3b2fbc5e413
Author: Leon de Rooij <leon at toyos.nl>
Date:   Thu Jan 27 14:17:49 2011 +0100

    Added test_reactive to mod_lua freeswitch.Dbh

diff --git a/src/mod/languages/mod_lua/freeswitch.i b/src/mod/languages/mod_lua/freeswitch.i
index 9ccaf8e..25faa5a 100644
--- a/src/mod/languages/mod_lua/freeswitch.i
+++ b/src/mod/languages/mod_lua/freeswitch.i
@@ -89,6 +89,7 @@ class Dbh {
     ~Dbh();
     bool release();
     bool connected();
+    bool test_reactive(char *test_sql, char *drop_sql = NULL, char *reactive_sql = NULL);
     bool query(char *sql, SWIGLUA_FN lua_fun);
     int affected_rows();
 };
diff --git a/src/mod/languages/mod_lua/freeswitch_lua.cpp b/src/mod/languages/mod_lua/freeswitch_lua.cpp
index 01f708d..b388f2e 100644
--- a/src/mod/languages/mod_lua/freeswitch_lua.cpp
+++ b/src/mod/languages/mod_lua/freeswitch_lua.cpp
@@ -350,6 +350,16 @@ bool Dbh::connected()
   return m_connected;
 }
 
+bool Dbh::test_reactive(char *test_sql, char *drop_sql, char *reactive_sql)
+{
+  if (m_connected) {
+    if (switch_cache_db_test_reactive(dbh, test_sql, drop_sql, reactive_sql) == SWITCH_TRUE) {
+      return true;
+    }
+  }
+  return false;
+}
+
 int Dbh::query_callback(void *pArg, int argc, char **argv, char **cargv)
 {
   SWIGLUA_FN *lua_fun = (SWIGLUA_FN *)pArg;
diff --git a/src/mod/languages/mod_lua/freeswitch_lua.h b/src/mod/languages/mod_lua/freeswitch_lua.h
index 5f79662..6411d69 100644
--- a/src/mod/languages/mod_lua/freeswitch_lua.h
+++ b/src/mod/languages/mod_lua/freeswitch_lua.h
@@ -62,6 +62,7 @@ namespace LUA {
       ~Dbh();
       bool release();
       bool connected();
+      bool test_reactive(char *test_sql, char *drop_sql = NULL, char *reactive_sql = NULL);
       bool query(char *sql, SWIGLUA_FN lua_fun);
       int affected_rows();
   };
diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp
index f10ed63..1d84a39 100644
--- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp
+++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp
@@ -7254,6 +7254,184 @@ fail:
 }
 
 
+static int _wrap_Dbh_test_reactive__SWIG_0(lua_State* L) {
+  int SWIG_arg = -1;
+  LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  bool result;
+  
+  SWIG_check_num_args("test_reactive",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");
+  if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");
+  if(!lua_isstring(L,3)) SWIG_fail_arg("test_reactive",3,"char *");
+  if(!lua_isstring(L,4)) SWIG_fail_arg("test_reactive",4,"char *");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
+    SWIG_fail_ptr("Dbh_test_reactive",1,SWIGTYPE_p_LUA__Dbh);
+  }
+  
+  arg2 = (char *)lua_tostring(L, 2);
+  arg3 = (char *)lua_tostring(L, 3);
+  arg4 = (char *)lua_tostring(L, 4);
+  result = (bool)(arg1)->test_reactive(arg2,arg3,arg4);
+  SWIG_arg=0;
+  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  return SWIG_arg;
+  
+  if(0) SWIG_fail;
+  
+fail:
+  lua_error(L);
+  return SWIG_arg;
+}
+
+
+static int _wrap_Dbh_test_reactive__SWIG_1(lua_State* L) {
+  int SWIG_arg = -1;
+  LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  bool result;
+  
+  SWIG_check_num_args("test_reactive",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");
+  if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");
+  if(!lua_isstring(L,3)) SWIG_fail_arg("test_reactive",3,"char *");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
+    SWIG_fail_ptr("Dbh_test_reactive",1,SWIGTYPE_p_LUA__Dbh);
+  }
+  
+  arg2 = (char *)lua_tostring(L, 2);
+  arg3 = (char *)lua_tostring(L, 3);
+  result = (bool)(arg1)->test_reactive(arg2,arg3);
+  SWIG_arg=0;
+  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  return SWIG_arg;
+  
+  if(0) SWIG_fail;
+  
+fail:
+  lua_error(L);
+  return SWIG_arg;
+}
+
+
+static int _wrap_Dbh_test_reactive__SWIG_2(lua_State* L) {
+  int SWIG_arg = -1;
+  LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
+  char *arg2 = (char *) 0 ;
+  bool result;
+  
+  SWIG_check_num_args("test_reactive",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");
+  if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
+    SWIG_fail_ptr("Dbh_test_reactive",1,SWIGTYPE_p_LUA__Dbh);
+  }
+  
+  arg2 = (char *)lua_tostring(L, 2);
+  result = (bool)(arg1)->test_reactive(arg2);
+  SWIG_arg=0;
+  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  return SWIG_arg;
+  
+  if(0) SWIG_fail;
+  
+fail:
+  lua_error(L);
+  return SWIG_arg;
+}
+
+
+static int _wrap_Dbh_test_reactive(lua_State* L) {
+  int argc;
+  int argv[5]={
+    1,2,3,4,5
+  };
+  
+  argc = lua_gettop(L);
+  if (argc == 2) {
+    int _v;
+    {
+      void *ptr;
+      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Dbh, 0)) {
+        _v = 0;
+      } else {
+        _v = 1;
+      }
+    }
+    if (_v) {
+      {
+        _v = lua_isstring(L,argv[1]);
+      }
+      if (_v) {
+        return _wrap_Dbh_test_reactive__SWIG_2(L);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    {
+      void *ptr;
+      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Dbh, 0)) {
+        _v = 0;
+      } else {
+        _v = 1;
+      }
+    }
+    if (_v) {
+      {
+        _v = lua_isstring(L,argv[1]);
+      }
+      if (_v) {
+        {
+          _v = lua_isstring(L,argv[2]);
+        }
+        if (_v) {
+          return _wrap_Dbh_test_reactive__SWIG_1(L);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    {
+      void *ptr;
+      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Dbh, 0)) {
+        _v = 0;
+      } else {
+        _v = 1;
+      }
+    }
+    if (_v) {
+      {
+        _v = lua_isstring(L,argv[1]);
+      }
+      if (_v) {
+        {
+          _v = lua_isstring(L,argv[2]);
+        }
+        if (_v) {
+          {
+            _v = lua_isstring(L,argv[3]);
+          }
+          if (_v) {
+            return _wrap_Dbh_test_reactive__SWIG_0(L);
+          }
+        }
+      }
+    }
+  }
+  
+  lua_pushstring(L,"No matching function for overloaded 'Dbh_test_reactive'");
+  lua_error(L);return 0;
+}
+
+
 static int _wrap_Dbh_query(lua_State* L) {
   int SWIG_arg = -1;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
@@ -7328,6 +7506,7 @@ delete arg1;
 static swig_lua_method swig_LUA_Dbh_methods[] = {
     {"release", _wrap_Dbh_release}, 
     {"connected", _wrap_Dbh_connected}, 
+    {"test_reactive", _wrap_Dbh_test_reactive}, 
     {"query", _wrap_Dbh_query}, 
     {"affected_rows", _wrap_Dbh_affected_rows}, 
     {0,0}

commit a01814794c1fb49b77a6015edc8e1ad6c925bae3
Author: Leon de Rooij <leon at toyos.nl>
Date:   Thu Jan 27 13:10:26 2011 +0100

    Added optional core: prefix to first arg passed to freeswitch.Dbh for giving direct access to sqlite db

diff --git a/src/mod/languages/mod_lua/freeswitch_lua.cpp b/src/mod/languages/mod_lua/freeswitch_lua.cpp
index 1a170dc..01f708d 100644
--- a/src/mod/languages/mod_lua/freeswitch_lua.cpp
+++ b/src/mod/languages/mod_lua/freeswitch_lua.cpp
@@ -312,15 +312,21 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp
 Dbh::Dbh(char *dsn, char *user, char *pass)
 {
   switch_cache_db_connection_options_t options = { {0} };
+  const char *prefix = "core:";
+  m_connected = false;
 
-  options.odbc_options.dsn = dsn;
-  options.odbc_options.user = user;
-  options.odbc_options.pass = pass;
-
-  if (switch_cache_db_get_db_handle(&dbh, SCDB_TYPE_ODBC, &options) == SWITCH_STATUS_SUCCESS) {
-    m_connected = true;
+  if (strstr(dsn, prefix) == dsn) {
+    options.core_db_options.db_path = &dsn[strlen(prefix)];
+    if (switch_cache_db_get_db_handle(&dbh, SCDB_TYPE_CORE_DB, &options) == SWITCH_STATUS_SUCCESS) {
+      m_connected = true;
+    }
   } else {
-    m_connected = false;
+    options.odbc_options.dsn = dsn;
+    options.odbc_options.user = user;
+    options.odbc_options.pass = pass;
+    if (switch_cache_db_get_db_handle(&dbh, SCDB_TYPE_ODBC, &options) == SWITCH_STATUS_SUCCESS) {
+      m_connected = true;
+    }
   }
 }
 

commit 9ffca057f109725986b741cb6019dce620c056b7
Author: David Yat Sin <dyatsin at sangoma.com>
Date:   Wed Jan 26 17:24:25 2011 -0500

    chlog: freetdm - isdn: fix for not including some bearer-cap contents on BRI

diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c
index 64147b7..23fe08b 100644
--- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c
+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c
@@ -873,38 +873,32 @@ ftdm_status_t set_bear_cap_ie(ftdm_channel_t *ftdmchan, BearCap *bearCap)
 	bearCap->tranMode.pres = PRSNT_NODEF;
 	bearCap->tranMode.val = IN_TM_CIRCUIT;
 
-	if (!FTDM_SPAN_IS_BRI(ftdmchan->span)) {
-		/* Trillium stack rejests lyr1Ident on BRI, but Netbricks always sends it.
-		Check with Trillium if this ever causes calls to fail in the field */
+	bearCap->usrInfoLyr1Prot.pres = PRSNT_NODEF;
+	bearCap->usrInfoLyr1Prot.val = sngisdn_get_usrInfoLyr1Prot_from_user(ftdmchan->caller_data.bearer_layer1);
 
-		/* PRI only params */
-		bearCap->usrInfoLyr1Prot.pres = PRSNT_NODEF;
-		bearCap->usrInfoLyr1Prot.val = sngisdn_get_usrInfoLyr1Prot_from_user(ftdmchan->caller_data.bearer_layer1);
-
-		switch (signal_data->switchtype) {
-			case SNGISDN_SWITCH_NI2:
-			case SNGISDN_SWITCH_4ESS:
-			case SNGISDN_SWITCH_5ESS:
-			case SNGISDN_SWITCH_DMS100:
-			case SNGISDN_SWITCH_INSNET:
-				if (bearCap->usrInfoLyr1Prot.val == IN_UIL1_G711ALAW) {
-					ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to u-law\n");
-					bearCap->usrInfoLyr1Prot.val = IN_UIL1_G711ULAW;
-				}
-				break;
-			case SNGISDN_SWITCH_EUROISDN:
-			case SNGISDN_SWITCH_QSIG:
-				if (bearCap->usrInfoLyr1Prot.val == IN_UIL1_G711ULAW) {
-					ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to a-law\n");
-					bearCap->usrInfoLyr1Prot.val = IN_UIL1_G711ALAW;
-				}
-				break;
-		}
-
-		
-		bearCap->lyr1Ident.pres = PRSNT_NODEF;
-		bearCap->lyr1Ident.val = IN_L1_IDENT;
+	switch (signal_data->switchtype) {
+		case SNGISDN_SWITCH_NI2:
+		case SNGISDN_SWITCH_4ESS:
+		case SNGISDN_SWITCH_5ESS:
+		case SNGISDN_SWITCH_DMS100:
+		case SNGISDN_SWITCH_INSNET:
+			if (bearCap->usrInfoLyr1Prot.val == IN_UIL1_G711ALAW) {
+				ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to u-law\n");
+				bearCap->usrInfoLyr1Prot.val = IN_UIL1_G711ULAW;
+			}
+			break;
+		case SNGISDN_SWITCH_EUROISDN:
+		case SNGISDN_SWITCH_QSIG:
+			if (bearCap->usrInfoLyr1Prot.val == IN_UIL1_G711ULAW) {
+				ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to a-law\n");
+				bearCap->usrInfoLyr1Prot.val = IN_UIL1_G711ALAW;
+			}
+			break;
 	}
+
+	bearCap->lyr1Ident.pres = PRSNT_NODEF;
+	bearCap->lyr1Ident.val = IN_L1_IDENT;
+	
 	return FTDM_SUCCESS;
 }
 

commit 6f58e6aa425283137effa286d7f8638aa035aff4
Author: Anthony Minessale <anthm at freeswitch.org>
Date:   Wed Jan 26 15:19:28 2011 -0600

    FS-2771

diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c
index 472f2d9..12b3193 100644
--- a/src/mod/applications/mod_conference/mod_conference.c
+++ b/src/mod/applications/mod_conference/mod_conference.c
@@ -152,7 +152,8 @@ typedef enum {
 	CFLAG_BRIDGE_TO = (1 << 6),
 	CFLAG_WAIT_MOD = (1 << 7),
 	CFLAG_VID_FLOOR = (1 << 8),
-	CFLAG_WASTE_BANDWIDTH = (1 << 9)
+	CFLAG_WASTE_BANDWIDTH = (1 << 9),
+	CFLAG_OUTCALL = (1 << 10)
 } conf_flag_t;
 
 typedef enum {
@@ -288,6 +289,8 @@ typedef struct conference_obj {
 	uint32_t avg_tally;
 	switch_time_t run_time;
 	char *uuid_str;
+	uint32_t originating;
+	switch_call_cause_t cancel_cause;
 } conference_obj_t;
 
 /* Relationship with another member */
@@ -395,11 +398,16 @@ SWITCH_STANDARD_API(conf_api_main);
 static switch_status_t conference_outcall(conference_obj_t *conference,
 										  char *conference_name,
 										  switch_core_session_t *session,
-										  char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num, switch_call_cause_t *cause);
+										  char *bridgeto, uint32_t timeout, 
+										  char *flags, 
+										  char *cid_name, 
+										  char *cid_num, 
+										  switch_call_cause_t *cause,
+										  switch_call_cause_t *cancel_cause);
 static switch_status_t conference_outcall_bg(conference_obj_t *conference,
 											 char *conference_name,
 											 switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name,
-											 const char *cid_num, const char *call_uuid);
+											 const char *cid_num, const char *call_uuid, switch_call_cause_t *cancel_cause);
 SWITCH_STANDARD_APP(conference_function);
 static void launch_conference_thread(conference_obj_t *conference);
 static void launch_conference_video_thread(conference_obj_t *conference);
@@ -1381,6 +1389,14 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
 	/* Rinse ... Repeat */
   end:
 
+	if (switch_test_flag(conference, CFLAG_OUTCALL)) {
+		conference->cancel_cause = SWITCH_CAUSE_ORIGINATOR_CANCEL;
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Ending pending outcall channels for Conference: '%s'\n", conference->name);
+		while(conference->originating) {
+			switch_yield(200000);
+		}
+	}
+
 	if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conference->name);
@@ -2404,6 +2420,8 @@ static void conference_loop_output(conference_member_t *member)
 
 			switch_channel_set_private(channel, "_conference_autocall_list_", NULL);
 
+			switch_set_flag(member->conference, CFLAG_OUTCALL);
+
 			if (toval) {
 				to = atoi(toval);
 				if (to < 10 || to > 500) {
@@ -2422,7 +2440,8 @@ static void conference_loop_output(conference_member_t *member)
 				for (x = 0; x < argc; x++) {
 					char *dial_str = switch_mprintf("%s%s", switch_str_nil(prefix), argv[x]);
 					switch_assert(dial_str);
-					conference_outcall_bg(member->conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num, NULL);
+					conference_outcall_bg(member->conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num, NULL, 
+										  &member->conference->cancel_cause);
 					switch_safe_free(dial_str);
 				}
 				switch_safe_free(cpstr);
@@ -4244,9 +4263,9 @@ static switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_st
 	}
 
 	if (conference) {
-		conference_outcall(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], &cause);
+		conference_outcall(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], &cause, NULL);
 	} else {
-		conference_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], &cause);
+		conference_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], &cause, NULL);
 	}
 	stream->write_function(stream, "Call Requested: result: [%s]\n", switch_channel_cause2str(cause));
 
@@ -4269,9 +4288,9 @@ static switch_status_t conf_api_sub_bgdial(conference_obj_t *conference, switch_
 	switch_uuid_format(uuid_str, &uuid);
 
 	if (conference) {
-		conference_outcall_bg(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str);
+		conference_outcall_bg(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str, NULL);
 	} else {
-		conference_outcall_bg(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str);
+		conference_outcall_bg(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str, NULL);
 	}
 
 	stream->write_function(stream, "OK Job-UUID: %s\n", uuid_str);
@@ -4785,7 +4804,11 @@ SWITCH_STANDARD_API(conf_api_main)
 static switch_status_t conference_outcall(conference_obj_t *conference,
 										  char *conference_name,
 										  switch_core_session_t *session,
-										  char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num, switch_call_cause_t *cause)
+										  char *bridgeto, uint32_t timeout, 
+										  char *flags, char *cid_name, 
+										  char *cid_num, 
+										  switch_call_cause_t *cause,
+										  switch_call_cause_t *cancel_cause)
 {
 	switch_core_session_t *peer_session = NULL;
 	switch_channel_t *peer_channel;
@@ -4831,8 +4854,15 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
 
 	/* establish an outbound call leg */
 
-	if (switch_ivr_originate(session, &peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NO_LIMITS, NULL) !=
-		SWITCH_STATUS_SUCCESS) {
+	switch_mutex_lock(conference->mutex);
+	conference->originating++;
+	switch_mutex_unlock(conference->mutex);
+	status = switch_ivr_originate(session, &peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NO_LIMITS, cancel_cause);
+	switch_mutex_lock(conference->mutex);
+	conference->originating--;
+	switch_mutex_unlock(conference->mutex);
+
+	if (status != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot create outgoing channel, cause: %s\n",
 						  switch_channel_cause2str(*cause));
 		if (caller_channel) {
@@ -4909,6 +4939,7 @@ struct bg_call {
 	char *cid_num;
 	char *conference_name;
 	char *uuid;
+	switch_call_cause_t *cancel_cause;
 	switch_memory_pool_t *pool;
 };
 
@@ -4921,7 +4952,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
 		switch_event_t *event;
 
 		conference_outcall(call->conference, call->conference_name,
-						   call->session, call->bridgeto, call->timeout, call->flags, call->cid_name, call->cid_num, &cause);
+						   call->session, call->bridgeto, call->timeout, call->flags, call->cid_name, call->cid_num, &cause, call->cancel_cause);
 
 		if (call->conference && test_eflag(call->conference, EFLAG_BGDIAL_RESULT) &&
 			switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
@@ -4949,7 +4980,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
 static switch_status_t conference_outcall_bg(conference_obj_t *conference,
 											 char *conference_name,
 											 switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name,
-											 const char *cid_num, const char *call_uuid)
+											 const char *cid_num, const char *call_uuid, switch_call_cause_t *cancel_cause)
 {
 	struct bg_call *call = NULL;
 	switch_thread_t *thread;
@@ -4963,6 +4994,7 @@ static switch_status_t conference_outcall_bg(conference_obj_t *conference,
 	call->conference = conference;
 	call->session = session;
 	call->timeout = timeout;
+	call->cancel_cause = cancel_cause;
 
 	if (conference) {
 		pool = conference->pool;
@@ -5717,7 +5749,7 @@ SWITCH_STANDARD_APP(conference_function)
 	/* if we're using "bridge:" make an outbound call and bridge it in */
 	if (!zstr(bridgeto) && strcasecmp(bridgeto, "none")) {
 		switch_call_cause_t cause;
-		if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, &cause) != SWITCH_STATUS_SUCCESS) {
+		if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, &cause, NULL) != SWITCH_STATUS_SUCCESS) {
 			goto done;
 		}
 	} else {

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                                         |    7 +-
 conf/freeswitch.xml                                |    3 -
 libs/freetdm/msvc/freetdm.2010.vcxproj             |    2 +
 libs/freetdm/msvc/freetdm.2010.vcxproj.filters     |    6 +
 libs/freetdm/msvc/testboost/testboost.2010.vcxproj |    6 +-
 .../msvc/testboost/testsangomaboost.2010.vcxproj   |    6 +-
 .../ftmod_sangoma_boost.2010.vcxproj               |   12 +-
 .../ftmod_sangoma_isdn_support.c                   |   54 ++---
 .../ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj |    8 +-
 scripts/perl/dhcp-inform.pl                        |    9 +-
 .../applications/mod_callcenter/mod_callcenter.c   |    9 +-
 .../applications/mod_conference/mod_conference.c   |   60 ++++-
 src/mod/applications/mod_spandsp/mod_spandsp_fax.c |   89 ++++---
 src/mod/endpoints/mod_gsmopen/.gitignore           |    2 +
 src/mod/endpoints/mod_sofia/sofia.c                |   12 +
 src/mod/event_handlers/mod_snmp/FREESWITCH-MIB     |  217 ++++++++++++++++-
 src/mod/event_handlers/mod_snmp/mod_snmp.c         |   26 ++-
 src/mod/event_handlers/mod_snmp/subagent.c         |  260 ++++++++++++++++++--
 src/mod/event_handlers/mod_snmp/subagent.h         |   57 +++++-
 src/mod/languages/mod_lua/freeswitch.i             |    1 +
 src/mod/languages/mod_lua/freeswitch_lua.cpp       |   32 ++-
 src/mod/languages/mod_lua/freeswitch_lua.h         |    1 +
 src/mod/languages/mod_lua/mod_lua_wrap.cpp         |  179 ++++++++++++++
 src/mod/languages/mod_managed/freeswitch_wrap.cxx  |  127 ++++++++++
 src/mod/languages/mod_managed/managed/swig.cs      |  134 ++++++++++-
 src/switch_channel.c                               |    4 +-
 src/switch_core_sqldb.c                            |   11 +-
 src/switch_ivr_async.c                             |    1 +
 28 files changed, 1182 insertions(+), 153 deletions(-)


hooks/post-receive
-- 
FreeSWITCH



More information about the Freeswitch-trunk mailing list