<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16796] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16796">16796</a></dd>
<dt>Author</dt> <dd>sathieu</dd>
<dt>Date</dt> <dd>2010-02-24 06:06:58 -0600 (Wed, 24 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Skinny: answer FeatureStatReqMessage with FeatureStatMessage

'#buggy version!'</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skinnyskinny_protocolc">freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skinnyskinny_protocolh">freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchtrunkconfskinny_profilesinternalxml">freeswitch/trunk/conf/skinny_profiles/internal.xml</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkconfskinny_profilesinternalxml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/conf/skinny_profiles/internal.xml (0 => 16796)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/skinny_profiles/internal.xml                                (rev 0)
+++ freeswitch/trunk/conf/skinny_profiles/internal.xml        2010-02-24 12:06:58 UTC (rev 16796)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;profile name=&quot;internal&quot;&gt;
+  &lt;settings&gt;
+    &lt;param name=&quot;domain&quot; value=&quot;$${domain}}&quot;/&gt;
+    &lt;param name=&quot;ip&quot; value=&quot;$${local_ip_v4}&quot;/&gt;
+    &lt;param name=&quot;port&quot; value=&quot;2000&quot;/&gt;
+    &lt;param name=&quot;dialplan&quot; value=&quot;XML&quot;/&gt;
+    &lt;param name=&quot;context&quot; value=&quot;public&quot;/&gt;
+    &lt;param name=&quot;keep-alive&quot; value=&quot;60&quot;/&gt;
+    &lt;param name=&quot;date-format&quot; value=&quot;D/M/Y&quot;/&gt;
+    &lt;param name=&quot;odbc-dsn&quot; value=&quot;&quot;/&gt;
+    &lt;param name=&quot;debug&quot; value=&quot;4&quot;/&gt;
+  &lt;/settings&gt;
+&lt;/profile&gt;
+
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skinnyskinny_protocolc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c (16795 => 16796)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c        2010-02-24 12:06:47 UTC (rev 16795)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c        2010-02-24 12:06:58 UTC (rev 16796)
</span><span class="lines">@@ -60,60 +60,59 @@
</span><span class="cx"> 
</span><span class="cx"> /* Translation tables */
</span><span class="cx"> struct skinny_table SKINNY_MESSAGE_TYPES[] = {
</span><del>-        {&quot;KEEP_ALIVE_MESSAGE&quot;, KEEP_ALIVE_MESSAGE},
-        {&quot;REGISTER_MESSAGE&quot;, REGISTER_MESSAGE},
-        {&quot;PORT_MESSAGE&quot;, PORT_MESSAGE},
-        {&quot;KEYPAD_BUTTON_MESSAGE&quot;, KEYPAD_BUTTON_MESSAGE},
-        {&quot;STIMULUS_MESSAGE&quot;, STIMULUS_MESSAGE},
-        {&quot;OFF_HOOK_MESSAGE&quot;, OFF_HOOK_MESSAGE},
-        {&quot;ON_HOOK_MESSAGE&quot;, ON_HOOK_MESSAGE},
-        {&quot;SPEED_DIAL_STAT_REQ_MESSAGE&quot;, SPEED_DIAL_STAT_REQ_MESSAGE},
-        {&quot;LINE_STAT_REQ_MESSAGE&quot;, LINE_STAT_REQ_MESSAGE},
-        {&quot;CONFIG_STAT_REQ_MESSAGE&quot;, CONFIG_STAT_REQ_MESSAGE},
-        {&quot;TIME_DATE_REQ_MESSAGE&quot;, TIME_DATE_REQ_MESSAGE},
-        {&quot;BUTTON_TEMPLATE_REQ_MESSAGE&quot;, BUTTON_TEMPLATE_REQ_MESSAGE},
-        {&quot;CAPABILITIES_RES_MESSAGE&quot;, CAPABILITIES_RES_MESSAGE},
-        {&quot;ALARM_MESSAGE&quot;, ALARM_MESSAGE},
-        {&quot;OPEN_RECEIVE_CHANNEL_ACK_MESSAGE&quot;, OPEN_RECEIVE_CHANNEL_ACK_MESSAGE},
-        {&quot;SOFT_KEY_SET_REQ_MESSAGE&quot;, SOFT_KEY_SET_REQ_MESSAGE},
-        {&quot;SOFT_KEY_EVENT_MESSAGE&quot;, SOFT_KEY_EVENT_MESSAGE},
-        {&quot;UNREGISTER_MESSAGE&quot;, UNREGISTER_MESSAGE},
-        {&quot;SOFT_KEY_TEMPLATE_REQ_MESSAGE&quot;, SOFT_KEY_TEMPLATE_REQ_MESSAGE},
-        {&quot;HEADSET_STATUS_MESSAGE&quot;, HEADSET_STATUS_MESSAGE},
-        {&quot;REGISTER_AVAILABLE_LINES_MESSAGE&quot;, REGISTER_AVAILABLE_LINES_MESSAGE},
-        {&quot;REGISTER_ACK_MESSAGE&quot;, REGISTER_ACK_MESSAGE},
-        {&quot;START_TONE_MESSAGE&quot;, START_TONE_MESSAGE},
-        {&quot;STOP_TONE_MESSAGE&quot;, STOP_TONE_MESSAGE},
-        {&quot;SET_RINGER_MESSAGE&quot;, SET_RINGER_MESSAGE},
-        {&quot;SET_LAMP_MESSAGE&quot;, SET_LAMP_MESSAGE},
-        {&quot;SET_SPEAKER_MODE_MESSAGE&quot;, SET_SPEAKER_MODE_MESSAGE},
-        {&quot;START_MEDIA_TRANSMISSION_MESSAGE&quot;, START_MEDIA_TRANSMISSION_MESSAGE},
-        {&quot;STOP_MEDIA_TRANSMISSION_MESSAGE&quot;, STOP_MEDIA_TRANSMISSION_MESSAGE},
-        {&quot;CALL_INFO_MESSAGE&quot;, CALL_INFO_MESSAGE},
-        {&quot;SPEED_DIAL_STAT_RES_MESSAGE&quot;, SPEED_DIAL_STAT_RES_MESSAGE},
-        {&quot;LINE_STAT_RES_MESSAGE&quot;, LINE_STAT_RES_MESSAGE},
-        {&quot;CONFIG_STAT_RES_MESSAGE&quot;, CONFIG_STAT_RES_MESSAGE},
-        {&quot;DEFINE_TIME_DATE_MESSAGE&quot;, DEFINE_TIME_DATE_MESSAGE},
-        {&quot;BUTTON_TEMPLATE_RES_MESSAGE&quot;, BUTTON_TEMPLATE_RES_MESSAGE},
-        {&quot;CAPABILITIES_REQ_MESSAGE&quot;, CAPABILITIES_REQ_MESSAGE},
-        {&quot;REGISTER_REJ_MESSAGE&quot;, REGISTER_REJ_MESSAGE},
-        {&quot;KEEP_ALIVE_ACK_MESSAGE&quot;, KEEP_ALIVE_ACK_MESSAGE},
-        {&quot;OPEN_RECEIVE_CHANNEL_MESSAGE&quot;, OPEN_RECEIVE_CHANNEL_MESSAGE},
-        {&quot;CLOSE_RECEIVE_CHANNEL_MESSAGE&quot;, CLOSE_RECEIVE_CHANNEL_MESSAGE},
-        {&quot;SOFT_KEY_TEMPLATE_RES_MESSAGE&quot;, SOFT_KEY_TEMPLATE_RES_MESSAGE},
-        {&quot;SOFT_KEY_SET_RES_MESSAGE&quot;, SOFT_KEY_SET_RES_MESSAGE},
-        {&quot;SELECT_SOFT_KEYS_MESSAGE&quot;, SELECT_SOFT_KEYS_MESSAGE},
-        {&quot;CALL_STATE_MESSAGE&quot;, CALL_STATE_MESSAGE},
-        {&quot;DISPLAY_PROMPT_STATUS_MESSAGE&quot;, DISPLAY_PROMPT_STATUS_MESSAGE},
-        {&quot;CLEAR_PROMPT_STATUS_MESSAGE&quot;, CLEAR_PROMPT_STATUS_MESSAGE},
-        {&quot;ACTIVATE_CALL_PLANE_MESSAGE&quot;, ACTIVATE_CALL_PLANE_MESSAGE},
-        {&quot;DIALED_NUMBER_MESSAGE&quot;, DIALED_NUMBER_MESSAGE},
-        {&quot;SKINNY_MESSAGE_FIELD_SIZE&quot;, SKINNY_MESSAGE_FIELD_SIZE},
-        {&quot;SKINNY_MESSAGE_HEADERSIZE&quot;, SKINNY_MESSAGE_HEADERSIZE},
-        {&quot;SKINNY_MESSAGE_MAXSIZE&quot;, SKINNY_MESSAGE_MAXSIZE},
</del><ins>+        {&quot;KeepAliveMessage&quot;, KEEP_ALIVE_MESSAGE},
+        {&quot;RegisterMessage&quot;, REGISTER_MESSAGE},
+        {&quot;PortMessage&quot;, PORT_MESSAGE},
+        {&quot;KeypadButtonMessage&quot;, KEYPAD_BUTTON_MESSAGE},
+        {&quot;StimulusMessage&quot;, STIMULUS_MESSAGE},
+        {&quot;OffHookMessage&quot;, OFF_HOOK_MESSAGE},
+        {&quot;OnHookMessage&quot;, ON_HOOK_MESSAGE},
+        {&quot;SpeedDialStatReqMessage&quot;, SPEED_DIAL_STAT_REQ_MESSAGE},
+        {&quot;LineStatReqMessage&quot;, LINE_STAT_REQ_MESSAGE},
+        {&quot;ConfigStatReqMessage&quot;, CONFIG_STAT_REQ_MESSAGE},
+        {&quot;TimeDateReqMessage&quot;, TIME_DATE_REQ_MESSAGE},
+        {&quot;ButtonTemplateReqMessage&quot;, BUTTON_TEMPLATE_REQ_MESSAGE},
+        {&quot;CapabilitiesReqMessage&quot;, CAPABILITIES_RES_MESSAGE},
+        {&quot;AlarmMessage&quot;, ALARM_MESSAGE},
+        {&quot;OpenReceiveChannelAckMessage&quot;, OPEN_RECEIVE_CHANNEL_ACK_MESSAGE},
+        {&quot;SoftKeySetReqMessage&quot;, SOFT_KEY_SET_REQ_MESSAGE},
+        {&quot;SOftKeyEventMessage&quot;, SOFT_KEY_EVENT_MESSAGE},
+        {&quot;UnregisterMessage&quot;, UNREGISTER_MESSAGE},
+        {&quot;SoftKeyTemplateReqMessage&quot;, SOFT_KEY_TEMPLATE_REQ_MESSAGE},
+        {&quot;FeatureStatReqMessage&quot;, FEATURE_STAT_REQ_MESSAGE},
+        {&quot;HeadsetStatusMessage&quot;, HEADSET_STATUS_MESSAGE},
+        {&quot;RegisterAvailableLinesMessage&quot;, REGISTER_AVAILABLE_LINES_MESSAGE},
+        {&quot;RegisterAckMessage&quot;, REGISTER_ACK_MESSAGE},
+        {&quot;StartToneMessage&quot;, START_TONE_MESSAGE},
+        {&quot;StopToneMessage&quot;, STOP_TONE_MESSAGE},
+        {&quot;SetRingerMessage&quot;, SET_RINGER_MESSAGE},
+        {&quot;SetLampMessage&quot;, SET_LAMP_MESSAGE},
+        {&quot;SetSpeakerModeMessage&quot;, SET_SPEAKER_MODE_MESSAGE},
+        {&quot;StartMediaTransmissionMessage&quot;, START_MEDIA_TRANSMISSION_MESSAGE},
+        {&quot;StopMediaTransmissionMessage&quot;, STOP_MEDIA_TRANSMISSION_MESSAGE},
+        {&quot;CallInfoMessage&quot;, CALL_INFO_MESSAGE},
+        {&quot;SpeedDialStatResMessage&quot;, SPEED_DIAL_STAT_RES_MESSAGE},
+        {&quot;LineStatResMessage&quot;, LINE_STAT_RES_MESSAGE},
+        {&quot;ConfigStatResMessage&quot;, CONFIG_STAT_RES_MESSAGE},
+        {&quot;DefineTimeDateMessage&quot;, DEFINE_TIME_DATE_MESSAGE},
+        {&quot;ButtonTemplateResMessage&quot;, BUTTON_TEMPLATE_RES_MESSAGE},
+        {&quot;CapabilitiesReqMessage&quot;, CAPABILITIES_REQ_MESSAGE},
+        {&quot;RegisterRejMessage&quot;, REGISTER_REJ_MESSAGE},
+        {&quot;KeepAliveAckMessageMessage&quot;, KEEP_ALIVE_ACK_MESSAGE},
+        {&quot;OpenReceiveChannelMessage&quot;, OPEN_RECEIVE_CHANNEL_MESSAGE},
+        {&quot;OCloseReceiveChannelMessage&quot;, CLOSE_RECEIVE_CHANNEL_MESSAGE},
+        {&quot;SoftKeyTemplateResMessage&quot;, SOFT_KEY_TEMPLATE_RES_MESSAGE},
+        {&quot;SoftKeySetResMessage&quot;, SOFT_KEY_SET_RES_MESSAGE},
+        {&quot;SelectSoftKeysMessage&quot;, SELECT_SOFT_KEYS_MESSAGE},
+        {&quot;CallStateMessage&quot;, CALL_STATE_MESSAGE},
+        {&quot;DisplayPromptStatusMessage&quot;, DISPLAY_PROMPT_STATUS_MESSAGE},
+        {&quot;ClearPromptStatusMessage&quot;, CLEAR_PROMPT_STATUS_MESSAGE},
+        {&quot;ActivateCallPlaneMessage&quot;, ACTIVATE_CALL_PLANE_MESSAGE},
+        {&quot;DialedNumberMessage&quot;, DIALED_NUMBER_MESSAGE},
+        {&quot;FeatureResMessage&quot;, FEATURE_STAT_RES_MESSAGE},
</ins><span class="cx">         {NULL, 0}
</span><span class="cx"> };
</span><del>-SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, &quot;UNKNOWN_MESSAGE&quot;)
</del><ins>+SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, &quot;UnknownMessage&quot;)
</ins><span class="cx"> SKINNY_DECLARE_STR2ID(skinny_str2message_type, SKINNY_MESSAGE_TYPES, -1)
</span><span class="cx"> 
</span><span class="cx"> struct skinny_table SKINNY_RING_TYPES[] = {
</span><span class="lines">@@ -656,7 +655,8 @@
</span><span class="cx">         
</span><span class="cx">         if ((sql = switch_mprintf(
</span><span class="cx">                         &quot;SELECT '%d' AS wanted_position, position, label, value, settings &quot;
</span><del>-                                &quot;FROM skinny_buttons WHERE device_name='%s' AND type=%d &quot;
</del><ins>+                                &quot;FROM skinny_buttons &quot;
+                                &quot;WHERE device_name='%s' AND type=%d &quot;
</ins><span class="cx">                                 &quot;ORDER BY position&quot;,
</span><span class="cx">                         instance,
</span><span class="cx">                         listener-&gt;device_name,
</span><span class="lines">@@ -699,7 +699,8 @@
</span><span class="cx">         
</span><span class="cx">         if ((sql = switch_mprintf(
</span><span class="cx">                         &quot;SELECT '%d' AS wanted_position, position, label, value, settings &quot;
</span><del>-                                &quot;FROM skinny_buttons WHERE device_name='%s' AND type=%d &quot;
</del><ins>+                                &quot;FROM skinny_buttons &quot;
+                                &quot;WHERE device_name='%s' AND type=%d &quot;
</ins><span class="cx">                                 &quot;ORDER BY position&quot;,
</span><span class="cx">                         instance,
</span><span class="cx">                         listener-&gt;device_name,
</span><span class="lines">@@ -711,6 +712,51 @@
</span><span class="cx">         *button = helper.button;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+struct feature_get_helper {
+        uint32_t pos;
+        struct feature_stat_res_message *button;
+};
+
+int skinny_feature_get_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+        struct feature_get_helper *helper = pArg;
+
+        helper-&gt;pos++;
+        if (helper-&gt;pos == atoi(argv[0])) { /* wanted_position */
+                helper-&gt;button-&gt;index = helper-&gt;pos;
+                helper-&gt;button-&gt;id = helper-&gt;pos;
+                strncpy(helper-&gt;button-&gt;text_label,  argv[2], 40); /* label */
+                helper-&gt;button-&gt;status = atoi(argv[3]); /* value */
+        }
+        return 0;
+}
+
+void skinny_feature_get(listener_t *listener, uint32_t instance, struct feature_stat_res_message **button)
+{
+        struct feature_get_helper helper = {0};
+        char *sql;
+
+        switch_assert(listener);
+        switch_assert(listener-&gt;profile);
+        switch_assert(listener-&gt;device_name);
+
+        helper.button = switch_core_alloc(listener-&gt;pool, sizeof(struct feature_stat_res_message));
+        
+        if ((sql = switch_mprintf(
+                        &quot;SELECT '%d' AS wanted_position, position, label, value, settings &quot;
+                                &quot;FROM skinny_buttons &quot;
+                                &quot;WHERE device_name='%s' AND NOT (type=%d OR type=%d) &quot;
+                                &quot;ORDER BY position&quot;,
+                        instance,
+                        listener-&gt;device_name,
+                        SKINNY_BUTTON_LINE, SKINNY_BUTTON_SPEED_DIAL
+                        ))) {
+                skinny_execute_sql_callback(listener-&gt;profile, listener-&gt;profile-&gt;listener_mutex, sql, skinny_feature_get_callback, &amp;helper);
+                switch_safe_free(sql);
+        }
+        *button = helper.button;
+}
+
</ins><span class="cx"> /*****************************************************************************/
</span><span class="cx"> /* SKINNY MESSAGE SENDER */
</span><span class="cx"> /*****************************************************************************/
</span><span class="lines">@@ -1469,7 +1515,7 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-switch_status_t skinny_handle_speed_dial_request(listener_t *listener, skinny_message_t *request)
</del><ins>+switch_status_t skinny_handle_speed_dial_stat_request(listener_t *listener, skinny_message_t *request)
</ins><span class="cx"> {
</span><span class="cx">         skinny_message_t *message;
</span><span class="cx">         struct speed_dial_stat_res_message *button = NULL;
</span><span class="lines">@@ -1489,6 +1535,26 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+switch_status_t skinny_handle_feature_stat_request(listener_t *listener, skinny_message_t *request)
+{
+        skinny_message_t *message;
+        struct feature_stat_res_message *button = NULL;
+
+        skinny_check_data_length(request, sizeof(request-&gt;data.feature_req));
+
+        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.feature_res));
+        message-&gt;type = FEATURE_STAT_RES_MESSAGE;
+        message-&gt;length = 4 + sizeof(message-&gt;data.feature_res);
+        
+        skinny_feature_get(listener, request-&gt;data.feature_req.feature_index, &amp;button);
+
+        memcpy(&amp;message-&gt;data.feature_res, button, sizeof(struct feature_stat_res_message));
+
+        skinny_send_reply(listener, message);
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
</ins><span class="cx"> switch_status_t skinny_handle_register_available_lines_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><span class="cx">         skinny_check_data_length(request, sizeof(request-&gt;data.reg_lines));
</span><span class="lines">@@ -1947,7 +2013,9 @@
</span><span class="cx">                 case LINE_STAT_REQ_MESSAGE:
</span><span class="cx">                         return skinny_handle_line_stat_request(listener, request);
</span><span class="cx">                 case SPEED_DIAL_STAT_REQ_MESSAGE:
</span><del>-                        return skinny_handle_speed_dial_request(listener, request);
</del><ins>+                        return skinny_handle_speed_dial_stat_request(listener, request);
+                case FEATURE_STAT_REQ_MESSAGE:
+                        return skinny_handle_feature_stat_request(listener, request);
</ins><span class="cx">                 case REGISTER_AVAILABLE_LINES_MESSAGE:
</span><span class="cx">                         return skinny_handle_register_available_lines_message(listener, request);
</span><span class="cx">                 case TIME_DATE_REQ_MESSAGE:
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skinnyskinny_protocolh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h (16795 => 16796)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h        2010-02-24 12:06:47 UTC (rev 16795)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h        2010-02-24 12:06:58 UTC (rev 16796)
</span><span class="lines">@@ -159,6 +159,12 @@
</span><span class="cx"> /* SoftKeyTemplateReqMessage */
</span><span class="cx"> #define SOFT_KEY_TEMPLATE_REQ_MESSAGE 0x0028
</span><span class="cx"> 
</span><ins>+/* FeatureStatReqMessage */
+#define FEATURE_STAT_REQ_MESSAGE 0x0034
+struct feature_stat_req_message {
+        uint32_t feature_index;
+};
+
</ins><span class="cx"> /* HeadsetStatusMessage */
</span><span class="cx"> #define HEADSET_STATUS_MESSAGE 0x002B
</span><span class="cx"> struct headset_status_message {
</span><span class="lines">@@ -437,6 +443,16 @@
</span><span class="cx">         uint32_t call_id;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+/* FeatureStatMessage */
+#define FEATURE_STAT_RES_MESSAGE 0x011F
+struct feature_stat_res_message {
+        uint32_t index;
+        uint32_t id;
+        char text_label[40];
+        uint32_t status;
+};
+
+
</ins><span class="cx"> /*****************************************************************************/
</span><span class="cx"> /* SKINNY MESSAGE */
</span><span class="cx"> /*****************************************************************************/
</span><span class="lines">@@ -456,6 +472,7 @@
</span><span class="cx">         struct alarm_message alarm;
</span><span class="cx">         struct open_receive_channel_ack_message open_receive_channel_ack;
</span><span class="cx">         struct soft_key_event_message soft_key_event;
</span><ins>+        struct feature_stat_req_message feature_req;
</ins><span class="cx">         struct headset_status_message headset_status;
</span><span class="cx">         struct register_available_lines_message reg_lines;
</span><span class="cx">         struct register_ack_message reg_ack;
</span><span class="lines">@@ -483,6 +500,7 @@
</span><span class="cx">         struct clear_prompt_status_message clear_prompt_status;
</span><span class="cx">         struct activate_call_plane_message activate_call_plane;
</span><span class="cx">         struct dialed_number_message dialed_number;
</span><ins>+        struct feature_stat_res_message feature_res;
</ins><span class="cx">         
</span><span class="cx">         uint16_t as_uint16;
</span><span class="cx">         char as_char;
</span><span class="lines">@@ -594,7 +612,7 @@
</span><span class="cx">                 status = SWITCH_STATUS_SUCCESS;\
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-struct skinny_table SKINNY_MESSAGE_TYPES[52];
</del><ins>+struct skinny_table SKINNY_MESSAGE_TYPES[51];
</ins><span class="cx"> const char *skinny_message_type2str(uint32_t id);
</span><span class="cx"> uint32_t skinny_str2message_type(const char *str);
</span><span class="cx"> #define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>