<!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][17022] </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=17022">17022</a></dd>
<dt>Author</dt> <dd>sathieu</dd>
<dt>Date</dt> <dd>2010-03-17 07:52:08 -0500 (Wed, 17 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Skinny: Split ou tables</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skinnyMakefileam">freeswitch/trunk/src/mod/endpoints/mod_skinny/Makefile.am</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skinnymod_skinnyc">freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c</a></li>
<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="#freeswitchtrunksrcmodendpointsmod_skinnyskinny_tablesc">freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skinnyskinny_tablesh">freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcmodendpointsmod_skinnyMakefileam"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/Makefile.am (17021 => 17022)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/Makefile.am        2010-03-17 06:40:15 UTC (rev 17021)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/Makefile.am        2010-03-17 12:52:08 UTC (rev 17022)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> MODNAME=mod_skinny
</span><span class="cx"> 
</span><span class="cx"> mod_LTLIBRARIES = mod_skinny.la
</span><del>-mod_skinny_la_SOURCES  = mod_skinny.c skinny_protocol.c
</del><ins>+mod_skinny_la_SOURCES  = mod_skinny.c skinny_protocol.c skinny_tables.c
</ins><span class="cx"> mod_skinny_la_CFLAGS   = $(AM_CFLAGS) -DSKINNY_SVN_VERSION=\&quot;`cat $(switch_builddir)/.version`\&quot;
</span><span class="cx"> mod_skinny_la_LIBADD   = $(switch_builddir)/libfreeswitch.la
</span><span class="cx"> mod_skinny_la_LDFLAGS  = -avoid-version -module -no-undefined -shared
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skinnymod_skinnyc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c (17021 => 17022)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c        2010-03-17 06:40:15 UTC (rev 17021)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c        2010-03-17 12:52:08 UTC (rev 17022)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &lt;switch.h&gt;
</span><span class="cx"> #include &quot;mod_skinny.h&quot;
</span><span class="cx"> #include &quot;skinny_protocol.h&quot;
</span><ins>+#include &quot;skinny_tables.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load);
</span><span class="cx"> SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skinny_shutdown);
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skinnyskinny_protocolc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c (17021 => 17022)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c        2010-03-17 06:40:15 UTC (rev 17021)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c        2010-03-17 12:52:08 UTC (rev 17022)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &lt;switch.h&gt;
</span><span class="cx"> #include &quot;mod_skinny.h&quot;
</span><span class="cx"> #include &quot;skinny_protocol.h&quot;
</span><ins>+#include &quot;skinny_tables.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> skinny_globals_t globals;
</span><span class="cx"> 
</span><span class="lines">@@ -58,162 +59,6 @@
</span><span class="cx">         { &quot;\200\120&quot;, SOFTKEY_IDIVERT },
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-/* Translation tables */
-struct skinny_table SKINNY_MESSAGE_TYPES[] = {
-        {&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;ServiceUrlStatReqMessage&quot;, SERVICE_URL_STAT_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;ResetMessage&quot;, RESET_MESSAGE},
-        {&quot;KeepAliveAckMessage&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;UnregisterAckMessage&quot;, UNREGISTER_ACK_MESSAGE},
-        {&quot;DialedNumberMessage&quot;, DIALED_NUMBER_MESSAGE},
-        {&quot;FeatureResMessage&quot;, FEATURE_STAT_RES_MESSAGE},
-        {&quot;ServiceUrlStatMessage&quot;, SERVICE_URL_STAT_RES_MESSAGE},
-        {NULL, 0}
-};
-SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, &quot;UnknownMessage&quot;)
-SKINNY_DECLARE_STR2ID(skinny_str2message_type, SKINNY_MESSAGE_TYPES, -1)
-
-struct skinny_table SKINNY_RING_TYPES[] = {
-        {&quot;RingOff&quot;, SKINNY_RING_OFF},
-        {&quot;RingInside&quot;, SKINNY_RING_INSIDE},
-        {&quot;RingOutside&quot;, SKINNY_RING_OUTSIDE},
-        {&quot;RingFeature&quot;, SKINNY_RING_FEATURE},
-        {NULL, 0}
-};
-SKINNY_DECLARE_ID2STR(skinny_ring_type2str, SKINNY_RING_TYPES, &quot;RingTypeUnknown&quot;)
-SKINNY_DECLARE_STR2ID(skinny_str2ring_type, SKINNY_RING_TYPES, -1)
-
-struct skinny_table SKINNY_RING_MODES[] = {
-        {&quot;RingForever&quot;, SKINNY_RING_FOREVER},
-        {&quot;RingOnce&quot;, SKINNY_RING_ONCE},
-        {NULL, 0}
-};
-SKINNY_DECLARE_ID2STR(skinny_ring_mode2str, SKINNY_RING_MODES, &quot;RingModeUnknown&quot;)
-SKINNY_DECLARE_STR2ID(skinny_str2ring_mode, SKINNY_RING_MODES, -1)
-
-struct skinny_table SKINNY_BUTTONS[] = {
-        {&quot;Unknown&quot;, SKINNY_BUTTON_UNKNOWN},
-        {&quot;LastNumberRedial&quot;, SKINNY_BUTTON_LAST_NUMBER_REDIAL},
-        {&quot;SpeedDial&quot;, SKINNY_BUTTON_SPEED_DIAL},
-        {&quot;Line&quot;, SKINNY_BUTTON_LINE},
-        {&quot;Voicemail&quot;, SKINNY_BUTTON_VOICEMAIL},
-        {&quot;Privacy&quot;, SKINNY_BUTTON_PRIVACY},
-        {&quot;ServiceUrl&quot;, SKINNY_BUTTON_SERVICE_URL},
-        {&quot;Undefined&quot;, SKINNY_BUTTON_UNDEFINED},
-        {NULL, 0}
-};
-SKINNY_DECLARE_ID2STR(skinny_button2str, SKINNY_BUTTONS, &quot;Unknown&quot;)
-SKINNY_DECLARE_STR2ID(skinny_str2button, SKINNY_BUTTONS, -1)
-
-struct skinny_table SKINNY_LAMP_MODES[] = {
-        {&quot;Off&quot;, SKINNY_LAMP_OFF},
-        {&quot;On&quot;, SKINNY_LAMP_ON},
-        {&quot;Wink&quot;, SKINNY_LAMP_WINK},
-        {&quot;Flash&quot;, SKINNY_LAMP_FLASH},
-        {&quot;Blink&quot;, SKINNY_LAMP_BLINK},
-        {NULL, 0}
-};
-SKINNY_DECLARE_ID2STR(skinny_lamp_mode2str, SKINNY_LAMP_MODES, &quot;Unknown&quot;)
-SKINNY_DECLARE_STR2ID(skinny_str2lamp_mode, SKINNY_LAMP_MODES, -1)
-
-struct skinny_table SKINNY_SPEAKER_MODES[] = {
-        {&quot;SpeakerOn&quot;, SKINNY_SPEAKER_ON},
-        {&quot;SpeakerOff&quot;, SKINNY_SPEAKER_OFF},
-        {NULL, 0}
-};
-SKINNY_DECLARE_ID2STR(skinny_speaker_mode2str, SKINNY_SPEAKER_MODES, &quot;Unknown&quot;)
-SKINNY_DECLARE_STR2ID(skinny_str2speaker_mode, SKINNY_SPEAKER_MODES, -1)
-
-struct skinny_table SKINNY_KEY_SETS[] = {
-        {&quot;KeySetOnHook&quot;, SKINNY_KEY_SET_ON_HOOK},
-        {&quot;KeySetConnected&quot;, SKINNY_KEY_SET_CONNECTED},
-        {&quot;KeySetOnHold&quot;, SKINNY_KEY_SET_ON_HOLD},
-        {&quot;KeySetRingIn&quot;, SKINNY_KEY_SET_RING_IN},
-        {&quot;KeySetOffHook&quot;, SKINNY_KEY_SET_OFF_HOOK},
-        {&quot;KeySetConnectedWithTransfer&quot;, SKINNY_KEY_SET_CONNECTED_WITH_TRANSFER},
-        {&quot;KeySetDigitsAfterDialingFirstDigit&quot;, SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT},
-        {&quot;KeySetConnectedWithConference&quot;, SKINNY_KEY_SET_CONNECTED_WITH_CONFERENCE},
-        {&quot;KeySetRingOut&quot;, SKINNY_KEY_SET_RING_OUT},
-        {&quot;KeySetOffHookWithFeatures&quot;, SKINNY_KEY_SET_OFF_HOOK_WITH_FEATURES},
-        {NULL, 0}
-};
-SKINNY_DECLARE_ID2STR(skinny_soft_key_set2str, SKINNY_KEY_SETS, &quot;UNKNOWN_SOFT_KEY_SET&quot;)
-SKINNY_DECLARE_STR2ID(skinny_str2soft_key_set, SKINNY_KEY_SETS, -1)
-
-struct skinny_table SKINNY_CALL_STATES[] = {
-        {&quot;OffHook&quot;, SKINNY_OFF_HOOK},
-        {&quot;OnHook&quot;, SKINNY_ON_HOOK},
-        {&quot;RingOut&quot;, SKINNY_RING_OUT},
-        {&quot;RingIn&quot;, SKINNY_RING_IN},
-        {&quot;Connected&quot;, SKINNY_CONNECTED},
-        {&quot;Busy&quot;, SKINNY_BUSY},
-        {&quot;Congestion&quot;, SKINNY_CONGESTION},
-        {&quot;Hold&quot;, SKINNY_HOLD},
-        {&quot;CallWaiting&quot;, SKINNY_CALL_WAITING},
-        {&quot;CallTransfer&quot;, SKINNY_CALL_TRANSFER},
-        {&quot;CallPark&quot;, SKINNY_CALL_PARK},
-        {&quot;Proceed&quot;, SKINNY_PROCEED},
-        {&quot;CallRemoteMultiline&quot;, SKINNY_CALL_REMOTE_MULTILINE},
-        {&quot;InvalidNumber&quot;, SKINNY_INVALID_NUMBER},
-        {NULL, 0}
-};
-SKINNY_DECLARE_ID2STR(skinny_call_state2str, SKINNY_CALL_STATES, &quot;CallStateUnknown&quot;)
-SKINNY_DECLARE_STR2ID(skinny_str2call_state, SKINNY_CALL_STATES, -1)
-
-struct skinny_table SKINNY_DEVICE_RESET_TYPES[] = {
-        {&quot;DeviceReset&quot;, SKINNY_DEVICE_RESET},
-        {&quot;DeviceRestart&quot;, SKINNY_DEVICE_RESTART},
-        {NULL, 0}
-};
-SKINNY_DECLARE_ID2STR(skinny_device_reset_type2str, SKINNY_DEVICE_RESET_TYPES, &quot;DeviceResetTypeUnknown&quot;)
-SKINNY_DECLARE_STR2ID(skinny_str2device_reset_type, SKINNY_DEVICE_RESET_TYPES, -1)
-
</del><span class="cx"> /*****************************************************************************/
</span><span class="cx"> /* SKINNY FUNCTIONS */
</span><span class="cx"> /*****************************************************************************/
</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 (17021 => 17022)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h        2010-03-17 06:40:15 UTC (rev 17021)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h        2010-03-17 12:52:08 UTC (rev 17022)
</span><span class="lines">@@ -591,206 +591,6 @@
</span><span class="cx"> typedef switch_status_t (*skinny_command_t) (char **argv, int argc, switch_stream_handle_t *stream);
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><del>-/* SKINNY TABLES */
-/*****************************************************************************/
-struct skinny_table {
-        const char *name;
-        uint32_t id;
-};
-
-#define SKINNY_DECLARE_ID2STR(func, TABLE, DEFAULT_STR) \
-const char *func(uint32_t id) \
-{ \
-        const char *str = DEFAULT_STR; \
-        \
-        for (uint8_t x = 0; x &lt; (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
-                if (TABLE[x].id == id) {\
-                        str = TABLE[x].name;\
-                        break;\
-                }\
-        }\
-        \
-        return str;\
-}
-
-#define SKINNY_DECLARE_STR2ID(func, TABLE, DEFAULT_ID) \
-uint32_t func(const char *str)\
-{\
-        uint32_t id = DEFAULT_ID;\
-        \
-        if (*str &gt; 47 &amp;&amp; *str &lt; 58) {\
-                id = atoi(str);\
-        } else {\
-                for (uint8_t x = 0; x &lt; (sizeof(TABLE) / sizeof(struct skinny_table)) - 1 &amp;&amp; TABLE[x].name; x++) {\
-                        if (!strcasecmp(TABLE[x].name, str)) {\
-                                id = TABLE[x].id;\
-                                break;\
-                        }\
-                }\
-        }\
-        return id;\
-}
-
-#define SKINNY_DECLARE_PUSH_MATCH(TABLE) \
-        switch_console_callback_match_t *my_matches = NULL;\
-        for (uint8_t x = 0; x &lt; (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
-                switch_console_push_match(&amp;my_matches, TABLE[x].name);\
-        }\
-        if (my_matches) {\
-                *matches = my_matches;\
-                status = SWITCH_STATUS_SUCCESS;\
-        }
-        
-struct skinny_table SKINNY_MESSAGE_TYPES[55];
-const char *skinny_message_type2str(uint32_t id);
-uint32_t skinny_str2message_type(const char *str);
-#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
-
-enum skinny_tone {
-        SKINNY_TONE_SILENCE = 0x00,
-        SKINNY_TONE_DIALTONE = 0x21,
-        SKINNY_TONE_BUSYTONE = 0x23,
-        SKINNY_TONE_ALERT = 0x24,
-        SKINNY_TONE_REORDER = 0x25,
-        SKINNY_TONE_CALLWAITTONE = 0x2D,
-        SKINNY_TONE_NOTONE = 0x7F,
-};
-
-enum skinny_ring_type {
-        SKINNY_RING_OFF = 1,
-        SKINNY_RING_INSIDE = 2,
-        SKINNY_RING_OUTSIDE = 3,
-        SKINNY_RING_FEATURE = 4
-};
-struct skinny_table SKINNY_RING_TYPES[5];
-const char *skinny_ring_type2str(uint32_t id);
-uint32_t skinny_str2ring_type(const char *str);
-#define SKINNY_PUSH_RING_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_RING_TYPES)
-
-enum skinny_ring_mode {
-        SKINNY_RING_FOREVER = 1,
-        SKINNY_RING_ONCE = 2,
-};
-struct skinny_table SKINNY_RING_MODES[3];
-const char *skinny_ring_mode2str(uint32_t id);
-uint32_t skinny_str2ring_mode(const char *str);
-#define SKINNY_PUSH_RING_MODES SKINNY_DECLARE_PUSH_MATCH(SKINNY_RING_MODES)
-
-
-enum skinny_lamp_mode {
-        SKINNY_LAMP_OFF = 1,
-        SKINNY_LAMP_ON = 2,
-        SKINNY_LAMP_WINK = 3,
-        SKINNY_LAMP_FLASH = 4,
-        SKINNY_LAMP_BLINK = 5,
-};
-struct skinny_table SKINNY_LAMP_MODES[6];
-const char *skinny_lamp_mode2str(uint32_t id);
-uint32_t skinny_str2lamp_mode(const char *str);
-#define SKINNY_PUSH_LAMP_MODES SKINNY_DECLARE_PUSH_MATCH(SKINNY_LAMP_MODES)
-
-enum skinny_speaker_mode {
-        SKINNY_SPEAKER_ON = 1,
-        SKINNY_SPEAKER_OFF = 2,
-};
-struct skinny_table SKINNY_SPEAKER_MODES[3];
-const char *skinny_speaker_mode2str(uint32_t id);
-uint32_t skinny_str2speaker_mode(const char *str);
-#define SKINNY_PUSH_SPEAKER_MODES SKINNY_DECLARE_PUSH_MATCH(SKINNY_SPEAKER_MODES)
-
-enum skinny_call_type {
-        SKINNY_INBOUND_CALL = 1,
-        SKINNY_OUTBOUND_CALL = 2,
-        SKINNY_FORWARD_CALL = 3,
-};
-
-enum skinny_button_definition {
-        SKINNY_BUTTON_UNKNOWN = 0x00,
-        SKINNY_BUTTON_LAST_NUMBER_REDIAL = 0x01,
-        SKINNY_BUTTON_SPEED_DIAL = 0x02,
-        SKINNY_BUTTON_LINE = 0x09,
-        SKINNY_BUTTON_VOICEMAIL = 0x0F,
-        SKINNY_BUTTON_PRIVACY = 0x13,
-        SKINNY_BUTTON_SERVICE_URL = 0x14,
-        SKINNY_BUTTON_UNDEFINED = 0xFF,
-};
-struct skinny_table SKINNY_BUTTONS[9];
-const char *skinny_button2str(uint32_t id);
-uint32_t skinny_str2button(const char *str);
-#define SKINNY_PUSH_STIMULI SKINNY_DECLARE_PUSH_MATCH(SKINNY_BUTTONS)
-
-enum skinny_soft_key_event {
-        SOFTKEY_REDIAL = 0x01,
-        SOFTKEY_NEWCALL = 0x02,
-        SOFTKEY_HOLD = 0x03,
-        SOFTKEY_TRANSFER = 0x04,
-        SOFTKEY_CFWDALL = 0x05,
-        SOFTKEY_CFWDBUSY = 0x06,
-        SOFTKEY_CFWDNOANSWER = 0x07,
-        SOFTKEY_BACKSPACE = 0x08,
-        SOFTKEY_ENDCALL = 0x09,
-        SOFTKEY_RESUME = 0x0A,
-        SOFTKEY_ANSWER = 0x0B,
-        SOFTKEY_INFO = 0x0C,
-        SOFTKEY_CONFRM = 0x0D,
-        SOFTKEY_PARK = 0x0E,
-        SOFTKEY_JOIN = 0x0F,
-        SOFTKEY_MEETMECONFRM = 0x10,
-        SOFTKEY_CALLPICKUP = 0x11,
-        SOFTKEY_GRPCALLPICKUP = 0x12,
-        SOFTKEY_DND = 0x13,
-        SOFTKEY_IDIVERT = 0x14,
-};
-
-enum skinny_key_set {
-        SKINNY_KEY_SET_ON_HOOK = 0,
-        SKINNY_KEY_SET_CONNECTED = 1,
-        SKINNY_KEY_SET_ON_HOLD = 2,
-        SKINNY_KEY_SET_RING_IN = 3,
-        SKINNY_KEY_SET_OFF_HOOK = 4,
-        SKINNY_KEY_SET_CONNECTED_WITH_TRANSFER = 5,
-        SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT = 6,
-        SKINNY_KEY_SET_CONNECTED_WITH_CONFERENCE = 7,
-        SKINNY_KEY_SET_RING_OUT = 8,
-        SKINNY_KEY_SET_OFF_HOOK_WITH_FEATURES = 9,
-};
-struct skinny_table SKINNY_KEY_SETS[11];
-const char *skinny_soft_key_set2str(uint32_t id);
-uint32_t skinny_str2soft_key_set(const char *str);
-#define SKINNY_PUSH_SOFT_KEY_SETS SKINNY_DECLARE_PUSH_MATCH(SKINNY_KEY_SETS)
-
-
-enum skinny_call_state {
-        SKINNY_OFF_HOOK = 1,
-        SKINNY_ON_HOOK = 2,
-        SKINNY_RING_OUT = 3,
-        SKINNY_RING_IN = 4,
-        SKINNY_CONNECTED = 5,
-        SKINNY_BUSY = 6,
-        SKINNY_CONGESTION = 7,
-        SKINNY_HOLD = 8,
-        SKINNY_CALL_WAITING = 9,
-        SKINNY_CALL_TRANSFER = 10,
-        SKINNY_CALL_PARK = 11,
-        SKINNY_PROCEED = 12,
-        SKINNY_CALL_REMOTE_MULTILINE = 13,
-        SKINNY_INVALID_NUMBER = 14
-};
-struct skinny_table SKINNY_CALL_STATES[15];
-const char *skinny_call_state2str(uint32_t id);
-uint32_t skinny_str2call_state(const char *str);
-#define SKINNY_PUSH_CALL_STATES SKINNY_DECLARE_PUSH_MATCH(SKINNY_CALL_STATES)
-
-enum skinny_device_reset_types {
-  SKINNY_DEVICE_RESET = 1,
-  SKINNY_DEVICE_RESTART = 2
-};
-struct skinny_table SKINNY_DEVICE_RESET_TYPES[3];
-const char *skinny_device_reset_type2str(uint32_t id);
-uint32_t skinny_str2device_reset_type(const char *str);
-#define SKINNY_PUSH_DEVICE_RESET_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_DEVICE_RESET_TYPES)
-
-/*****************************************************************************/
</del><span class="cx"> /* SKINNY FUNCTIONS */
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> #define skinny_check_data_length(message, len) \
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skinnyskinny_tablesc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c (0 => 17022)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c                                (rev 0)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c        2010-03-17 12:52:08 UTC (rev 17022)
</span><span class="lines">@@ -0,0 +1,191 @@
</span><ins>+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2010, Mathieu Parent &lt;math.parent@gmail.com&gt;
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the &quot;License&quot;); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an &quot;AS IS&quot; basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Mathieu Parent &lt;math.parent@gmail.com&gt;
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Mathieu Parent &lt;math.parent@gmail.com&gt;
+ *
+ *
+ * skinny_tables.c -- Skinny Call Control Protocol (SCCP) Endpoint Module
+ *
+ */
+
+#include &quot;skinny_protocol.h&quot;
+#include &quot;skinny_tables.h&quot;
+
+/* Translation tables */
+struct skinny_table SKINNY_MESSAGE_TYPES[] = {
+        {&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;ServiceUrlStatReqMessage&quot;, SERVICE_URL_STAT_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;ResetMessage&quot;, RESET_MESSAGE},
+        {&quot;KeepAliveAckMessage&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;UnregisterAckMessage&quot;, UNREGISTER_ACK_MESSAGE},
+        {&quot;DialedNumberMessage&quot;, DIALED_NUMBER_MESSAGE},
+        {&quot;FeatureResMessage&quot;, FEATURE_STAT_RES_MESSAGE},
+        {&quot;ServiceUrlStatMessage&quot;, SERVICE_URL_STAT_RES_MESSAGE},
+        {NULL, 0}
+};
+SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, &quot;UnknownMessage&quot;)
+SKINNY_DECLARE_STR2ID(skinny_str2message_type, SKINNY_MESSAGE_TYPES, -1)
+
+struct skinny_table SKINNY_RING_TYPES[] = {
+        {&quot;RingOff&quot;, SKINNY_RING_OFF},
+        {&quot;RingInside&quot;, SKINNY_RING_INSIDE},
+        {&quot;RingOutside&quot;, SKINNY_RING_OUTSIDE},
+        {&quot;RingFeature&quot;, SKINNY_RING_FEATURE},
+        {NULL, 0}
+};
+SKINNY_DECLARE_ID2STR(skinny_ring_type2str, SKINNY_RING_TYPES, &quot;RingTypeUnknown&quot;)
+SKINNY_DECLARE_STR2ID(skinny_str2ring_type, SKINNY_RING_TYPES, -1)
+
+struct skinny_table SKINNY_RING_MODES[] = {
+        {&quot;RingForever&quot;, SKINNY_RING_FOREVER},
+        {&quot;RingOnce&quot;, SKINNY_RING_ONCE},
+        {NULL, 0}
+};
+SKINNY_DECLARE_ID2STR(skinny_ring_mode2str, SKINNY_RING_MODES, &quot;RingModeUnknown&quot;)
+SKINNY_DECLARE_STR2ID(skinny_str2ring_mode, SKINNY_RING_MODES, -1)
+
+struct skinny_table SKINNY_BUTTONS[] = {
+        {&quot;Unknown&quot;, SKINNY_BUTTON_UNKNOWN},
+        {&quot;LastNumberRedial&quot;, SKINNY_BUTTON_LAST_NUMBER_REDIAL},
+        {&quot;SpeedDial&quot;, SKINNY_BUTTON_SPEED_DIAL},
+        {&quot;Line&quot;, SKINNY_BUTTON_LINE},
+        {&quot;Voicemail&quot;, SKINNY_BUTTON_VOICEMAIL},
+        {&quot;Privacy&quot;, SKINNY_BUTTON_PRIVACY},
+        {&quot;ServiceUrl&quot;, SKINNY_BUTTON_SERVICE_URL},
+        {&quot;Undefined&quot;, SKINNY_BUTTON_UNDEFINED},
+        {NULL, 0}
+};
+SKINNY_DECLARE_ID2STR(skinny_button2str, SKINNY_BUTTONS, &quot;Unknown&quot;)
+SKINNY_DECLARE_STR2ID(skinny_str2button, SKINNY_BUTTONS, -1)
+
+struct skinny_table SKINNY_LAMP_MODES[] = {
+        {&quot;Off&quot;, SKINNY_LAMP_OFF},
+        {&quot;On&quot;, SKINNY_LAMP_ON},
+        {&quot;Wink&quot;, SKINNY_LAMP_WINK},
+        {&quot;Flash&quot;, SKINNY_LAMP_FLASH},
+        {&quot;Blink&quot;, SKINNY_LAMP_BLINK},
+        {NULL, 0}
+};
+SKINNY_DECLARE_ID2STR(skinny_lamp_mode2str, SKINNY_LAMP_MODES, &quot;Unknown&quot;)
+SKINNY_DECLARE_STR2ID(skinny_str2lamp_mode, SKINNY_LAMP_MODES, -1)
+
+struct skinny_table SKINNY_SPEAKER_MODES[] = {
+        {&quot;SpeakerOn&quot;, SKINNY_SPEAKER_ON},
+        {&quot;SpeakerOff&quot;, SKINNY_SPEAKER_OFF},
+        {NULL, 0}
+};
+SKINNY_DECLARE_ID2STR(skinny_speaker_mode2str, SKINNY_SPEAKER_MODES, &quot;Unknown&quot;)
+SKINNY_DECLARE_STR2ID(skinny_str2speaker_mode, SKINNY_SPEAKER_MODES, -1)
+
+struct skinny_table SKINNY_KEY_SETS[] = {
+        {&quot;KeySetOnHook&quot;, SKINNY_KEY_SET_ON_HOOK},
+        {&quot;KeySetConnected&quot;, SKINNY_KEY_SET_CONNECTED},
+        {&quot;KeySetOnHold&quot;, SKINNY_KEY_SET_ON_HOLD},
+        {&quot;KeySetRingIn&quot;, SKINNY_KEY_SET_RING_IN},
+        {&quot;KeySetOffHook&quot;, SKINNY_KEY_SET_OFF_HOOK},
+        {&quot;KeySetConnectedWithTransfer&quot;, SKINNY_KEY_SET_CONNECTED_WITH_TRANSFER},
+        {&quot;KeySetDigitsAfterDialingFirstDigit&quot;, SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT},
+        {&quot;KeySetConnectedWithConference&quot;, SKINNY_KEY_SET_CONNECTED_WITH_CONFERENCE},
+        {&quot;KeySetRingOut&quot;, SKINNY_KEY_SET_RING_OUT},
+        {&quot;KeySetOffHookWithFeatures&quot;, SKINNY_KEY_SET_OFF_HOOK_WITH_FEATURES},
+        {NULL, 0}
+};
+SKINNY_DECLARE_ID2STR(skinny_soft_key_set2str, SKINNY_KEY_SETS, &quot;UNKNOWN_SOFT_KEY_SET&quot;)
+SKINNY_DECLARE_STR2ID(skinny_str2soft_key_set, SKINNY_KEY_SETS, -1)
+
+struct skinny_table SKINNY_CALL_STATES[] = {
+        {&quot;OffHook&quot;, SKINNY_OFF_HOOK},
+        {&quot;OnHook&quot;, SKINNY_ON_HOOK},
+        {&quot;RingOut&quot;, SKINNY_RING_OUT},
+        {&quot;RingIn&quot;, SKINNY_RING_IN},
+        {&quot;Connected&quot;, SKINNY_CONNECTED},
+        {&quot;Busy&quot;, SKINNY_BUSY},
+        {&quot;Congestion&quot;, SKINNY_CONGESTION},
+        {&quot;Hold&quot;, SKINNY_HOLD},
+        {&quot;CallWaiting&quot;, SKINNY_CALL_WAITING},
+        {&quot;CallTransfer&quot;, SKINNY_CALL_TRANSFER},
+        {&quot;CallPark&quot;, SKINNY_CALL_PARK},
+        {&quot;Proceed&quot;, SKINNY_PROCEED},
+        {&quot;CallRemoteMultiline&quot;, SKINNY_CALL_REMOTE_MULTILINE},
+        {&quot;InvalidNumber&quot;, SKINNY_INVALID_NUMBER},
+        {NULL, 0}
+};
+SKINNY_DECLARE_ID2STR(skinny_call_state2str, SKINNY_CALL_STATES, &quot;CallStateUnknown&quot;)
+SKINNY_DECLARE_STR2ID(skinny_str2call_state, SKINNY_CALL_STATES, -1)
+
+struct skinny_table SKINNY_DEVICE_RESET_TYPES[] = {
+        {&quot;DeviceReset&quot;, SKINNY_DEVICE_RESET},
+        {&quot;DeviceRestart&quot;, SKINNY_DEVICE_RESTART},
+        {NULL, 0}
+};
+SKINNY_DECLARE_ID2STR(skinny_device_reset_type2str, SKINNY_DEVICE_RESET_TYPES, &quot;DeviceResetTypeUnknown&quot;)
+SKINNY_DECLARE_STR2ID(skinny_str2device_reset_type, SKINNY_DEVICE_RESET_TYPES, -1)
+
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skinnyskinny_tablesh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h (0 => 17022)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h                                (rev 0)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h        2010-03-17 12:52:08 UTC (rev 17022)
</span><span class="lines">@@ -0,0 +1,237 @@
</span><ins>+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2010, Mathieu Parent &lt;math.parent@gmail.com&gt;
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the &quot;License&quot;); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an &quot;AS IS&quot; basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Mathieu Parent &lt;math.parent@gmail.com&gt;
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Mathieu Parent &lt;math.parent@gmail.com&gt;
+ *
+ *
+ * skinny_tables.h -- Skinny Call Control Protocol (SCCP) Endpoint Module
+ *
+ */
+#ifndef _SKINNY_TABLES_H
+#define _SKINNY_TABLES_H
+
+/*****************************************************************************/
+/* SKINNY TABLES */
+/*****************************************************************************/
+struct skinny_table {
+        const char *name;
+        uint32_t id;
+};
+
+#define SKINNY_DECLARE_ID2STR(func, TABLE, DEFAULT_STR) \
+const char *func(uint32_t id) \
+{ \
+        const char *str = DEFAULT_STR; \
+        \
+        for (uint8_t x = 0; x &lt; (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
+                if (TABLE[x].id == id) {\
+                        str = TABLE[x].name;\
+                        break;\
+                }\
+        }\
+        \
+        return str;\
+}
+
+#define SKINNY_DECLARE_STR2ID(func, TABLE, DEFAULT_ID) \
+uint32_t func(const char *str)\
+{\
+        uint32_t id = DEFAULT_ID;\
+        \
+        if (*str &gt; 47 &amp;&amp; *str &lt; 58) {\
+                id = atoi(str);\
+        } else {\
+                for (uint8_t x = 0; x &lt; (sizeof(TABLE) / sizeof(struct skinny_table)) - 1 &amp;&amp; TABLE[x].name; x++) {\
+                        if (!strcasecmp(TABLE[x].name, str)) {\
+                                id = TABLE[x].id;\
+                                break;\
+                        }\
+                }\
+        }\
+        return id;\
+}
+
+#define SKINNY_DECLARE_PUSH_MATCH(TABLE) \
+        switch_console_callback_match_t *my_matches = NULL;\
+        for (uint8_t x = 0; x &lt; (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
+                switch_console_push_match(&amp;my_matches, TABLE[x].name);\
+        }\
+        if (my_matches) {\
+                *matches = my_matches;\
+                status = SWITCH_STATUS_SUCCESS;\
+        }
+        
+
+struct skinny_table SKINNY_MESSAGE_TYPES[55];
+const char *skinny_message_type2str(uint32_t id);
+uint32_t skinny_str2message_type(const char *str);
+#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
+
+enum skinny_tone {
+        SKINNY_TONE_SILENCE = 0x00,
+        SKINNY_TONE_DIALTONE = 0x21,
+        SKINNY_TONE_BUSYTONE = 0x23,
+        SKINNY_TONE_ALERT = 0x24,
+        SKINNY_TONE_REORDER = 0x25,
+        SKINNY_TONE_CALLWAITTONE = 0x2D,
+        SKINNY_TONE_NOTONE = 0x7F,
+};
+
+enum skinny_ring_type {
+        SKINNY_RING_OFF = 1,
+        SKINNY_RING_INSIDE = 2,
+        SKINNY_RING_OUTSIDE = 3,
+        SKINNY_RING_FEATURE = 4
+};
+struct skinny_table SKINNY_RING_TYPES[5];
+const char *skinny_ring_type2str(uint32_t id);
+uint32_t skinny_str2ring_type(const char *str);
+#define SKINNY_PUSH_RING_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_RING_TYPES)
+
+enum skinny_ring_mode {
+        SKINNY_RING_FOREVER = 1,
+        SKINNY_RING_ONCE = 2,
+};
+struct skinny_table SKINNY_RING_MODES[3];
+const char *skinny_ring_mode2str(uint32_t id);
+uint32_t skinny_str2ring_mode(const char *str);
+#define SKINNY_PUSH_RING_MODES SKINNY_DECLARE_PUSH_MATCH(SKINNY_RING_MODES)
+
+
+enum skinny_lamp_mode {
+        SKINNY_LAMP_OFF = 1,
+        SKINNY_LAMP_ON = 2,
+        SKINNY_LAMP_WINK = 3,
+        SKINNY_LAMP_FLASH = 4,
+        SKINNY_LAMP_BLINK = 5,
+};
+struct skinny_table SKINNY_LAMP_MODES[6];
+const char *skinny_lamp_mode2str(uint32_t id);
+uint32_t skinny_str2lamp_mode(const char *str);
+#define SKINNY_PUSH_LAMP_MODES SKINNY_DECLARE_PUSH_MATCH(SKINNY_LAMP_MODES)
+
+enum skinny_speaker_mode {
+        SKINNY_SPEAKER_ON = 1,
+        SKINNY_SPEAKER_OFF = 2,
+};
+struct skinny_table SKINNY_SPEAKER_MODES[3];
+const char *skinny_speaker_mode2str(uint32_t id);
+uint32_t skinny_str2speaker_mode(const char *str);
+#define SKINNY_PUSH_SPEAKER_MODES SKINNY_DECLARE_PUSH_MATCH(SKINNY_SPEAKER_MODES)
+
+enum skinny_call_type {
+        SKINNY_INBOUND_CALL = 1,
+        SKINNY_OUTBOUND_CALL = 2,
+        SKINNY_FORWARD_CALL = 3,
+};
+
+enum skinny_button_definition {
+        SKINNY_BUTTON_UNKNOWN = 0x00,
+        SKINNY_BUTTON_LAST_NUMBER_REDIAL = 0x01,
+        SKINNY_BUTTON_SPEED_DIAL = 0x02,
+        SKINNY_BUTTON_LINE = 0x09,
+        SKINNY_BUTTON_VOICEMAIL = 0x0F,
+        SKINNY_BUTTON_PRIVACY = 0x13,
+        SKINNY_BUTTON_SERVICE_URL = 0x14,
+        SKINNY_BUTTON_UNDEFINED = 0xFF,
+};
+struct skinny_table SKINNY_BUTTONS[9];
+const char *skinny_button2str(uint32_t id);
+uint32_t skinny_str2button(const char *str);
+#define SKINNY_PUSH_STIMULI SKINNY_DECLARE_PUSH_MATCH(SKINNY_BUTTONS)
+
+enum skinny_soft_key_event {
+        SOFTKEY_REDIAL = 0x01,
+        SOFTKEY_NEWCALL = 0x02,
+        SOFTKEY_HOLD = 0x03,
+        SOFTKEY_TRANSFER = 0x04,
+        SOFTKEY_CFWDALL = 0x05,
+        SOFTKEY_CFWDBUSY = 0x06,
+        SOFTKEY_CFWDNOANSWER = 0x07,
+        SOFTKEY_BACKSPACE = 0x08,
+        SOFTKEY_ENDCALL = 0x09,
+        SOFTKEY_RESUME = 0x0A,
+        SOFTKEY_ANSWER = 0x0B,
+        SOFTKEY_INFO = 0x0C,
+        SOFTKEY_CONFRM = 0x0D,
+        SOFTKEY_PARK = 0x0E,
+        SOFTKEY_JOIN = 0x0F,
+        SOFTKEY_MEETMECONFRM = 0x10,
+        SOFTKEY_CALLPICKUP = 0x11,
+        SOFTKEY_GRPCALLPICKUP = 0x12,
+        SOFTKEY_DND = 0x13,
+        SOFTKEY_IDIVERT = 0x14,
+};
+
+enum skinny_key_set {
+        SKINNY_KEY_SET_ON_HOOK = 0,
+        SKINNY_KEY_SET_CONNECTED = 1,
+        SKINNY_KEY_SET_ON_HOLD = 2,
+        SKINNY_KEY_SET_RING_IN = 3,
+        SKINNY_KEY_SET_OFF_HOOK = 4,
+        SKINNY_KEY_SET_CONNECTED_WITH_TRANSFER = 5,
+        SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT = 6,
+        SKINNY_KEY_SET_CONNECTED_WITH_CONFERENCE = 7,
+        SKINNY_KEY_SET_RING_OUT = 8,
+        SKINNY_KEY_SET_OFF_HOOK_WITH_FEATURES = 9,
+};
+struct skinny_table SKINNY_KEY_SETS[11];
+const char *skinny_soft_key_set2str(uint32_t id);
+uint32_t skinny_str2soft_key_set(const char *str);
+#define SKINNY_PUSH_SOFT_KEY_SETS SKINNY_DECLARE_PUSH_MATCH(SKINNY_KEY_SETS)
+
+
+enum skinny_call_state {
+        SKINNY_OFF_HOOK = 1,
+        SKINNY_ON_HOOK = 2,
+        SKINNY_RING_OUT = 3,
+        SKINNY_RING_IN = 4,
+        SKINNY_CONNECTED = 5,
+        SKINNY_BUSY = 6,
+        SKINNY_CONGESTION = 7,
+        SKINNY_HOLD = 8,
+        SKINNY_CALL_WAITING = 9,
+        SKINNY_CALL_TRANSFER = 10,
+        SKINNY_CALL_PARK = 11,
+        SKINNY_PROCEED = 12,
+        SKINNY_CALL_REMOTE_MULTILINE = 13,
+        SKINNY_INVALID_NUMBER = 14
+};
+struct skinny_table SKINNY_CALL_STATES[15];
+const char *skinny_call_state2str(uint32_t id);
+uint32_t skinny_str2call_state(const char *str);
+#define SKINNY_PUSH_CALL_STATES SKINNY_DECLARE_PUSH_MATCH(SKINNY_CALL_STATES)
+
+enum skinny_device_reset_types {
+  SKINNY_DEVICE_RESET = 1,
+  SKINNY_DEVICE_RESTART = 2
+};
+struct skinny_table SKINNY_DEVICE_RESET_TYPES[3];
+const char *skinny_device_reset_type2str(uint32_t id);
+uint32_t skinny_str2device_reset_type(const char *str);
+#define SKINNY_PUSH_DEVICE_RESET_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_DEVICE_RESET_TYPES)
+
+#endif /* _SKINNY_TABLES_H */
+
</ins></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>