<h1>Project "FreeSWITCH Source" received a push.</h1>

<h2>branch: master updated</h2>
<pre>
       via: 231a7ffaa19886653705c217a73d8e25b705503c (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)
      from: 9a8eea27feb6f300d5adeb078cad82974681bca7 (commit)


</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Leon de Rooij
comments: 
Merge branch &#39;master&#39; of ssh://git.freeswitch.org/freeswitch
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments: 
Merge branch &#39;master&#39; of fs-git:freeswitch
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments: 
TEST-002

<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 5fc9402..6914128 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -61,5 +61,4 @@</span>
       &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;lang/ru/*.xml&quot;/&gt;
     &lt;/macros&gt;
   &lt;/section&gt;
<span style="color: #A00000">-</span>
 &lt;/document&gt;
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments: 
partial implementation of channel list via snmp

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

<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 6ed99ef..5fc9402 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -63,4 +63,3 @@</span>
   &lt;/section&gt;
 
 &lt;/document&gt;
<span style="color: #A00000">-</span>
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments: 
add support for getting current call count

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/subagent.c b/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #000080; font-weight: bold">index 8f08baf..bad3dc6 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #800080; font-weight: bold">@@ -49,6 +49,14 @@ void init_subagent(void)</span>
 }
 
 
<span style="color: #00A000">+static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        uint32_t *count = (uint32_t *) pArg;</span>
<span style="color: #00A000">+        *count = atoi(argv[0]);</span>
<span style="color: #00A000">+        return 0;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
 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;
<span style="color: #800080; font-weight: bold">@@ -113,13 +121,20 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
                         snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));
                         break;
                 case SS_CURRENT_CALLS:
<span style="color: #A00000">-                        /*</span>
<span style="color: #A00000">-                         * This is zero for now, since there is no convenient way to get total call</span>
<span style="color: #A00000">-                         * count (not to be confused with session count), without touching the</span>
<span style="color: #A00000">-                         * database.</span>
<span style="color: #A00000">-                         */</span>
<span style="color: #A00000">-                        int_val = 0;</span>
<span style="color: #00A000">+                        {</span>
<span style="color: #00A000">+                        switch_cache_db_handle_t *dbh;</span>
<span style="color: #00A000">+                        char sql[1024] = &quot;&quot;, hostname[256] = &quot;&quot;;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (switch_core_db_handle(&amp;dbh) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                                return SNMP_ERR_GENERR;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        gethostname(hostname, sizeof(hostname));</span>
<span style="color: #00A000">+                        sprintf(sql, &quot;SELECT COUNT(*) FROM calls WHERE hostname=&#39;%s&#39;&quot;, hostname);</span>
<span style="color: #00A000">+                        switch_cache_db_execute_sql_callback(dbh, sql, sql_count_callback, &amp;int_val, NULL);</span>
                         snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));
<span style="color: #00A000">+                        switch_cache_db_release_db_handle(&amp;dbh);</span>
<span style="color: #00A000">+                        }</span>
                         break;
                 case SS_SESSIONS_PER_SECOND:
                         switch_core_session_ctl(SCSC_LAST_SPS, &amp;int_val);
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments: 
test

<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 80e7728..6ed99ef 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -64,4 +64,3 @@</span>
 
 &lt;/document&gt;
 
<span style="color: #A00000">-</span>
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments: 
test

<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 6ed99ef..80e7728 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -64,3 +64,4 @@</span>
 
 &lt;/document&gt;
 
<span style="color: #00A000">+</span>
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments: 
test

<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 5fc9402..6ed99ef 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -63,3 +63,4 @@</span>
   &lt;/section&gt;
 
 &lt;/document&gt;
<span style="color: #00A000">+</span>
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments: 
test

<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 6ed99ef..5fc9402 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -63,4 +63,3 @@</span>
   &lt;/section&gt;
 
 &lt;/document&gt;
<span style="color: #A00000">-</span>
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments: 
test

<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 80e7728..6ed99ef 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -64,4 +64,3 @@</span>
 
 &lt;/document&gt;
 
<span style="color: #A00000">-</span>
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments: 
typo

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/subagent.c b/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #000080; font-weight: bold">index 2da9ebe..8f08baf 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #800080; font-weight: bold">@@ -109,7 +109,7 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
                         snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));
                         break;
                 case SS_MAX_SESSIONS:
<span style="color: #A00000">-                        switch_core_session_ctl(SCSC_MAX_SESSIONS, &amp;int_val);;</span>
<span style="color: #00A000">+                        switch_core_session_ctl(SCSC_MAX_SESSIONS, &amp;int_val);</span>
                         snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));
                         break;
                 case SS_CURRENT_CALLS:
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments: 
add missing files

<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/msvc/freetdm.2010.vcxproj b/libs/freetdm/msvc/freetdm.2010.vcxproj</span>
<span style="color: #000080; font-weight: bold">index 71eb6db..aecb9ef 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/msvc/freetdm.2010.vcxproj</span>
<span style="color: #00A000">+++ b/libs/freetdm/msvc/freetdm.2010.vcxproj</span>
<span style="color: #800080; font-weight: bold">@@ -188,6 +188,7 @@</span>
     &lt;ClInclude Include=&quot;..\src\include\ftdm_os.h&quot; /&gt;
     &lt;ClInclude Include=&quot;..\src\include\private\ftdm_sched.h&quot; /&gt;
     &lt;ClInclude Include=&quot;..\src\include\ftdm_threadmutex.h&quot; /&gt;
<span style="color: #00A000">+    &lt;ClInclude Include=&quot;..\src\include\private\ftdm_state.h&quot; /&gt;</span>
     &lt;ClInclude Include=&quot;..\src\include\private\ftdm_types.h&quot; /&gt;
     &lt;ClInclude Include=&quot;..\src\include\private\g711.h&quot; /&gt;
     &lt;ClInclude Include=&quot;..\src\include\private\hashtable.h&quot; /&gt;
<span style="color: #800080; font-weight: bold">@@ -209,6 +210,7 @@</span>
     &lt;ClCompile Include=&quot;..\src\ftdm_io.c&quot; /&gt;
     &lt;ClCompile Include=&quot;..\src\ftdm_queue.c&quot; /&gt;
     &lt;ClCompile Include=&quot;..\src\ftdm_sched.c&quot; /&gt;
<span style="color: #00A000">+    &lt;ClCompile Include=&quot;..\src\ftdm_state.c&quot; /&gt;</span>
     &lt;ClCompile Include=&quot;..\src\ftdm_threadmutex.c&quot; /&gt;
     &lt;ClCompile Include=&quot;..\src\g711.c&quot; /&gt;
     &lt;ClCompile Include=&quot;..\src\hashtable.c&quot; /&gt;
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/msvc/freetdm.2010.vcxproj.filters b/libs/freetdm/msvc/freetdm.2010.vcxproj.filters</span>
<span style="color: #000080; font-weight: bold">index ed642ba..e6dc40d 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/msvc/freetdm.2010.vcxproj.filters</span>
<span style="color: #00A000">+++ b/libs/freetdm/msvc/freetdm.2010.vcxproj.filters</span>
<span style="color: #800080; font-weight: bold">@@ -71,6 +71,9 @@</span>
     &lt;ClInclude Include=&quot;..\src\include\private\uart.h&quot;&gt;
       &lt;Filter&gt;Header Files&lt;/Filter&gt;
     &lt;/ClInclude&gt;
<span style="color: #00A000">+    &lt;ClInclude Include=&quot;..\src\include\private\ftdm_state.h&quot;&gt;</span>
<span style="color: #00A000">+      &lt;Filter&gt;Header Files&lt;/Filter&gt;</span>
<span style="color: #00A000">+    &lt;/ClInclude&gt;</span>
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
     &lt;ClCompile Include=&quot;..\src\fsk.c&quot;&gt;
<span style="color: #800080; font-weight: bold">@@ -124,5 +127,8 @@</span>
     &lt;ClCompile Include=&quot;..\src\uart.c&quot;&gt;
       &lt;Filter&gt;Source Files&lt;/Filter&gt;
     &lt;/ClCompile&gt;
<span style="color: #00A000">+    &lt;ClCompile Include=&quot;..\src\ftdm_state.c&quot;&gt;</span>
<span style="color: #00A000">+      &lt;Filter&gt;Source Files&lt;/Filter&gt;</span>
<span style="color: #00A000">+    &lt;/ClCompile&gt;</span>
   &lt;/ItemGroup&gt;
 &lt;/Project&gt;
\ No newline at end of file
</pre></div>
<div class="highlight"><pre>committer: Travis Cross
comments: 
.gitignore compressed files

<span style="color: #000080; font-weight: bold">diff --git a/.gitignore b/.gitignore</span>
<span style="color: #000080; font-weight: bold">index 304b42c..c53d07d 100644</span>
<span style="color: #A00000">--- a/.gitignore</span>
<span style="color: #00A000">+++ b/.gitignore</span>
<span style="color: #800080; font-weight: bold">@@ -33,6 +33,12 @@</span>
 *.ilk
 *.bsc
 *.pch
<span style="color: #00A000">+*.tar</span>
<span style="color: #00A000">+*.gz</span>
<span style="color: #00A000">+*.tgz</span>
<span style="color: #00A000">+*.xz</span>
<span style="color: #00A000">+*.bz2</span>
<span style="color: #00A000">+*.tbz2</span>
 core.*
 /Path
 /w32/Library/lastversion
<span style="color: #800080; font-weight: bold">@@ -79,7 +85,6 @@ configure.lineno</span>
 /scripts/fsxs
 /scripts/gentls_cert
 /a.out.dSYM
<span style="color: #A00000">-/freeswitch-sounds-*</span>
 src/mod/applications/mod_easyroute/Makefile
 src/mod/applications/mod_lcr/Makefile
 src/mod/applications/mod_nibblebill/Makefile
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_gsmopen/.gitignore b/src/mod/endpoints/mod_gsmopen/.gitignore</span>
<span style="color: #000080; font-weight: bold">index 9fdeeb1..fe8dc68 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_gsmopen/.gitignore</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_gsmopen/.gitignore</span>
<span style="color: #800080; font-weight: bold">@@ -1,2 +1,4 @@</span>
 !/gsmlib/gsmlib-*/aclocal.m4
 !/gsmlib/gsmlib-*/configure
<span style="color: #00A000">+!/gsmlib/gsmlib-1.10.tar.gz</span>
<span style="color: #00A000">+!/gsmlib/gsmlib_1.10-12ubuntu1.diff.gz</span>
</pre></div>
========================================================================<pre>

Summary of changes:
 .gitignore                                     |    7 +-
 conf/freeswitch.xml                            |    3 -
 libs/freetdm/msvc/freetdm.2010.vcxproj         |    2 +
 libs/freetdm/msvc/freetdm.2010.vcxproj.filters |    6 +
 src/mod/endpoints/mod_gsmopen/.gitignore       |    2 +
 src/mod/event_handlers/mod_snmp/FREESWITCH-MIB |   84 ++++++++++++
 src/mod/event_handlers/mod_snmp/mod_snmp.c     |    2 +-
 src/mod/event_handlers/mod_snmp/subagent.c     |  165 ++++++++++++++++++++++--
 src/mod/event_handlers/mod_snmp/subagent.h     |   22 +++-
 9 files changed, 277 insertions(+), 16 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH Source</p>