<!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][17174] </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=17174">17174</a></dd>
<dt>Author</dt> <dd>mikej</dd>
<dt>Date</dt> <dd>2010-04-01 15:16:49 -0500 (Thu, 01 Apr 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Skinny: Check for socket to see if listener is alive

also, use tab to indent</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skinnymod_skinnyc">freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skinnymod_skinnyh">freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.h</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>
<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_skinnymod_skinnyc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c (17173 => 17174)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c        2010-04-01 20:16:45 UTC (rev 17173)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.c        2010-04-01 20:16:49 UTC (rev 17174)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> 
</span><span class="cx"> skinny_profile_t *skinny_find_profile(const char *profile_name)
</span><span class="cx"> {
</span><del>-    skinny_profile_t *profile;
</del><ins>+        skinny_profile_t *profile;
</ins><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">         profile = (skinny_profile_t *) switch_core_hash_find(globals.profile_hash, profile_name);
</span><span class="cx">         switch_mutex_unlock(globals.mutex);
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> struct skinny_profile_find_session_uuid_helper {
</span><del>-    skinny_profile_t *profile;
</del><ins>+        skinny_profile_t *profile;
</ins><span class="cx">         char *channel_uuid;
</span><span class="cx">         uint32_t line_instance;
</span><span class="cx"> };
</span><span class="lines">@@ -178,12 +178,12 @@
</span><span class="cx">         char *channel_uuid = argv[0];
</span><span class="cx">         uint32_t line_instance = atoi(argv[1]);
</span><span class="cx"> 
</span><del>-    if(helper-&gt;channel_uuid == NULL) {
-        helper-&gt;channel_uuid = switch_mprintf(&quot;%s&quot;, channel_uuid);
-        helper-&gt;line_instance = line_instance;
-    }
</del><ins>+        if(helper-&gt;channel_uuid == NULL) {
+                helper-&gt;channel_uuid = switch_mprintf(&quot;%s&quot;, channel_uuid);
+                helper-&gt;line_instance = line_instance;
+        }
</ins><span class="cx"> 
</span><del>-    return 0;
</del><ins>+        return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> char * skinny_profile_find_session_uuid(skinny_profile_t *profile, listener_t *listener, uint32_t *line_instance_p, uint32_t call_id)
</span><span class="lines">@@ -193,28 +193,28 @@
</span><span class="cx">         char *device_condition = NULL;
</span><span class="cx">         char *line_instance_condition = NULL;
</span><span class="cx">         char *call_id_condition = NULL;
</span><del>-        
</del><ins>+
</ins><span class="cx">         switch_assert(profile);
</span><span class="cx">         helper.profile = profile;
</span><span class="cx">         helper.channel_uuid = NULL;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if(listener) {
</span><del>-            device_condition = switch_mprintf(&quot;device_name='%s' AND device_instance=%d&quot;,
-                listener-&gt;device_name, listener-&gt;device_instance);
</del><ins>+                device_condition = switch_mprintf(&quot;device_name='%s' AND device_instance=%d&quot;,
+                        listener-&gt;device_name, listener-&gt;device_instance);
</ins><span class="cx">         } else {
</span><del>-            device_condition = switch_mprintf(&quot;1=1&quot;);
</del><ins>+                device_condition = switch_mprintf(&quot;1=1&quot;);
</ins><span class="cx">         }
</span><span class="cx">         switch_assert(device_condition);
</span><span class="cx">         if(*line_instance_p &gt; 0) {
</span><del>-            line_instance_condition = switch_mprintf(&quot;line_instance=%d&quot;, *line_instance_p);
</del><ins>+                line_instance_condition = switch_mprintf(&quot;line_instance=%d&quot;, *line_instance_p);
</ins><span class="cx">         } else {
</span><del>-            line_instance_condition = switch_mprintf(&quot;1=1&quot;);
</del><ins>+                line_instance_condition = switch_mprintf(&quot;1=1&quot;);
</ins><span class="cx">         }
</span><span class="cx">         switch_assert(line_instance_condition);
</span><span class="cx">         if(call_id &gt; 0) {
</span><del>-            call_id_condition = switch_mprintf(&quot;call_id=%d&quot;, call_id);
</del><ins>+                call_id_condition = switch_mprintf(&quot;call_id=%d&quot;, call_id);
</ins><span class="cx">         } else {
</span><del>-            call_id_condition = switch_mprintf(&quot;1=1&quot;);
</del><ins>+                call_id_condition = switch_mprintf(&quot;1=1&quot;);
</ins><span class="cx">         }
</span><span class="cx">         switch_assert(call_id_condition);
</span><span class="cx">         if((sql = switch_mprintf(
</span><span class="lines">@@ -225,7 +225,7 @@
</span><span class="cx">                         device_condition, line_instance_condition, call_id_condition
</span><span class="cx">                         ))) {
</span><span class="cx">                 skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql,
</span><del>-                    skinny_profile_find_session_uuid_callback, &amp;helper);
</del><ins>+                        skinny_profile_find_session_uuid_callback, &amp;helper);
</ins><span class="cx">                 switch_safe_free(sql);
</span><span class="cx">         }
</span><span class="cx">         switch_safe_free(device_condition);
</span><span class="lines">@@ -237,21 +237,21 @@
</span><span class="cx"> 
</span><span class="cx"> switch_core_session_t * skinny_profile_find_session(skinny_profile_t *profile, listener_t *listener, uint32_t *line_instance_p, uint32_t call_id)
</span><span class="cx"> {
</span><del>-    char *uuid;
-    switch_core_session_t *result = NULL;
-    uuid = skinny_profile_find_session_uuid(profile, listener, line_instance_p, call_id);
</del><ins>+        char *uuid;
+        switch_core_session_t *result = NULL;
+        uuid = skinny_profile_find_session_uuid(profile, listener, line_instance_p, call_id);
</ins><span class="cx"> 
</span><del>-    if(!zstr(uuid)) {
-        /* TODO Why should we force? */
-        result = switch_core_session_force_locate(uuid);
</del><ins>+        if(!zstr(uuid)) {
+                /* TODO Why should we force? */
+                result = switch_core_session_force_locate(uuid);
</ins><span class="cx">                 if(!result) {
</span><del>-                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, 
-                        &quot;Unable to find session %s on %s:%d, line %d\n&quot;,
-                        uuid, listener-&gt;device_name, listener-&gt;device_instance, *line_instance_p);
</del><ins>+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, 
+                                &quot;Unable to find session %s on %s:%d, line %d\n&quot;,
+                                uuid, listener-&gt;device_name, listener-&gt;device_instance, *line_instance_p);
</ins><span class="cx">                 }
</span><span class="cx">                 switch_safe_free(uuid);
</span><del>-    }
-    return result;
</del><ins>+        }
+        return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="lines">@@ -337,7 +337,7 @@
</span><span class="cx"> void skinny_line_perform_set_state(const char *file, const char *func, int line, listener_t *listener, uint32_t line_instance, uint32_t call_id, uint32_t call_state)
</span><span class="cx"> {
</span><span class="cx">         switch_event_t *event = NULL;
</span><del>-    switch_assert(listener);
</del><ins>+        switch_assert(listener);
</ins><span class="cx"> 
</span><span class="cx">         skinny_device_event(listener, &amp;event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_CALL_STATE);
</span><span class="cx">         switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Line-Instance&quot;, &quot;%d&quot;, line_instance);
</span><span class="lines">@@ -359,31 +359,31 @@
</span><span class="cx"> {
</span><span class="cx">         struct skinny_line_get_state_helper *helper = pArg;
</span><span class="cx">         helper-&gt;call_state = atoi(argv[0]);
</span><del>-    return 0;
</del><ins>+        return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> uint32_t skinny_line_get_state(listener_t *listener, uint32_t line_instance, uint32_t call_id)
</span><span class="cx"> {
</span><del>-    char *line_instance_condition;
-    char *call_id_condition;
-    char *sql;
</del><ins>+        char *line_instance_condition;
+        char *call_id_condition;
+        char *sql;
</ins><span class="cx">         struct skinny_line_get_state_helper helper = {0};
</span><span class="cx"> 
</span><del>-    switch_assert(listener);
-    
-    if(line_instance &gt; 0) {
-        line_instance_condition = switch_mprintf(&quot;line_instance=%d&quot;, line_instance);
-    } else {
-        line_instance_condition = switch_mprintf(&quot;1=1&quot;);
-    }
-    switch_assert(line_instance_condition);
-    if(call_id &gt; 0) {
-        call_id_condition = switch_mprintf(&quot;call_id=%d&quot;, call_id);
-    } else {
-        call_id_condition = switch_mprintf(&quot;1=1&quot;);
-    }
-    switch_assert(call_id_condition);
</del><ins>+        switch_assert(listener);
</ins><span class="cx"> 
</span><ins>+        if(line_instance &gt; 0) {
+                line_instance_condition = switch_mprintf(&quot;line_instance=%d&quot;, line_instance);
+        } else {
+                line_instance_condition = switch_mprintf(&quot;1=1&quot;);
+        }
+        switch_assert(line_instance_condition);
+        if(call_id &gt; 0) {
+                call_id_condition = switch_mprintf(&quot;call_id=%d&quot;, call_id);
+        } else {
+                call_id_condition = switch_mprintf(&quot;1=1&quot;);
+        }
+        switch_assert(call_id_condition);
+
</ins><span class="cx">         if ((sql = switch_mprintf(
</span><span class="cx">                         &quot;SELECT call_state FROM skinny_active_lines &quot;
</span><span class="cx">                         &quot;WHERE device_name='%s' AND device_instance=%d &quot;
</span><span class="lines">@@ -396,7 +396,7 @@
</span><span class="cx">         }
</span><span class="cx">         switch_safe_free(line_instance_condition);
</span><span class="cx">         switch_safe_free(call_id_condition);
</span><del>-        
</del><ins>+
</ins><span class="cx">         return helper.call_state;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -419,11 +419,11 @@
</span><span class="cx">                 if (strcasecmp(tech_pvt-&gt;read_impl.iananame, tech_pvt-&gt;iananame) ||
</span><span class="cx">                         tech_pvt-&gt;read_impl.samples_per_second != tech_pvt-&gt;rm_rate ||
</span><span class="cx">                         tech_pvt-&gt;codec_ms != (uint32_t)tech_pvt-&gt;read_impl.microseconds_per_packet / 1000) {
</span><del>-                        
</del><ins>+        
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG, &quot;Changing Codec from %s@%dms to %s@%dms\n&quot;,
</span><span class="cx">                                                           tech_pvt-&gt;read_impl.iananame, tech_pvt-&gt;read_impl.microseconds_per_packet / 1000, 
</span><span class="cx">                                                           tech_pvt-&gt;rm_encoding, tech_pvt-&gt;codec_ms);
</span><del>-                        
</del><ins>+        
</ins><span class="cx">                         switch_core_session_lock_codec_write(tech_pvt-&gt;session);
</span><span class="cx">                         switch_core_session_lock_codec_read(tech_pvt-&gt;session);
</span><span class="cx">                         resetting = 1;
</span><span class="lines">@@ -434,7 +434,7 @@
</span><span class="cx">                         switch_goto_status(SWITCH_STATUS_SUCCESS, end);
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         if (switch_core_codec_init(&amp;tech_pvt-&gt;read_codec,
</span><span class="cx">                                                            tech_pvt-&gt;iananame,
</span><span class="cx">                                                            tech_pvt-&gt;rm_fmtp,
</span><span class="lines">@@ -526,7 +526,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_assert(tech_pvt);
</span><span class="cx">         switch_assert(session);
</span><del>-        
</del><ins>+
</ins><span class="cx">         tech_pvt-&gt;read_frame.data = tech_pvt-&gt;databuf;
</span><span class="cx">         tech_pvt-&gt;read_frame.buflen = sizeof(tech_pvt-&gt;databuf);
</span><span class="cx">         switch_mutex_init(&amp;tech_pvt-&gt;mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
</span><span class="lines">@@ -562,7 +562,7 @@
</span><span class="cx"> 
</span><span class="cx"> switch_status_t channel_on_routing(switch_core_session_t *session)
</span><span class="cx"> {
</span><del>-    switch_channel_t *channel = switch_core_session_get_channel(session);
</del><ins>+        switch_channel_t *channel = switch_core_session_get_channel(session);
</ins><span class="cx"> 
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;%s CHANNEL ROUTING\n&quot;, switch_channel_get_name(channel));
</span><span class="cx"> 
</span><span class="lines">@@ -571,7 +571,7 @@
</span><span class="cx"> 
</span><span class="cx"> switch_status_t channel_on_execute(switch_core_session_t *session)
</span><span class="cx"> {
</span><del>-    switch_channel_t *channel = switch_core_session_get_channel(session);
</del><ins>+        switch_channel_t *channel = switch_core_session_get_channel(session);
</ins><span class="cx"> 
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;%s CHANNEL EXECUTE\n&quot;, switch_channel_get_name(channel));
</span><span class="cx"> 
</span><span class="lines">@@ -588,7 +588,7 @@
</span><span class="cx">                 if (switch_core_codec_ready(&amp;tech_pvt-&gt;read_codec)) {
</span><span class="cx">                         switch_core_codec_destroy(&amp;tech_pvt-&gt;read_codec);
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if (switch_core_codec_ready(&amp;tech_pvt-&gt;write_codec)) {
</span><span class="cx">                         switch_core_codec_destroy(&amp;tech_pvt-&gt;write_codec);
</span><span class="cx">                 }
</span><span class="lines">@@ -627,33 +627,33 @@
</span><span class="cx">         uint32_t call_state = atoi(argv[16]);
</span><span class="cx"> 
</span><span class="cx">         skinny_profile_find_listener_by_device_name_and_instance(helper-&gt;tech_pvt-&gt;profile, device_name, device_instance, &amp;listener);
</span><del>-    if(listener) {
-        if(call_state == SKINNY_CONNECTED) {
-                stop_tone(listener, line_instance, call_id);
-            }
-        set_lamp(listener, SKINNY_BUTTON_LINE, line_instance, SKINNY_LAMP_OFF);
-        clear_prompt_status(listener, line_instance, call_id);
-        if(call_state == SKINNY_CONNECTED) { /* calling parties */
-                    close_receive_channel(listener,
-                            call_id, /* uint32_t conference_id, */
-                            helper-&gt;tech_pvt-&gt;party_id, /* uint32_t pass_thru_party_id, */
-                            call_id /* uint32_t conference_id2, */
-                    );
-                    stop_media_transmission(listener,
-                            call_id, /* uint32_t conference_id, */
-                            helper-&gt;tech_pvt-&gt;party_id, /* uint32_t pass_thru_party_id, */
-                            call_id /* uint32_t conference_id2, */
-                    );
-            }
</del><ins>+        if(listener) {
+                if(call_state == SKINNY_CONNECTED) {
+                        stop_tone(listener, line_instance, call_id);
+                }
+                set_lamp(listener, SKINNY_BUTTON_LINE, line_instance, SKINNY_LAMP_OFF);
+                clear_prompt_status(listener, line_instance, call_id);
+                if(call_state == SKINNY_CONNECTED) { /* calling parties */
+                        close_receive_channel(listener,
+                                call_id, /* uint32_t conference_id, */
+                                helper-&gt;tech_pvt-&gt;party_id, /* uint32_t pass_thru_party_id, */
+                                call_id /* uint32_t conference_id2, */
+                        );
+                        stop_media_transmission(listener,
+                                call_id, /* uint32_t conference_id, */
+                                helper-&gt;tech_pvt-&gt;party_id, /* uint32_t pass_thru_party_id, */
+                                call_id /* uint32_t conference_id2, */
+                        );
+                }
</ins><span class="cx"> 
</span><del>-            skinny_line_set_state(listener, line_instance, call_id, SKINNY_ON_HOOK);
-            send_select_soft_keys(listener, line_instance, call_id, SKINNY_KEY_SET_ON_HOOK, 0xffff);
-        /* TODO: DefineTimeDate */
-        set_speaker_mode(listener, SKINNY_SPEAKER_OFF);
-        set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, call_id);
-    
-    }
-    return 0;
</del><ins>+                skinny_line_set_state(listener, line_instance, call_id, SKINNY_ON_HOOK);
+                send_select_soft_keys(listener, line_instance, call_id, SKINNY_KEY_SET_ON_HOOK, 0xffff);
+                /* TODO: DefineTimeDate */
+                set_speaker_mode(listener, SKINNY_SPEAKER_OFF);
+                set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, call_id);
+
+        }
+        return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t channel_on_hangup(switch_core_session_t *session)
</span><span class="lines">@@ -668,9 +668,9 @@
</span><span class="cx"> 
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;%s CHANNEL HANGUP\n&quot;, switch_channel_get_name(channel));
</span><span class="cx"> 
</span><del>-    helper.tech_pvt= tech_pvt;
</del><ins>+        helper.tech_pvt= tech_pvt;
</ins><span class="cx"> 
</span><del>-    skinny_session_walk_lines(tech_pvt-&gt;profile, switch_core_session_get_uuid(session), channel_on_hangup_callback, &amp;helper);
</del><ins>+        skinny_session_walk_lines(tech_pvt-&gt;profile, switch_core_session_get_uuid(session), channel_on_hangup_callback, &amp;helper);
</ins><span class="cx">         if ((sql = switch_mprintf(
</span><span class="cx">                         &quot;DELETE FROM skinny_active_lines WHERE channel_uuid='%s'&quot;,
</span><span class="cx">                         switch_core_session_get_uuid(session)
</span><span class="lines">@@ -698,7 +698,7 @@
</span><span class="cx">         default:
</span><span class="cx">                 break;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;%s CHANNEL KILL %d\n&quot;, switch_channel_get_name(channel), sig);
</span><span class="cx"> 
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="lines">@@ -728,7 +728,7 @@
</span><span class="cx"> 
</span><span class="cx"> switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id)
</span><span class="cx"> {
</span><del>-    switch_channel_t *channel = switch_core_session_get_channel(session);
</del><ins>+        switch_channel_t *channel = switch_core_session_get_channel(session);
</ins><span class="cx">         private_t *tech_pvt = switch_core_session_get_private(session);
</span><span class="cx">         int payload = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -799,7 +799,7 @@
</span><span class="cx">         private_t *tech_pvt = switch_core_session_get_private(session);
</span><span class="cx">         //switch_frame_t *pframe;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if (!switch_test_flag(tech_pvt, TFLAG_IO)) {
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -850,7 +850,7 @@
</span><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
</span><span class="cx">         switch_core_session_t *nsession = NULL;
</span><span class="cx">         private_t *tech_pvt;
</span><del>-        
</del><ins>+
</ins><span class="cx">         char *profile_name, *dest;
</span><span class="cx">         skinny_profile_t *profile = NULL;
</span><span class="cx">         char *sql;
</span><span class="lines">@@ -891,12 +891,12 @@
</span><span class="cx">                 cause = SWITCH_CAUSE_UNALLOCATED_NUMBER;
</span><span class="cx">                 goto error;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         snprintf(name, sizeof(name), &quot;SKINNY/%s/%s&quot;, profile-&gt;name, dest);
</span><span class="cx"> 
</span><span class="cx">         channel = switch_core_session_get_channel(nsession);
</span><span class="cx">         switch_channel_set_name(channel, name);
</span><del>-        
</del><ins>+
</ins><span class="cx">         tech_init(tech_pvt, profile, nsession);
</span><span class="cx"> 
</span><span class="cx">         caller_profile = switch_caller_profile_clone(nsession, outbound_profile);
</span><span class="lines">@@ -917,9 +917,9 @@
</span><span class="cx">                 skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
</span><span class="cx">                 switch_safe_free(sql);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         cause = skinny_ring_lines(tech_pvt);
</span><del>-        
</del><ins>+
</ins><span class="cx">         if(cause != SWITCH_CAUSE_SUCCESS) {
</span><span class="cx">                 goto error;
</span><span class="cx">         }
</span><span class="lines">@@ -1001,10 +1001,11 @@
</span><span class="cx"> 
</span><span class="cx"> uint8_t listener_is_ready(listener_t *listener)
</span><span class="cx"> {
</span><del>-    return globals.running
-        &amp;&amp; listener
-        &amp;&amp; switch_test_flag(listener, LFLAG_RUNNING)
-        &amp;&amp; listener-&gt;profile-&gt;listener_ready;
</del><ins>+        return globals.running
+                &amp;&amp; listener
+                &amp;&amp; listener-&gt;sock
+                &amp;&amp; switch_test_flag(listener, LFLAG_RUNNING)
+                &amp;&amp; listener-&gt;profile-&gt;listener_ready;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void add_listener(listener_t *listener)
</span><span class="lines">@@ -1049,7 +1050,7 @@
</span><span class="cx">         void *val;
</span><span class="cx">         skinny_profile_t *profile;
</span><span class="cx">         listener_t *l;
</span><del>-        
</del><ins>+
</ins><span class="cx">         /* walk listeners */
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">         for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
</span><span class="lines">@@ -1071,7 +1072,7 @@
</span><span class="cx">         if(!zstr(listener-&gt;device_name)) {
</span><span class="cx">                 skinny_profile_t *profile = listener-&gt;profile;
</span><span class="cx">                 char *sql;
</span><del>-        
</del><ins>+
</ins><span class="cx">                 if ((sql = switch_mprintf(
</span><span class="cx">                                 &quot;DELETE FROM skinny_devices &quot;
</span><span class="cx">                                         &quot;WHERE name='%s' and instance=%d&quot;,
</span><span class="lines">@@ -1180,7 +1181,7 @@
</span><span class="cx">         switch_assert(listener);
</span><span class="cx">         assert(listener-&gt;profile);
</span><span class="cx">         profile = listener-&gt;profile;
</span><del>-        
</del><ins>+
</ins><span class="cx">         listener-&gt;expire_time = switch_epoch_time_now(NULL)+profile-&gt;keep_alive*110/100;
</span><span class="cx"> 
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="lines">@@ -1201,9 +1202,9 @@
</span><span class="cx">         switch_mutex_lock(profile-&gt;listener_mutex);
</span><span class="cx">         profile-&gt;listener_threads++;
</span><span class="cx">         switch_mutex_unlock(profile-&gt;listener_mutex);
</span><del>-        
</del><ins>+
</ins><span class="cx">         switch_assert(listener != NULL);
</span><del>-        
</del><ins>+
</ins><span class="cx">         switch_socket_opt_set(listener-&gt;sock, SWITCH_SO_TCP_NODELAY, TRUE);
</span><span class="cx">         switch_socket_opt_set(listener-&gt;sock, SWITCH_SO_NONBLOCK, TRUE);
</span><span class="cx"> 
</span><span class="lines">@@ -1260,7 +1261,7 @@
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Connection Closed\n&quot;);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-    /* TODO
</del><ins>+        /* TODO
</ins><span class="cx">         for(int line = 0 ; line &lt; SKINNY_MAX_BUTTON_COUNT ; line++) {
</span><span class="cx">                 if(listener-&gt;session[line]) {
</span><span class="cx">                         switch_channel_clear_flag(switch_core_session_get_channel(listener-&gt;session[line]), CF_CONTROLLED);
</span><span class="lines">@@ -1362,7 +1363,7 @@
</span><span class="cx">                         errs = 0;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if (!(listener = switch_core_alloc(listener_pool, sizeof(*listener)))) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Memory Error\n&quot;);
</span><span class="cx">                         break;
</span><span class="lines">@@ -1388,7 +1389,7 @@
</span><span class="cx">  end:
</span><span class="cx"> 
</span><span class="cx">         close_socket(&amp;profile-&gt;sock, profile);
</span><del>-        
</del><ins>+
</ins><span class="cx">         if (tmp_pool) {
</span><span class="cx">                 switch_core_destroy_memory_pool(&amp;tmp_pool);
</span><span class="cx">         }
</span><span class="lines">@@ -1461,23 +1462,23 @@
</span><span class="cx">                                 continue;
</span><span class="cx">                         }
</span><span class="cx">                         if (xsettings) {
</span><del>-                            switch_memory_pool_t *profile_pool = NULL;
</del><ins>+                                switch_memory_pool_t *profile_pool = NULL;
</ins><span class="cx">                                 char dbname[256];
</span><span class="cx">                                 switch_core_db_t *db;
</span><span class="cx">                                 skinny_profile_t *profile = NULL;
</span><span class="cx">                                 switch_xml_t param;
</span><del>-                                
-                    if (switch_core_new_memory_pool(&amp;profile_pool) != SWITCH_STATUS_SUCCESS) {
-                            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;OH OH no pool\n&quot;);
-                            return SWITCH_STATUS_TERM;
-                    }
</del><ins>+                
+                            if (switch_core_new_memory_pool(&amp;profile_pool) != SWITCH_STATUS_SUCCESS) {
+                                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;OH OH no pool\n&quot;);
+                                    return SWITCH_STATUS_TERM;
+                            }
</ins><span class="cx">                                 profile = switch_core_alloc(profile_pool, sizeof(skinny_profile_t));
</span><span class="cx">                                 profile-&gt;pool = profile_pool;
</span><span class="cx">                                 profile-&gt;name = profile_name;
</span><del>-                        switch_mutex_init(&amp;profile-&gt;listener_mutex, SWITCH_MUTEX_NESTED, profile-&gt;pool);
-                        switch_mutex_init(&amp;profile-&gt;sql_mutex, SWITCH_MUTEX_NESTED, profile-&gt;pool);
-                        switch_mutex_init(&amp;profile-&gt;sock_mutex, SWITCH_MUTEX_NESTED, profile-&gt;pool);
-                                
</del><ins>+                                switch_mutex_init(&amp;profile-&gt;listener_mutex, SWITCH_MUTEX_NESTED, profile-&gt;pool);
+                                switch_mutex_init(&amp;profile-&gt;sql_mutex, SWITCH_MUTEX_NESTED, profile-&gt;pool);
+                                switch_mutex_init(&amp;profile-&gt;sock_mutex, SWITCH_MUTEX_NESTED, profile-&gt;pool);
+                
</ins><span class="cx">                                 for (param = switch_xml_child(xsettings, &quot;param&quot;); param; param = param-&gt;next) {
</span><span class="cx">                                         char *var = (char *) switch_xml_attr_soft(param, &quot;name&quot;);
</span><span class="cx">                                         char *val = (char *) switch_xml_attr_soft(param, &quot;value&quot;);
</span><span class="lines">@@ -1502,7 +1503,7 @@
</span><span class="cx">                                                 profile-&gt;debug = atoi(val);
</span><span class="cx">                                         }
</span><span class="cx">                                 } /* param */
</span><del>-                                
</del><ins>+                
</ins><span class="cx">                                 if (!profile-&gt;dialplan) {
</span><span class="cx">                                         skinny_profile_set(profile, &quot;dialplan&quot;,&quot;default&quot;);
</span><span class="cx">                                 }
</span><span class="lines">@@ -1546,15 +1547,15 @@
</span><span class="cx">                                         }
</span><span class="cx">                                         switch_core_db_close(db);
</span><span class="cx">                                 }
</span><del>-                                
</del><ins>+                
</ins><span class="cx">                                 skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, &quot;DELETE FROM skinny_devices&quot;, NULL, NULL);
</span><span class="cx">                                 skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, &quot;DELETE FROM skinny_lines&quot;, NULL, NULL);
</span><span class="cx">                                 skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, &quot;DELETE FROM skinny_buttons&quot;, NULL, NULL);
</span><span class="cx">                                 skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, &quot;DELETE FROM skinny_active_lines&quot;, NULL, NULL);
</span><span class="cx"> 
</span><del>-                    switch_mutex_lock(globals.mutex);
-                    switch_core_hash_insert(globals.profile_hash, profile-&gt;name, profile);
-                    switch_mutex_unlock(globals.mutex);
</del><ins>+                            switch_mutex_lock(globals.mutex);
+                            switch_core_hash_insert(globals.profile_hash, profile-&gt;name, profile);
+                            switch_mutex_unlock(globals.mutex);
</ins><span class="cx">                                 profile = NULL;
</span><span class="cx">                         } else {
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
</span><span class="lines">@@ -1575,50 +1576,50 @@
</span><span class="cx">         if (event-&gt;event_id == SWITCH_EVENT_HEARTBEAT) {
</span><span class="cx">                 walk_listeners(kill_expired_listener, NULL);
</span><span class="cx">         } else if ((subclass = switch_event_get_header_nil(event, &quot;Event-Subclass&quot;)) &amp;&amp; !strcasecmp(subclass, SKINNY_EVENT_CALL_STATE)) {
</span><del>-            char *profile_name = switch_event_get_header_nil(event, &quot;Skinny-Profile-Name&quot;);
-            char *device_name = switch_event_get_header_nil(event, &quot;Skinny-Device-Name&quot;);
-            uint32_t device_instance = atoi(switch_event_get_header_nil(event, &quot;Skinny-Device-Instance&quot;));
</del><ins>+                char *profile_name = switch_event_get_header_nil(event, &quot;Skinny-Profile-Name&quot;);
+                char *device_name = switch_event_get_header_nil(event, &quot;Skinny-Device-Name&quot;);
+                uint32_t device_instance = atoi(switch_event_get_header_nil(event, &quot;Skinny-Device-Instance&quot;));
</ins><span class="cx">                 uint32_t line_instance = atoi(switch_event_get_header_nil(event, &quot;Skinny-Line-Instance&quot;));
</span><span class="cx">                 uint32_t call_id = atoi(switch_event_get_header_nil(event, &quot;Skinny-Call-Id&quot;));
</span><span class="cx">                 uint32_t call_state = atoi(switch_event_get_header_nil(event, &quot;Skinny-Call-State&quot;));
</span><del>-            skinny_profile_t *profile;
-            listener_t *listener = NULL;
-        char *line_instance_condition, *call_id_condition;
-        char *sql;
</del><ins>+                skinny_profile_t *profile;
+                listener_t *listener = NULL;
+                char *line_instance_condition, *call_id_condition;
+                char *sql;
</ins><span class="cx"> 
</span><del>-            if ((profile = skinny_find_profile(profile_name))) {
-                skinny_profile_find_listener_by_device_name_and_instance(profile, device_name, device_instance, &amp;listener);
-            if(listener) {
-                if(line_instance &gt; 0) {
-                    line_instance_condition = switch_mprintf(&quot;line_instance=%d&quot;, line_instance);
-                } else {
-                    line_instance_condition = switch_mprintf(&quot;1=1&quot;);
-                }
-                switch_assert(line_instance_condition);
-                if(call_id &gt; 0) {
-                    call_id_condition = switch_mprintf(&quot;call_id=%d&quot;, call_id);
-                } else {
-                    call_id_condition = switch_mprintf(&quot;1=1&quot;);
-                }
-                switch_assert(call_id_condition);
</del><ins>+                if ((profile = skinny_find_profile(profile_name))) {
+                        skinny_profile_find_listener_by_device_name_and_instance(profile, device_name, device_instance, &amp;listener);
+                    if(listener) {
+                        if(line_instance &gt; 0) {
+                            line_instance_condition = switch_mprintf(&quot;line_instance=%d&quot;, line_instance);
+                        } else {
+                            line_instance_condition = switch_mprintf(&quot;1=1&quot;);
+                        }
+                        switch_assert(line_instance_condition);
+                        if(call_id &gt; 0) {
+                            call_id_condition = switch_mprintf(&quot;call_id=%d&quot;, call_id);
+                        } else {
+                            call_id_condition = switch_mprintf(&quot;1=1&quot;);
+                        }
+                        switch_assert(call_id_condition);
</ins><span class="cx"> 
</span><del>-                    if ((sql = switch_mprintf(
-                                    &quot;UPDATE skinny_active_lines &quot;
-                                    &quot;SET call_state=%d &quot;
-                                    &quot;WHERE device_name='%s' AND device_instance=%d &quot;
-                                    &quot;AND %s AND %s&quot;,
-                                    call_state,
-                                    listener-&gt;device_name, listener-&gt;device_instance,
-                                    line_instance_condition, call_id_condition
-                                    ))) {
-                            skinny_execute_sql(listener-&gt;profile, sql, listener-&gt;profile-&gt;sql_mutex);
-                            switch_safe_free(sql);
-                            send_call_state(listener, call_state, line_instance, call_id);
-                    }
-                    switch_safe_free(line_instance_condition);
-                    switch_safe_free(call_id_condition);
-                }
-            }
</del><ins>+                            if ((sql = switch_mprintf(
+                                            &quot;UPDATE skinny_active_lines &quot;
+                                            &quot;SET call_state=%d &quot;
+                                            &quot;WHERE device_name='%s' AND device_instance=%d &quot;
+                                            &quot;AND %s AND %s&quot;,
+                                            call_state,
+                                            listener-&gt;device_name, listener-&gt;device_instance,
+                                            line_instance_condition, call_id_condition
+                                            ))) {
+                                    skinny_execute_sql(listener-&gt;profile, sql, listener-&gt;profile-&gt;sql_mutex);
+                                    switch_safe_free(sql);
+                                    send_call_state(listener, call_state, line_instance, call_id);
+                            }
+                            switch_safe_free(line_instance_condition);
+                            switch_safe_free(call_id_condition);
+                        }
+                }
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1627,20 +1628,20 @@
</span><span class="cx"> SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load)
</span><span class="cx"> {
</span><span class="cx">         switch_hash_index_t *hi;
</span><del>-    /* globals init */
</del><ins>+        /* globals init */
</ins><span class="cx">         memset(&amp;globals, 0, sizeof(globals));
</span><span class="cx"> 
</span><del>-    if (switch_core_new_memory_pool(&amp;globals.pool) != SWITCH_STATUS_SUCCESS) {
-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;OH OH no pool\n&quot;);
-        return SWITCH_STATUS_TERM;
-    }
</del><ins>+        if (switch_core_new_memory_pool(&amp;globals.pool) != SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;OH OH no pool\n&quot;);
+                return SWITCH_STATUS_TERM;
+        }
</ins><span class="cx">         switch_mutex_init(&amp;globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
</span><span class="cx">         switch_core_hash_init(&amp;globals.profile_hash, globals.pool);
</span><span class="cx">         globals.running = 1;
</span><del>-        
</del><ins>+
</ins><span class="cx">         load_skinny_config();
</span><span class="cx"> 
</span><del>-    /* bind to events */
</del><ins>+        /* bind to events */
</ins><span class="cx">         if ((switch_event_bind_removable(modname, SWITCH_EVENT_HEARTBEAT, NULL, event_handler, NULL, &amp;globals.heartbeat_node) != SWITCH_STATUS_SUCCESS)) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Couldn't bind our heartbeat handler!\n&quot;);
</span><span class="cx">                 /* Not such severe to prevent loading */
</span><span class="lines">@@ -1650,7 +1651,7 @@
</span><span class="cx">                 return SWITCH_STATUS_TERM;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-    /* reserve events */
</del><ins>+        /* reserve events */
</ins><span class="cx">         if (switch_event_reserve_subclass(SKINNY_EVENT_REGISTER) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Couldn't register subclass %s!\n&quot;, SKINNY_EVENT_REGISTER);
</span><span class="cx">                 return SWITCH_STATUS_TERM;
</span><span class="lines">@@ -1679,23 +1680,23 @@
</span><span class="cx">         skinny_endpoint_interface-&gt;io_routines = &amp;skinny_io_routines;
</span><span class="cx">         skinny_endpoint_interface-&gt;state_handler = &amp;skinny_state_handlers;
</span><span class="cx"> 
</span><del>-    skinny_api_register(module_interface);
</del><ins>+        skinny_api_register(module_interface);
</ins><span class="cx"> 
</span><span class="cx">         /* launch listeners */
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">         for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
</span><del>-            void *val;
-            skinny_profile_t *profile;
-            switch_thread_t *thread;
-            switch_threadattr_t *thd_attr = NULL;
</del><ins>+                void *val;
+                skinny_profile_t *profile;
+                switch_thread_t *thread;
+                switch_threadattr_t *thd_attr = NULL;
</ins><span class="cx"> 
</span><span class="cx">                 switch_hash_this(hi, NULL, NULL, &amp;val);
</span><span class="cx">                 profile = (skinny_profile_t *) val;
</span><del>-        
-            switch_threadattr_create(&amp;thd_attr, profile-&gt;pool);
-            switch_threadattr_detach_set(thd_attr, 1);
-            switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
-            switch_thread_create(&amp;thread, thd_attr, skinny_profile_run, profile, profile-&gt;pool);
</del><ins>+
+                switch_threadattr_create(&amp;thd_attr, profile-&gt;pool);
+                switch_threadattr_detach_set(thd_attr, 1);
+                switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
+                switch_thread_create(&amp;thread, thd_attr, skinny_profile_run, profile, profile-&gt;pool);
</ins><span class="cx">         }
</span><span class="cx">         switch_mutex_unlock(globals.mutex);
</span><span class="cx"> 
</span><span class="lines">@@ -1711,7 +1712,7 @@
</span><span class="cx">         switch_mutex_t *mutex = globals.mutex;
</span><span class="cx">         int sanity = 0;
</span><span class="cx"> 
</span><del>-    /* release events */
</del><ins>+        /* release events */
</ins><span class="cx">         switch_event_unbind(&amp;globals.heartbeat_node);
</span><span class="cx">         switch_event_unbind(&amp;globals.call_state_node);
</span><span class="cx">         switch_event_free_subclass(SKINNY_EVENT_REGISTER);
</span><span class="lines">@@ -1730,7 +1731,7 @@
</span><span class="cx">         /* close sockets */
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">         for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
</span><del>-            skinny_profile_t *profile;
</del><ins>+                skinny_profile_t *profile;
</ins><span class="cx">                 switch_hash_this(hi, NULL, NULL, &amp;val);
</span><span class="cx">                 profile = (skinny_profile_t *) val;
</span><span class="cx"> 
</span><span class="lines">@@ -1743,7 +1744,7 @@
</span><span class="cx">                                 break;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-            switch_core_destroy_memory_pool(&amp;profile-&gt;pool);
</del><ins>+                switch_core_destroy_memory_pool(&amp;profile-&gt;pool);
</ins><span class="cx">         }
</span><span class="cx">         switch_mutex_unlock(globals.mutex);
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skinnymod_skinnyh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.h (17173 => 17174)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.h        2010-04-01 20:16:45 UTC (rev 17173)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/mod_skinny.h        2010-04-01 20:16:49 UTC (rev 17174)
</span><span class="lines">@@ -45,51 +45,51 @@
</span><span class="cx"> #define SKINNY_EVENT_CALL_STATE &quot;skinny::call_state&quot;
</span><span class="cx"> 
</span><span class="cx"> struct skinny_globals {
</span><del>-        int running;
-        switch_memory_pool_t *pool;
-        switch_mutex_t *mutex;
-        switch_hash_t *profile_hash;
-        switch_event_node_t *heartbeat_node;
-        switch_event_node_t *call_state_node;
</del><ins>+    int running;
+    switch_memory_pool_t *pool;
+    switch_mutex_t *mutex;
+    switch_hash_t *profile_hash;
+    switch_event_node_t *heartbeat_node;
+    switch_event_node_t *call_state_node;
</ins><span class="cx"> };
</span><span class="cx"> typedef struct skinny_globals skinny_globals_t;
</span><span class="cx"> 
</span><span class="cx"> skinny_globals_t globals;
</span><span class="cx"> 
</span><span class="cx"> struct skinny_profile {
</span><del>-        /* prefs */
-        char *name;
-        char *domain;
-        char *ip;
-        unsigned int port;
-        char *dialplan;
-        char *context;
-        uint32_t keep_alive;
-        char date_format[6];
-        int debug;
-        /* db */
-        char *dbname;
-        char *odbc_dsn;
-        char *odbc_user;
-        char *odbc_pass;
-        switch_odbc_handle_t *master_odbc;
-        switch_mutex_t *sql_mutex;        
-        /* stats */
-        uint32_t ib_calls;
-        uint32_t ob_calls;
-        uint32_t ib_failed_calls;
-        uint32_t ob_failed_calls;        
-        /* listener */
-        int listener_threads;
-        switch_mutex_t *listener_mutex;        
-        switch_socket_t *sock;
-        switch_mutex_t *sock_mutex;
-        struct listener *listeners;
-        uint8_t listener_ready;
-        /* call id */
-        uint32_t next_call_id;
-        /* others */
-        switch_memory_pool_t *pool;
</del><ins>+    /* prefs */
+    char *name;
+    char *domain;
+    char *ip;
+    unsigned int port;
+    char *dialplan;
+    char *context;
+    uint32_t keep_alive;
+    char date_format[6];
+    int debug;
+    /* db */
+    char *dbname;
+    char *odbc_dsn;
+    char *odbc_user;
+    char *odbc_pass;
+    switch_odbc_handle_t *master_odbc;
+    switch_mutex_t *sql_mutex;        
+    /* stats */
+    uint32_t ib_calls;
+    uint32_t ob_calls;
+    uint32_t ib_failed_calls;
+    uint32_t ob_failed_calls;        
+    /* listener */
+    int listener_threads;
+    switch_mutex_t *listener_mutex;        
+    switch_socket_t *sock;
+    switch_mutex_t *sock_mutex;
+    struct listener *listeners;
+    uint8_t listener_ready;
+    /* call id */
+    uint32_t next_call_id;
+    /* others */
+    switch_memory_pool_t *pool;
</ins><span class="cx"> };
</span><span class="cx"> typedef struct skinny_profile skinny_profile_t;
</span><span class="cx"> 
</span><span class="lines">@@ -99,26 +99,26 @@
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> 
</span><span class="cx"> typedef enum {
</span><del>-        LFLAG_RUNNING = (1 &lt;&lt; 0),
</del><ins>+    LFLAG_RUNNING = (1 &lt;&lt; 0),
</ins><span class="cx"> } event_flag_t;
</span><span class="cx"> 
</span><span class="cx"> #define SKINNY_MAX_LINES 42
</span><span class="cx"> struct listener {
</span><del>-        skinny_profile_t *profile;
-        char device_name[16];
-        uint32_t device_instance;
</del><ins>+    skinny_profile_t *profile;
+    char device_name[16];
+    uint32_t device_instance;
</ins><span class="cx"> 
</span><del>-        switch_socket_t *sock;
-        switch_memory_pool_t *pool;
-        switch_thread_rwlock_t *rwlock;
-        switch_sockaddr_t *sa;
-        char remote_ip[50];
-        switch_mutex_t *flag_mutex;
-        uint32_t flags;
-        switch_port_t remote_port;
-        uint32_t id;
-        time_t expire_time;
-        struct listener *next;
</del><ins>+    switch_socket_t *sock;
+    switch_memory_pool_t *pool;
+    switch_thread_rwlock_t *rwlock;
+    switch_sockaddr_t *sa;
+    char remote_ip[50];
+    switch_mutex_t *flag_mutex;
+    uint32_t flags;
+    switch_port_t remote_port;
+    uint32_t id;
+    time_t expire_time;
+    struct listener *next;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> typedef struct listener listener_t;
</span><span class="lines">@@ -129,54 +129,54 @@
</span><span class="cx"> /* CHANNEL TYPES */
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> typedef enum {
</span><del>-        TFLAG_IO = (1 &lt;&lt; 0),
-        TFLAG_INBOUND = (1 &lt;&lt; 1),
-        TFLAG_OUTBOUND = (1 &lt;&lt; 2),
-        TFLAG_DTMF = (1 &lt;&lt; 3),
-        TFLAG_VOICE = (1 &lt;&lt; 4),
-        TFLAG_HANGUP = (1 &lt;&lt; 5),
-        TFLAG_LINEAR = (1 &lt;&lt; 6),
-        TFLAG_CODEC = (1 &lt;&lt; 7),
-        
-        TFLAG_READING = (1 &lt;&lt; 9),
-        TFLAG_WRITING = (1 &lt;&lt; 10)
</del><ins>+    TFLAG_IO = (1 &lt;&lt; 0),
+    TFLAG_INBOUND = (1 &lt;&lt; 1),
+    TFLAG_OUTBOUND = (1 &lt;&lt; 2),
+    TFLAG_DTMF = (1 &lt;&lt; 3),
+    TFLAG_VOICE = (1 &lt;&lt; 4),
+    TFLAG_HANGUP = (1 &lt;&lt; 5),
+    TFLAG_LINEAR = (1 &lt;&lt; 6),
+    TFLAG_CODEC = (1 &lt;&lt; 7),
+
+    TFLAG_READING = (1 &lt;&lt; 9),
+    TFLAG_WRITING = (1 &lt;&lt; 10)
</ins><span class="cx"> } TFLAGS;
</span><span class="cx"> 
</span><span class="cx"> typedef enum {
</span><del>-        GFLAG_MY_CODEC_PREFS = (1 &lt;&lt; 0)
</del><ins>+    GFLAG_MY_CODEC_PREFS = (1 &lt;&lt; 0)
</ins><span class="cx"> } GFLAGS;
</span><span class="cx"> 
</span><span class="cx"> struct private_object {
</span><del>-        unsigned int flags;
-        switch_frame_t read_frame;
-        unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
-        switch_core_session_t *session;
-        switch_caller_profile_t *caller_profile;
-        switch_mutex_t *mutex;
-        switch_mutex_t *flag_mutex;
-        /* identification */
-        uint32_t call_id;
-        uint32_t party_id;
</del><ins>+    unsigned int flags;
+    switch_frame_t read_frame;
+    unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
+    switch_core_session_t *session;
+    switch_caller_profile_t *caller_profile;
+    switch_mutex_t *mutex;
+    switch_mutex_t *flag_mutex;
+    /* identification */
+    uint32_t call_id;
+    uint32_t party_id;
</ins><span class="cx"> 
</span><del>-        skinny_profile_t *profile;
</del><ins>+    skinny_profile_t *profile;
</ins><span class="cx"> 
</span><del>-        /* codec */
-        char *iananame;        
-        switch_codec_t read_codec;
-        switch_codec_t write_codec;
-        switch_codec_implementation_t read_impl;
-        switch_codec_implementation_t write_impl;
-        unsigned long rm_rate;
-        uint32_t codec_ms;
-        char *rm_encoding;
-        char *rm_fmtp;
-        switch_payload_t agreed_pt;
-        /* RTP */
-        switch_rtp_t *rtp_session;
-        char *local_sdp_audio_ip;
-        switch_port_t local_sdp_audio_port;
-        char *remote_sdp_audio_ip;
-        switch_port_t remote_sdp_audio_port;
</del><ins>+    /* codec */
+    char *iananame;        
+    switch_codec_t read_codec;
+    switch_codec_t write_codec;
+    switch_codec_implementation_t read_impl;
+    switch_codec_implementation_t write_impl;
+    unsigned long rm_rate;
+    uint32_t codec_ms;
+    char *rm_encoding;
+    char *rm_fmtp;
+    switch_payload_t agreed_pt;
+    /* RTP */
+    switch_rtp_t *rtp_session;
+    char *local_sdp_audio_ip;
+    switch_port_t local_sdp_audio_port;
+    char *remote_sdp_audio_ip;
+    switch_port_t remote_sdp_audio_port;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> typedef struct private_object private_t;
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> void skinny_execute_sql(skinny_profile_t *profile, char *sql, switch_mutex_t *mutex);
</span><span class="cx"> switch_bool_t skinny_execute_sql_callback(skinny_profile_t *profile,
</span><del>-                                                                                          switch_mutex_t *mutex, char *sql, switch_core_db_callback_func_t callback, void *pdata);
</del><ins>+                                                                                      switch_mutex_t *mutex, char *sql, switch_core_db_callback_func_t callback, void *pdata);
</ins><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> /* LISTENER FUNCTIONS */
</span><span class="lines">@@ -222,8 +222,8 @@
</span><span class="cx"> switch_status_t channel_on_exchange_media(switch_core_session_t *session);
</span><span class="cx"> switch_status_t channel_on_soft_execute(switch_core_session_t *session);
</span><span class="cx"> switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><del>-                                                                                                        switch_caller_profile_t *outbound_profile,
-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</del><ins>+                                                                                                    switch_caller_profile_t *outbound_profile,
+                                                                                                    switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
</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 (17173 => 17174)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c        2010-04-01 20:16:45 UTC (rev 17173)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c        2010-04-01 20:16:49 UTC (rev 17174)
</span><span class="lines">@@ -37,26 +37,26 @@
</span><span class="cx"> skinny_globals_t globals;
</span><span class="cx"> 
</span><span class="cx"> struct soft_key_template_definition soft_key_template_default[] = {
</span><del>-        { &quot;\200\001&quot;, SOFTKEY_REDIAL },
-        { &quot;\200\002&quot;, SOFTKEY_NEWCALL },
-        { &quot;\200\003&quot;, SOFTKEY_HOLD },
-        { &quot;\200\004&quot;, SOFTKEY_TRANSFER },
-        { &quot;\200\005&quot;, SOFTKEY_CFWDALL },
-        { &quot;\200\006&quot;, SOFTKEY_CFWDBUSY },
-        { &quot;\200\007&quot;, SOFTKEY_CFWDNOANSWER },
-        { &quot;\200\010&quot;, SOFTKEY_BACKSPACE },
-        { &quot;\200\011&quot;, SOFTKEY_ENDCALL },
-        { &quot;\200\012&quot;, SOFTKEY_RESUME },
-        { &quot;\200\013&quot;, SOFTKEY_ANSWER },
-        { &quot;\200\014&quot;, SOFTKEY_INFO },
-        { &quot;\200\015&quot;, SOFTKEY_CONFRM },
-        { &quot;\200\016&quot;, SOFTKEY_PARK },
-        { &quot;\200\017&quot;, SOFTKEY_JOIN },
-        { &quot;\200\020&quot;, SOFTKEY_MEETMECONFRM },
-        { &quot;\200\021&quot;, SOFTKEY_CALLPICKUP },
-        { &quot;\200\022&quot;, SOFTKEY_GRPCALLPICKUP },
-        { &quot;\200\077&quot;, SOFTKEY_DND },
-        { &quot;\200\120&quot;, SOFTKEY_IDIVERT },
</del><ins>+    { &quot;\200\001&quot;, SOFTKEY_REDIAL },
+    { &quot;\200\002&quot;, SOFTKEY_NEWCALL },
+    { &quot;\200\003&quot;, SOFTKEY_HOLD },
+    { &quot;\200\004&quot;, SOFTKEY_TRANSFER },
+    { &quot;\200\005&quot;, SOFTKEY_CFWDALL },
+    { &quot;\200\006&quot;, SOFTKEY_CFWDBUSY },
+    { &quot;\200\007&quot;, SOFTKEY_CFWDNOANSWER },
+    { &quot;\200\010&quot;, SOFTKEY_BACKSPACE },
+    { &quot;\200\011&quot;, SOFTKEY_ENDCALL },
+    { &quot;\200\012&quot;, SOFTKEY_RESUME },
+    { &quot;\200\013&quot;, SOFTKEY_ANSWER },
+    { &quot;\200\014&quot;, SOFTKEY_INFO },
+    { &quot;\200\015&quot;, SOFTKEY_CONFRM },
+    { &quot;\200\016&quot;, SOFTKEY_PARK },
+    { &quot;\200\017&quot;, SOFTKEY_JOIN },
+    { &quot;\200\020&quot;, SOFTKEY_MEETMECONFRM },
+    { &quot;\200\021&quot;, SOFTKEY_CALLPICKUP },
+    { &quot;\200\022&quot;, SOFTKEY_GRPCALLPICKUP },
+    { &quot;\200\077&quot;, SOFTKEY_DND },
+    { &quot;\200\120&quot;, SOFTKEY_IDIVERT },
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="lines">@@ -64,391 +64,391 @@
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> char* skinny_codec2string(enum skinny_codecs skinnycodec)
</span><span class="cx"> {
</span><del>-        switch (skinnycodec) {
-                case SKINNY_CODEC_ALAW_64K:
-                case SKINNY_CODEC_ALAW_56K:
-                        return &quot;ALAW&quot;;
-                case SKINNY_CODEC_ULAW_64K:
-                case SKINNY_CODEC_ULAW_56K:
-                        return &quot;ULAW&quot;;
-                case SKINNY_CODEC_G722_64K:
-                case SKINNY_CODEC_G722_56K:
-                case SKINNY_CODEC_G722_48K:
-                        return &quot;G722&quot;;
-                case SKINNY_CODEC_G723_1:
-                        return &quot;G723&quot;;
-                case SKINNY_CODEC_G728:
-                        return &quot;G728&quot;;
-                case SKINNY_CODEC_G729:
-                case SKINNY_CODEC_G729A:
-                        return &quot;G729&quot;;
-                case SKINNY_CODEC_IS11172:
-                        return &quot;IS11172&quot;;
-                case SKINNY_CODEC_IS13818:
-                        return &quot;IS13818&quot;;
-                case SKINNY_CODEC_G729B:
-                case SKINNY_CODEC_G729AB:
-                        return &quot;G729&quot;;
-                case SKINNY_CODEC_GSM_FULL:
-                case SKINNY_CODEC_GSM_HALF:
-                case SKINNY_CODEC_GSM_EFULL:
-                        return &quot;GSM&quot;;
-                case SKINNY_CODEC_WIDEBAND_256K:
-                        return &quot;WIDEBAND&quot;;
-                case SKINNY_CODEC_DATA_64K:
-                case SKINNY_CODEC_DATA_56K:
-                        return &quot;DATA&quot;;
-                case SKINNY_CODEC_GSM:
-                        return &quot;GSM&quot;;
-                case SKINNY_CODEC_ACTIVEVOICE:
-                        return &quot;ACTIVEVOICE&quot;;
-                case SKINNY_CODEC_G726_32K:
-                case SKINNY_CODEC_G726_24K:
-                case SKINNY_CODEC_G726_16K:
-                        return &quot;G726&quot;;
-                case SKINNY_CODEC_G729B_BIS:
-                case SKINNY_CODEC_G729B_LOW:
-                        return &quot;G729&quot;;
-                case SKINNY_CODEC_H261:
-                        return &quot;H261&quot;;
-                case SKINNY_CODEC_H263:
-                        return &quot;H263&quot;;
-                case SKINNY_CODEC_VIDEO:
-                        return &quot;VIDEO&quot;;
-                case SKINNY_CODEC_T120:
-                        return &quot;T120&quot;;
-                case SKINNY_CODEC_H224:
-                        return &quot;H224&quot;;
-                case SKINNY_CODEC_RFC2833_DYNPAYLOAD:
-                        return &quot;RFC2833_DYNPAYLOAD&quot;;
-                default:
-                        return &quot;&quot;;
-        }
</del><ins>+    switch (skinnycodec) {
+            case SKINNY_CODEC_ALAW_64K:
+            case SKINNY_CODEC_ALAW_56K:
+                    return &quot;ALAW&quot;;
+            case SKINNY_CODEC_ULAW_64K:
+            case SKINNY_CODEC_ULAW_56K:
+                    return &quot;ULAW&quot;;
+            case SKINNY_CODEC_G722_64K:
+            case SKINNY_CODEC_G722_56K:
+            case SKINNY_CODEC_G722_48K:
+                    return &quot;G722&quot;;
+            case SKINNY_CODEC_G723_1:
+                    return &quot;G723&quot;;
+            case SKINNY_CODEC_G728:
+                    return &quot;G728&quot;;
+            case SKINNY_CODEC_G729:
+            case SKINNY_CODEC_G729A:
+                    return &quot;G729&quot;;
+            case SKINNY_CODEC_IS11172:
+                    return &quot;IS11172&quot;;
+            case SKINNY_CODEC_IS13818:
+                    return &quot;IS13818&quot;;
+            case SKINNY_CODEC_G729B:
+            case SKINNY_CODEC_G729AB:
+                    return &quot;G729&quot;;
+            case SKINNY_CODEC_GSM_FULL:
+            case SKINNY_CODEC_GSM_HALF:
+            case SKINNY_CODEC_GSM_EFULL:
+                    return &quot;GSM&quot;;
+            case SKINNY_CODEC_WIDEBAND_256K:
+                    return &quot;WIDEBAND&quot;;
+            case SKINNY_CODEC_DATA_64K:
+            case SKINNY_CODEC_DATA_56K:
+                    return &quot;DATA&quot;;
+            case SKINNY_CODEC_GSM:
+                    return &quot;GSM&quot;;
+            case SKINNY_CODEC_ACTIVEVOICE:
+                    return &quot;ACTIVEVOICE&quot;;
+            case SKINNY_CODEC_G726_32K:
+            case SKINNY_CODEC_G726_24K:
+            case SKINNY_CODEC_G726_16K:
+                    return &quot;G726&quot;;
+            case SKINNY_CODEC_G729B_BIS:
+            case SKINNY_CODEC_G729B_LOW:
+                    return &quot;G729&quot;;
+            case SKINNY_CODEC_H261:
+                    return &quot;H261&quot;;
+            case SKINNY_CODEC_H263:
+                    return &quot;H263&quot;;
+            case SKINNY_CODEC_VIDEO:
+                    return &quot;VIDEO&quot;;
+            case SKINNY_CODEC_T120:
+                    return &quot;T120&quot;;
+            case SKINNY_CODEC_H224:
+                    return &quot;H224&quot;;
+            case SKINNY_CODEC_RFC2833_DYNPAYLOAD:
+                    return &quot;RFC2833_DYNPAYLOAD&quot;;
+            default:
+                    return &quot;&quot;;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> switch_status_t skinny_read_packet(listener_t *listener, skinny_message_t **req)
</span><span class="cx"> {
</span><del>-        skinny_message_t *request;
-        switch_size_t mlen, bytes = 0;
-        char mbuf[SKINNY_MESSAGE_MAXSIZE] = &quot;&quot;;
-        char *ptr;
-        switch_status_t status = SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *request;
+    switch_size_t mlen, bytes = 0;
+    char mbuf[SKINNY_MESSAGE_MAXSIZE] = &quot;&quot;;
+    char *ptr;
+    switch_status_t status = SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> 
</span><del>-        request = switch_core_alloc(listener-&gt;pool, SKINNY_MESSAGE_MAXSIZE);
</del><ins>+    request = switch_core_alloc(listener-&gt;pool, SKINNY_MESSAGE_MAXSIZE);
</ins><span class="cx"> 
</span><del>-        if (!request) {
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Unable to allocate memory.\n&quot;);
-                return SWITCH_STATUS_MEMERR;
-        }
-        
-        if (!listener_is_ready(listener)) {
-                return SWITCH_STATUS_FALSE;
-        }
</del><ins>+    if (!request) {
+            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Unable to allocate memory.\n&quot;);
+            return SWITCH_STATUS_MEMERR;
+    }
</ins><span class="cx"> 
</span><del>-        ptr = mbuf;
</del><ins>+    if (!listener_is_ready(listener)) {
+            return SWITCH_STATUS_FALSE;
+    }
</ins><span class="cx"> 
</span><del>-        while (listener-&gt;sock &amp;&amp; listener_is_ready(listener)) {
-                uint8_t do_sleep = 1;
-                if(bytes &lt; SKINNY_MESSAGE_FIELD_SIZE) {
-                        /* We have nothing yet, get length header field */
-                        mlen = SKINNY_MESSAGE_FIELD_SIZE - bytes;
-                } else {
-                        /* We now know the message size */
-                        mlen = request-&gt;length + 2*SKINNY_MESSAGE_FIELD_SIZE - bytes;
-                }
</del><ins>+    ptr = mbuf;
</ins><span class="cx"> 
</span><del>-                status = switch_socket_recv(listener-&gt;sock, ptr, &amp;mlen);
</del><ins>+    while (listener_is_ready(listener)) {
+            uint8_t do_sleep = 1;
+            if(bytes &lt; SKINNY_MESSAGE_FIELD_SIZE) {
+                    /* We have nothing yet, get length header field */
+                    mlen = SKINNY_MESSAGE_FIELD_SIZE - bytes;
+            } else {
+                    /* We now know the message size */
+                    mlen = request-&gt;length + 2*SKINNY_MESSAGE_FIELD_SIZE - bytes;
+            }
+
+            status = switch_socket_recv(listener-&gt;sock, ptr, &amp;mlen);
+        
+            if (!listener_is_ready(listener) || (!SWITCH_STATUS_IS_BREAK(status) &amp;&amp; status != SWITCH_STATUS_SUCCESS)) {
+                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, &quot;Socket break.\n&quot;);
+                    return SWITCH_STATUS_FALSE;
+            }
+        
+            if(mlen) {
+                    bytes += mlen;
</ins><span class="cx">                 
</span><del>-                if (!listener_is_ready(listener) || (!SWITCH_STATUS_IS_BREAK(status) &amp;&amp; status != SWITCH_STATUS_SUCCESS)) {
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, &quot;Socket break.\n&quot;);
-                        return SWITCH_STATUS_FALSE;
-                }
-                
-                if(mlen) {
-                        bytes += mlen;
-                        
-                        if(bytes &gt;= SKINNY_MESSAGE_FIELD_SIZE) {
-                                do_sleep = 0;
-                                ptr += mlen;
-                                memcpy(request, mbuf, bytes);
</del><ins>+                    if(bytes &gt;= SKINNY_MESSAGE_FIELD_SIZE) {
+                            do_sleep = 0;
+                            ptr += mlen;
+                            memcpy(request, mbuf, bytes);
</ins><span class="cx"> #ifdef SKINNY_MEGA_DEBUG
</span><del>-                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
-                                        &quot;Got request: length=%d,reserved=%x,type=%x\n&quot;,
-                                        request-&gt;length,request-&gt;reserved,request-&gt;type);
</del><ins>+                            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+                                    &quot;Got request: length=%d,reserved=%x,type=%x\n&quot;,
+                                    request-&gt;length,request-&gt;reserved,request-&gt;type);
</ins><span class="cx"> #endif
</span><del>-                                if(request-&gt;length &lt; SKINNY_MESSAGE_FIELD_SIZE) {
-                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                                                &quot;Skinny client sent invalid data. Length should be greater than 4 but got %d.\n&quot;,
-                                                request-&gt;length);
-                                        return SWITCH_STATUS_FALSE;
-                                }
-                                if(request-&gt;length + 2*SKINNY_MESSAGE_FIELD_SIZE &gt; SKINNY_MESSAGE_MAXSIZE) {
-                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                                                &quot;Skinny client sent too huge data. Got %d which is above threshold %d.\n&quot;,
-                                                request-&gt;length, SKINNY_MESSAGE_MAXSIZE - 2*SKINNY_MESSAGE_FIELD_SIZE);
-                                        return SWITCH_STATUS_FALSE;
-                                }
-                                if(bytes &gt;= request-&gt;length + 2*SKINNY_MESSAGE_FIELD_SIZE) {
-                                        /* Message body */
</del><ins>+                            if(request-&gt;length &lt; SKINNY_MESSAGE_FIELD_SIZE) {
+                                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+                                            &quot;Skinny client sent invalid data. Length should be greater than 4 but got %d.\n&quot;,
+                                            request-&gt;length);
+                                    return SWITCH_STATUS_FALSE;
+                            }
+                            if(request-&gt;length + 2*SKINNY_MESSAGE_FIELD_SIZE &gt; SKINNY_MESSAGE_MAXSIZE) {
+                                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+                                            &quot;Skinny client sent too huge data. Got %d which is above threshold %d.\n&quot;,
+                                            request-&gt;length, SKINNY_MESSAGE_MAXSIZE - 2*SKINNY_MESSAGE_FIELD_SIZE);
+                                    return SWITCH_STATUS_FALSE;
+                            }
+                            if(bytes &gt;= request-&gt;length + 2*SKINNY_MESSAGE_FIELD_SIZE) {
+                                    /* Message body */
</ins><span class="cx"> #ifdef SKINNY_MEGA_DEBUG
</span><del>-                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
-                                                &quot;Got complete request: length=%d,reserved=%x,type=%x,data=%d\n&quot;,
-                                                request-&gt;length,request-&gt;reserved,request-&gt;type,request-&gt;data.as_char);
</del><ins>+                                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+                                            &quot;Got complete request: length=%d,reserved=%x,type=%x,data=%d\n&quot;,
+                                            request-&gt;length,request-&gt;reserved,request-&gt;type,request-&gt;data.as_char);
</ins><span class="cx"> #endif
</span><del>-                                        *req = request;
-                                        return  SWITCH_STATUS_SUCCESS;
-                                }
-                        }
-                }
-                if (listener-&gt;expire_time &amp;&amp; listener-&gt;expire_time &lt; switch_epoch_time_now(NULL)) {
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, &quot;Listener timed out.\n&quot;);
-                        switch_clear_flag_locked(listener, LFLAG_RUNNING);
-                        return SWITCH_STATUS_FALSE;
-                }
-                if (do_sleep) {
-                        switch_cond_next();
-                }
-        }
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+                                    *req = request;
+                                    return  SWITCH_STATUS_SUCCESS;
+                            }
+                    }
+            }
+            if (listener-&gt;expire_time &amp;&amp; listener-&gt;expire_time &lt; switch_epoch_time_now(NULL)) {
+                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, &quot;Listener timed out.\n&quot;);
+                    switch_clear_flag_locked(listener, LFLAG_RUNNING);
+                    return SWITCH_STATUS_FALSE;
+            }
+            if (do_sleep) {
+                    switch_cond_next();
+            }
+    }
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> int skinny_device_event_callback(void *pArg, int argc, char **argv, char **columnNames)
</span><span class="cx"> {
</span><del>-        switch_event_t *event = (switch_event_t *) pArg;
</del><ins>+    switch_event_t *event = (switch_event_t *) pArg;
</ins><span class="cx"> 
</span><del>-        char *profile_name = argv[0];
-        char *device_name = argv[1];
-        char *user_id = argv[2];
-        char *device_instance = argv[3];
-        char *ip = argv[4];
-        char *device_type = argv[5];
-        char *max_streams = argv[6];
-        char *port = argv[7];
-        char *codec_string = argv[8];
</del><ins>+    char *profile_name = argv[0];
+    char *device_name = argv[1];
+    char *user_id = argv[2];
+    char *device_instance = argv[3];
+    char *ip = argv[4];
+    char *device_type = argv[5];
+    char *max_streams = argv[6];
+    char *port = argv[7];
+    char *codec_string = argv[8];
</ins><span class="cx"> 
</span><del>-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Profile-Name&quot;, &quot;%s&quot;, profile_name);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Device-Name&quot;, &quot;%s&quot;, device_name);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Station-User-Id&quot;, &quot;%s&quot;, user_id);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Station-Instance&quot;, &quot;%s&quot;, device_instance);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-IP-Address&quot;, &quot;%s&quot;, ip);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Device-Type&quot;, &quot;%s&quot;, device_type);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Max-Streams&quot;, &quot;%s&quot;, max_streams);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Port&quot;, &quot;%s&quot;, port);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Codecs&quot;, &quot;%s&quot;, codec_string);
</del><ins>+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Profile-Name&quot;, &quot;%s&quot;, profile_name);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Device-Name&quot;, &quot;%s&quot;, device_name);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Station-User-Id&quot;, &quot;%s&quot;, user_id);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Station-Instance&quot;, &quot;%s&quot;, device_instance);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-IP-Address&quot;, &quot;%s&quot;, ip);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Device-Type&quot;, &quot;%s&quot;, device_type);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Max-Streams&quot;, &quot;%s&quot;, max_streams);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Port&quot;, &quot;%s&quot;, port);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Codecs&quot;, &quot;%s&quot;, codec_string);
</ins><span class="cx"> 
</span><del>-        return 0;
</del><ins>+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_device_event(listener_t *listener, switch_event_t **ev, switch_event_types_t event_id, const char *subclass_name)
</span><span class="cx"> {
</span><del>-        switch_event_t *event = NULL;
-        char *sql;
-        skinny_profile_t *profile;
-        assert(listener-&gt;profile);
-        profile = listener-&gt;profile;
</del><ins>+    switch_event_t *event = NULL;
+    char *sql;
+    skinny_profile_t *profile;
+    assert(listener-&gt;profile);
+    profile = listener-&gt;profile;
</ins><span class="cx"> 
</span><del>-        switch_event_create_subclass(&amp;event, event_id, subclass_name);
-        switch_assert(event);
-        if ((sql = switch_mprintf(&quot;SELECT '%s', name, user_id, instance, ip, type, max_streams, port, codec_string &quot;
-                &quot;FROM skinny_devices &quot;
-                        &quot;WHERE name='%s' AND instance=%d&quot;,
-                        listener-&gt;profile-&gt;name,
-                        listener-&gt;device_name, listener-&gt;device_instance))) {
-                skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, skinny_device_event_callback, event);
-                switch_safe_free(sql);
-        }
</del><ins>+    switch_event_create_subclass(&amp;event, event_id, subclass_name);
+    switch_assert(event);
+    if ((sql = switch_mprintf(&quot;SELECT '%s', name, user_id, instance, ip, type, max_streams, port, codec_string &quot;
+            &quot;FROM skinny_devices &quot;
+                    &quot;WHERE name='%s' AND instance=%d&quot;,
+                    listener-&gt;profile-&gt;name,
+                    listener-&gt;device_name, listener-&gt;device_instance))) {
+            skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, skinny_device_event_callback, event);
+            switch_safe_free(sql);
+    }
</ins><span class="cx"> 
</span><del>-        *ev = event;
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    *ev = event;
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> switch_status_t skinny_send_call_info(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
</span><span class="cx"> {
</span><del>-        private_t *tech_pvt;
-        switch_channel_t *channel;
-        
-        char calling_party_name[40] = &quot;UNKNOWN&quot;;
-        char calling_party[24] = &quot;0000000000&quot;;
-        char called_party_name[40] = &quot;UNKNOWN&quot;;
-        char called_party[24] = &quot;0000000000&quot;;
-        
-        channel = switch_core_session_get_channel(session);
-        tech_pvt = switch_core_session_get_private(session);
</del><ins>+    private_t *tech_pvt;
+    switch_channel_t *channel;
</ins><span class="cx"> 
</span><del>-        switch_assert(tech_pvt-&gt;caller_profile != NULL);
-        
-        if(        switch_channel_test_flag(channel, CF_OUTBOUND) ) {
-            struct line_stat_res_message *button = NULL;
</del><ins>+    char calling_party_name[40] = &quot;UNKNOWN&quot;;
+    char calling_party[24] = &quot;0000000000&quot;;
+    char called_party_name[40] = &quot;UNKNOWN&quot;;
+    char called_party[24] = &quot;0000000000&quot;;
</ins><span class="cx"> 
</span><del>-            skinny_line_get(listener, line_instance, &amp;button);
</del><ins>+    channel = switch_core_session_get_channel(session);
+    tech_pvt = switch_core_session_get_private(session);
</ins><span class="cx"> 
</span><del>-            if (button) {
-                    strncpy(calling_party_name, button-&gt;displayname, 40);
-                    strncpy(calling_party, button-&gt;name, 24);
-            }        
-                strncpy(called_party_name, tech_pvt-&gt;caller_profile-&gt;caller_id_name, 40);
-                strncpy(called_party, tech_pvt-&gt;caller_profile-&gt;caller_id_number, 24);
-        } else {
-                strncpy(calling_party_name, tech_pvt-&gt;caller_profile-&gt;caller_id_name, 40);
-                strncpy(calling_party, tech_pvt-&gt;caller_profile-&gt;caller_id_number, 24);
-                /* TODO called party */
-        }
-        send_call_info(listener,
-                calling_party_name, /* char calling_party_name[40], */
-                calling_party, /* char calling_party[24], */
-                called_party_name, /* char called_party_name[40], */
-                called_party, /* char called_party[24], */
-                line_instance, /* uint32_t line_instance, */
-                tech_pvt-&gt;call_id, /* uint32_t call_id, */
-                SKINNY_OUTBOUND_CALL, /* uint32_t call_type, */
-                &quot;&quot;, /* TODO char original_called_party_name[40], */
-                &quot;&quot;, /* TODO char original_called_party[24], */
-                &quot;&quot;, /* TODO char last_redirecting_party_name[40], */
-                &quot;&quot;, /* TODO char last_redirecting_party[24], */
-                0, /* TODO uint32_t original_called_party_redirect_reason, */
-                0, /* TODO uint32_t last_redirecting_reason, */
-                &quot;&quot;, /* TODO char calling_party_voice_mailbox[24], */
-                &quot;&quot;, /* TODO char called_party_voice_mailbox[24], */
-                &quot;&quot;, /* TODO char original_called_party_voice_mailbox[24], */
-                &quot;&quot;, /* TODO char last_redirecting_voice_mailbox[24], */
-                1, /* uint32_t call_instance, */
-                1, /* uint32_t call_security_status, */
-                0 /* uint32_t party_pi_restriction_bits */
-        );
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    switch_assert(tech_pvt-&gt;caller_profile != NULL);
+
+    if(        switch_channel_test_flag(channel, CF_OUTBOUND) ) {
+        struct line_stat_res_message *button = NULL;
+
+        skinny_line_get(listener, line_instance, &amp;button);
+
+        if (button) {
+                strncpy(calling_party_name, button-&gt;displayname, 40);
+                strncpy(calling_party, button-&gt;name, 24);
+        }        
+            strncpy(called_party_name, tech_pvt-&gt;caller_profile-&gt;caller_id_name, 40);
+            strncpy(called_party, tech_pvt-&gt;caller_profile-&gt;caller_id_number, 24);
+    } else {
+            strncpy(calling_party_name, tech_pvt-&gt;caller_profile-&gt;caller_id_name, 40);
+            strncpy(calling_party, tech_pvt-&gt;caller_profile-&gt;caller_id_number, 24);
+            /* TODO called party */
+    }
+    send_call_info(listener,
+            calling_party_name, /* char calling_party_name[40], */
+            calling_party, /* char calling_party[24], */
+            called_party_name, /* char called_party_name[40], */
+            called_party, /* char called_party[24], */
+            line_instance, /* uint32_t line_instance, */
+            tech_pvt-&gt;call_id, /* uint32_t call_id, */
+            SKINNY_OUTBOUND_CALL, /* uint32_t call_type, */
+            &quot;&quot;, /* TODO char original_called_party_name[40], */
+            &quot;&quot;, /* TODO char original_called_party[24], */
+            &quot;&quot;, /* TODO char last_redirecting_party_name[40], */
+            &quot;&quot;, /* TODO char last_redirecting_party[24], */
+            0, /* TODO uint32_t original_called_party_redirect_reason, */
+            0, /* TODO uint32_t last_redirecting_reason, */
+            &quot;&quot;, /* TODO char calling_party_voice_mailbox[24], */
+            &quot;&quot;, /* TODO char called_party_voice_mailbox[24], */
+            &quot;&quot;, /* TODO char original_called_party_voice_mailbox[24], */
+            &quot;&quot;, /* TODO char last_redirecting_voice_mailbox[24], */
+            1, /* uint32_t call_instance, */
+            1, /* uint32_t call_security_status, */
+            0 /* uint32_t party_pi_restriction_bits */
+    );
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> switch_status_t skinny_session_walk_lines(skinny_profile_t *profile, char *channel_uuid, switch_core_db_callback_func_t callback, void *data)
</span><span class="cx"> {
</span><del>-        char *sql;
-        if ((sql = switch_mprintf(
-                        &quot;SELECT skinny_lines.*, channel_uuid, call_id, call_state &quot;
-                        &quot;FROM skinny_active_lines &quot;
-                        &quot;INNER JOIN skinny_lines &quot;
-                                &quot;ON skinny_active_lines.device_name = skinny_lines.device_name &quot;
-                                &quot;AND skinny_active_lines.device_instance = skinny_lines.device_instance &quot;
-                                &quot;AND skinny_active_lines.line_instance = skinny_lines.line_instance &quot;
-                        &quot;WHERE channel_uuid='%s'&quot;,
-                        channel_uuid))) {
-                skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, callback, data);
-                switch_safe_free(sql);
-        }
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    char *sql;
+    if ((sql = switch_mprintf(
+                    &quot;SELECT skinny_lines.*, channel_uuid, call_id, call_state &quot;
+                    &quot;FROM skinny_active_lines &quot;
+                    &quot;INNER JOIN skinny_lines &quot;
+                            &quot;ON skinny_active_lines.device_name = skinny_lines.device_name &quot;
+                            &quot;AND skinny_active_lines.device_instance = skinny_lines.device_instance &quot;
+                            &quot;AND skinny_active_lines.line_instance = skinny_lines.line_instance &quot;
+                    &quot;WHERE channel_uuid='%s'&quot;,
+                    channel_uuid))) {
+            skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, callback, data);
+            switch_safe_free(sql);
+    }
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_session_walk_lines_by_call_id(skinny_profile_t *profile, uint32_t call_id, switch_core_db_callback_func_t callback, void *data)
</span><span class="cx"> {
</span><del>-        char *sql;
-        if ((sql = switch_mprintf(
-                        &quot;SELECT skinny_lines.*, channel_uuid, call_id, call_state &quot;
-                        &quot;FROM skinny_active_lines &quot;
-                        &quot;INNER JOIN skinny_lines &quot;
-                                &quot;ON skinny_active_lines.device_name = skinny_lines.device_name &quot;
-                                &quot;AND skinny_active_lines.device_instance = skinny_lines.device_instance &quot;
-                                &quot;AND skinny_active_lines.line_instance = skinny_lines.line_instance &quot;
-                        &quot;WHERE call_id='%d'&quot;,
-                        call_id))) {
-                skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, callback, data);
-                switch_safe_free(sql);
-        }
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    char *sql;
+    if ((sql = switch_mprintf(
+                    &quot;SELECT skinny_lines.*, channel_uuid, call_id, call_state &quot;
+                    &quot;FROM skinny_active_lines &quot;
+                    &quot;INNER JOIN skinny_lines &quot;
+                            &quot;ON skinny_active_lines.device_name = skinny_lines.device_name &quot;
+                            &quot;AND skinny_active_lines.device_instance = skinny_lines.device_instance &quot;
+                            &quot;AND skinny_active_lines.line_instance = skinny_lines.line_instance &quot;
+                    &quot;WHERE call_id='%d'&quot;,
+                    call_id))) {
+            skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, callback, data);
+            switch_safe_free(sql);
+    }
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> struct skinny_ring_lines_helper {
</span><del>-        private_t *tech_pvt;
-        uint32_t lines_count;
</del><ins>+    private_t *tech_pvt;
+    uint32_t lines_count;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> int skinny_ring_lines_callback(void *pArg, int argc, char **argv, char **columnNames)
</span><span class="cx"> {
</span><del>-        struct skinny_ring_lines_helper *helper = pArg;
-        char *tmp;
</del><ins>+    struct skinny_ring_lines_helper *helper = pArg;
+    char *tmp;
</ins><span class="cx"> 
</span><del>-        char *device_name = argv[0];
-        uint32_t device_instance = atoi(argv[1]);
-        /* uint32_t position = atoi(argv[2]); */
-        uint32_t line_instance = atoi(argv[3]);
-        /* char *label = argv[4]; */
-        /* char *value = argv[5]; */
-        /* char *caller_name = argv[6]; */
-        /* uint32_t ring_on_idle = atoi(argv[7]); */
-        /* uint32_t ring_on_active = atoi(argv[8]); */
-        /* uint32_t busy_trigger = atoi(argv[9]); */
-        /* char *forward_all = argv[10]; */
-        /* char *forward_busy = argv[11]; */
-        /* char *forward_noanswer = argv[12]; */
-        /* uint32_t noanswer_duration = atoi(argv[13]); */
-        /* char *channel_uuid = argv[14]; */
-        /* uint32_t call_id = atoi(argv[15]); */
-        /* uint32_t call_state = atoi(argv[16]); */
</del><ins>+    char *device_name = argv[0];
+    uint32_t device_instance = atoi(argv[1]);
+    /* uint32_t position = atoi(argv[2]); */
+    uint32_t line_instance = atoi(argv[3]);
+    /* char *label = argv[4]; */
+    /* char *value = argv[5]; */
+    /* char *caller_name = argv[6]; */
+    /* uint32_t ring_on_idle = atoi(argv[7]); */
+    /* uint32_t ring_on_active = atoi(argv[8]); */
+    /* uint32_t busy_trigger = atoi(argv[9]); */
+    /* char *forward_all = argv[10]; */
+    /* char *forward_busy = argv[11]; */
+    /* char *forward_noanswer = argv[12]; */
+    /* uint32_t noanswer_duration = atoi(argv[13]); */
+    /* char *channel_uuid = argv[14]; */
+    /* uint32_t call_id = atoi(argv[15]); */
+    /* uint32_t call_state = atoi(argv[16]); */
</ins><span class="cx"> 
</span><del>-        listener_t *listener = NULL;
</del><ins>+    listener_t *listener = NULL;
</ins><span class="cx"> 
</span><span class="cx">     skinny_profile_find_listener_by_device_name_and_instance(helper-&gt;tech_pvt-&gt;profile, 
</span><del>-            device_name, device_instance, &amp;listener);
-        if(listener) {
-                helper-&gt;lines_count++;
-                skinny_line_set_state(listener, line_instance, helper-&gt;tech_pvt-&gt;call_id, SKINNY_RING_IN);
-                send_select_soft_keys(listener, line_instance, helper-&gt;tech_pvt-&gt;call_id, SKINNY_KEY_SET_RING_IN, 0xffff);
-            if ((tmp = switch_mprintf(&quot;\200\027%s&quot;, helper-&gt;tech_pvt-&gt;caller_profile-&gt;destination_number))) {
-                display_prompt_status(listener, 0, tmp, line_instance, helper-&gt;tech_pvt-&gt;call_id);
-                    switch_safe_free(tmp);
-            }
-            if ((tmp = switch_mprintf(&quot;\005\000\000\000%s&quot;, helper-&gt;tech_pvt-&gt;caller_profile-&gt;destination_number))) {
</del><ins>+        device_name, device_instance, &amp;listener);
+    if(listener) {
+            helper-&gt;lines_count++;
+            skinny_line_set_state(listener, line_instance, helper-&gt;tech_pvt-&gt;call_id, SKINNY_RING_IN);
+            send_select_soft_keys(listener, line_instance, helper-&gt;tech_pvt-&gt;call_id, SKINNY_KEY_SET_RING_IN, 0xffff);
+        if ((tmp = switch_mprintf(&quot;\200\027%s&quot;, helper-&gt;tech_pvt-&gt;caller_profile-&gt;destination_number))) {
+            display_prompt_status(listener, 0, tmp, line_instance, helper-&gt;tech_pvt-&gt;call_id);
+                switch_safe_free(tmp);
+        }
+        if ((tmp = switch_mprintf(&quot;\005\000\000\000%s&quot;, helper-&gt;tech_pvt-&gt;caller_profile-&gt;destination_number))) {
</ins><span class="cx">                 send_display_pri_notify(listener, 10 /* message_timeout */, 5 /* priority */, tmp);
</span><del>-                    switch_safe_free(tmp);
-            }
-                skinny_send_call_info(helper-&gt;tech_pvt-&gt;session, listener, line_instance);
-                set_lamp(listener, SKINNY_BUTTON_LINE, line_instance, SKINNY_LAMP_BLINK);
-                set_ringer(listener, SKINNY_RING_INSIDE, SKINNY_RING_FOREVER, 0, helper-&gt;tech_pvt-&gt;call_id);
-        }
-        return 0;
</del><ins>+                switch_safe_free(tmp);
+        }
+            skinny_send_call_info(helper-&gt;tech_pvt-&gt;session, listener, line_instance);
+            set_lamp(listener, SKINNY_BUTTON_LINE, line_instance, SKINNY_LAMP_BLINK);
+            set_ringer(listener, SKINNY_RING_INSIDE, SKINNY_RING_FOREVER, 0, helper-&gt;tech_pvt-&gt;call_id);
+    }
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_call_cause_t skinny_ring_lines(private_t *tech_pvt)
</span><span class="cx"> {
</span><del>-        switch_status_t status;
-        struct skinny_ring_lines_helper helper = {0};
</del><ins>+    switch_status_t status;
+    struct skinny_ring_lines_helper helper = {0};
</ins><span class="cx"> 
</span><del>-        switch_assert(tech_pvt);
-        switch_assert(tech_pvt-&gt;profile);
-        switch_assert(tech_pvt-&gt;session);
-        
-        helper.tech_pvt = tech_pvt;
-        helper.lines_count = 0;
-        
-        status = skinny_session_walk_lines(tech_pvt-&gt;profile,
-            switch_core_session_get_uuid(tech_pvt-&gt;session), skinny_ring_lines_callback, &amp;helper);
-        if(status != SWITCH_STATUS_SUCCESS) {
-                return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
-        } else if(helper.lines_count == 0) {
-                return SWITCH_CAUSE_UNALLOCATED_NUMBER;
-        } else {
-                return SWITCH_CAUSE_SUCCESS;
-        }
</del><ins>+    switch_assert(tech_pvt);
+    switch_assert(tech_pvt-&gt;profile);
+    switch_assert(tech_pvt-&gt;session);
+
+    helper.tech_pvt = tech_pvt;
+    helper.lines_count = 0;
+
+    status = skinny_session_walk_lines(tech_pvt-&gt;profile,
+        switch_core_session_get_uuid(tech_pvt-&gt;session), skinny_ring_lines_callback, &amp;helper);
+    if(status != SWITCH_STATUS_SUCCESS) {
+            return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
+    } else if(helper.lines_count == 0) {
+            return SWITCH_CAUSE_UNALLOCATED_NUMBER;
+    } else {
+            return SWITCH_CAUSE_SUCCESS;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> switch_status_t skinny_create_ingoing_session(listener_t *listener, uint32_t *line_instance_p, switch_core_session_t **session)
</span><span class="cx"> {
</span><del>-        switch_core_session_t *nsession;
-        switch_channel_t *channel;
-        private_t *tech_pvt;
-        char name[128];
-        char *sql;
-        struct line_stat_res_message *button = NULL;
</del><ins>+    switch_core_session_t *nsession;
+    switch_channel_t *channel;
+    private_t *tech_pvt;
+    char name[128];
+    char *sql;
+    struct line_stat_res_message *button = NULL;
</ins><span class="cx"> 
</span><span class="cx">     if((nsession = skinny_profile_find_session(listener-&gt;profile, listener, line_instance_p, 0))) {
</span><span class="cx">         switch_core_session_rwunlock(nsession);
</span><span class="cx">         if(skinny_line_get_state(listener, *line_instance_p, 0) == SKINNY_OFF_HOOK) {
</span><span class="cx">             /* Reuse existing session */
</span><span class="cx">             *session = nsession;
</span><del>-                return SWITCH_STATUS_SUCCESS;
</del><ins>+            return SWITCH_STATUS_SUCCESS;
</ins><span class="cx">         }
</span><span class="cx">         skinny_session_hold_line(nsession, listener, *line_instance_p);
</span><span class="cx">     }
</span><span class="lines">@@ -456,108 +456,108 @@
</span><span class="cx">         *line_instance_p = 1;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-        skinny_line_get(listener, *line_instance_p, &amp;button);
</del><ins>+    skinny_line_get(listener, *line_instance_p, &amp;button);
</ins><span class="cx"> 
</span><del>-        if (!button || !button-&gt;shortname) {
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, &quot;Line %d not found on device %s %d\n&quot;,
-                    *line_instance_p, listener-&gt;device_name, listener-&gt;device_instance);
-                goto error;
-        }
-        
-        if (!(nsession = switch_core_session_request(skinny_get_endpoint_interface(),
-                SWITCH_CALL_DIRECTION_INBOUND, NULL))) {
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, &quot;Error Creating Session\n&quot;);
-                goto error;
-        }
</del><ins>+    if (!button || !button-&gt;shortname) {
+            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, &quot;Line %d not found on device %s %d\n&quot;,
+                *line_instance_p, listener-&gt;device_name, listener-&gt;device_instance);
+            goto error;
+    }
</ins><span class="cx"> 
</span><del>-        if (!(tech_pvt = (struct private_object *) switch_core_session_alloc(nsession, sizeof(*tech_pvt)))) {
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(nsession), SWITCH_LOG_CRIT, 
-                    &quot;Error Creating Session private object\n&quot;);
-                goto error;
-        }
</del><ins>+    if (!(nsession = switch_core_session_request(skinny_get_endpoint_interface(),
+            SWITCH_CALL_DIRECTION_INBOUND, NULL))) {
+            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, &quot;Error Creating Session\n&quot;);
+            goto error;
+    }
</ins><span class="cx"> 
</span><del>-        switch_core_session_add_stream(nsession, NULL);
</del><ins>+    if (!(tech_pvt = (struct private_object *) switch_core_session_alloc(nsession, sizeof(*tech_pvt)))) {
+            switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(nsession), SWITCH_LOG_CRIT, 
+                &quot;Error Creating Session private object\n&quot;);
+            goto error;
+    }
</ins><span class="cx"> 
</span><del>-        tech_init(tech_pvt, listener-&gt;profile, nsession);
</del><ins>+    switch_core_session_add_stream(nsession, NULL);
</ins><span class="cx"> 
</span><del>-        channel = switch_core_session_get_channel(nsession);
</del><ins>+    tech_init(tech_pvt, listener-&gt;profile, nsession);
</ins><span class="cx"> 
</span><del>-        snprintf(name, sizeof(name), &quot;SKINNY/%s/%s:%d/%d&quot;, listener-&gt;profile-&gt;name, 
-            listener-&gt;device_name, listener-&gt;device_instance, *line_instance_p);
-        switch_channel_set_name(channel, name);
</del><ins>+    channel = switch_core_session_get_channel(nsession);
</ins><span class="cx"> 
</span><del>-        if (switch_core_session_thread_launch(nsession) != SWITCH_STATUS_SUCCESS) {
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(nsession), SWITCH_LOG_CRIT, 
-                    &quot;Error Creating Session thread\n&quot;);
-                goto error;
-        }
</del><ins>+    snprintf(name, sizeof(name), &quot;SKINNY/%s/%s:%d/%d&quot;, listener-&gt;profile-&gt;name, 
+        listener-&gt;device_name, listener-&gt;device_instance, *line_instance_p);
+    switch_channel_set_name(channel, name);
</ins><span class="cx"> 
</span><del>-        if (!(tech_pvt-&gt;caller_profile = switch_caller_profile_new(switch_core_session_get_pool(nsession),
-                                                                                                                  NULL, listener-&gt;profile-&gt;dialplan, 
-                                                                                                                  button-&gt;shortname, button-&gt;name, 
-                                                                                                                  listener-&gt;remote_ip, NULL, NULL, NULL,
-                                                                                                                  &quot;skinny&quot; /* modname */,
-                                                                                                                  listener-&gt;profile-&gt;context, 
-                                                                                                                  &quot;&quot;)) != 0) {
</del><ins>+    if (switch_core_session_thread_launch(nsession) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">             switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(nsession), SWITCH_LOG_CRIT, 
</span><del>-                                &quot;Error Creating Session caller profile\n&quot;);
-                goto error;
-        }
</del><ins>+                &quot;Error Creating Session thread\n&quot;);
+            goto error;
+    }
</ins><span class="cx"> 
</span><del>-        switch_channel_set_caller_profile(channel, tech_pvt-&gt;caller_profile);
</del><ins>+    if (!(tech_pvt-&gt;caller_profile = switch_caller_profile_new(switch_core_session_get_pool(nsession),
+                                                                                                              NULL, listener-&gt;profile-&gt;dialplan, 
+                                                                                                              button-&gt;shortname, button-&gt;name, 
+                                                                                                              listener-&gt;remote_ip, NULL, NULL, NULL,
+                                                                                                              &quot;skinny&quot; /* modname */,
+                                                                                                              listener-&gt;profile-&gt;context, 
+                                                                                                              &quot;&quot;)) != 0) {
+        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(nsession), SWITCH_LOG_CRIT, 
+                            &quot;Error Creating Session caller profile\n&quot;);
+            goto error;
+    }
</ins><span class="cx"> 
</span><del>-        if ((sql = switch_mprintf(
-                        &quot;INSERT INTO skinny_active_lines &quot;
-                                &quot;(device_name, device_instance, line_instance, channel_uuid, call_id, call_state) &quot;
-                                &quot;SELECT device_name, device_instance, line_instance, '%s', %d, %d &quot;
-                                &quot;FROM skinny_lines &quot;
-                                &quot;WHERE value='%s'&quot;,
-                        switch_core_session_get_uuid(nsession), tech_pvt-&gt;call_id, SKINNY_ON_HOOK, button-&gt;shortname
-                        ))) {
-                skinny_execute_sql(listener-&gt;profile, sql, listener-&gt;profile-&gt;sql_mutex);
-                switch_safe_free(sql);
-        }
</del><ins>+    switch_channel_set_caller_profile(channel, tech_pvt-&gt;caller_profile);
</ins><span class="cx"> 
</span><del>-        set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, tech_pvt-&gt;call_id);
-        set_speaker_mode(listener, SKINNY_SPEAKER_ON);
-        set_lamp(listener, SKINNY_BUTTON_LINE, *line_instance_p, SKINNY_LAMP_ON);
</del><ins>+    if ((sql = switch_mprintf(
+                    &quot;INSERT INTO skinny_active_lines &quot;
+                            &quot;(device_name, device_instance, line_instance, channel_uuid, call_id, call_state) &quot;
+                            &quot;SELECT device_name, device_instance, line_instance, '%s', %d, %d &quot;
+                            &quot;FROM skinny_lines &quot;
+                            &quot;WHERE value='%s'&quot;,
+                    switch_core_session_get_uuid(nsession), tech_pvt-&gt;call_id, SKINNY_ON_HOOK, button-&gt;shortname
+                    ))) {
+            skinny_execute_sql(listener-&gt;profile, sql, listener-&gt;profile-&gt;sql_mutex);
+            switch_safe_free(sql);
+    }
+
+    set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, tech_pvt-&gt;call_id);
+    set_speaker_mode(listener, SKINNY_SPEAKER_ON);
+    set_lamp(listener, SKINNY_BUTTON_LINE, *line_instance_p, SKINNY_LAMP_ON);
</ins><span class="cx">     skinny_line_set_state(listener, *line_instance_p, tech_pvt-&gt;call_id, SKINNY_OFF_HOOK);
</span><span class="cx">     send_select_soft_keys(listener, *line_instance_p, tech_pvt-&gt;call_id, SKINNY_KEY_SET_OFF_HOOK, 0xffff);
</span><del>-        display_prompt_status(listener, 0, &quot;\200\000&quot;,
-                *line_instance_p, tech_pvt-&gt;call_id);
-        activate_call_plane(listener, *line_instance_p);
</del><ins>+    display_prompt_status(listener, 0, &quot;\200\000&quot;,
+            *line_instance_p, tech_pvt-&gt;call_id);
+    activate_call_plane(listener, *line_instance_p);
</ins><span class="cx"> 
</span><del>-        goto done;
</del><ins>+    goto done;
</ins><span class="cx"> error:
</span><del>-        if (nsession) {
-                switch_core_session_destroy(&amp;nsession);
-        }
</del><ins>+    if (nsession) {
+            switch_core_session_destroy(&amp;nsession);
+    }
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_FALSE;
</del><ins>+    return SWITCH_STATUS_FALSE;
</ins><span class="cx"> 
</span><span class="cx"> done:
</span><del>-        *session = nsession;
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    *session = nsession;
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_session_process_dest(switch_core_session_t *session, listener_t *listener, uint32_t line_instance, char *dest, char append_dest, uint32_t backspace)
</span><span class="cx"> {
</span><del>-        switch_channel_t *channel = NULL;
-        private_t *tech_pvt = NULL;
</del><ins>+    switch_channel_t *channel = NULL;
+    private_t *tech_pvt = NULL;
</ins><span class="cx"> 
</span><span class="cx">     switch_assert(session);
</span><span class="cx">     switch_assert(listener);
</span><span class="cx">     switch_assert(listener-&gt;profile);
</span><span class="cx">     
</span><del>-        channel = switch_core_session_get_channel(session);
-        tech_pvt = switch_core_session_get_private(session);
</del><ins>+    channel = switch_core_session_get_channel(session);
+    tech_pvt = switch_core_session_get_private(session);
</ins><span class="cx"> 
</span><del>-        if(!dest) {
</del><ins>+    if(!dest) {
</ins><span class="cx">         if(append_dest == '\0') {/* no digit yet */
</span><span class="cx">                 start_tone(listener, SKINNY_TONE_DIALTONE, 0, line_instance, tech_pvt-&gt;call_id);
</span><span class="cx">         } else {
</span><span class="cx">             if(strlen(tech_pvt-&gt;caller_profile-&gt;destination_number) == 0) {/* first digit */
</span><del>-                        stop_tone(listener, line_instance, tech_pvt-&gt;call_id);
</del><ins>+                    stop_tone(listener, line_instance, tech_pvt-&gt;call_id);
</ins><span class="cx">                 send_select_soft_keys(listener, line_instance, tech_pvt-&gt;call_id,
</span><span class="cx">                     SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT, 0xffff);
</span><span class="cx">             }
</span><span class="lines">@@ -565,91 +565,91 @@
</span><span class="cx">                 &quot;%s%c&quot;, tech_pvt-&gt;caller_profile-&gt;destination_number, append_dest);
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><del>-            tech_pvt-&gt;caller_profile-&gt;destination_number = switch_core_strdup(tech_pvt-&gt;caller_profile-&gt;pool,
-                dest);
</del><ins>+        tech_pvt-&gt;caller_profile-&gt;destination_number = switch_core_strdup(tech_pvt-&gt;caller_profile-&gt;pool,
+            dest);
</ins><span class="cx">     }
</span><span class="cx">     /* TODO Number is complete -&gt; check against dialplan */
</span><del>-        if((strlen(tech_pvt-&gt;caller_profile-&gt;destination_number) &gt;= 4) || dest) {
-                send_dialed_number(listener, tech_pvt-&gt;caller_profile-&gt;destination_number, line_instance, tech_pvt-&gt;call_id);
</del><ins>+    if((strlen(tech_pvt-&gt;caller_profile-&gt;destination_number) &gt;= 4) || dest) {
+            send_dialed_number(listener, tech_pvt-&gt;caller_profile-&gt;destination_number, line_instance, tech_pvt-&gt;call_id);
</ins><span class="cx">         skinny_line_set_state(listener, line_instance, tech_pvt-&gt;call_id, SKINNY_PROCEED);
</span><del>-            skinny_send_call_info(session, listener, line_instance);
</del><ins>+        skinny_send_call_info(session, listener, line_instance);
</ins><span class="cx">         skinny_session_start_media(session, listener, line_instance);
</span><del>-        }
</del><ins>+    }
</ins><span class="cx"> 
</span><del>-        switch_core_session_rwunlock(session);
-        
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    switch_core_session_rwunlock(session);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_session_ring_out(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
</span><span class="cx"> {
</span><del>-        switch_channel_t *channel = NULL;
-        private_t *tech_pvt = NULL;
</del><ins>+    switch_channel_t *channel = NULL;
+    private_t *tech_pvt = NULL;
</ins><span class="cx"> 
</span><span class="cx">     switch_assert(session);
</span><span class="cx">     switch_assert(listener);
</span><span class="cx">     switch_assert(listener-&gt;profile);
</span><span class="cx">     
</span><del>-        channel = switch_core_session_get_channel(session);
-        tech_pvt = switch_core_session_get_private(session);
</del><ins>+    channel = switch_core_session_get_channel(session);
+    tech_pvt = switch_core_session_get_private(session);
</ins><span class="cx"> 
</span><span class="cx">     skinny_line_set_state(listener, line_instance, tech_pvt-&gt;call_id, SKINNY_RING_OUT);
</span><span class="cx">     send_select_soft_keys(listener, line_instance, tech_pvt-&gt;call_id,
</span><span class="cx">         SKINNY_KEY_SET_RING_OUT, 0xffff);
</span><del>-        display_prompt_status(listener, 0, &quot;\200\026&quot;,
-                line_instance, tech_pvt-&gt;call_id);
</del><ins>+    display_prompt_status(listener, 0, &quot;\200\026&quot;,
+            line_instance, tech_pvt-&gt;call_id);
</ins><span class="cx">     skinny_send_call_info(session, listener, line_instance);
</span><span class="cx"> 
</span><del>-        switch_core_session_rwunlock(session);
-        
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    switch_core_session_rwunlock(session);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> struct skinny_session_answer_helper {
</span><del>-        private_t *tech_pvt;
-        listener_t *listener;
-        uint32_t line_instance;
</del><ins>+    private_t *tech_pvt;
+    listener_t *listener;
+    uint32_t line_instance;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> int skinny_session_answer_callback(void *pArg, int argc, char **argv, char **columnNames)
</span><span class="cx"> {
</span><del>-        struct skinny_session_answer_helper *helper = pArg;
-        listener_t *listener = NULL;
</del><ins>+    struct skinny_session_answer_helper *helper = pArg;
+    listener_t *listener = NULL;
</ins><span class="cx"> 
</span><del>-        char *device_name = argv[0];
-        uint32_t device_instance = atoi(argv[1]);
-        /* uint32_t position = atoi(argv[2]); */
-        uint32_t line_instance = atoi(argv[3]);
-        /* char *label = argv[4]; */
-        /* char *value = argv[5]; */
-        /* char *caller_name = argv[6]; */
-        /* uint32_t ring_on_idle = atoi(argv[7]); */
-        /* uint32_t ring_on_active = atoi(argv[8]); */
-        /* uint32_t busy_trigger = atoi(argv[9]); */
-        /* char *forward_all = argv[10]; */
-        /* char *forward_busy = argv[11]; */
-        /* char *forward_noanswer = argv[12]; */
-        /* uint32_t noanswer_duration = atoi(argv[13]); */
-        /* char *channel_uuid = argv[14]; */
-        /* uint32_t call_id = atoi(argv[15]); */
-        /* uint32_t call_state = atoi(argv[16]); */
</del><ins>+    char *device_name = argv[0];
+    uint32_t device_instance = atoi(argv[1]);
+    /* uint32_t position = atoi(argv[2]); */
+    uint32_t line_instance = atoi(argv[3]);
+    /* char *label = argv[4]; */
+    /* char *value = argv[5]; */
+    /* char *caller_name = argv[6]; */
+    /* uint32_t ring_on_idle = atoi(argv[7]); */
+    /* uint32_t ring_on_active = atoi(argv[8]); */
+    /* uint32_t busy_trigger = atoi(argv[9]); */
+    /* char *forward_all = argv[10]; */
+    /* char *forward_busy = argv[11]; */
+    /* char *forward_noanswer = argv[12]; */
+    /* uint32_t noanswer_duration = atoi(argv[13]); */
+    /* char *channel_uuid = argv[14]; */
+    /* uint32_t call_id = atoi(argv[15]); */
+    /* uint32_t call_state = atoi(argv[16]); */
</ins><span class="cx"> 
</span><del>-        skinny_profile_find_listener_by_device_name_and_instance(helper-&gt;tech_pvt-&gt;profile, device_name, device_instance, &amp;listener);
</del><ins>+    skinny_profile_find_listener_by_device_name_and_instance(helper-&gt;tech_pvt-&gt;profile, device_name, device_instance, &amp;listener);
</ins><span class="cx">     if(listener) {
</span><span class="cx">         if(!strcmp(device_name, helper-&gt;listener-&gt;device_name) 
</span><span class="cx">                 &amp;&amp; (device_instance == helper-&gt;listener-&gt;device_instance)
</span><span class="cx">                 &amp;&amp; (line_instance == helper-&gt;line_instance)) {/* the answering line */
</span><span class="cx">                    
</span><span class="cx">                    
</span><del>-                set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, helper-&gt;tech_pvt-&gt;call_id);
-                set_speaker_mode(listener, SKINNY_SPEAKER_ON);
-                set_lamp(listener, SKINNY_BUTTON_LINE, line_instance, SKINNY_LAMP_ON);
</del><ins>+            set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, helper-&gt;tech_pvt-&gt;call_id);
+            set_speaker_mode(listener, SKINNY_SPEAKER_ON);
+            set_lamp(listener, SKINNY_BUTTON_LINE, line_instance, SKINNY_LAMP_ON);
</ins><span class="cx">             skinny_line_set_state(listener, line_instance, helper-&gt;tech_pvt-&gt;call_id, SKINNY_OFF_HOOK);
</span><span class="cx">             /* send_select_soft_keys(listener, line_instance, helper-&gt;tech_pvt-&gt;call_id, SKINNY_KEY_SET_OFF_HOOK, 0xffff); */
</span><del>-                /* display_prompt_status(listener, 0, &quot;\200\000&quot;,
-                        line_instance, tech_pvt-&gt;call_id); */
-                activate_call_plane(listener, line_instance);
</del><ins>+            /* display_prompt_status(listener, 0, &quot;\200\000&quot;,
+                    line_instance, tech_pvt-&gt;call_id); */
+            activate_call_plane(listener, line_instance);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     return 0;
</span><span class="lines">@@ -657,41 +657,41 @@
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_session_answer(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
</span><span class="cx"> {
</span><del>-        struct skinny_session_answer_helper helper = {0};
-        switch_channel_t *channel = NULL;
-        private_t *tech_pvt = NULL;
</del><ins>+    struct skinny_session_answer_helper helper = {0};
+    switch_channel_t *channel = NULL;
+    private_t *tech_pvt = NULL;
</ins><span class="cx"> 
</span><span class="cx">     switch_assert(session);
</span><span class="cx">     switch_assert(listener);
</span><span class="cx">     switch_assert(listener-&gt;profile);
</span><span class="cx">     
</span><del>-        channel = switch_core_session_get_channel(session);
-        tech_pvt = switch_core_session_get_private(session);
-        
</del><ins>+    channel = switch_core_session_get_channel(session);
+    tech_pvt = switch_core_session_get_private(session);
+
</ins><span class="cx">     helper.tech_pvt = tech_pvt;
</span><span class="cx">     helper.listener = listener;
</span><span class="cx">     helper.line_instance = line_instance;
</span><span class="cx"> 
</span><span class="cx">     skinny_session_walk_lines(tech_pvt-&gt;profile, switch_core_session_get_uuid(session), skinny_session_answer_callback, &amp;helper);
</span><span class="cx"> 
</span><del>-        skinny_session_start_media(session, listener, line_instance);
</del><ins>+    skinny_session_start_media(session, listener, line_instance);
</ins><span class="cx"> 
</span><del>-        switch_core_session_rwunlock(session);
-        
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    switch_core_session_rwunlock(session);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_session_start_media(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
</span><span class="cx"> {
</span><del>-        switch_channel_t *channel = NULL;
-        private_t *tech_pvt = NULL;
</del><ins>+    switch_channel_t *channel = NULL;
+    private_t *tech_pvt = NULL;
</ins><span class="cx"> 
</span><span class="cx">     switch_assert(session);
</span><span class="cx">     switch_assert(listener);
</span><span class="cx">     switch_assert(listener-&gt;profile);
</span><span class="cx">     
</span><del>-        channel = switch_core_session_get_channel(session);
-        tech_pvt = switch_core_session_get_private(session);
</del><ins>+    channel = switch_core_session_get_channel(session);
+    tech_pvt = switch_core_session_get_private(session);
</ins><span class="cx">      
</span><span class="cx">     stop_tone(listener, line_instance, tech_pvt-&gt;call_id);
</span><span class="cx">     open_receive_channel(listener,
</span><span class="lines">@@ -714,1390 +714,1390 @@
</span><span class="cx">         tech_pvt-&gt;call_id);
</span><span class="cx">     skinny_send_call_info(session, listener, line_instance);
</span><span class="cx"> 
</span><del>-        switch_core_session_rwunlock(session);
-        
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    switch_core_session_rwunlock(session);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_session_hold_line(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
</span><span class="cx"> {
</span><del>-        switch_channel_t *channel = NULL;
-        private_t *tech_pvt = NULL;
</del><ins>+    switch_channel_t *channel = NULL;
+    private_t *tech_pvt = NULL;
</ins><span class="cx"> 
</span><span class="cx">     switch_assert(session);
</span><span class="cx">     switch_assert(listener);
</span><span class="cx">     switch_assert(listener-&gt;profile);
</span><span class="cx">     
</span><del>-        channel = switch_core_session_get_channel(session);
-        tech_pvt = switch_core_session_get_private(session);
-                
-        /* TODO */
-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;Hold is not implemented yet. Hanging up the line.\n&quot;);
</del><ins>+    channel = switch_core_session_get_channel(session);
+    tech_pvt = switch_core_session_get_private(session);
+        
+    /* TODO */
+    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;Hold is not implemented yet. Hanging up the line.\n&quot;);
</ins><span class="cx"> 
</span><del>-        switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
</del><ins>+    switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
</ins><span class="cx"> 
</span><del>-        switch_core_session_rwunlock(session);
-        
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    switch_core_session_rwunlock(session);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_session_unhold_line(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
</span><span class="cx"> {
</span><del>-        /* TODO */
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    /* TODO */
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> /* SKINNY BUTTONS */
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> struct line_get_helper {
</span><del>-        uint32_t pos;
-        struct line_stat_res_message *button;
</del><ins>+    uint32_t pos;
+    struct line_stat_res_message *button;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> int skinny_line_get_callback(void *pArg, int argc, char **argv, char **columnNames)
</span><span class="cx"> {
</span><del>-        struct line_get_helper *helper = pArg;
</del><ins>+    struct line_get_helper *helper = pArg;
</ins><span class="cx"> 
</span><del>-        helper-&gt;pos++;
-        if (helper-&gt;pos == atoi(argv[0])) { /* wanted_position */
-                helper-&gt;button-&gt;number = helper-&gt;pos;
-                strncpy(helper-&gt;button-&gt;name,  argv[2], 24); /* label */
-                strncpy(helper-&gt;button-&gt;shortname,  argv[3], 40); /* value */
-                strncpy(helper-&gt;button-&gt;displayname,  argv[4], 44); /* caller_name */
-        }
-        return 0;
</del><ins>+    helper-&gt;pos++;
+    if (helper-&gt;pos == atoi(argv[0])) { /* wanted_position */
+            helper-&gt;button-&gt;number = helper-&gt;pos;
+            strncpy(helper-&gt;button-&gt;name,  argv[2], 24); /* label */
+            strncpy(helper-&gt;button-&gt;shortname,  argv[3], 40); /* value */
+            strncpy(helper-&gt;button-&gt;displayname,  argv[4], 44); /* caller_name */
+    }
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void skinny_line_get(listener_t *listener, uint32_t instance, struct line_stat_res_message **button)
</span><span class="cx"> {
</span><del>-        struct line_get_helper helper = {0};
-        char *sql;
</del><ins>+    struct line_get_helper helper = {0};
+    char *sql;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener);
-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    switch_assert(listener);
+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        helper.button = switch_core_alloc(listener-&gt;pool, sizeof(struct line_stat_res_message));
-        
-        if ((sql = switch_mprintf(
-                        &quot;SELECT '%d' AS wanted_position, position, label, value, caller_name &quot;
-                                &quot;FROM skinny_lines &quot;
-                                &quot;WHERE device_name='%s' AND device_instance=%d &quot;
-                                &quot;ORDER BY position&quot;,
-                        instance,
-                        listener-&gt;device_name, listener-&gt;device_instance
-                        ))) {
-                skinny_execute_sql_callback(listener-&gt;profile, listener-&gt;profile-&gt;sql_mutex, sql, skinny_line_get_callback, &amp;helper);
-                switch_safe_free(sql);
-        }
-        *button = helper.button;
</del><ins>+    helper.button = switch_core_alloc(listener-&gt;pool, sizeof(struct line_stat_res_message));
+
+    if ((sql = switch_mprintf(
+                    &quot;SELECT '%d' AS wanted_position, position, label, value, caller_name &quot;
+                            &quot;FROM skinny_lines &quot;
+                            &quot;WHERE device_name='%s' AND device_instance=%d &quot;
+                            &quot;ORDER BY position&quot;,
+                    instance,
+                    listener-&gt;device_name, listener-&gt;device_instance
+                    ))) {
+            skinny_execute_sql_callback(listener-&gt;profile, listener-&gt;profile-&gt;sql_mutex, sql, skinny_line_get_callback, &amp;helper);
+            switch_safe_free(sql);
+    }
+    *button = helper.button;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> struct speed_dial_get_helper {
</span><del>-        uint32_t pos;
-        struct speed_dial_stat_res_message *button;
</del><ins>+    uint32_t pos;
+    struct speed_dial_stat_res_message *button;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> int skinny_speed_dial_get_callback(void *pArg, int argc, char **argv, char **columnNames)
</span><span class="cx"> {
</span><del>-        struct speed_dial_get_helper *helper = pArg;
</del><ins>+    struct speed_dial_get_helper *helper = pArg;
</ins><span class="cx"> 
</span><del>-        helper-&gt;pos++;
-        if (helper-&gt;pos == atoi(argv[0])) { /* wanted_position */
-                helper-&gt;button-&gt;number = helper-&gt;pos; /* value */
-                strncpy(helper-&gt;button-&gt;line,  argv[3], 24); /* value */
-                strncpy(helper-&gt;button-&gt;label,  argv[2], 40); /* label */
-        }
-        return 0;
</del><ins>+    helper-&gt;pos++;
+    if (helper-&gt;pos == atoi(argv[0])) { /* wanted_position */
+            helper-&gt;button-&gt;number = helper-&gt;pos; /* value */
+            strncpy(helper-&gt;button-&gt;line,  argv[3], 24); /* value */
+            strncpy(helper-&gt;button-&gt;label,  argv[2], 40); /* label */
+    }
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void skinny_speed_dial_get(listener_t *listener, uint32_t instance, struct speed_dial_stat_res_message **button)
</span><span class="cx"> {
</span><del>-        struct speed_dial_get_helper helper = {0};
-        char *sql;
</del><ins>+    struct speed_dial_get_helper helper = {0};
+    char *sql;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener);
-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    switch_assert(listener);
+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        helper.button = switch_core_alloc(listener-&gt;pool, sizeof(struct speed_dial_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 device_instance=%d AND type=%d &quot;
-                                &quot;ORDER BY position&quot;,
-                        instance,
-                        listener-&gt;device_name, listener-&gt;device_instance,
-                        SKINNY_BUTTON_SPEED_DIAL
-                        ))) {
-                skinny_execute_sql_callback(listener-&gt;profile, listener-&gt;profile-&gt;sql_mutex, sql, skinny_speed_dial_get_callback, &amp;helper);
-                switch_safe_free(sql);
-        }
-        *button = helper.button;
</del><ins>+    helper.button = switch_core_alloc(listener-&gt;pool, sizeof(struct speed_dial_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 device_instance=%d AND type=%d &quot;
+                            &quot;ORDER BY position&quot;,
+                    instance,
+                    listener-&gt;device_name, listener-&gt;device_instance,
+                    SKINNY_BUTTON_SPEED_DIAL
+                    ))) {
+            skinny_execute_sql_callback(listener-&gt;profile, listener-&gt;profile-&gt;sql_mutex, sql, skinny_speed_dial_get_callback, &amp;helper);
+            switch_safe_free(sql);
+    }
+    *button = helper.button;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> struct service_url_get_helper {
</span><del>-        uint32_t pos;
-        struct service_url_stat_res_message *button;
</del><ins>+    uint32_t pos;
+    struct service_url_stat_res_message *button;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> int skinny_service_url_get_callback(void *pArg, int argc, char **argv, char **columnNames)
</span><span class="cx"> {
</span><del>-        struct service_url_get_helper *helper = pArg;
</del><ins>+    struct service_url_get_helper *helper = pArg;
</ins><span class="cx"> 
</span><del>-        helper-&gt;pos++;
-        if (helper-&gt;pos == atoi(argv[0])) { /* wanted_position */
-                helper-&gt;button-&gt;index = helper-&gt;pos;
-                strncpy(helper-&gt;button-&gt;url, argv[3], 256); /* value */
-                strncpy(helper-&gt;button-&gt;display_name,  argv[2], 40); /* label */
-        }
-        return 0;
</del><ins>+    helper-&gt;pos++;
+    if (helper-&gt;pos == atoi(argv[0])) { /* wanted_position */
+            helper-&gt;button-&gt;index = helper-&gt;pos;
+            strncpy(helper-&gt;button-&gt;url, argv[3], 256); /* value */
+            strncpy(helper-&gt;button-&gt;display_name,  argv[2], 40); /* label */
+    }
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void skinny_service_url_get(listener_t *listener, uint32_t instance, struct service_url_stat_res_message **button)
</span><span class="cx"> {
</span><del>-        struct service_url_get_helper helper = {0};
-        char *sql;
</del><ins>+    struct service_url_get_helper helper = {0};
+    char *sql;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener);
-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    switch_assert(listener);
+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        helper.button = switch_core_alloc(listener-&gt;pool, sizeof(struct service_url_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 device_instance=%d AND type=%d &quot;
-                                &quot;ORDER BY position&quot;,
-                        instance,
-                        listener-&gt;device_name,
-                        listener-&gt;device_instance,
-                        SKINNY_BUTTON_SERVICE_URL
-                        ))) {
-                skinny_execute_sql_callback(listener-&gt;profile, listener-&gt;profile-&gt;sql_mutex, sql, skinny_service_url_get_callback, &amp;helper);
-                switch_safe_free(sql);
-        }
-        *button = helper.button;
</del><ins>+    helper.button = switch_core_alloc(listener-&gt;pool, sizeof(struct service_url_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 device_instance=%d AND type=%d &quot;
+                            &quot;ORDER BY position&quot;,
+                    instance,
+                    listener-&gt;device_name,
+                    listener-&gt;device_instance,
+                    SKINNY_BUTTON_SERVICE_URL
+                    ))) {
+            skinny_execute_sql_callback(listener-&gt;profile, listener-&gt;profile-&gt;sql_mutex, sql, skinny_service_url_get_callback, &amp;helper);
+            switch_safe_free(sql);
+    }
+    *button = helper.button;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> struct feature_get_helper {
</span><del>-        uint32_t pos;
-        struct feature_stat_res_message *button;
</del><ins>+    uint32_t pos;
+    struct feature_stat_res_message *button;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> int skinny_feature_get_callback(void *pArg, int argc, char **argv, char **columnNames)
</span><span class="cx"> {
</span><del>-        struct feature_get_helper *helper = pArg;
</del><ins>+    struct feature_get_helper *helper = pArg;
</ins><span class="cx"> 
</span><del>-        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;
</del><ins>+    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;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void skinny_feature_get(listener_t *listener, uint32_t instance, struct feature_stat_res_message **button)
</span><span class="cx"> {
</span><del>-        struct feature_get_helper helper = {0};
-        char *sql;
</del><ins>+    struct feature_get_helper helper = {0};
+    char *sql;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener);
-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    switch_assert(listener);
+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        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 device_instance=%d AND NOT (type=%d OR type=%d) &quot;
-                                &quot;ORDER BY position&quot;,
-                        instance,
-                        listener-&gt;device_name,
-                        listener-&gt;device_instance,
-                        SKINNY_BUTTON_SPEED_DIAL, SKINNY_BUTTON_SERVICE_URL
-                        ))) {
-                skinny_execute_sql_callback(listener-&gt;profile, listener-&gt;profile-&gt;sql_mutex, sql, skinny_feature_get_callback, &amp;helper);
-                switch_safe_free(sql);
-        }
-        *button = helper.button;
</del><ins>+    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 device_instance=%d AND NOT (type=%d OR type=%d) &quot;
+                            &quot;ORDER BY position&quot;,
+                    instance,
+                    listener-&gt;device_name,
+                    listener-&gt;device_instance,
+                    SKINNY_BUTTON_SPEED_DIAL, SKINNY_BUTTON_SERVICE_URL
+                    ))) {
+            skinny_execute_sql_callback(listener-&gt;profile, listener-&gt;profile-&gt;sql_mutex, sql, skinny_feature_get_callback, &amp;helper);
+            switch_safe_free(sql);
+    }
+    *button = helper.button;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> /* SKINNY MESSAGE SENDER */
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> switch_status_t start_tone(listener_t *listener,
</span><del>-        uint32_t tone,
-        uint32_t reserved,
-        uint32_t line_instance,
-        uint32_t call_id)
</del><ins>+    uint32_t tone,
+    uint32_t reserved,
+    uint32_t line_instance,
+    uint32_t call_id)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.start_tone));
-        message-&gt;type = START_TONE_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.start_tone);
-        message-&gt;data.start_tone.tone = tone;
-        message-&gt;data.start_tone.reserved = reserved;
-        message-&gt;data.start_tone.line_instance = line_instance;
-        message-&gt;data.start_tone.call_id = call_id;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.start_tone));
+    message-&gt;type = START_TONE_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.start_tone);
+    message-&gt;data.start_tone.tone = tone;
+    message-&gt;data.start_tone.reserved = reserved;
+    message-&gt;data.start_tone.line_instance = line_instance;
+    message-&gt;data.start_tone.call_id = call_id;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t stop_tone(listener_t *listener,
</span><del>-        uint32_t line_instance,
-        uint32_t call_id)
</del><ins>+    uint32_t line_instance,
+    uint32_t call_id)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.stop_tone));
-        message-&gt;type = STOP_TONE_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.stop_tone);
-        message-&gt;data.stop_tone.line_instance = line_instance;
-        message-&gt;data.stop_tone.call_id = call_id;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.stop_tone));
+    message-&gt;type = STOP_TONE_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.stop_tone);
+    message-&gt;data.stop_tone.line_instance = line_instance;
+    message-&gt;data.stop_tone.call_id = call_id;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t set_ringer(listener_t *listener,
</span><del>-        uint32_t ring_type,
-        uint32_t ring_mode,
-        uint32_t line_instance,
-        uint32_t call_id)
</del><ins>+    uint32_t ring_type,
+    uint32_t ring_mode,
+    uint32_t line_instance,
+    uint32_t call_id)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.ringer));
-        message-&gt;type = SET_RINGER_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.ringer);
-        message-&gt;data.ringer.ring_type = ring_type;
-        message-&gt;data.ringer.ring_mode = ring_mode;
-        message-&gt;data.ringer.line_instance = line_instance;
-        message-&gt;data.ringer.call_id = call_id;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.ringer));
+    message-&gt;type = SET_RINGER_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.ringer);
+    message-&gt;data.ringer.ring_type = ring_type;
+    message-&gt;data.ringer.ring_mode = ring_mode;
+    message-&gt;data.ringer.line_instance = line_instance;
+    message-&gt;data.ringer.call_id = call_id;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t set_lamp(listener_t *listener,
</span><del>-        uint32_t stimulus,
-        uint32_t stimulus_instance,
-        uint32_t mode)
</del><ins>+    uint32_t stimulus,
+    uint32_t stimulus_instance,
+    uint32_t mode)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.lamp));
-        message-&gt;type = SET_LAMP_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.lamp);
-        message-&gt;data.lamp.stimulus = stimulus;
-        message-&gt;data.lamp.stimulus_instance = stimulus_instance;
-        message-&gt;data.lamp.mode = mode;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.lamp));
+    message-&gt;type = SET_LAMP_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.lamp);
+    message-&gt;data.lamp.stimulus = stimulus;
+    message-&gt;data.lamp.stimulus_instance = stimulus_instance;
+    message-&gt;data.lamp.mode = mode;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t set_speaker_mode(listener_t *listener,
</span><del>-        uint32_t mode)
</del><ins>+    uint32_t mode)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.speaker_mode));
-        message-&gt;type = SET_SPEAKER_MODE_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.speaker_mode);
-        message-&gt;data.speaker_mode.mode = mode;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.speaker_mode));
+    message-&gt;type = SET_SPEAKER_MODE_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.speaker_mode);
+    message-&gt;data.speaker_mode.mode = mode;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t start_media_transmission(listener_t *listener,
</span><del>-        uint32_t conference_id,
-        uint32_t pass_thru_party_id,
-        uint32_t remote_ip,
-        uint32_t remote_port,
-        uint32_t ms_per_packet,
-        uint32_t payload_capacity,
-        uint32_t precedence,
-        uint32_t silence_suppression,
-        uint16_t max_frames_per_packet,
-        uint32_t g723_bitrate)
</del><ins>+    uint32_t conference_id,
+    uint32_t pass_thru_party_id,
+    uint32_t remote_ip,
+    uint32_t remote_port,
+    uint32_t ms_per_packet,
+    uint32_t payload_capacity,
+    uint32_t precedence,
+    uint32_t silence_suppression,
+    uint16_t max_frames_per_packet,
+    uint32_t g723_bitrate)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.start_media));
-        message-&gt;type = START_MEDIA_TRANSMISSION_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.start_media);
-        message-&gt;data.start_media.conference_id = conference_id;
-        message-&gt;data.start_media.pass_thru_party_id = pass_thru_party_id;
-        message-&gt;data.start_media.remote_ip = remote_ip;
-        message-&gt;data.start_media.remote_port = remote_port;
-        message-&gt;data.start_media.ms_per_packet = ms_per_packet;
-        message-&gt;data.start_media.payload_capacity = payload_capacity;
-        message-&gt;data.start_media.precedence = precedence;
-        message-&gt;data.start_media.silence_suppression = silence_suppression;
-        message-&gt;data.start_media.max_frames_per_packet = max_frames_per_packet;
-        message-&gt;data.start_media.g723_bitrate = g723_bitrate;
-        /* ... */
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.start_media));
+    message-&gt;type = START_MEDIA_TRANSMISSION_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.start_media);
+    message-&gt;data.start_media.conference_id = conference_id;
+    message-&gt;data.start_media.pass_thru_party_id = pass_thru_party_id;
+    message-&gt;data.start_media.remote_ip = remote_ip;
+    message-&gt;data.start_media.remote_port = remote_port;
+    message-&gt;data.start_media.ms_per_packet = ms_per_packet;
+    message-&gt;data.start_media.payload_capacity = payload_capacity;
+    message-&gt;data.start_media.precedence = precedence;
+    message-&gt;data.start_media.silence_suppression = silence_suppression;
+    message-&gt;data.start_media.max_frames_per_packet = max_frames_per_packet;
+    message-&gt;data.start_media.g723_bitrate = g723_bitrate;
+    /* ... */
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t stop_media_transmission(listener_t *listener,
</span><del>-        uint32_t conference_id,
-        uint32_t pass_thru_party_id,
-        uint32_t conference_id2)
</del><ins>+    uint32_t conference_id,
+    uint32_t pass_thru_party_id,
+    uint32_t conference_id2)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.stop_media));
-        message-&gt;type = STOP_MEDIA_TRANSMISSION_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.stop_media);
-        message-&gt;data.stop_media.conference_id = conference_id;
-        message-&gt;data.stop_media.pass_thru_party_id = pass_thru_party_id;
-        message-&gt;data.stop_media.conference_id2 = conference_id2;
-        /* ... */
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.stop_media));
+    message-&gt;type = STOP_MEDIA_TRANSMISSION_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.stop_media);
+    message-&gt;data.stop_media.conference_id = conference_id;
+    message-&gt;data.stop_media.pass_thru_party_id = pass_thru_party_id;
+    message-&gt;data.stop_media.conference_id2 = conference_id2;
+    /* ... */
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t send_call_info(listener_t *listener,
</span><del>-        char calling_party_name[40],
-        char calling_party[24],
-        char called_party_name[40],
-        char called_party[24],
-        uint32_t line_instance,
-        uint32_t call_id,
-        uint32_t call_type,
-        char original_called_party_name[40],
-        char original_called_party[24],
-        char last_redirecting_party_name[40],
-        char last_redirecting_party[24],
-        uint32_t original_called_party_redirect_reason,
-        uint32_t last_redirecting_reason,
-        char calling_party_voice_mailbox[24],
-        char called_party_voice_mailbox[24],
-        char original_called_party_voice_mailbox[24],
-        char last_redirecting_voice_mailbox[24],
-        uint32_t call_instance,
-        uint32_t call_security_status,
-        uint32_t party_pi_restriction_bits)
</del><ins>+    char calling_party_name[40],
+    char calling_party[24],
+    char called_party_name[40],
+    char called_party[24],
+    uint32_t line_instance,
+    uint32_t call_id,
+    uint32_t call_type,
+    char original_called_party_name[40],
+    char original_called_party[24],
+    char last_redirecting_party_name[40],
+    char last_redirecting_party[24],
+    uint32_t original_called_party_redirect_reason,
+    uint32_t last_redirecting_reason,
+    char calling_party_voice_mailbox[24],
+    char called_party_voice_mailbox[24],
+    char original_called_party_voice_mailbox[24],
+    char last_redirecting_voice_mailbox[24],
+    uint32_t call_instance,
+    uint32_t call_security_status,
+    uint32_t party_pi_restriction_bits)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.call_info));
-        message-&gt;type = CALL_INFO_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.call_info);
-        strcpy(message-&gt;data.call_info.calling_party_name, calling_party_name);
-        strcpy(message-&gt;data.call_info.calling_party, calling_party);
-        strcpy(message-&gt;data.call_info.called_party_name, called_party_name);
-        strcpy(message-&gt;data.call_info.called_party, called_party);
-        message-&gt;data.call_info.line_instance = line_instance;
-        message-&gt;data.call_info.call_id = call_id;
-        message-&gt;data.call_info.call_type = call_type;
-        strcpy(message-&gt;data.call_info.original_called_party_name, original_called_party_name);
-        strcpy(message-&gt;data.call_info.original_called_party, original_called_party);
-        strcpy(message-&gt;data.call_info.last_redirecting_party_name, last_redirecting_party_name);
-        strcpy(message-&gt;data.call_info.last_redirecting_party, last_redirecting_party);
-        message-&gt;data.call_info.original_called_party_redirect_reason = original_called_party_redirect_reason;
-        message-&gt;data.call_info.last_redirecting_reason = last_redirecting_reason;
-        strcpy(message-&gt;data.call_info.calling_party_voice_mailbox, calling_party_voice_mailbox);
-        strcpy(message-&gt;data.call_info.called_party_voice_mailbox, called_party_voice_mailbox);
-        strcpy(message-&gt;data.call_info.original_called_party_voice_mailbox, original_called_party_voice_mailbox);
-        strcpy(message-&gt;data.call_info.last_redirecting_voice_mailbox, last_redirecting_voice_mailbox);
-        message-&gt;data.call_info.call_instance = call_instance;
-        message-&gt;data.call_info.call_security_status = call_security_status;
-        message-&gt;data.call_info.party_pi_restriction_bits = party_pi_restriction_bits;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.call_info));
+    message-&gt;type = CALL_INFO_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.call_info);
+    strcpy(message-&gt;data.call_info.calling_party_name, calling_party_name);
+    strcpy(message-&gt;data.call_info.calling_party, calling_party);
+    strcpy(message-&gt;data.call_info.called_party_name, called_party_name);
+    strcpy(message-&gt;data.call_info.called_party, called_party);
+    message-&gt;data.call_info.line_instance = line_instance;
+    message-&gt;data.call_info.call_id = call_id;
+    message-&gt;data.call_info.call_type = call_type;
+    strcpy(message-&gt;data.call_info.original_called_party_name, original_called_party_name);
+    strcpy(message-&gt;data.call_info.original_called_party, original_called_party);
+    strcpy(message-&gt;data.call_info.last_redirecting_party_name, last_redirecting_party_name);
+    strcpy(message-&gt;data.call_info.last_redirecting_party, last_redirecting_party);
+    message-&gt;data.call_info.original_called_party_redirect_reason = original_called_party_redirect_reason;
+    message-&gt;data.call_info.last_redirecting_reason = last_redirecting_reason;
+    strcpy(message-&gt;data.call_info.calling_party_voice_mailbox, calling_party_voice_mailbox);
+    strcpy(message-&gt;data.call_info.called_party_voice_mailbox, called_party_voice_mailbox);
+    strcpy(message-&gt;data.call_info.original_called_party_voice_mailbox, original_called_party_voice_mailbox);
+    strcpy(message-&gt;data.call_info.last_redirecting_voice_mailbox, last_redirecting_voice_mailbox);
+    message-&gt;data.call_info.call_instance = call_instance;
+    message-&gt;data.call_info.call_security_status = call_security_status;
+    message-&gt;data.call_info.party_pi_restriction_bits = party_pi_restriction_bits;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t open_receive_channel(listener_t *listener,
</span><del>-        uint32_t conference_id,
-        uint32_t pass_thru_party_id,
-        uint32_t packets,
-        uint32_t payload_capacity,
-        uint32_t echo_cancel_type,
-        uint32_t g723_bitrate,
-        uint32_t conference_id2,
-        uint32_t reserved[10])
</del><ins>+    uint32_t conference_id,
+    uint32_t pass_thru_party_id,
+    uint32_t packets,
+    uint32_t payload_capacity,
+    uint32_t echo_cancel_type,
+    uint32_t g723_bitrate,
+    uint32_t conference_id2,
+    uint32_t reserved[10])
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.open_receive_channel));
-        message-&gt;type = OPEN_RECEIVE_CHANNEL_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.open_receive_channel);
-        message-&gt;data.open_receive_channel.conference_id = conference_id;
-        message-&gt;data.open_receive_channel.pass_thru_party_id = pass_thru_party_id;
-        message-&gt;data.open_receive_channel.packets = packets;
-        message-&gt;data.open_receive_channel.payload_capacity = payload_capacity;
-        message-&gt;data.open_receive_channel.echo_cancel_type = echo_cancel_type;
-        message-&gt;data.open_receive_channel.g723_bitrate = g723_bitrate;
-        message-&gt;data.open_receive_channel.conference_id2 = conference_id2;
-        /*
-        message-&gt;data.open_receive_channel.reserved[0] = reserved[0];
-        message-&gt;data.open_receive_channel.reserved[1] = reserved[1];
-        message-&gt;data.open_receive_channel.reserved[2] = reserved[2];
-        message-&gt;data.open_receive_channel.reserved[3] = reserved[3];
-        message-&gt;data.open_receive_channel.reserved[4] = reserved[4];
-        message-&gt;data.open_receive_channel.reserved[5] = reserved[5];
-        message-&gt;data.open_receive_channel.reserved[6] = reserved[6];
-        message-&gt;data.open_receive_channel.reserved[7] = reserved[7];
-        message-&gt;data.open_receive_channel.reserved[8] = reserved[8];
-        message-&gt;data.open_receive_channel.reserved[9] = reserved[9];
-        */
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.open_receive_channel));
+    message-&gt;type = OPEN_RECEIVE_CHANNEL_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.open_receive_channel);
+    message-&gt;data.open_receive_channel.conference_id = conference_id;
+    message-&gt;data.open_receive_channel.pass_thru_party_id = pass_thru_party_id;
+    message-&gt;data.open_receive_channel.packets = packets;
+    message-&gt;data.open_receive_channel.payload_capacity = payload_capacity;
+    message-&gt;data.open_receive_channel.echo_cancel_type = echo_cancel_type;
+    message-&gt;data.open_receive_channel.g723_bitrate = g723_bitrate;
+    message-&gt;data.open_receive_channel.conference_id2 = conference_id2;
+    /*
+    message-&gt;data.open_receive_channel.reserved[0] = reserved[0];
+    message-&gt;data.open_receive_channel.reserved[1] = reserved[1];
+    message-&gt;data.open_receive_channel.reserved[2] = reserved[2];
+    message-&gt;data.open_receive_channel.reserved[3] = reserved[3];
+    message-&gt;data.open_receive_channel.reserved[4] = reserved[4];
+    message-&gt;data.open_receive_channel.reserved[5] = reserved[5];
+    message-&gt;data.open_receive_channel.reserved[6] = reserved[6];
+    message-&gt;data.open_receive_channel.reserved[7] = reserved[7];
+    message-&gt;data.open_receive_channel.reserved[8] = reserved[8];
+    message-&gt;data.open_receive_channel.reserved[9] = reserved[9];
+    */
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t close_receive_channel(listener_t *listener,
</span><del>-        uint32_t conference_id,
-        uint32_t pass_thru_party_id,
-        uint32_t conference_id2)
</del><ins>+    uint32_t conference_id,
+    uint32_t pass_thru_party_id,
+    uint32_t conference_id2)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.close_receive_channel));
-        message-&gt;type = CLOSE_RECEIVE_CHANNEL_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.close_receive_channel);
-        message-&gt;data.close_receive_channel.conference_id = conference_id;
-        message-&gt;data.close_receive_channel.pass_thru_party_id = pass_thru_party_id;
-        message-&gt;data.close_receive_channel.conference_id2 = conference_id2;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.close_receive_channel));
+    message-&gt;type = CLOSE_RECEIVE_CHANNEL_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.close_receive_channel);
+    message-&gt;data.close_receive_channel.conference_id = conference_id;
+    message-&gt;data.close_receive_channel.pass_thru_party_id = pass_thru_party_id;
+    message-&gt;data.close_receive_channel.conference_id2 = conference_id2;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t send_select_soft_keys(listener_t *listener,
</span><del>-        uint32_t line_instance,
-        uint32_t call_id,
-        uint32_t soft_key_set,
-        uint32_t valid_key_mask)
</del><ins>+    uint32_t line_instance,
+    uint32_t call_id,
+    uint32_t soft_key_set,
+    uint32_t valid_key_mask)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.select_soft_keys));
-        message-&gt;type = SELECT_SOFT_KEYS_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.select_soft_keys);
-        message-&gt;data.select_soft_keys.line_instance = line_instance;
-        message-&gt;data.select_soft_keys.call_id = call_id;
-        message-&gt;data.select_soft_keys.soft_key_set = soft_key_set;
-        message-&gt;data.select_soft_keys.valid_key_mask = valid_key_mask;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.select_soft_keys));
+    message-&gt;type = SELECT_SOFT_KEYS_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.select_soft_keys);
+    message-&gt;data.select_soft_keys.line_instance = line_instance;
+    message-&gt;data.select_soft_keys.call_id = call_id;
+    message-&gt;data.select_soft_keys.soft_key_set = soft_key_set;
+    message-&gt;data.select_soft_keys.valid_key_mask = valid_key_mask;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t send_call_state(listener_t *listener,
</span><del>-        uint32_t call_state,
-        uint32_t line_instance,
-        uint32_t call_id)
</del><ins>+    uint32_t call_state,
+    uint32_t line_instance,
+    uint32_t call_id)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.call_state));
-        message-&gt;type = CALL_STATE_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.call_state);
-        message-&gt;data.call_state.call_state = call_state;
-        message-&gt;data.call_state.line_instance = line_instance;
-        message-&gt;data.call_state.call_id = call_id;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.call_state));
+    message-&gt;type = CALL_STATE_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.call_state);
+    message-&gt;data.call_state.call_state = call_state;
+    message-&gt;data.call_state.line_instance = line_instance;
+    message-&gt;data.call_state.call_id = call_id;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t display_prompt_status(listener_t *listener,
</span><del>-        uint32_t timeout,
-        char display[32],
-        uint32_t line_instance,
-        uint32_t call_id)
</del><ins>+    uint32_t timeout,
+    char display[32],
+    uint32_t line_instance,
+    uint32_t call_id)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.display_prompt_status));
-        message-&gt;type = DISPLAY_PROMPT_STATUS_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.display_prompt_status);
-        message-&gt;data.display_prompt_status.timeout = timeout;
-        strcpy(message-&gt;data.display_prompt_status.display, display);
-        message-&gt;data.display_prompt_status.line_instance = line_instance;
-        message-&gt;data.display_prompt_status.call_id = call_id;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.display_prompt_status));
+    message-&gt;type = DISPLAY_PROMPT_STATUS_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.display_prompt_status);
+    message-&gt;data.display_prompt_status.timeout = timeout;
+    strcpy(message-&gt;data.display_prompt_status.display, display);
+    message-&gt;data.display_prompt_status.line_instance = line_instance;
+    message-&gt;data.display_prompt_status.call_id = call_id;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t clear_prompt_status(listener_t *listener,
</span><del>-        uint32_t line_instance,
-        uint32_t call_id)
</del><ins>+    uint32_t line_instance,
+    uint32_t call_id)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.clear_prompt_status));
-        message-&gt;type = CLEAR_PROMPT_STATUS_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.clear_prompt_status);
-        message-&gt;data.clear_prompt_status.line_instance = line_instance;
-        message-&gt;data.clear_prompt_status.call_id = call_id;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.clear_prompt_status));
+    message-&gt;type = CLEAR_PROMPT_STATUS_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.clear_prompt_status);
+    message-&gt;data.clear_prompt_status.line_instance = line_instance;
+    message-&gt;data.clear_prompt_status.call_id = call_id;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t activate_call_plane(listener_t *listener,
</span><del>-        uint32_t line_instance)
</del><ins>+    uint32_t line_instance)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.activate_call_plane));
-        message-&gt;type = ACTIVATE_CALL_PLANE_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.activate_call_plane);
-        message-&gt;data.activate_call_plane.line_instance = line_instance;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.activate_call_plane));
+    message-&gt;type = ACTIVATE_CALL_PLANE_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.activate_call_plane);
+    message-&gt;data.activate_call_plane.line_instance = line_instance;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t send_dialed_number(listener_t *listener,
</span><del>-        char called_party[24],
-        uint32_t line_instance,
-        uint32_t call_id)
</del><ins>+    char called_party[24],
+    uint32_t line_instance,
+    uint32_t call_id)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.dialed_number));
-        message-&gt;type = DIALED_NUMBER_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.dialed_number);
-        strcpy(message-&gt;data.dialed_number.called_party, called_party);
-        message-&gt;data.dialed_number.line_instance = line_instance;
-        message-&gt;data.dialed_number.call_id = call_id;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.dialed_number));
+    message-&gt;type = DIALED_NUMBER_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.dialed_number);
+    strcpy(message-&gt;data.dialed_number.called_party, called_party);
+    message-&gt;data.dialed_number.line_instance = line_instance;
+    message-&gt;data.dialed_number.call_id = call_id;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t send_display_pri_notify(listener_t *listener,
</span><del>-        uint32_t message_timeout,
-        uint32_t priority,
-        char *notify)
</del><ins>+    uint32_t message_timeout,
+    uint32_t priority,
+    char *notify)
</ins><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.display_pri_notify));
-        message-&gt;type = DISPLAY_PRI_NOTIFY_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.display_pri_notify);
-        message-&gt;data.display_pri_notify.message_timeout = message_timeout;
-        message-&gt;data.display_pri_notify.priority = priority;
-        strncpy(message-&gt;data.display_pri_notify.notify, notify, 32);
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.display_pri_notify));
+    message-&gt;type = DISPLAY_PRI_NOTIFY_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.display_pri_notify);
+    message-&gt;data.display_pri_notify.message_timeout = message_timeout;
+    message-&gt;data.display_pri_notify.priority = priority;
+    strncpy(message-&gt;data.display_pri_notify.notify, notify, 32);
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> switch_status_t send_reset(listener_t *listener, uint32_t reset_type)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.reset));
-        message-&gt;type = RESET_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.reset);
-        message-&gt;data.reset.reset_type = reset_type;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.reset));
+    message-&gt;type = RESET_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.reset);
+    message-&gt;data.reset.reset_type = reset_type;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /* Message handling */
</span><span class="cx"> switch_status_t skinny_handle_alarm(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        switch_event_t *event = NULL;
</del><ins>+    switch_event_t *event = NULL;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.alarm));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.alarm));
</ins><span class="cx"> 
</span><del>-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-                &quot;Received alarm: Severity=%d, DisplayMessage=%s, Param1=%d, Param2=%d.\n&quot;,
-                request-&gt;data.alarm.alarm_severity, request-&gt;data.alarm.display_message,
-                request-&gt;data.alarm.alarm_param1, request-&gt;data.alarm.alarm_param2);
-        /* skinny::alarm event */
-        skinny_device_event(listener, &amp;event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_ALARM);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Alarm-Severity&quot;, &quot;%d&quot;, request-&gt;data.alarm.alarm_severity);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Alarm-DisplayMessage&quot;, &quot;%s&quot;, request-&gt;data.alarm.display_message);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Alarm-Param1&quot;, &quot;%d&quot;, request-&gt;data.alarm.alarm_param1);
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Alarm-Param2&quot;, &quot;%d&quot;, request-&gt;data.alarm.alarm_param2);
-        switch_event_fire(&amp;event);
-        
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
+            &quot;Received alarm: Severity=%d, DisplayMessage=%s, Param1=%d, Param2=%d.\n&quot;,
+            request-&gt;data.alarm.alarm_severity, request-&gt;data.alarm.display_message,
+            request-&gt;data.alarm.alarm_param1, request-&gt;data.alarm.alarm_param2);
+    /* skinny::alarm event */
+    skinny_device_event(listener, &amp;event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_ALARM);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Alarm-Severity&quot;, &quot;%d&quot;, request-&gt;data.alarm.alarm_severity);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Alarm-DisplayMessage&quot;, &quot;%s&quot;, request-&gt;data.alarm.display_message);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Alarm-Param1&quot;, &quot;%d&quot;, request-&gt;data.alarm.alarm_param1);
+    switch_event_add_header(event, SWITCH_STACK_BOTTOM, &quot;Skinny-Alarm-Param2&quot;, &quot;%d&quot;, request-&gt;data.alarm.alarm_param2);
+    switch_event_fire(&amp;event);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        switch_status_t status = SWITCH_STATUS_FALSE;
-        skinny_message_t *message;
-        skinny_profile_t *profile;
-        switch_event_t *event = NULL;
-        switch_event_t *params = NULL;
-        switch_xml_t xroot, xdomain, xgroup, xuser, xskinny, xbuttons, xbutton;
-        char *sql;
-        assert(listener-&gt;profile);
-        profile = listener-&gt;profile;
</del><ins>+    switch_status_t status = SWITCH_STATUS_FALSE;
+    skinny_message_t *message;
+    skinny_profile_t *profile;
+    switch_event_t *event = NULL;
+    switch_event_t *params = NULL;
+    switch_xml_t xroot, xdomain, xgroup, xuser, xskinny, xbuttons, xbutton;
+    char *sql;
+    assert(listener-&gt;profile);
+    profile = listener-&gt;profile;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.reg));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.reg));
</ins><span class="cx"> 
</span><del>-        if(!zstr(listener-&gt;device_name)) {
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                        &quot;A device is already registred on this listener.\n&quot;);
-                message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.reg_rej));
-                message-&gt;type = REGISTER_REJ_MESSAGE;
-                message-&gt;length = 4 + sizeof(message-&gt;data.reg_rej);
-                strcpy(message-&gt;data.reg_rej.error, &quot;A device is already registred on this listener&quot;);
-                skinny_send_reply(listener, message);
-                return SWITCH_STATUS_FALSE;
-        }
</del><ins>+    if(!zstr(listener-&gt;device_name)) {
+            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+                    &quot;A device is already registred on this listener.\n&quot;);
+            message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.reg_rej));
+            message-&gt;type = REGISTER_REJ_MESSAGE;
+            message-&gt;length = 4 + sizeof(message-&gt;data.reg_rej);
+            strcpy(message-&gt;data.reg_rej.error, &quot;A device is already registred on this listener&quot;);
+            skinny_send_reply(listener, message);
+            return SWITCH_STATUS_FALSE;
+    }
</ins><span class="cx"> 
</span><del>-        /* Check directory */
-        skinny_device_event(listener, &amp;params, SWITCH_EVENT_REQUEST_PARAMS, SWITCH_EVENT_SUBCLASS_ANY);
-        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, &quot;action&quot;, &quot;skinny-auth&quot;);
</del><ins>+    /* Check directory */
+    skinny_device_event(listener, &amp;params, SWITCH_EVENT_REQUEST_PARAMS, SWITCH_EVENT_SUBCLASS_ANY);
+    switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, &quot;action&quot;, &quot;skinny-auth&quot;);
</ins><span class="cx"> 
</span><del>-        if (switch_xml_locate_user(&quot;id&quot;, request-&gt;data.reg.device_name, profile-&gt;domain, &quot;&quot;, &amp;xroot, &amp;xdomain, &amp;xuser, &amp;xgroup, params) != SWITCH_STATUS_SUCCESS) {
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;Can't find device [%s@%s]\n&quot;
-                                          &quot;You must define a domain called '%s' in your directory and add a user with id=\&quot;%s\&quot;.\n&quot;
-                                          , request-&gt;data.reg.device_name, profile-&gt;domain, profile-&gt;domain, request-&gt;data.reg.device_name);
-                message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.reg_rej));
-                message-&gt;type = REGISTER_REJ_MESSAGE;
-                message-&gt;length = 4 + sizeof(message-&gt;data.reg_rej);
-                strcpy(message-&gt;data.reg_rej.error, &quot;Device not found&quot;);
-                skinny_send_reply(listener, message);
-                status =  SWITCH_STATUS_FALSE;
-                goto end;
-        }
</del><ins>+    if (switch_xml_locate_user(&quot;id&quot;, request-&gt;data.reg.device_name, profile-&gt;domain, &quot;&quot;, &amp;xroot, &amp;xdomain, &amp;xuser, &amp;xgroup, params) != SWITCH_STATUS_SUCCESS) {
+            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;Can't find device [%s@%s]\n&quot;
+                                      &quot;You must define a domain called '%s' in your directory and add a user with id=\&quot;%s\&quot;.\n&quot;
+                                      , request-&gt;data.reg.device_name, profile-&gt;domain, profile-&gt;domain, request-&gt;data.reg.device_name);
+            message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.reg_rej));
+            message-&gt;type = REGISTER_REJ_MESSAGE;
+            message-&gt;length = 4 + sizeof(message-&gt;data.reg_rej);
+            strcpy(message-&gt;data.reg_rej.error, &quot;Device not found&quot;);
+            skinny_send_reply(listener, message);
+            status =  SWITCH_STATUS_FALSE;
+            goto end;
+    }
</ins><span class="cx"> 
</span><del>-        if ((sql = switch_mprintf(
-                        &quot;INSERT INTO skinny_devices &quot;
-                                &quot;(name, user_id, instance, ip, type, max_streams, codec_string) &quot;
-                                &quot;VALUES ('%s','%d','%d', '%s', '%d', '%d', '%s')&quot;,
-                        request-&gt;data.reg.device_name,
-                        request-&gt;data.reg.user_id,
-                        request-&gt;data.reg.instance,
-                        inet_ntoa(request-&gt;data.reg.ip),
-                        request-&gt;data.reg.device_type,
-                        request-&gt;data.reg.max_streams,
-                        &quot;&quot; /* codec_string */
-                        ))) {
-                skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
-                switch_safe_free(sql);
-        }
</del><ins>+    if ((sql = switch_mprintf(
+                    &quot;INSERT INTO skinny_devices &quot;
+                            &quot;(name, user_id, instance, ip, type, max_streams, codec_string) &quot;
+                            &quot;VALUES ('%s','%d','%d', '%s', '%d', '%d', '%s')&quot;,
+                    request-&gt;data.reg.device_name,
+                    request-&gt;data.reg.user_id,
+                    request-&gt;data.reg.instance,
+                    inet_ntoa(request-&gt;data.reg.ip),
+                    request-&gt;data.reg.device_type,
+                    request-&gt;data.reg.max_streams,
+                    &quot;&quot; /* codec_string */
+                    ))) {
+            skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
+            switch_safe_free(sql);
+    }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-        strcpy(listener-&gt;device_name, request-&gt;data.reg.device_name);
-        listener-&gt;device_instance = request-&gt;data.reg.instance;
</del><ins>+    strcpy(listener-&gt;device_name, request-&gt;data.reg.device_name);
+    listener-&gt;device_instance = request-&gt;data.reg.instance;
</ins><span class="cx"> 
</span><del>-        xskinny = switch_xml_child(xuser, &quot;skinny&quot;);
-        if (xskinny) {
-                xbuttons = switch_xml_child(xskinny, &quot;buttons&quot;);
-                if (xbuttons) {
-                        uint32_t line_instance = 1;
-                        for (xbutton = switch_xml_child(xbuttons, &quot;button&quot;); xbutton; xbutton = xbutton-&gt;next) {
-                                uint32_t position = atoi(switch_xml_attr_soft(xbutton, &quot;position&quot;));
-                                uint32_t type = skinny_str2button(switch_xml_attr_soft(xbutton, &quot;type&quot;));
-                                const char *label = switch_xml_attr_soft(xbutton, &quot;label&quot;);
-                                const char *value = switch_xml_attr_soft(xbutton, &quot;value&quot;);
-                                if(type ==  SKINNY_BUTTON_LINE) {
-                                        const char *caller_name = switch_xml_attr_soft(xbutton, &quot;caller-name&quot;);
-                                        uint32_t ring_on_idle = atoi(switch_xml_attr_soft(xbutton, &quot;ring-on-idle&quot;));
-                                        uint32_t ring_on_active = atoi(switch_xml_attr_soft(xbutton, &quot;ring-on-active&quot;));
-                                        uint32_t busy_trigger = atoi(switch_xml_attr_soft(xbutton, &quot;busy-trigger&quot;));
-                                        const char *forward_all = switch_xml_attr_soft(xbutton, &quot;forward-all&quot;);
-                                        const char *forward_busy = switch_xml_attr_soft(xbutton, &quot;forward-busy&quot;);
-                                        const char *forward_noanswer = switch_xml_attr_soft(xbutton, &quot;forward-noanswer&quot;);
-                                        uint32_t noanswer_duration = atoi(switch_xml_attr_soft(xbutton, &quot;noanswer-duration&quot;));
-                                        if ((sql = switch_mprintf(
-                                                        &quot;INSERT INTO skinny_lines &quot;
-                                                                &quot;(device_name, device_instance, position, line_instance, &quot;
-                                                                &quot;label, value, caller_name, &quot;
-                                                                &quot;ring_on_idle, ring_on_active, busy_trigger, &quot;
</del><ins>+    xskinny = switch_xml_child(xuser, &quot;skinny&quot;);
+    if (xskinny) {
+            xbuttons = switch_xml_child(xskinny, &quot;buttons&quot;);
+            if (xbuttons) {
+                    uint32_t line_instance = 1;
+                    for (xbutton = switch_xml_child(xbuttons, &quot;button&quot;); xbutton; xbutton = xbutton-&gt;next) {
+                            uint32_t position = atoi(switch_xml_attr_soft(xbutton, &quot;position&quot;));
+                            uint32_t type = skinny_str2button(switch_xml_attr_soft(xbutton, &quot;type&quot;));
+                            const char *label = switch_xml_attr_soft(xbutton, &quot;label&quot;);
+                            const char *value = switch_xml_attr_soft(xbutton, &quot;value&quot;);
+                            if(type ==  SKINNY_BUTTON_LINE) {
+                                    const char *caller_name = switch_xml_attr_soft(xbutton, &quot;caller-name&quot;);
+                                    uint32_t ring_on_idle = atoi(switch_xml_attr_soft(xbutton, &quot;ring-on-idle&quot;));
+                                    uint32_t ring_on_active = atoi(switch_xml_attr_soft(xbutton, &quot;ring-on-active&quot;));
+                                    uint32_t busy_trigger = atoi(switch_xml_attr_soft(xbutton, &quot;busy-trigger&quot;));
+                                    const char *forward_all = switch_xml_attr_soft(xbutton, &quot;forward-all&quot;);
+                                    const char *forward_busy = switch_xml_attr_soft(xbutton, &quot;forward-busy&quot;);
+                                    const char *forward_noanswer = switch_xml_attr_soft(xbutton, &quot;forward-noanswer&quot;);
+                                    uint32_t noanswer_duration = atoi(switch_xml_attr_soft(xbutton, &quot;noanswer-duration&quot;));
+                                    if ((sql = switch_mprintf(
+                                                    &quot;INSERT INTO skinny_lines &quot;
+                                                            &quot;(device_name, device_instance, position, line_instance, &quot;
+                                                            &quot;label, value, caller_name, &quot;
+                                                            &quot;ring_on_idle, ring_on_active, busy_trigger, &quot;
</ins><span class="cx">                                                               &quot;forward_all, forward_busy, forward_noanswer, noanswer_duration) &quot;
</span><del>-                                                                &quot;VALUES('%s', %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s', '%s', %d)&quot;,
-                                                        request-&gt;data.reg.device_name, request-&gt;data.reg.instance, position, line_instance++,
-                                                        label, value, caller_name,
-                                                        ring_on_idle, ring_on_active, busy_trigger,
</del><ins>+                                                            &quot;VALUES('%s', %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s', '%s', %d)&quot;,
+                                                    request-&gt;data.reg.device_name, request-&gt;data.reg.instance, position, line_instance++,
+                                                    label, value, caller_name,
+                                                    ring_on_idle, ring_on_active, busy_trigger,
</ins><span class="cx">                                                       forward_all, forward_busy, forward_noanswer, noanswer_duration))) {
</span><del>-                                                skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
-                                                switch_safe_free(sql);
-                                        }
-                                } else {
-                                        const char *settings = switch_xml_attr_soft(xbutton, &quot;settings&quot;);
-                                        if ((sql = switch_mprintf(
-                                                        &quot;INSERT INTO skinny_buttons &quot;
-                                                                &quot;(device_name, device_instance, position, type, label, value, settings) &quot;
-                                                                &quot;VALUES('%s', %d, %d, %d, '%s', '%s', '%s')&quot;,
-                                                        request-&gt;data.reg.device_name,
-                                                        request-&gt;data.reg.instance,
-                                                        position,
-                                                        type,
-                                                        label,
-                                                        value,
-                                                        settings))) {
-                                                skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
-                                                switch_safe_free(sql);
-                                        }
-                                }
-                        }
-                }
-        }
</del><ins>+                                            skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
+                                            switch_safe_free(sql);
+                                    }
+                            } else {
+                                    const char *settings = switch_xml_attr_soft(xbutton, &quot;settings&quot;);
+                                    if ((sql = switch_mprintf(
+                                                    &quot;INSERT INTO skinny_buttons &quot;
+                                                            &quot;(device_name, device_instance, position, type, label, value, settings) &quot;
+                                                            &quot;VALUES('%s', %d, %d, %d, '%s', '%s', '%s')&quot;,
+                                                    request-&gt;data.reg.device_name,
+                                                    request-&gt;data.reg.instance,
+                                                    position,
+                                                    type,
+                                                    label,
+                                                    value,
+                                                    settings))) {
+                                            skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
+                                            switch_safe_free(sql);
+                                    }
+                            }
+                    }
+            }
+    }
</ins><span class="cx"> 
</span><del>-        status = SWITCH_STATUS_SUCCESS;
</del><ins>+    status = SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> 
</span><del>-        /* Reply with RegisterAckMessage */
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.reg_ack));
-        message-&gt;type = REGISTER_ACK_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.reg_ack);
-        message-&gt;data.reg_ack.keep_alive = profile-&gt;keep_alive;
-        memcpy(message-&gt;data.reg_ack.date_format, profile-&gt;date_format, 6);
-        message-&gt;data.reg_ack.secondary_keep_alive = profile-&gt;keep_alive;
-        skinny_send_reply(listener, message);
</del><ins>+    /* Reply with RegisterAckMessage */
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.reg_ack));
+    message-&gt;type = REGISTER_ACK_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.reg_ack);
+    message-&gt;data.reg_ack.keep_alive = profile-&gt;keep_alive;
+    memcpy(message-&gt;data.reg_ack.date_format, profile-&gt;date_format, 6);
+    message-&gt;data.reg_ack.secondary_keep_alive = profile-&gt;keep_alive;
+    skinny_send_reply(listener, message);
</ins><span class="cx"> 
</span><del>-        /* Send CapabilitiesReqMessage */
-        message = switch_core_alloc(listener-&gt;pool, 12);
-        message-&gt;type = CAPABILITIES_REQ_MESSAGE;
-        message-&gt;length = 4;
-        skinny_send_reply(listener, message);
</del><ins>+    /* Send CapabilitiesReqMessage */
+    message = switch_core_alloc(listener-&gt;pool, 12);
+    message-&gt;type = CAPABILITIES_REQ_MESSAGE;
+    message-&gt;length = 4;
+    skinny_send_reply(listener, message);
</ins><span class="cx"> 
</span><del>-        /* skinny::register event */
-        skinny_device_event(listener, &amp;event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_REGISTER);
-        switch_event_fire(&amp;event);
-        
-        keepalive_listener(listener, NULL);
</del><ins>+    /* skinny::register event */
+    skinny_device_event(listener, &amp;event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_REGISTER);
+    switch_event_fire(&amp;event);
</ins><span class="cx"> 
</span><ins>+    keepalive_listener(listener, NULL);
+
</ins><span class="cx"> end:
</span><del>-        if(params) {
-                switch_event_destroy(&amp;params);
-        }
-        
-        return status;
</del><ins>+    if(params) {
+            switch_event_destroy(&amp;params);
+    }
+
+    return status;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_headset_status_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.headset_status));
-        
-        /* Nothing to do */
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.headset_status));
+
+    /* Nothing to do */
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int skinny_config_stat_res_callback(void *pArg, int argc, char **argv, char **columnNames)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message = pArg;
-        char *device_name = argv[0];
-        int user_id = atoi(argv[1]);
-        int instance = atoi(argv[2]);
-        char *user_name = argv[3];
-        char *server_name = argv[4];
-        int number_lines = atoi(argv[5]);
-        int number_speed_dials = atoi(argv[6]);
-        
-        strcpy(message-&gt;data.config_res.device_name, device_name);
-        message-&gt;data.config_res.user_id = user_id;
-        message-&gt;data.config_res.instance = instance;
-        strcpy(message-&gt;data.config_res.user_name, user_name);
-        strcpy(message-&gt;data.config_res.server_name, server_name);
-        message-&gt;data.config_res.number_lines = number_lines;
-        message-&gt;data.config_res.number_speed_dials = number_speed_dials;
</del><ins>+    skinny_message_t *message = pArg;
+    char *device_name = argv[0];
+    int user_id = atoi(argv[1]);
+    int instance = atoi(argv[2]);
+    char *user_name = argv[3];
+    char *server_name = argv[4];
+    int number_lines = atoi(argv[5]);
+    int number_speed_dials = atoi(argv[6]);
</ins><span class="cx"> 
</span><del>-        return 0;
</del><ins>+    strcpy(message-&gt;data.config_res.device_name, device_name);
+    message-&gt;data.config_res.user_id = user_id;
+    message-&gt;data.config_res.instance = instance;
+    strcpy(message-&gt;data.config_res.user_name, user_name);
+    strcpy(message-&gt;data.config_res.server_name, server_name);
+    message-&gt;data.config_res.number_lines = number_lines;
+    message-&gt;data.config_res.number_speed_dials = number_speed_dials;
+
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_config_stat_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        char *sql;
-        skinny_message_t *message;
-        skinny_profile_t *profile;
</del><ins>+    char *sql;
+    skinny_message_t *message;
+    skinny_profile_t *profile;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        profile = listener-&gt;profile;
</del><ins>+    profile = listener-&gt;profile;
</ins><span class="cx"> 
</span><del>-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.config_res));
-        message-&gt;type = CONFIG_STAT_RES_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.config_res);
</del><ins>+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.config_res));
+    message-&gt;type = CONFIG_STAT_RES_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.config_res);
</ins><span class="cx"> 
</span><del>-        if ((sql = switch_mprintf(
-                        &quot;SELECT name, user_id, instance, '' AS user_name, '' AS server_name, &quot;
-                                &quot;(SELECT COUNT(*) FROM skinny_lines WHERE device_name='%s' AND device_instance=%d) AS number_lines, &quot;
-                                &quot;(SELECT COUNT(*) FROM skinny_buttons WHERE device_name='%s' AND device_instance=%d AND type=%d) AS number_speed_dials &quot;
-                                &quot;FROM skinny_devices WHERE name='%s' &quot;,
-                        listener-&gt;device_name,
-                        listener-&gt;device_instance,
-                        listener-&gt;device_name,
-                        listener-&gt;device_instance,
-                        SKINNY_BUTTON_SPEED_DIAL,
-                        listener-&gt;device_name
-                        ))) {
-                skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, skinny_config_stat_res_callback, message);
-                switch_safe_free(sql);
-        }
-        skinny_send_reply(listener, message);
</del><ins>+    if ((sql = switch_mprintf(
+                    &quot;SELECT name, user_id, instance, '' AS user_name, '' AS server_name, &quot;
+                            &quot;(SELECT COUNT(*) FROM skinny_lines WHERE device_name='%s' AND device_instance=%d) AS number_lines, &quot;
+                            &quot;(SELECT COUNT(*) FROM skinny_buttons WHERE device_name='%s' AND device_instance=%d AND type=%d) AS number_speed_dials &quot;
+                            &quot;FROM skinny_devices WHERE name='%s' &quot;,
+                    listener-&gt;device_name,
+                    listener-&gt;device_instance,
+                    listener-&gt;device_name,
+                    listener-&gt;device_instance,
+                    SKINNY_BUTTON_SPEED_DIAL,
+                    listener-&gt;device_name
+                    ))) {
+            skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, skinny_config_stat_res_callback, message);
+            switch_safe_free(sql);
+    }
+    skinny_send_reply(listener, message);
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_capabilities_response(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        char *sql;
-        skinny_profile_t *profile;
</del><ins>+    char *sql;
+    skinny_profile_t *profile;
</ins><span class="cx"> 
</span><del>-        uint32_t i = 0;
-        uint32_t n = 0;
-        char *codec_order[SWITCH_MAX_CODECS];
-        char *codec_string;
-        
-        size_t string_len, string_pos, pos;
</del><ins>+    uint32_t i = 0;
+    uint32_t n = 0;
+    char *codec_order[SWITCH_MAX_CODECS];
+    char *codec_string;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    size_t string_len, string_pos, pos;
</ins><span class="cx"> 
</span><del>-        profile = listener-&gt;profile;
</del><ins>+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.cap_res.count));
</del><ins>+    profile = listener-&gt;profile;
</ins><span class="cx"> 
</span><del>-        n = request-&gt;data.cap_res.count;
-        if (n &gt; SWITCH_MAX_CODECS) {
-                n = SWITCH_MAX_CODECS;
-        }
-        string_len = -1;
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.cap_res.count));
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.cap_res.count) + n * sizeof(request-&gt;data.cap_res.caps[0]));
</del><ins>+    n = request-&gt;data.cap_res.count;
+    if (n &gt; SWITCH_MAX_CODECS) {
+            n = SWITCH_MAX_CODECS;
+    }
+    string_len = -1;
</ins><span class="cx"> 
</span><del>-        for (i = 0; i &lt; n; i++) {
-                char *codec = skinny_codec2string(request-&gt;data.cap_res.caps[i].codec);
-                codec_order[i] = codec;
-                string_len += strlen(codec)+1;
-        }
-        i = 0;
-        pos = 0;
-        codec_string = switch_core_alloc(listener-&gt;pool, string_len+1);
-        for (string_pos = 0; string_pos &lt; string_len; string_pos++) {
-                char *codec = codec_order[i];
-                switch_assert(i &lt; n);
-                if(pos == strlen(codec)) {
-                        codec_string[string_pos] = ',';
-                        i++;
-                        pos = 0;
-                } else {
-                        codec_string[string_pos] = codec[pos++];
-                }
-        }
-        codec_string[string_len] = '\0';
-        if ((sql = switch_mprintf(
-                        &quot;UPDATE skinny_devices SET codec_string='%s' WHERE name='%s'&quot;,
-                        codec_string,
-                        listener-&gt;device_name
-                        ))) {
-                skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
-                switch_safe_free(sql);
-        }
-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
-                &quot;Codecs %s supported.\n&quot;, codec_string);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.cap_res.count) + n * sizeof(request-&gt;data.cap_res.caps[0]));
+
+    for (i = 0; i &lt; n; i++) {
+            char *codec = skinny_codec2string(request-&gt;data.cap_res.caps[i].codec);
+            codec_order[i] = codec;
+            string_len += strlen(codec)+1;
+    }
+    i = 0;
+    pos = 0;
+    codec_string = switch_core_alloc(listener-&gt;pool, string_len+1);
+    for (string_pos = 0; string_pos &lt; string_len; string_pos++) {
+            char *codec = codec_order[i];
+            switch_assert(i &lt; n);
+            if(pos == strlen(codec)) {
+                    codec_string[string_pos] = ',';
+                    i++;
+                    pos = 0;
+            } else {
+                    codec_string[string_pos] = codec[pos++];
+            }
+    }
+    codec_string[string_len] = '\0';
+    if ((sql = switch_mprintf(
+                    &quot;UPDATE skinny_devices SET codec_string='%s' WHERE name='%s'&quot;,
+                    codec_string,
+                    listener-&gt;device_name
+                    ))) {
+            skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
+            switch_safe_free(sql);
+    }
+    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+            &quot;Codecs %s supported.\n&quot;, codec_string);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_port_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        char *sql;
-        skinny_profile_t *profile;
</del><ins>+    char *sql;
+    skinny_profile_t *profile;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        profile = listener-&gt;profile;
</del><ins>+    profile = listener-&gt;profile;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.as_uint16));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.as_uint16));
</ins><span class="cx"> 
</span><del>-        if ((sql = switch_mprintf(
-                        &quot;UPDATE skinny_devices SET port=%d WHERE name='%s' and instance=%d&quot;,
-                        request-&gt;data.port.port,
-                        listener-&gt;device_name,
-                        listener-&gt;device_instance
-                        ))) {
-                skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
-                switch_safe_free(sql);
-        }
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    if ((sql = switch_mprintf(
+                    &quot;UPDATE skinny_devices SET port=%d WHERE name='%s' and instance=%d&quot;,
+                    request-&gt;data.port.port,
+                    listener-&gt;device_name,
+                    listener-&gt;device_instance
+                    ))) {
+            skinny_execute_sql(profile, sql, profile-&gt;sql_mutex);
+            switch_safe_free(sql);
+    }
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> struct button_template_helper {
</span><del>-        skinny_message_t *message;
-        int count[SKINNY_BUTTON_UNDEFINED+1];
-        int max_position;
</del><ins>+    skinny_message_t *message;
+    int count[SKINNY_BUTTON_UNDEFINED+1];
+    int max_position;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> int skinny_handle_button_template_request_callback(void *pArg, int argc, char **argv, char **columnNames)
</span><span class="cx"> {
</span><del>-        struct button_template_helper *helper = pArg;
-        skinny_message_t *message = helper-&gt;message;
-        /* char *device_name = argv[0]; */
-        /* uint32_t device_instance = argv[1]; */
-        int position = atoi(argv[2]);
-        uint32_t type = atoi(argv[3]);
-        /* int relative_position = atoi(argv[4]); */
</del><ins>+    struct button_template_helper *helper = pArg;
+    skinny_message_t *message = helper-&gt;message;
+    /* char *device_name = argv[0]; */
+    /* uint32_t device_instance = argv[1]; */
+    int position = atoi(argv[2]);
+    uint32_t type = atoi(argv[3]);
+    /* int relative_position = atoi(argv[4]); */
</ins><span class="cx"> 
</span><del>-        message-&gt;data.button_template.btn[position-1].instance_number = ++helper-&gt;count[type];
-        message-&gt;data.button_template.btn[position-1].button_definition = type;
</del><ins>+    message-&gt;data.button_template.btn[position-1].instance_number = ++helper-&gt;count[type];
+    message-&gt;data.button_template.btn[position-1].button_definition = type;
</ins><span class="cx"> 
</span><del>-        message-&gt;data.button_template.button_count++;
-        message-&gt;data.button_template.total_button_count++;
-        if(position &gt; helper-&gt;max_position) {
-                helper-&gt;max_position = position;
-        }
</del><ins>+    message-&gt;data.button_template.button_count++;
+    message-&gt;data.button_template.total_button_count++;
+    if(position &gt; helper-&gt;max_position) {
+            helper-&gt;max_position = position;
+    }
</ins><span class="cx"> 
</span><del>-        return 0;
</del><ins>+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_button_template_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        struct button_template_helper helper = {0};
-        skinny_profile_t *profile;
-        char *sql;
</del><ins>+    skinny_message_t *message;
+    struct button_template_helper helper = {0};
+    skinny_profile_t *profile;
+    char *sql;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        profile = listener-&gt;profile;
</del><ins>+    profile = listener-&gt;profile;
</ins><span class="cx"> 
</span><del>-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.button_template));
-        message-&gt;type = BUTTON_TEMPLATE_RES_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.button_template);
</del><ins>+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.button_template));
+    message-&gt;type = BUTTON_TEMPLATE_RES_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.button_template);
</ins><span class="cx"> 
</span><del>-        message-&gt;data.button_template.button_offset = 0;
-        message-&gt;data.button_template.button_count = 0;
-        message-&gt;data.button_template.total_button_count = 0;
-        
-        helper.message = message;
</del><ins>+    message-&gt;data.button_template.button_offset = 0;
+    message-&gt;data.button_template.button_count = 0;
+    message-&gt;data.button_template.total_button_count = 0;
</ins><span class="cx"> 
</span><del>-        /* Add buttons */
-        if ((sql = switch_mprintf(
-                        &quot;SELECT device_name, device_instance, position, MIN(type, %d) AS type &quot;
-                                &quot;FROM skinny_buttons &quot;
-                                &quot;WHERE device_name='%s' AND device_instance=%d &quot;
-                                &quot;ORDER BY position&quot;,
-                        SKINNY_BUTTON_UNDEFINED,
-                        listener-&gt;device_name, listener-&gt;device_instance
-                        ))) {
-                skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, skinny_handle_button_template_request_callback, &amp;helper);
-                switch_safe_free(sql);
-        }
-        
-        /* Add lines */
-        if ((sql = switch_mprintf(
-                        &quot;SELECT device_name, device_instance, position, %d AS type &quot;
-                                &quot;FROM skinny_lines &quot;
-                                &quot;WHERE device_name='%s' AND device_instance=%d &quot;
-                                &quot;ORDER BY position&quot;,
-                        SKINNY_BUTTON_LINE,
-                        listener-&gt;device_name, listener-&gt;device_instance
-                        ))) {
-                skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, skinny_handle_button_template_request_callback, &amp;helper);
-                switch_safe_free(sql);
-        }
-        
-        /* Fill remaining buttons with Undefined */
-        for(int i = 0; i+1 &lt; helper.max_position; i++) {
-                if(message-&gt;data.button_template.btn[i].button_definition == SKINNY_BUTTON_UNKNOWN) {
-                        message-&gt;data.button_template.btn[i].instance_number = ++helper.count[SKINNY_BUTTON_UNDEFINED];
-                        message-&gt;data.button_template.btn[i].button_definition = SKINNY_BUTTON_UNDEFINED;
-                        message-&gt;data.button_template.button_count++;
-                        message-&gt;data.button_template.total_button_count++;
-                }
-        }
</del><ins>+    helper.message = message;
</ins><span class="cx"> 
</span><del>-        skinny_send_reply(listener, message);
</del><ins>+    /* Add buttons */
+    if ((sql = switch_mprintf(
+                    &quot;SELECT device_name, device_instance, position, MIN(type, %d) AS type &quot;
+                            &quot;FROM skinny_buttons &quot;
+                            &quot;WHERE device_name='%s' AND device_instance=%d &quot;
+                            &quot;ORDER BY position&quot;,
+                    SKINNY_BUTTON_UNDEFINED,
+                    listener-&gt;device_name, listener-&gt;device_instance
+                    ))) {
+            skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, skinny_handle_button_template_request_callback, &amp;helper);
+            switch_safe_free(sql);
+    }
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    /* Add lines */
+    if ((sql = switch_mprintf(
+                    &quot;SELECT device_name, device_instance, position, %d AS type &quot;
+                            &quot;FROM skinny_lines &quot;
+                            &quot;WHERE device_name='%s' AND device_instance=%d &quot;
+                            &quot;ORDER BY position&quot;,
+                    SKINNY_BUTTON_LINE,
+                    listener-&gt;device_name, listener-&gt;device_instance
+                    ))) {
+            skinny_execute_sql_callback(profile, profile-&gt;sql_mutex, sql, skinny_handle_button_template_request_callback, &amp;helper);
+            switch_safe_free(sql);
+    }
+
+    /* Fill remaining buttons with Undefined */
+    for(int i = 0; i+1 &lt; helper.max_position; i++) {
+            if(message-&gt;data.button_template.btn[i].button_definition == SKINNY_BUTTON_UNKNOWN) {
+                    message-&gt;data.button_template.btn[i].instance_number = ++helper.count[SKINNY_BUTTON_UNDEFINED];
+                    message-&gt;data.button_template.btn[i].button_definition = SKINNY_BUTTON_UNDEFINED;
+                    message-&gt;data.button_template.button_count++;
+                    message-&gt;data.button_template.total_button_count++;
+            }
+    }
+
+    skinny_send_reply(listener, message);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_soft_key_template_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        skinny_profile_t *profile;
</del><ins>+    skinny_message_t *message;
+    skinny_profile_t *profile;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        profile = listener-&gt;profile;
</del><ins>+    profile = listener-&gt;profile;
</ins><span class="cx"> 
</span><del>-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.soft_key_template));
-        message-&gt;type = SOFT_KEY_TEMPLATE_RES_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.soft_key_template);
</del><ins>+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.soft_key_template));
+    message-&gt;type = SOFT_KEY_TEMPLATE_RES_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.soft_key_template);
</ins><span class="cx"> 
</span><del>-        message-&gt;data.soft_key_template.soft_key_offset = 0;
-        message-&gt;data.soft_key_template.soft_key_count = 21;
-        message-&gt;data.soft_key_template.total_soft_key_count = 21;
-        
-        memcpy(message-&gt;data.soft_key_template.soft_key,
-                soft_key_template_default,
-                sizeof(soft_key_template_default));
-        
-        skinny_send_reply(listener, message);
</del><ins>+    message-&gt;data.soft_key_template.soft_key_offset = 0;
+    message-&gt;data.soft_key_template.soft_key_count = 21;
+    message-&gt;data.soft_key_template.total_soft_key_count = 21;
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    memcpy(message-&gt;data.soft_key_template.soft_key,
+            soft_key_template_default,
+            sizeof(soft_key_template_default));
+
+    skinny_send_reply(listener, message);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_soft_key_set_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        skinny_profile_t *profile;
</del><ins>+    skinny_message_t *message;
+    skinny_profile_t *profile;
</ins><span class="cx"> 
</span><del>-        switch_assert(listener-&gt;profile);
-        switch_assert(listener-&gt;device_name);
</del><ins>+    switch_assert(listener-&gt;profile);
+    switch_assert(listener-&gt;device_name);
</ins><span class="cx"> 
</span><del>-        profile = listener-&gt;profile;
</del><ins>+    profile = listener-&gt;profile;
</ins><span class="cx"> 
</span><del>-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.soft_key_set));
-        message-&gt;type = SOFT_KEY_SET_RES_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.soft_key_set);
</del><ins>+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.soft_key_set));
+    message-&gt;type = SOFT_KEY_SET_RES_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.soft_key_set);
</ins><span class="cx"> 
</span><del>-        message-&gt;data.soft_key_set.soft_key_set_offset = 0;
-        message-&gt;data.soft_key_set.soft_key_set_count = 11;
-        message-&gt;data.soft_key_set.total_soft_key_set_count = 11;
-        
-        /* TODO fill the set */
-        message-&gt;data.soft_key_set.soft_key_set[SKINNY_KEY_SET_ON_HOOK].soft_key_template_index[0] = SOFTKEY_REDIAL;
-        message-&gt;data.soft_key_set.soft_key_set[SKINNY_KEY_SET_ON_HOOK].soft_key_template_index[1] = SOFTKEY_NEWCALL;
-        message-&gt;data.soft_key_set.soft_key_set[SKINNY_KEY_SET_CONNECTED].soft_key_template_index[0] = SOFTKEY_ENDCALL;
-        message-&gt;data.soft_key_set.soft_key_set[SKINNY_KEY_SET_RING_IN].soft_key_template_index[0] = SOFTKEY_ENDCALL;
</del><ins>+    message-&gt;data.soft_key_set.soft_key_set_offset = 0;
+    message-&gt;data.soft_key_set.soft_key_set_count = 11;
+    message-&gt;data.soft_key_set.total_soft_key_set_count = 11;
</ins><span class="cx"> 
</span><del>-        skinny_send_reply(listener, message);
</del><ins>+    /* TODO fill the set */
+    message-&gt;data.soft_key_set.soft_key_set[SKINNY_KEY_SET_ON_HOOK].soft_key_template_index[0] = SOFTKEY_REDIAL;
+    message-&gt;data.soft_key_set.soft_key_set[SKINNY_KEY_SET_ON_HOOK].soft_key_template_index[1] = SOFTKEY_NEWCALL;
+    message-&gt;data.soft_key_set.soft_key_set[SKINNY_KEY_SET_CONNECTED].soft_key_template_index[0] = SOFTKEY_ENDCALL;
+    message-&gt;data.soft_key_set.soft_key_set[SKINNY_KEY_SET_RING_IN].soft_key_template_index[0] = SOFTKEY_ENDCALL;
</ins><span class="cx"> 
</span><del>-        /* Init the states */
</del><ins>+    skinny_send_reply(listener, message);
+
+    /* Init the states */
</ins><span class="cx">     send_select_soft_keys(listener, 0, 0, SKINNY_KEY_SET_ON_HOOK, 0xffff);
</span><del>-        
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_line_stat_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        struct line_stat_res_message *button = NULL;
</del><ins>+    skinny_message_t *message;
+    struct line_stat_res_message *button = NULL;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.line_req));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.line_req));
</ins><span class="cx"> 
</span><del>-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.line_res));
-        message-&gt;type = LINE_STAT_RES_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.line_res);
-        
-        skinny_line_get(listener, request-&gt;data.line_req.number, &amp;button);
</del><ins>+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.line_res));
+    message-&gt;type = LINE_STAT_RES_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.line_res);
</ins><span class="cx"> 
</span><del>-        memcpy(&amp;message-&gt;data.line_res, button, sizeof(struct line_stat_res_message));
</del><ins>+    skinny_line_get(listener, request-&gt;data.line_req.number, &amp;button);
</ins><span class="cx"> 
</span><del>-        skinny_send_reply(listener, message);
</del><ins>+    memcpy(&amp;message-&gt;data.line_res, button, sizeof(struct line_stat_res_message));
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_send_reply(listener, message);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_speed_dial_stat_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        struct speed_dial_stat_res_message *button = NULL;
</del><ins>+    skinny_message_t *message;
+    struct speed_dial_stat_res_message *button = NULL;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.speed_dial_req));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.speed_dial_req));
</ins><span class="cx"> 
</span><del>-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.speed_dial_res));
-        message-&gt;type = SPEED_DIAL_STAT_RES_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.speed_dial_res);
-        
-        skinny_speed_dial_get(listener, request-&gt;data.speed_dial_req.number, &amp;button);
</del><ins>+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.speed_dial_res));
+    message-&gt;type = SPEED_DIAL_STAT_RES_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.speed_dial_res);
</ins><span class="cx"> 
</span><del>-        memcpy(&amp;message-&gt;data.speed_dial_res, button, sizeof(struct speed_dial_stat_res_message));
</del><ins>+    skinny_speed_dial_get(listener, request-&gt;data.speed_dial_req.number, &amp;button);
</ins><span class="cx"> 
</span><del>-        skinny_send_reply(listener, message);
</del><ins>+    memcpy(&amp;message-&gt;data.speed_dial_res, button, sizeof(struct speed_dial_stat_res_message));
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_send_reply(listener, message);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_service_url_stat_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        struct service_url_stat_res_message *button = NULL;
</del><ins>+    skinny_message_t *message;
+    struct service_url_stat_res_message *button = NULL;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.service_url_req));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.service_url_req));
</ins><span class="cx"> 
</span><del>-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.service_url_res));
-        message-&gt;type = SERVICE_URL_STAT_RES_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.service_url_res);
-        
-        skinny_service_url_get(listener, request-&gt;data.service_url_req.service_url_index, &amp;button);
</del><ins>+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.service_url_res));
+    message-&gt;type = SERVICE_URL_STAT_RES_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.service_url_res);
</ins><span class="cx"> 
</span><del>-        memcpy(&amp;message-&gt;data.service_url_res, button, sizeof(struct service_url_stat_res_message));
</del><ins>+    skinny_service_url_get(listener, request-&gt;data.service_url_req.service_url_index, &amp;button);
</ins><span class="cx"> 
</span><del>-        skinny_send_reply(listener, message);
</del><ins>+    memcpy(&amp;message-&gt;data.service_url_res, button, sizeof(struct service_url_stat_res_message));
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_send_reply(listener, message);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_feature_stat_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        struct feature_stat_res_message *button = NULL;
</del><ins>+    skinny_message_t *message;
+    struct feature_stat_res_message *button = NULL;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.feature_req));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.feature_req));
</ins><span class="cx"> 
</span><del>-        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);
</del><ins>+    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);
</ins><span class="cx"> 
</span><del>-        memcpy(&amp;message-&gt;data.feature_res, button, sizeof(struct feature_stat_res_message));
</del><ins>+    skinny_feature_get(listener, request-&gt;data.feature_req.feature_index, &amp;button);
</ins><span class="cx"> 
</span><del>-        skinny_send_reply(listener, message);
</del><ins>+    memcpy(&amp;message-&gt;data.feature_res, button, sizeof(struct feature_stat_res_message));
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_send_reply(listener, message);
+
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_register_available_lines_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.reg_lines));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.reg_lines));
</ins><span class="cx"> 
</span><del>-        /* Do nothing */
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    /* Do nothing */
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_time_date_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
-        switch_time_t ts;
-        switch_time_exp_t tm;
-        
-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.define_time_date));
-        message-&gt;type = DEFINE_TIME_DATE_MESSAGE;
-        message-&gt;length = 4+sizeof(message-&gt;data.define_time_date);
-        ts = switch_micro_time_now();
-        switch_time_exp_lt(&amp;tm, ts);
-        message-&gt;data.define_time_date.year = tm.tm_year + 1900;
-        message-&gt;data.define_time_date.month = tm.tm_mon + 1;
-        message-&gt;data.define_time_date.day_of_week = tm.tm_wday;
-        message-&gt;data.define_time_date.day = tm.tm_yday + 1;
-        message-&gt;data.define_time_date.hour = tm.tm_hour;
-        message-&gt;data.define_time_date.minute = tm.tm_min;
-        message-&gt;data.define_time_date.seconds = tm.tm_sec + 1;
-        message-&gt;data.define_time_date.milliseconds = tm.tm_usec / 1000;
-        message-&gt;data.define_time_date.timestamp = ts / 1000000;
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    skinny_message_t *message;
+    switch_time_t ts;
+    switch_time_exp_t tm;
+
+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.define_time_date));
+    message-&gt;type = DEFINE_TIME_DATE_MESSAGE;
+    message-&gt;length = 4+sizeof(message-&gt;data.define_time_date);
+    ts = switch_micro_time_now();
+    switch_time_exp_lt(&amp;tm, ts);
+    message-&gt;data.define_time_date.year = tm.tm_year + 1900;
+    message-&gt;data.define_time_date.month = tm.tm_mon + 1;
+    message-&gt;data.define_time_date.day_of_week = tm.tm_wday;
+    message-&gt;data.define_time_date.day = tm.tm_yday + 1;
+    message-&gt;data.define_time_date.hour = tm.tm_hour;
+    message-&gt;data.define_time_date.minute = tm.tm_min;
+    message-&gt;data.define_time_date.seconds = tm.tm_sec + 1;
+    message-&gt;data.define_time_date.milliseconds = tm.tm_usec / 1000;
+    message-&gt;data.define_time_date.timestamp = ts / 1000000;
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_keep_alive_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        skinny_message_t *message;
</del><ins>+    skinny_message_t *message;
</ins><span class="cx"> 
</span><del>-        message = switch_core_alloc(listener-&gt;pool, 12);
-        message-&gt;type = KEEP_ALIVE_ACK_MESSAGE;
-        message-&gt;length = 4;
-        keepalive_listener(listener, NULL);
-        skinny_send_reply(listener, message);
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    message = switch_core_alloc(listener-&gt;pool, 12);
+    message-&gt;type = KEEP_ALIVE_ACK_MESSAGE;
+    message-&gt;length = 4;
+    keepalive_listener(listener, NULL);
+    skinny_send_reply(listener, message);
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        switch_status_t status = SWITCH_STATUS_SUCCESS;
-        uint32_t line_instance = 0;
-        switch_core_session_t *session = NULL;
-        switch_channel_t *channel = NULL;
-        private_t *tech_pvt = NULL;
</del><ins>+    switch_status_t status = SWITCH_STATUS_SUCCESS;
+    uint32_t line_instance = 0;
+    switch_core_session_t *session = NULL;
+    switch_channel_t *channel = NULL;
+    private_t *tech_pvt = NULL;
</ins><span class="cx"> 
</span><span class="cx">     switch_assert(listener);
</span><span class="cx">     switch_assert(listener-&gt;profile);
</span><span class="cx">     
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.soft_key_event));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.soft_key_event));
</ins><span class="cx"> 
</span><del>-        line_instance = request-&gt;data.soft_key_event.line_instance;
</del><ins>+    line_instance = request-&gt;data.soft_key_event.line_instance;
</ins><span class="cx"> 
</span><del>-        switch(request-&gt;data.soft_key_event.event) {
-                case SOFTKEY_REDIAL:
-                status = skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
</del><ins>+    switch(request-&gt;data.soft_key_event.event) {
+            case SOFTKEY_REDIAL:
+            status = skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
</ins><span class="cx"> 
</span><del>-                    skinny_session_process_dest(session, listener, line_instance, &quot;redial&quot;, '\0', 0);
-                        break;
-                case SOFTKEY_NEWCALL:
-                status = skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
-                    tech_pvt = switch_core_session_get_private(session);
-                    assert(tech_pvt != NULL);
</del><ins>+                skinny_session_process_dest(session, listener, line_instance, &quot;redial&quot;, '\0', 0);
+                    break;
+            case SOFTKEY_NEWCALL:
+            status = skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
+                tech_pvt = switch_core_session_get_private(session);
+                assert(tech_pvt != NULL);
</ins><span class="cx"> 
</span><del>-                    skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0);
-                        break;
-                case SOFTKEY_HOLD:
</del><ins>+                skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0);
+                    break;
+            case SOFTKEY_HOLD:
</ins><span class="cx">             session = skinny_profile_find_session(listener-&gt;profile, listener, &amp;line_instance, request-&gt;data.soft_key_event.call_id);
</span><span class="cx"> 
</span><del>-                    if(session) {
</del><ins>+                if(session) {
</ins><span class="cx">                 status = skinny_session_hold_line(session, listener, line_instance);
</span><span class="cx">             }
</span><del>-                        break;
-                case SOFTKEY_ENDCALL:
</del><ins>+                    break;
+            case SOFTKEY_ENDCALL:
</ins><span class="cx">             session = skinny_profile_find_session(listener-&gt;profile, listener, &amp;line_instance, request-&gt;data.soft_key_event.call_id);
</span><span class="cx"> 
</span><del>-                    if(session) {
-                            channel = switch_core_session_get_channel(session);
</del><ins>+                if(session) {
+                        channel = switch_core_session_get_channel(session);
</ins><span class="cx"> 
</span><del>-                            switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
</del><ins>+                        switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
</ins><span class="cx">             }
</span><del>-                        break;
-                case SOFTKEY_RESUME:
</del><ins>+                    break;
+            case SOFTKEY_RESUME:
</ins><span class="cx">             session = skinny_profile_find_session(listener-&gt;profile, listener, &amp;line_instance, request-&gt;data.soft_key_event.call_id);
</span><span class="cx"> 
</span><del>-                    if(session) {
</del><ins>+                if(session) {
</ins><span class="cx">                 status = skinny_session_unhold_line(session, listener, line_instance);
</span><span class="cx">             }
</span><del>-                        break;
-                case SOFTKEY_ANSWER:
</del><ins>+                    break;
+            case SOFTKEY_ANSWER:
</ins><span class="cx">             session = skinny_profile_find_session(listener-&gt;profile, listener, &amp;line_instance, request-&gt;data.soft_key_event.call_id);
</span><span class="cx"> 
</span><del>-                    if(session) {
</del><ins>+                if(session) {
</ins><span class="cx">                             status = skinny_session_answer(session, listener, line_instance);
</span><del>-                    }
-                        break;
-                default:
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
-                                &quot;Unknown SoftKeyEvent type while busy: %d.\n&quot;, request-&gt;data.soft_key_event.event);
-        }
</del><ins>+                }
+                    break;
+            default:
+                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
+                            &quot;Unknown SoftKeyEvent type while busy: %d.\n&quot;, request-&gt;data.soft_key_event.event);
+    }
</ins><span class="cx"> 
</span><span class="cx">     if(session) {
</span><span class="cx">             switch_core_session_rwunlock(session);
</span><span class="cx">     }
</span><del>-        
-        return status;
</del><ins>+
+    return status;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_off_hook_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        uint32_t line_instance;
-        switch_core_session_t *session = NULL;
-        private_t *tech_pvt = NULL;
</del><ins>+    uint32_t line_instance;
+    switch_core_session_t *session = NULL;
+    private_t *tech_pvt = NULL;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.off_hook));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.off_hook));
</ins><span class="cx"> 
</span><del>-        if(request-&gt;data.off_hook.line_instance &gt; 0) {
-                line_instance = request-&gt;data.off_hook.line_instance;
-        } else {
-                line_instance = 1;
-        }
</del><ins>+    if(request-&gt;data.off_hook.line_instance &gt; 0) {
+            line_instance = request-&gt;data.off_hook.line_instance;
+    } else {
+            line_instance = 1;
+    }
</ins><span class="cx"> 
</span><span class="cx">     session = skinny_profile_find_session(listener-&gt;profile, listener, &amp;line_instance, request-&gt;data.off_hook.call_id);
</span><span class="cx"> 
</span><del>-        if(session) { /*answering a call */
-                skinny_session_answer(session, listener, line_instance);
-        } else { /* start a new call */
-                skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
-            tech_pvt = switch_core_session_get_private(session);
-            assert(tech_pvt != NULL);
</del><ins>+    if(session) { /*answering a call */
+            skinny_session_answer(session, listener, line_instance);
+    } else { /* start a new call */
+            skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
+        tech_pvt = switch_core_session_get_private(session);
+        assert(tech_pvt != NULL);
</ins><span class="cx"> 
</span><del>-            skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0);
-        }
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+        skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0);
+    }
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        struct speed_dial_stat_res_message *button = NULL;
-        uint32_t line_instance = 0;
-        uint32_t call_id = 0;
-        switch_core_session_t *session = NULL;
</del><ins>+    struct speed_dial_stat_res_message *button = NULL;
+    uint32_t line_instance = 0;
+    uint32_t call_id = 0;
+    switch_core_session_t *session = NULL;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.stimulus)-sizeof(request-&gt;data.stimulus.call_id));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.stimulus)-sizeof(request-&gt;data.stimulus.call_id));
</ins><span class="cx"> 
</span><del>-        if(skinny_check_data_length_soft(request, sizeof(request-&gt;data.stimulus))) {
-            call_id = request-&gt;data.stimulus.call_id;
-        }
</del><ins>+    if(skinny_check_data_length_soft(request, sizeof(request-&gt;data.stimulus))) {
+        call_id = request-&gt;data.stimulus.call_id;
+    }
</ins><span class="cx"> 
</span><del>-        switch(request-&gt;data.stimulus.instance_type) {
-                case SKINNY_BUTTON_LAST_NUMBER_REDIAL:
-                    skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
-                        skinny_session_process_dest(session, listener, line_instance, &quot;redial&quot;, '\0', 0);
-                        break;
-                case SKINNY_BUTTON_VOICEMAIL:
-                    skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
-                        skinny_session_process_dest(session, listener, line_instance, &quot;vmain&quot;, '\0', 0);
-                        break;
-                case SKINNY_BUTTON_SPEED_DIAL:
-                        skinny_speed_dial_get(listener, request-&gt;data.stimulus.instance, &amp;button);
-                        if(strlen(button-&gt;line) &gt; 0) {
-                        skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
-                            skinny_session_process_dest(session, listener, line_instance, button-&gt;line, '\0', 0);
-                        }
-                        break;
-                default:
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;Unknown Stimulus Type Received [%d]\n&quot;, request-&gt;data.stimulus.instance_type);
-        }
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    switch(request-&gt;data.stimulus.instance_type) {
+            case SKINNY_BUTTON_LAST_NUMBER_REDIAL:
+                skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
+                    skinny_session_process_dest(session, listener, line_instance, &quot;redial&quot;, '\0', 0);
+                    break;
+            case SKINNY_BUTTON_VOICEMAIL:
+                skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
+                    skinny_session_process_dest(session, listener, line_instance, &quot;vmain&quot;, '\0', 0);
+                    break;
+            case SKINNY_BUTTON_SPEED_DIAL:
+                    skinny_speed_dial_get(listener, request-&gt;data.stimulus.instance, &amp;button);
+                    if(strlen(button-&gt;line) &gt; 0) {
+                    skinny_create_ingoing_session(listener, &amp;line_instance, &amp;session);
+                        skinny_session_process_dest(session, listener, line_instance, button-&gt;line, '\0', 0);
+                    }
+                    break;
+            default:
+                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;Unknown Stimulus Type Received [%d]\n&quot;, request-&gt;data.stimulus.instance_type);
+    }
+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_open_receive_channel_ack_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        switch_status_t status = SWITCH_STATUS_SUCCESS;
-        uint32_t line_instance = 0;
-        switch_core_session_t *session;
</del><ins>+    switch_status_t status = SWITCH_STATUS_SUCCESS;
+    uint32_t line_instance = 0;
+    switch_core_session_t *session;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.open_receive_channel_ack));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.open_receive_channel_ack));
</ins><span class="cx"> 
</span><span class="cx">     session = skinny_profile_find_session(listener-&gt;profile, listener, &amp;line_instance, request-&gt;data.open_receive_channel_ack.pass_thru_party_id);
</span><span class="cx"> 
</span><del>-        if(session) {
-                const char *err = NULL;
-                private_t *tech_pvt = NULL;
-                switch_channel_t *channel = NULL;
-                struct in_addr addr;
</del><ins>+    if(session) {
+            const char *err = NULL;
+            private_t *tech_pvt = NULL;
+            switch_channel_t *channel = NULL;
+            struct in_addr addr;
</ins><span class="cx"> 
</span><del>-                tech_pvt = switch_core_session_get_private(session);
-                channel = switch_core_session_get_channel(session);
</del><ins>+            tech_pvt = switch_core_session_get_private(session);
+            channel = switch_core_session_get_channel(session);
</ins><span class="cx"> 
</span><del>-                /* Codec */
-                tech_pvt-&gt;iananame = &quot;PCMU&quot;; /* TODO */
-                tech_pvt-&gt;codec_ms = 10; /* TODO */
-                tech_pvt-&gt;rm_rate = 8000; /* TODO */
-                tech_pvt-&gt;rm_fmtp = NULL; /* TODO */
-                tech_pvt-&gt;agreed_pt = (switch_payload_t) 0; /* TODO */
-                tech_pvt-&gt;rm_encoding = switch_core_strdup(switch_core_session_get_pool(session), &quot;&quot;);
-                skinny_tech_set_codec(tech_pvt, 0);
-                if ((status = skinny_tech_set_codec(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) {
-                        goto end;
-                }
-                
-                /* Request a local port from the core's allocator */
-                if (!(tech_pvt-&gt;local_sdp_audio_port = switch_rtp_request_port(listener-&gt;profile-&gt;ip))) {
-                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_CRIT, &quot;No RTP ports available!\n&quot;);
-                        return SWITCH_STATUS_FALSE;
-                }
-                tech_pvt-&gt;local_sdp_audio_ip = switch_core_strdup(switch_core_session_get_pool(session), listener-&gt;profile-&gt;ip);
</del><ins>+            /* Codec */
+            tech_pvt-&gt;iananame = &quot;PCMU&quot;; /* TODO */
+            tech_pvt-&gt;codec_ms = 10; /* TODO */
+            tech_pvt-&gt;rm_rate = 8000; /* TODO */
+            tech_pvt-&gt;rm_fmtp = NULL; /* TODO */
+            tech_pvt-&gt;agreed_pt = (switch_payload_t) 0; /* TODO */
+            tech_pvt-&gt;rm_encoding = switch_core_strdup(switch_core_session_get_pool(session), &quot;&quot;);
+            skinny_tech_set_codec(tech_pvt, 0);
+            if ((status = skinny_tech_set_codec(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) {
+                    goto end;
+            }
+        
+            /* Request a local port from the core's allocator */
+            if (!(tech_pvt-&gt;local_sdp_audio_port = switch_rtp_request_port(listener-&gt;profile-&gt;ip))) {
+                    switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_CRIT, &quot;No RTP ports available!\n&quot;);
+                    return SWITCH_STATUS_FALSE;
+            }
+            tech_pvt-&gt;local_sdp_audio_ip = switch_core_strdup(switch_core_session_get_pool(session), listener-&gt;profile-&gt;ip);
</ins><span class="cx"> 
</span><del>-                tech_pvt-&gt;remote_sdp_audio_ip = inet_ntoa(request-&gt;data.open_receive_channel_ack.ip);
-                tech_pvt-&gt;remote_sdp_audio_port = request-&gt;data.open_receive_channel_ack.port;
</del><ins>+            tech_pvt-&gt;remote_sdp_audio_ip = inet_ntoa(request-&gt;data.open_receive_channel_ack.ip);
+            tech_pvt-&gt;remote_sdp_audio_port = request-&gt;data.open_receive_channel_ack.port;
</ins><span class="cx"> 
</span><del>-                tech_pvt-&gt;rtp_session = switch_rtp_new(tech_pvt-&gt;local_sdp_audio_ip,
-                                                                                           tech_pvt-&gt;local_sdp_audio_port,
-                                                                                           tech_pvt-&gt;remote_sdp_audio_ip,
-                                                                                           tech_pvt-&gt;remote_sdp_audio_port,
-                                                                                           tech_pvt-&gt;agreed_pt,
-                                                                                           tech_pvt-&gt;read_impl.samples_per_packet,
-                                                                                           tech_pvt-&gt;codec_ms * 1000,
-                                                                                           (switch_rtp_flag_t) 0, &quot;soft&quot;, &amp;err,
-                                                                                           switch_core_session_get_pool(session));
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG,
-                                                  &quot;AUDIO RTP [%s] %s:%d-&gt;%s:%d codec: %u ms: %d [%s]\n&quot;,
-                                                  switch_channel_get_name(channel),
-                                                  tech_pvt-&gt;local_sdp_audio_ip,
-                                                  tech_pvt-&gt;local_sdp_audio_port,
-                                                  tech_pvt-&gt;remote_sdp_audio_ip,
-                                                  tech_pvt-&gt;remote_sdp_audio_port,
-                                                  tech_pvt-&gt;agreed_pt,
-                                                  tech_pvt-&gt;read_impl.microseconds_per_packet / 1000,
-                                                  switch_rtp_ready(tech_pvt-&gt;rtp_session) ? &quot;SUCCESS&quot; : err);
-                inet_aton(tech_pvt-&gt;local_sdp_audio_ip, &amp;addr);
-                start_media_transmission(listener,
-                        tech_pvt-&gt;call_id, /* uint32_t conference_id, */
-                        tech_pvt-&gt;party_id, /* uint32_t pass_thru_party_id, */
-                        addr.s_addr, /* uint32_t remote_ip, */
-                        tech_pvt-&gt;local_sdp_audio_port, /* uint32_t remote_port, */
-                        20, /* uint32_t ms_per_packet, */
-                        SKINNY_CODEC_ULAW_64K, /* uint32_t payload_capacity, */
-                        184, /* uint32_t precedence, */
-                        0, /* uint32_t silence_suppression, */
-                        0, /* uint16_t max_frames_per_packet, */
-                        0 /* uint32_t g723_bitrate */
-                );
-            if (switch_channel_get_state(channel) == CS_NEW) {
-                    switch_channel_set_state(channel, CS_INIT);
-            }
-                switch_channel_mark_answered(channel);
-                
-                switch_core_session_rwunlock(session);
-        }
</del><ins>+            tech_pvt-&gt;rtp_session = switch_rtp_new(tech_pvt-&gt;local_sdp_audio_ip,
+                                                                                       tech_pvt-&gt;local_sdp_audio_port,
+                                                                                       tech_pvt-&gt;remote_sdp_audio_ip,
+                                                                                       tech_pvt-&gt;remote_sdp_audio_port,
+                                                                                       tech_pvt-&gt;agreed_pt,
+                                                                                       tech_pvt-&gt;read_impl.samples_per_packet,
+                                                                                       tech_pvt-&gt;codec_ms * 1000,
+                                                                                       (switch_rtp_flag_t) 0, &quot;soft&quot;, &amp;err,
+                                                                                       switch_core_session_get_pool(session));
+            switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG,
+                                              &quot;AUDIO RTP [%s] %s:%d-&gt;%s:%d codec: %u ms: %d [%s]\n&quot;,
+                                              switch_channel_get_name(channel),
+                                              tech_pvt-&gt;local_sdp_audio_ip,
+                                              tech_pvt-&gt;local_sdp_audio_port,
+                                              tech_pvt-&gt;remote_sdp_audio_ip,
+                                              tech_pvt-&gt;remote_sdp_audio_port,
+                                              tech_pvt-&gt;agreed_pt,
+                                              tech_pvt-&gt;read_impl.microseconds_per_packet / 1000,
+                                              switch_rtp_ready(tech_pvt-&gt;rtp_session) ? &quot;SUCCESS&quot; : err);
+            inet_aton(tech_pvt-&gt;local_sdp_audio_ip, &amp;addr);
+            start_media_transmission(listener,
+                    tech_pvt-&gt;call_id, /* uint32_t conference_id, */
+                    tech_pvt-&gt;party_id, /* uint32_t pass_thru_party_id, */
+                    addr.s_addr, /* uint32_t remote_ip, */
+                    tech_pvt-&gt;local_sdp_audio_port, /* uint32_t remote_port, */
+                    20, /* uint32_t ms_per_packet, */
+                    SKINNY_CODEC_ULAW_64K, /* uint32_t payload_capacity, */
+                    184, /* uint32_t precedence, */
+                    0, /* uint32_t silence_suppression, */
+                    0, /* uint16_t max_frames_per_packet, */
+                    0 /* uint32_t g723_bitrate */
+            );
+        if (switch_channel_get_state(channel) == CS_NEW) {
+                switch_channel_set_state(channel, CS_INIT);
+        }
+            switch_channel_mark_answered(channel);
+        
+            switch_core_session_rwunlock(session);
+    }
</ins><span class="cx"> end:
</span><del>-        return status;
</del><ins>+    return status;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_keypad_button_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        uint32_t line_instance = 0;
-        switch_core_session_t *session;
</del><ins>+    uint32_t line_instance = 0;
+    switch_core_session_t *session;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.keypad_button));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.keypad_button));
</ins><span class="cx">     
</span><span class="cx">     if(request-&gt;data.keypad_button.line_instance) {
</span><span class="cx">         line_instance = request-&gt;data.keypad_button.line_instance;
</span><span class="lines">@@ -2107,169 +2107,169 @@
</span><span class="cx"> 
</span><span class="cx">     session = skinny_profile_find_session(listener-&gt;profile, listener, &amp;line_instance, request-&gt;data.keypad_button.call_id);
</span><span class="cx"> 
</span><del>-        if(session) {
-                switch_channel_t *channel = NULL;
-                private_t *tech_pvt = NULL;
-                char digit = '\0';
</del><ins>+    if(session) {
+            switch_channel_t *channel = NULL;
+            private_t *tech_pvt = NULL;
+            char digit = '\0';
</ins><span class="cx"> 
</span><del>-                channel = switch_core_session_get_channel(session);
-                tech_pvt = switch_core_session_get_private(session);
-                
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;SEND DTMF ON CALL %d [%d]\n&quot;, tech_pvt-&gt;call_id, request-&gt;data.keypad_button.button);
</del><ins>+            channel = switch_core_session_get_channel(session);
+            tech_pvt = switch_core_session_get_private(session);
+        
+            switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;SEND DTMF ON CALL %d [%d]\n&quot;, tech_pvt-&gt;call_id, request-&gt;data.keypad_button.button);
</ins><span class="cx"> 
</span><del>-                if (request-&gt;data.keypad_button.button == 14) {
-                        digit = '*';
-                } else if (request-&gt;data.keypad_button.button == 15) {
-                        digit = '#';
-                } else if (request-&gt;data.keypad_button.button &gt;= 0 &amp;&amp; request-&gt;data.keypad_button.button &lt;= 9) {
-                        digit = '0' + request-&gt;data.keypad_button.button;
-                } else {
-                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, &quot;UNKNOW DTMF RECEIVED ON CALL %d [%d]\n&quot;, tech_pvt-&gt;call_id, request-&gt;data.keypad_button.button);
-                }
</del><ins>+            if (request-&gt;data.keypad_button.button == 14) {
+                    digit = '*';
+            } else if (request-&gt;data.keypad_button.button == 15) {
+                    digit = '#';
+            } else if (request-&gt;data.keypad_button.button &gt;= 0 &amp;&amp; request-&gt;data.keypad_button.button &lt;= 9) {
+                    digit = '0' + request-&gt;data.keypad_button.button;
+            } else {
+                    switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, &quot;UNKNOW DTMF RECEIVED ON CALL %d [%d]\n&quot;, tech_pvt-&gt;call_id, request-&gt;data.keypad_button.button);
+            }
</ins><span class="cx"> 
</span><del>-                /* TODO check call_id and line */
</del><ins>+            /* TODO check call_id and line */
</ins><span class="cx"> 
</span><del>-                if((skinny_line_get_state(listener, line_instance, tech_pvt-&gt;call_id) == SKINNY_OFF_HOOK)) {
-                        
-                    skinny_session_process_dest(session, listener, line_instance, NULL, digit, 0);
-                } else {
-                        if(digit != '\0') {
-                                switch_dtmf_t dtmf = { 0, switch_core_default_dtmf_duration(0)};
-                                dtmf.digit = digit;
-                                switch_channel_queue_dtmf(channel, &amp;dtmf);
-                        }
-                }
</del><ins>+            if((skinny_line_get_state(listener, line_instance, tech_pvt-&gt;call_id) == SKINNY_OFF_HOOK)) {
+                
+                skinny_session_process_dest(session, listener, line_instance, NULL, digit, 0);
+            } else {
+                    if(digit != '\0') {
+                            switch_dtmf_t dtmf = { 0, switch_core_default_dtmf_duration(0)};
+                            dtmf.digit = digit;
+                            switch_channel_queue_dtmf(channel, &amp;dtmf);
+                    }
+            }
</ins><span class="cx">             switch_core_session_rwunlock(session);
</span><del>-        }
</del><ins>+    }
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_on_hook_message(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        switch_status_t status = SWITCH_STATUS_SUCCESS;
-        switch_core_session_t *session = NULL;
-        uint32_t line_instance = 0;
</del><ins>+    switch_status_t status = SWITCH_STATUS_SUCCESS;
+    switch_core_session_t *session = NULL;
+    uint32_t line_instance = 0;
</ins><span class="cx"> 
</span><del>-        skinny_check_data_length(request, sizeof(request-&gt;data.on_hook));
</del><ins>+    skinny_check_data_length(request, sizeof(request-&gt;data.on_hook));
</ins><span class="cx"> 
</span><span class="cx">     line_instance = request-&gt;data.on_hook.line_instance;
</span><span class="cx">     
</span><span class="cx">     session = skinny_profile_find_session(listener-&gt;profile, listener, &amp;line_instance, request-&gt;data.on_hook.call_id);
</span><span class="cx"> 
</span><del>-        if(session) {
-                switch_channel_t *channel = NULL;
</del><ins>+    if(session) {
+            switch_channel_t *channel = NULL;
</ins><span class="cx"> 
</span><del>-                channel = switch_core_session_get_channel(session);
</del><ins>+            channel = switch_core_session_get_channel(session);
</ins><span class="cx"> 
</span><del>-                switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
-                
-                switch_core_session_rwunlock(session);
-        }
-        return status;
</del><ins>+            switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+        
+            switch_core_session_rwunlock(session);
+    }
+    return status;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_unregister(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        switch_event_t *event = NULL;
-        skinny_message_t *message;
</del><ins>+    switch_event_t *event = NULL;
+    skinny_message_t *message;
</ins><span class="cx"> 
</span><del>-        /* skinny::unregister event */
-        skinny_device_event(listener, &amp;event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_UNREGISTER);
-        switch_event_fire(&amp;event);
</del><ins>+    /* skinny::unregister event */
+    skinny_device_event(listener, &amp;event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_UNREGISTER);
+    switch_event_fire(&amp;event);
</ins><span class="cx"> 
</span><del>-        message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.unregister_ack));
-        message-&gt;type = UNREGISTER_ACK_MESSAGE;
-        message-&gt;length = 4 + sizeof(message-&gt;data.unregister_ack);
-        message-&gt;data.unregister_ack.unregister_status = 0; /* OK */
-        skinny_send_reply(listener, message);
</del><ins>+    message = switch_core_alloc(listener-&gt;pool, 12+sizeof(message-&gt;data.unregister_ack));
+    message-&gt;type = UNREGISTER_ACK_MESSAGE;
+    message-&gt;length = 4 + sizeof(message-&gt;data.unregister_ack);
+    message-&gt;data.unregister_ack.unregister_status = 0; /* OK */
+    skinny_send_reply(listener, message);
</ins><span class="cx"> 
</span><del>-        /* Close socket */
-        switch_clear_flag_locked(listener, LFLAG_RUNNING);
</del><ins>+    /* Close socket */
+    switch_clear_flag_locked(listener, LFLAG_RUNNING);
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *request)
</span><span class="cx"> {
</span><del>-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
-                &quot;Received %s (type=%x,length=%d).\n&quot;, skinny_message_type2str(request-&gt;type), request-&gt;type, request-&gt;length);
-        if(zstr(listener-&gt;device_name) &amp;&amp; request-&gt;type != REGISTER_MESSAGE &amp;&amp; request-&gt;type != ALARM_MESSAGE) {
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                        &quot;Device should send a register message first.\n&quot;);
-                return SWITCH_STATUS_FALSE;
-        }
-        switch(request-&gt;type) {
-                case ALARM_MESSAGE:
-                        return skinny_handle_alarm(listener, request);
-                /* registering phase */
-                case REGISTER_MESSAGE:
-                        return skinny_handle_register(listener, request);
-                case HEADSET_STATUS_MESSAGE:
-                        return skinny_headset_status_message(listener, request);
-                case CONFIG_STAT_REQ_MESSAGE:
-                        return skinny_handle_config_stat_request(listener, request);
-                case CAPABILITIES_RES_MESSAGE:
-                        return skinny_handle_capabilities_response(listener, request);
-                case PORT_MESSAGE:
-                        return skinny_handle_port_message(listener, request);
-                case BUTTON_TEMPLATE_REQ_MESSAGE:
-                        return skinny_handle_button_template_request(listener, request);
-                case SOFT_KEY_TEMPLATE_REQ_MESSAGE:
-                        return skinny_handle_soft_key_template_request(listener, request);
-                case SOFT_KEY_SET_REQ_MESSAGE:
-                        return skinny_handle_soft_key_set_request(listener, request);
-                case LINE_STAT_REQ_MESSAGE:
-                        return skinny_handle_line_stat_request(listener, request);
-                case SPEED_DIAL_STAT_REQ_MESSAGE:
-                        return skinny_handle_speed_dial_stat_request(listener, request);
-                case SERVICE_URL_STAT_REQ_MESSAGE:
-                        return skinny_handle_service_url_stat_request(listener, request);
-                case FEATURE_STAT_REQ_MESSAGE:
-                        return skinny_handle_feature_stat_request(listener, request);
-                case REGISTER_AVAILABLE_LINES_MESSAGE:
-                        return skinny_handle_register_available_lines_message(listener, request);
-                case TIME_DATE_REQ_MESSAGE:
-                        return skinny_handle_time_date_request(listener, request);
-                /* live phase */
-                case KEEP_ALIVE_MESSAGE:
-                        return skinny_handle_keep_alive_message(listener, request);
-                case SOFT_KEY_EVENT_MESSAGE:
-                        return skinny_handle_soft_key_event_message(listener, request);
-                case OFF_HOOK_MESSAGE:
-                        return skinny_handle_off_hook_message(listener, request);
-                case STIMULUS_MESSAGE:
-                        return skinny_handle_stimulus_message(listener, request);
-                case OPEN_RECEIVE_CHANNEL_ACK_MESSAGE:
-                        return skinny_handle_open_receive_channel_ack_message(listener, request);
-                case KEYPAD_BUTTON_MESSAGE:
-                        return skinny_handle_keypad_button_message(listener, request);
-                case ON_HOOK_MESSAGE:
-                        return skinny_handle_on_hook_message(listener, request);
-                /* end phase */
-                case UNREGISTER_MESSAGE:
-                        return skinny_handle_unregister(listener, request);
-                default:
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
-                                &quot;Unhandled request %s (type=%x,length=%d).\n&quot;, skinny_message_type2str(request-&gt;type), request-&gt;type, request-&gt;length);
-                        return SWITCH_STATUS_SUCCESS;
-        }
</del><ins>+    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+            &quot;Received %s (type=%x,length=%d).\n&quot;, skinny_message_type2str(request-&gt;type), request-&gt;type, request-&gt;length);
+    if(zstr(listener-&gt;device_name) &amp;&amp; request-&gt;type != REGISTER_MESSAGE &amp;&amp; request-&gt;type != ALARM_MESSAGE) {
+            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+                    &quot;Device should send a register message first.\n&quot;);
+            return SWITCH_STATUS_FALSE;
+    }
+    switch(request-&gt;type) {
+            case ALARM_MESSAGE:
+                    return skinny_handle_alarm(listener, request);
+            /* registering phase */
+            case REGISTER_MESSAGE:
+                    return skinny_handle_register(listener, request);
+            case HEADSET_STATUS_MESSAGE:
+                    return skinny_headset_status_message(listener, request);
+            case CONFIG_STAT_REQ_MESSAGE:
+                    return skinny_handle_config_stat_request(listener, request);
+            case CAPABILITIES_RES_MESSAGE:
+                    return skinny_handle_capabilities_response(listener, request);
+            case PORT_MESSAGE:
+                    return skinny_handle_port_message(listener, request);
+            case BUTTON_TEMPLATE_REQ_MESSAGE:
+                    return skinny_handle_button_template_request(listener, request);
+            case SOFT_KEY_TEMPLATE_REQ_MESSAGE:
+                    return skinny_handle_soft_key_template_request(listener, request);
+            case SOFT_KEY_SET_REQ_MESSAGE:
+                    return skinny_handle_soft_key_set_request(listener, request);
+            case LINE_STAT_REQ_MESSAGE:
+                    return skinny_handle_line_stat_request(listener, request);
+            case SPEED_DIAL_STAT_REQ_MESSAGE:
+                    return skinny_handle_speed_dial_stat_request(listener, request);
+            case SERVICE_URL_STAT_REQ_MESSAGE:
+                    return skinny_handle_service_url_stat_request(listener, request);
+            case FEATURE_STAT_REQ_MESSAGE:
+                    return skinny_handle_feature_stat_request(listener, request);
+            case REGISTER_AVAILABLE_LINES_MESSAGE:
+                    return skinny_handle_register_available_lines_message(listener, request);
+            case TIME_DATE_REQ_MESSAGE:
+                    return skinny_handle_time_date_request(listener, request);
+            /* live phase */
+            case KEEP_ALIVE_MESSAGE:
+                    return skinny_handle_keep_alive_message(listener, request);
+            case SOFT_KEY_EVENT_MESSAGE:
+                    return skinny_handle_soft_key_event_message(listener, request);
+            case OFF_HOOK_MESSAGE:
+                    return skinny_handle_off_hook_message(listener, request);
+            case STIMULUS_MESSAGE:
+                    return skinny_handle_stimulus_message(listener, request);
+            case OPEN_RECEIVE_CHANNEL_ACK_MESSAGE:
+                    return skinny_handle_open_receive_channel_ack_message(listener, request);
+            case KEYPAD_BUTTON_MESSAGE:
+                    return skinny_handle_keypad_button_message(listener, request);
+            case ON_HOOK_MESSAGE:
+                    return skinny_handle_on_hook_message(listener, request);
+            /* end phase */
+            case UNREGISTER_MESSAGE:
+                    return skinny_handle_unregister(listener, request);
+            default:
+                    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
+                            &quot;Unhandled request %s (type=%x,length=%d).\n&quot;, skinny_message_type2str(request-&gt;type), request-&gt;type, request-&gt;length);
+                    return SWITCH_STATUS_SUCCESS;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> switch_status_t skinny_perform_send_reply(listener_t *listener, const char *file, const char *func, int line, skinny_message_t *reply)
</span><span class="cx"> {
</span><del>-        char *ptr;
-        switch_size_t len;
-        switch_assert(reply != NULL);
-        len = reply-&gt;length+8;
-        ptr = (char *) reply;
</del><ins>+    char *ptr;
+    switch_size_t len;
+    switch_assert(reply != NULL);
+    len = reply-&gt;length+8;
+    ptr = (char *) reply;
</ins><span class="cx"> 
</span><del>-        switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG,
-                &quot;Sending %s (type=%x,length=%d).\n&quot;,
-                skinny_message_type2str(reply-&gt;type), reply-&gt;type, reply-&gt;length);
-        switch_socket_send(listener-&gt;sock, ptr, &amp;len);
</del><ins>+    switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG,
+            &quot;Sending %s (type=%x,length=%d).\n&quot;,
+            skinny_message_type2str(reply-&gt;type), reply-&gt;type, reply-&gt;length);
+    switch_socket_send(listener-&gt;sock, ptr, &amp;len);
</ins><span class="cx"> 
</span><del>-        return SWITCH_STATUS_SUCCESS;
</del><ins>+    return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /* For Emacs:
</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 (17173 => 17174)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h        2010-04-01 20:16:45 UTC (rev 17173)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h        2010-04-01 20:16:49 UTC (rev 17174)
</span><span class="lines">@@ -49,60 +49,60 @@
</span><span class="cx"> /* RegisterMessage */
</span><span class="cx"> #define REGISTER_MESSAGE 0x0001
</span><span class="cx"> struct register_message {
</span><del>-        char device_name[16];
-        uint32_t user_id;
-        uint32_t instance;
-        struct in_addr ip;
-        uint32_t device_type;
-        uint32_t max_streams;
</del><ins>+    char device_name[16];
+    uint32_t user_id;
+    uint32_t instance;
+    struct in_addr ip;
+    uint32_t device_type;
+    uint32_t max_streams;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* PortMessage */
</span><span class="cx"> #define PORT_MESSAGE 0x0002
</span><span class="cx"> struct port_message {
</span><del>-        uint16_t port;
</del><ins>+    uint16_t port;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* KeypadButtonMessage */
</span><span class="cx"> #define KEYPAD_BUTTON_MESSAGE 0x0003
</span><span class="cx"> struct keypad_button_message {
</span><del>-        uint32_t button;
-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t button;
+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* StimulusMessage */
</span><span class="cx"> #define STIMULUS_MESSAGE 0x0005
</span><span class="cx"> struct stimulus_message {
</span><del>-        uint32_t instance_type; /* See enum skinny_button_definition */
-        uint32_t instance;
-        uint32_t call_id;
</del><ins>+    uint32_t instance_type; /* See enum skinny_button_definition */
+    uint32_t instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* OffHookMessage */
</span><span class="cx"> #define OFF_HOOK_MESSAGE 0x0006
</span><span class="cx"> struct off_hook_message {
</span><del>-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* OnHookMessage */
</span><span class="cx"> #define ON_HOOK_MESSAGE 0x0007
</span><span class="cx"> struct on_hook_message {
</span><del>-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* SpeedDialStatReqMessage */
</span><span class="cx"> #define SPEED_DIAL_STAT_REQ_MESSAGE 0x000A
</span><span class="cx"> struct speed_dial_stat_req_message {
</span><del>-        uint32_t number;
</del><ins>+    uint32_t number;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* LineStatReqMessage */
</span><span class="cx"> #define LINE_STAT_REQ_MESSAGE 0x000B
</span><span class="cx"> struct line_stat_req_message {
</span><del>-        uint32_t number;
</del><ins>+    uint32_t number;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* ConfigStatReqMessage */
</span><span class="lines">@@ -117,32 +117,32 @@
</span><span class="cx"> /* CapabilitiesResMessage */
</span><span class="cx"> #define CAPABILITIES_RES_MESSAGE 0x0010
</span><span class="cx"> struct station_capabilities {
</span><del>-        uint32_t codec;
-        uint16_t frames;
-        char reserved[10];
</del><ins>+    uint32_t codec;
+    uint16_t frames;
+    char reserved[10];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct capabilities_res_message {
</span><del>-        uint32_t count;
-        struct station_capabilities caps[SWITCH_MAX_CODECS];
</del><ins>+    uint32_t count;
+    struct station_capabilities caps[SWITCH_MAX_CODECS];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* AlarmMessage */
</span><span class="cx"> #define ALARM_MESSAGE 0x0020
</span><span class="cx"> struct alarm_message {
</span><del>-        uint32_t alarm_severity;
-        char display_message[80];
-        uint32_t alarm_param1;
-        uint32_t alarm_param2;
</del><ins>+    uint32_t alarm_severity;
+    char display_message[80];
+    uint32_t alarm_param1;
+    uint32_t alarm_param2;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* OpenReceiveChannelAck */
</span><span class="cx"> #define OPEN_RECEIVE_CHANNEL_ACK_MESSAGE 0x0022
</span><span class="cx"> struct open_receive_channel_ack_message {
</span><del>-        uint32_t status;
-        struct in_addr ip;
-        uint32_t port;
-        uint32_t pass_thru_party_id;
</del><ins>+    uint32_t status;
+    struct in_addr ip;
+    uint32_t port;
+    uint32_t pass_thru_party_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* SoftKeySetReqMessage */
</span><span class="lines">@@ -151,9 +151,9 @@
</span><span class="cx"> /* SoftKeyEventMessage */
</span><span class="cx"> #define SOFT_KEY_EVENT_MESSAGE 0x0026
</span><span class="cx"> struct soft_key_event_message {
</span><del>-        uint32_t event;
-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t event;
+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* UnregisterMessage */
</span><span class="lines">@@ -165,182 +165,182 @@
</span><span class="cx"> /* ServiceUrlStatReqMessage */
</span><span class="cx"> #define SERVICE_URL_STAT_REQ_MESSAGE 0x0033
</span><span class="cx"> struct service_url_stat_req_message {
</span><del>-        uint32_t service_url_index;
</del><ins>+    uint32_t service_url_index;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* FeatureStatReqMessage */
</span><span class="cx"> #define FEATURE_STAT_REQ_MESSAGE 0x0034
</span><span class="cx"> struct feature_stat_req_message {
</span><del>-        uint32_t feature_index;
</del><ins>+    uint32_t feature_index;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* HeadsetStatusMessage */
</span><span class="cx"> #define HEADSET_STATUS_MESSAGE 0x002B
</span><span class="cx"> struct headset_status_message {
</span><del>-        uint32_t mode;
</del><ins>+    uint32_t mode;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* RegisterAvailableLinesMessage */
</span><span class="cx"> #define REGISTER_AVAILABLE_LINES_MESSAGE 0x002D
</span><span class="cx"> struct register_available_lines_message {
</span><del>-        uint32_t count;
</del><ins>+    uint32_t count;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* RegisterAckMessage */
</span><span class="cx"> #define REGISTER_ACK_MESSAGE 0x0081
</span><span class="cx"> struct register_ack_message {
</span><del>-        uint32_t keep_alive;
-        char date_format[6];
-        char reserved[2];
-        uint32_t secondary_keep_alive;
-        char reserved2[4];
</del><ins>+    uint32_t keep_alive;
+    char date_format[6];
+    char reserved[2];
+    uint32_t secondary_keep_alive;
+    char reserved2[4];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* StartToneMessage */
</span><span class="cx"> #define START_TONE_MESSAGE 0x0082
</span><span class="cx"> struct start_tone_message {
</span><del>-        uint32_t tone; /* see enum skinny_tone */
-        uint32_t reserved;
-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t tone; /* see enum skinny_tone */
+    uint32_t reserved;
+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* StopToneMessage */
</span><span class="cx"> #define STOP_TONE_MESSAGE 0x0083
</span><span class="cx"> struct stop_tone_message {
</span><del>-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* SetRingerMessage */
</span><span class="cx"> #define SET_RINGER_MESSAGE 0x0085
</span><span class="cx"> struct set_ringer_message {
</span><del>-        uint32_t ring_type; /* See enum skinny_ring_type */
-        uint32_t ring_mode; /* See enum skinny_ring_mode */
-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t ring_type; /* See enum skinny_ring_type */
+    uint32_t ring_mode; /* See enum skinny_ring_mode */
+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* SetLampMessage */
</span><span class="cx"> #define SET_LAMP_MESSAGE 0x0086
</span><span class="cx"> struct set_lamp_message {
</span><del>-        uint32_t stimulus; /* See enum skinny_button_definition */
-        uint32_t stimulus_instance;
-        uint32_t mode; /* See enum skinny_lamp_mode */
</del><ins>+    uint32_t stimulus; /* See enum skinny_button_definition */
+    uint32_t stimulus_instance;
+    uint32_t mode; /* See enum skinny_lamp_mode */
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* SetSpeakerModeMessage */
</span><span class="cx"> #define SET_SPEAKER_MODE_MESSAGE 0x0088
</span><span class="cx"> struct set_speaker_mode_message {
</span><del>-        uint32_t mode; /* See enum skinny_speaker_mode */
</del><ins>+    uint32_t mode; /* See enum skinny_speaker_mode */
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* StartMediaTransmissionMessage */
</span><span class="cx"> #define START_MEDIA_TRANSMISSION_MESSAGE 0x008A
</span><span class="cx"> struct start_media_transmission_message {
</span><del>-        uint32_t conference_id;
-        uint32_t pass_thru_party_id;
-        uint32_t remote_ip;
-        uint32_t remote_port;
-        uint32_t ms_per_packet;
-        uint32_t payload_capacity;
-        uint32_t precedence;
-        uint32_t silence_suppression;
-        uint16_t max_frames_per_packet;
-        uint32_t g723_bitrate;
-        /* ... */
</del><ins>+    uint32_t conference_id;
+    uint32_t pass_thru_party_id;
+    uint32_t remote_ip;
+    uint32_t remote_port;
+    uint32_t ms_per_packet;
+    uint32_t payload_capacity;
+    uint32_t precedence;
+    uint32_t silence_suppression;
+    uint16_t max_frames_per_packet;
+    uint32_t g723_bitrate;
+    /* ... */
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* StopMediaTransmissionMessage */
</span><span class="cx"> #define STOP_MEDIA_TRANSMISSION_MESSAGE 0x008B
</span><span class="cx"> struct stop_media_transmission_message {
</span><del>-        uint32_t conference_id;
-        uint32_t pass_thru_party_id;
-        uint32_t conference_id2;
-        /* ... */
</del><ins>+    uint32_t conference_id;
+    uint32_t pass_thru_party_id;
+    uint32_t conference_id2;
+    /* ... */
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* CallInfoMessage */
</span><span class="cx"> #define CALL_INFO_MESSAGE 0x008F
</span><span class="cx"> struct call_info_message {
</span><del>-        char calling_party_name[40];
-        char calling_party[24];
-        char called_party_name[40];
-        char called_party[24];
-        uint32_t line_instance;
-        uint32_t call_id;
-        uint32_t call_type; /* See enum skinny_call_type */
-        char original_called_party_name[40];
-        char original_called_party[24];
-        char last_redirecting_party_name[40];
-        char last_redirecting_party[24];
-        uint32_t original_called_party_redirect_reason;
-        uint32_t last_redirecting_reason;
-        char calling_party_voice_mailbox[24];
-        char called_party_voice_mailbox[24];
-        char original_called_party_voice_mailbox[24];
-        char last_redirecting_voice_mailbox[24];
-        uint32_t call_instance;
-        uint32_t call_security_status;
-        uint32_t party_pi_restriction_bits;
</del><ins>+    char calling_party_name[40];
+    char calling_party[24];
+    char called_party_name[40];
+    char called_party[24];
+    uint32_t line_instance;
+    uint32_t call_id;
+    uint32_t call_type; /* See enum skinny_call_type */
+    char original_called_party_name[40];
+    char original_called_party[24];
+    char last_redirecting_party_name[40];
+    char last_redirecting_party[24];
+    uint32_t original_called_party_redirect_reason;
+    uint32_t last_redirecting_reason;
+    char calling_party_voice_mailbox[24];
+    char called_party_voice_mailbox[24];
+    char original_called_party_voice_mailbox[24];
+    char last_redirecting_voice_mailbox[24];
+    uint32_t call_instance;
+    uint32_t call_security_status;
+    uint32_t party_pi_restriction_bits;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* SpeedDialStatMessage */
</span><span class="cx"> #define SPEED_DIAL_STAT_RES_MESSAGE 0x0091
</span><span class="cx"> struct speed_dial_stat_res_message {
</span><del>-        uint32_t number;
-        char line[24];
-        char label[40];
</del><ins>+    uint32_t number;
+    char line[24];
+    char label[40];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* LineStatMessage */
</span><span class="cx"> #define LINE_STAT_RES_MESSAGE 0x0092
</span><span class="cx"> struct line_stat_res_message {
</span><del>-        uint32_t number;
-        char name[24];
-        char shortname[40];
-        char displayname[44];
</del><ins>+    uint32_t number;
+    char name[24];
+    char shortname[40];
+    char displayname[44];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* ConfigStatMessage */
</span><span class="cx"> #define CONFIG_STAT_RES_MESSAGE 0x0093
</span><span class="cx"> struct config_stat_res_message {
</span><del>-        char device_name[16];
-        uint32_t user_id;
-        uint32_t instance;
-        char user_name[40];
-        char server_name[40];
-        uint32_t number_lines;
-        uint32_t number_speed_dials;
</del><ins>+    char device_name[16];
+    uint32_t user_id;
+    uint32_t instance;
+    char user_name[40];
+    char server_name[40];
+    uint32_t number_lines;
+    uint32_t number_speed_dials;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* DefineTimeDate */
</span><span class="cx"> #define DEFINE_TIME_DATE_MESSAGE 0x0094
</span><span class="cx"> struct define_time_date_message {
</span><del>-        uint32_t year;
-        uint32_t month;
-        uint32_t day_of_week; /* monday = 1 */
-        uint32_t day;
-        uint32_t hour;
-        uint32_t minute;
-        uint32_t seconds;
-        uint32_t milliseconds;
-        uint32_t timestamp;
</del><ins>+    uint32_t year;
+    uint32_t month;
+    uint32_t day_of_week; /* monday = 1 */
+    uint32_t day;
+    uint32_t hour;
+    uint32_t minute;
+    uint32_t seconds;
+    uint32_t milliseconds;
+    uint32_t timestamp;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* ButtonTemplateMessage */
</span><span class="cx"> #define BUTTON_TEMPLATE_RES_MESSAGE 0x0097
</span><span class="cx"> struct button_definition {
</span><del>-        uint8_t instance_number;
-        uint8_t button_definition; /* See enum skinny_button_definition */
</del><ins>+    uint8_t instance_number;
+    uint8_t button_definition; /* See enum skinny_button_definition */
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #define SKINNY_MAX_BUTTON_COUNT 42
</span><span class="cx"> struct button_template_message {
</span><del>-        uint32_t button_offset;
-        uint32_t button_count;
-        uint32_t total_button_count;
-        struct button_definition btn[SKINNY_MAX_BUTTON_COUNT];
</del><ins>+    uint32_t button_offset;
+    uint32_t button_count;
+    uint32_t total_button_count;
+    struct button_definition btn[SKINNY_MAX_BUTTON_COUNT];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* CapabilitiesReqMessage */
</span><span class="lines">@@ -349,13 +349,13 @@
</span><span class="cx"> /* RegisterRejectMessage */
</span><span class="cx"> #define REGISTER_REJ_MESSAGE 0x009D
</span><span class="cx"> struct register_rej_message {
</span><del>-        char error[33];
</del><ins>+    char error[33];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* ResetMessage */
</span><span class="cx"> #define RESET_MESSAGE 0x009F
</span><span class="cx"> struct reset_message {
</span><del>-        uint32_t reset_type; /* See enum skinny_device_reset_types */
</del><ins>+    uint32_t reset_type; /* See enum skinny_device_reset_types */
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* KeepAliveAckMessage */
</span><span class="lines">@@ -364,130 +364,130 @@
</span><span class="cx"> /* OpenReceiveChannelMessage */
</span><span class="cx"> #define OPEN_RECEIVE_CHANNEL_MESSAGE 0x0105
</span><span class="cx"> struct open_receive_channel_message {
</span><del>-        uint32_t conference_id;
-        uint32_t pass_thru_party_id;
-        uint32_t packets;
-        uint32_t payload_capacity;
-        uint32_t echo_cancel_type;
-        uint32_t g723_bitrate;
-        uint32_t conference_id2;
-        uint32_t reserved[10];
</del><ins>+    uint32_t conference_id;
+    uint32_t pass_thru_party_id;
+    uint32_t packets;
+    uint32_t payload_capacity;
+    uint32_t echo_cancel_type;
+    uint32_t g723_bitrate;
+    uint32_t conference_id2;
+    uint32_t reserved[10];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* CloseReceiveChannelMessage */
</span><span class="cx"> #define CLOSE_RECEIVE_CHANNEL_MESSAGE 0x0106
</span><span class="cx"> struct close_receive_channel_message {
</span><del>-        uint32_t conference_id;
-        uint32_t pass_thru_party_id;
-        uint32_t conference_id2;
</del><ins>+    uint32_t conference_id;
+    uint32_t pass_thru_party_id;
+    uint32_t conference_id2;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* SoftKeyTemplateResMessage */
</span><span class="cx"> #define SOFT_KEY_TEMPLATE_RES_MESSAGE 0x0108
</span><span class="cx"> 
</span><span class="cx"> struct soft_key_template_definition {
</span><del>-        char soft_key_label[16];
-        uint32_t soft_key_event;
</del><ins>+    char soft_key_label[16];
+    uint32_t soft_key_event;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct soft_key_template_res_message {
</span><del>-        uint32_t soft_key_offset;
-        uint32_t soft_key_count;
-        uint32_t total_soft_key_count;
-        struct soft_key_template_definition soft_key[32];
</del><ins>+    uint32_t soft_key_offset;
+    uint32_t soft_key_count;
+    uint32_t total_soft_key_count;
+    struct soft_key_template_definition soft_key[32];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* SoftKeySetResMessage */
</span><span class="cx"> #define SOFT_KEY_SET_RES_MESSAGE 0x0109
</span><span class="cx"> struct soft_key_set_definition {
</span><del>-        uint8_t soft_key_template_index[16]; /* See enum skinny_soft_key_event */
-        uint16_t soft_key_info_index[16];
</del><ins>+    uint8_t soft_key_template_index[16]; /* See enum skinny_soft_key_event */
+    uint16_t soft_key_info_index[16];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct soft_key_set_res_message {
</span><del>-        uint32_t soft_key_set_offset;
-        uint32_t soft_key_set_count;
-        uint32_t total_soft_key_set_count;
-        struct soft_key_set_definition soft_key_set[16];
-        uint32_t res;
</del><ins>+    uint32_t soft_key_set_offset;
+    uint32_t soft_key_set_count;
+    uint32_t total_soft_key_set_count;
+    struct soft_key_set_definition soft_key_set[16];
+    uint32_t res;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* SelectSoftKeysMessage */
</span><span class="cx"> #define SELECT_SOFT_KEYS_MESSAGE 0x0110
</span><span class="cx"> struct select_soft_keys_message {
</span><del>-        uint32_t line_instance;
-        uint32_t call_id;
-        uint32_t soft_key_set; /* See enum skinny_key_set */
-        uint32_t valid_key_mask;
</del><ins>+    uint32_t line_instance;
+    uint32_t call_id;
+    uint32_t soft_key_set; /* See enum skinny_key_set */
+    uint32_t valid_key_mask;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* CallStateMessage */
</span><span class="cx"> #define CALL_STATE_MESSAGE 0x0111
</span><span class="cx"> struct call_state_message {
</span><del>-        uint32_t call_state; /* See enum skinny_call_state */
-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t call_state; /* See enum skinny_call_state */
+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* DisplayPromptStatusMessage */
</span><span class="cx"> #define DISPLAY_PROMPT_STATUS_MESSAGE 0x0112
</span><span class="cx"> struct display_prompt_status_message {
</span><del>-        uint32_t timeout;
-        char display[32];
-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t timeout;
+    char display[32];
+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* ClearPromptStatusMessage */
</span><span class="cx"> #define CLEAR_PROMPT_STATUS_MESSAGE  0x0113
</span><span class="cx"> struct clear_prompt_status_message {
</span><del>-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* ActivateCallPlaneMessage */
</span><span class="cx"> #define ACTIVATE_CALL_PLANE_MESSAGE 0x0116
</span><span class="cx"> struct activate_call_plane_message {
</span><del>-        uint32_t line_instance;
</del><ins>+    uint32_t line_instance;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* UnregisterAckMessage */
</span><span class="cx"> #define UNREGISTER_ACK_MESSAGE 0x0118
</span><span class="cx"> struct unregister_ack_message {
</span><del>-        uint32_t unregister_status;
</del><ins>+    uint32_t unregister_status;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* DialedNumberMessage */
</span><span class="cx"> #define DIALED_NUMBER_MESSAGE 0x011D
</span><span class="cx"> struct dialed_number_message {
</span><del>-        char called_party[24];
-        uint32_t line_instance;
-        uint32_t call_id;
</del><ins>+    char called_party[24];
+    uint32_t line_instance;
+    uint32_t call_id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* FeatureStatMessage */
</span><span class="cx"> #define FEATURE_STAT_RES_MESSAGE 0x011F
</span><span class="cx"> struct feature_stat_res_message {
</span><del>-        uint32_t index;
-        uint32_t id;
-        char text_label[40];
-        uint32_t status;
</del><ins>+    uint32_t index;
+    uint32_t id;
+    char text_label[40];
+    uint32_t status;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* DisplayPriNotifyMessage */
</span><span class="cx"> #define DISPLAY_PRI_NOTIFY_MESSAGE 0x0120
</span><span class="cx"> struct display_pri_notify_message {
</span><del>-        uint32_t message_timeout;
-        uint32_t priority;
-        char notify[32];
</del><ins>+    uint32_t message_timeout;
+    uint32_t priority;
+    char notify[32];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* ServiceUrlStatMessage */
</span><span class="cx"> #define SERVICE_URL_STAT_RES_MESSAGE 0x012F
</span><span class="cx"> struct service_url_stat_res_message {
</span><del>-        uint32_t index;
-        char url[256];
-        char display_name[40];
</del><ins>+    uint32_t index;
+    char url[256];
+    char display_name[40];
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /*****************************************************************************/
</span><span class="lines">@@ -498,56 +498,56 @@
</span><span class="cx"> #define SKINNY_MESSAGE_MAXSIZE 1000
</span><span class="cx"> 
</span><span class="cx"> union skinny_data {
</span><del>-        struct register_message reg;
-        struct port_message port;
-        struct keypad_button_message keypad_button;
-        struct stimulus_message stimulus;
-        struct off_hook_message off_hook;
-        struct on_hook_message on_hook;
-        struct speed_dial_stat_req_message speed_dial_req;
-        struct line_stat_req_message line_req;
-        struct capabilities_res_message cap_res;
-        struct alarm_message alarm;
-        struct open_receive_channel_ack_message open_receive_channel_ack;
-        struct soft_key_event_message soft_key_event;
-        struct service_url_stat_req_message service_url_req;
-        struct feature_stat_req_message feature_req;
-        struct headset_status_message headset_status;
-        struct register_available_lines_message reg_lines;
-        struct register_ack_message reg_ack;
-        struct start_tone_message start_tone;
-        struct stop_tone_message stop_tone;
-        struct set_ringer_message ringer;
-        struct set_lamp_message lamp;
-        struct set_speaker_mode_message speaker_mode;
-        struct start_media_transmission_message start_media;
-        struct stop_media_transmission_message stop_media;
-        struct call_info_message call_info;
-        struct speed_dial_stat_res_message speed_dial_res;
-        struct line_stat_res_message line_res;
-        struct config_stat_res_message config_res;
-        struct define_time_date_message define_time_date;
-        struct button_template_message button_template;
-        struct register_rej_message reg_rej;
-        struct reset_message reset;
-        struct open_receive_channel_message open_receive_channel;
-        struct close_receive_channel_message close_receive_channel;
-        struct soft_key_template_res_message soft_key_template;
-        struct soft_key_set_res_message soft_key_set;
-        struct select_soft_keys_message select_soft_keys;
-        struct call_state_message call_state;
-        struct display_prompt_status_message display_prompt_status;
-        struct clear_prompt_status_message clear_prompt_status;
-        struct activate_call_plane_message activate_call_plane;
-        struct unregister_ack_message unregister_ack;
-        struct dialed_number_message dialed_number;
-        struct feature_stat_res_message feature_res;
-        struct display_pri_notify_message display_pri_notify;
-        struct service_url_stat_res_message service_url_res;
-        
-        uint16_t as_uint16;
-        char as_char;
-        void *raw;
</del><ins>+    struct register_message reg;
+    struct port_message port;
+    struct keypad_button_message keypad_button;
+    struct stimulus_message stimulus;
+    struct off_hook_message off_hook;
+    struct on_hook_message on_hook;
+    struct speed_dial_stat_req_message speed_dial_req;
+    struct line_stat_req_message line_req;
+    struct capabilities_res_message cap_res;
+    struct alarm_message alarm;
+    struct open_receive_channel_ack_message open_receive_channel_ack;
+    struct soft_key_event_message soft_key_event;
+    struct service_url_stat_req_message service_url_req;
+    struct feature_stat_req_message feature_req;
+    struct headset_status_message headset_status;
+    struct register_available_lines_message reg_lines;
+    struct register_ack_message reg_ack;
+    struct start_tone_message start_tone;
+    struct stop_tone_message stop_tone;
+    struct set_ringer_message ringer;
+    struct set_lamp_message lamp;
+    struct set_speaker_mode_message speaker_mode;
+    struct start_media_transmission_message start_media;
+    struct stop_media_transmission_message stop_media;
+    struct call_info_message call_info;
+    struct speed_dial_stat_res_message speed_dial_res;
+    struct line_stat_res_message line_res;
+    struct config_stat_res_message config_res;
+    struct define_time_date_message define_time_date;
+    struct button_template_message button_template;
+    struct register_rej_message reg_rej;
+    struct reset_message reset;
+    struct open_receive_channel_message open_receive_channel;
+    struct close_receive_channel_message close_receive_channel;
+    struct soft_key_template_res_message soft_key_template;
+    struct soft_key_set_res_message soft_key_set;
+    struct select_soft_keys_message select_soft_keys;
+    struct call_state_message call_state;
+    struct display_prompt_status_message display_prompt_status;
+    struct clear_prompt_status_message clear_prompt_status;
+    struct activate_call_plane_message activate_call_plane;
+    struct unregister_ack_message unregister_ack;
+    struct dialed_number_message dialed_number;
+    struct feature_stat_res_message feature_res;
+    struct display_pri_notify_message display_pri_notify;
+    struct service_url_stat_res_message service_url_res;
+
+    uint16_t as_uint16;
+    char as_char;
+    void *raw;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /*
</span><span class="lines">@@ -555,10 +555,10 @@
</span><span class="cx">  * body is type+data
</span><span class="cx">  */
</span><span class="cx"> struct skinny_message {
</span><del>-        uint32_t length;
-        uint32_t reserved;
-        uint32_t type;
-        union skinny_data data;
</del><ins>+    uint32_t length;
+    uint32_t reserved;
+    uint32_t type;
+    union skinny_data data;
</ins><span class="cx"> };
</span><span class="cx"> typedef struct skinny_message skinny_message_t;
</span><span class="cx"> 
</span><span class="lines">@@ -566,40 +566,40 @@
</span><span class="cx"> /* SKINNY TYPES */
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> enum skinny_codecs {
</span><del>-        SKINNY_CODEC_ALAW_64K = 2,
-        SKINNY_CODEC_ALAW_56K = 3,
-        SKINNY_CODEC_ULAW_64K = 4,
-        SKINNY_CODEC_ULAW_56K = 5,
-        SKINNY_CODEC_G722_64K = 6,
-        SKINNY_CODEC_G722_56K = 7,
-        SKINNY_CODEC_G722_48K = 8,
-        SKINNY_CODEC_G723_1 = 9,
-        SKINNY_CODEC_G728 = 10,
-        SKINNY_CODEC_G729 = 11,
-        SKINNY_CODEC_G729A = 12,
-        SKINNY_CODEC_IS11172 = 13,
-        SKINNY_CODEC_IS13818 = 14,
-        SKINNY_CODEC_G729B = 15,
-        SKINNY_CODEC_G729AB = 16,
-        SKINNY_CODEC_GSM_FULL = 18,
-        SKINNY_CODEC_GSM_HALF = 19,
-        SKINNY_CODEC_GSM_EFULL = 20,
-        SKINNY_CODEC_WIDEBAND_256K = 25,
-        SKINNY_CODEC_DATA_64K = 32,
-        SKINNY_CODEC_DATA_56K = 33,
-        SKINNY_CODEC_GSM = 80,
-        SKINNY_CODEC_ACTIVEVOICE = 81,
-        SKINNY_CODEC_G726_32K = 82,
-        SKINNY_CODEC_G726_24K = 83,
-        SKINNY_CODEC_G726_16K = 84,
-        SKINNY_CODEC_G729B_BIS = 85,
-        SKINNY_CODEC_G729B_LOW = 86,
-        SKINNY_CODEC_H261 = 100,
-        SKINNY_CODEC_H263 = 101,
-        SKINNY_CODEC_VIDEO = 102,
-        SKINNY_CODEC_T120 = 105,
-        SKINNY_CODEC_H224 = 106,
-        SKINNY_CODEC_RFC2833_DYNPAYLOAD = 257
</del><ins>+    SKINNY_CODEC_ALAW_64K = 2,
+    SKINNY_CODEC_ALAW_56K = 3,
+    SKINNY_CODEC_ULAW_64K = 4,
+    SKINNY_CODEC_ULAW_56K = 5,
+    SKINNY_CODEC_G722_64K = 6,
+    SKINNY_CODEC_G722_56K = 7,
+    SKINNY_CODEC_G722_48K = 8,
+    SKINNY_CODEC_G723_1 = 9,
+    SKINNY_CODEC_G728 = 10,
+    SKINNY_CODEC_G729 = 11,
+    SKINNY_CODEC_G729A = 12,
+    SKINNY_CODEC_IS11172 = 13,
+    SKINNY_CODEC_IS13818 = 14,
+    SKINNY_CODEC_G729B = 15,
+    SKINNY_CODEC_G729AB = 16,
+    SKINNY_CODEC_GSM_FULL = 18,
+    SKINNY_CODEC_GSM_HALF = 19,
+    SKINNY_CODEC_GSM_EFULL = 20,
+    SKINNY_CODEC_WIDEBAND_256K = 25,
+    SKINNY_CODEC_DATA_64K = 32,
+    SKINNY_CODEC_DATA_56K = 33,
+    SKINNY_CODEC_GSM = 80,
+    SKINNY_CODEC_ACTIVEVOICE = 81,
+    SKINNY_CODEC_G726_32K = 82,
+    SKINNY_CODEC_G726_24K = 83,
+    SKINNY_CODEC_G726_16K = 84,
+    SKINNY_CODEC_G729B_BIS = 85,
+    SKINNY_CODEC_G729B_LOW = 86,
+    SKINNY_CODEC_H261 = 100,
+    SKINNY_CODEC_H263 = 101,
+    SKINNY_CODEC_VIDEO = 102,
+    SKINNY_CODEC_T120 = 105,
+    SKINNY_CODEC_H224 = 106,
+    SKINNY_CODEC_RFC2833_DYNPAYLOAD = 257
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> typedef switch_status_t (*skinny_command_t) (char **argv, int argc, switch_stream_handle_t *stream);
</span><span class="lines">@@ -608,10 +608,10 @@
</span><span class="cx"> /* SKINNY FUNCTIONS */
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> #define skinny_check_data_length(message, len) \
</span><del>-        if (message-&gt;length &lt; len+4) {\
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Received Too Short Skinny Message (Expected %&quot; SWITCH_SIZE_T_FMT &quot;, got %d).\n&quot;, len+4, message-&gt;length);\
-                return SWITCH_STATUS_FALSE;\
-        }
</del><ins>+    if (message-&gt;length &lt; len+4) {\
+            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Received Too Short Skinny Message (Expected %&quot; SWITCH_SIZE_T_FMT &quot;, got %d).\n&quot;, len+4, message-&gt;length);\
+            return SWITCH_STATUS_FALSE;\
+    }
</ins><span class="cx"> #define skinny_check_data_length_soft(message, len) \
</span><span class="cx">     (message-&gt;length &gt;= len+4)
</span><span class="cx"> 
</span><span class="lines">@@ -643,102 +643,102 @@
</span><span class="cx"> /* SKINNY MESSAGE HELPER */
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> switch_status_t start_tone(listener_t *listener,
</span><del>-        uint32_t tone,
-        uint32_t reserved,
-        uint32_t line_instance,
-        uint32_t call_id);
</del><ins>+    uint32_t tone,
+    uint32_t reserved,
+    uint32_t line_instance,
+    uint32_t call_id);
</ins><span class="cx"> switch_status_t stop_tone(listener_t *listener,
</span><del>-        uint32_t line_instance,
-        uint32_t call_id);
</del><ins>+    uint32_t line_instance,
+    uint32_t call_id);
</ins><span class="cx"> switch_status_t set_ringer(listener_t *listener,
</span><del>-        uint32_t ring_type,
-        uint32_t ring_mode,
-        uint32_t line_instance,
-        uint32_t call_id);
</del><ins>+    uint32_t ring_type,
+    uint32_t ring_mode,
+    uint32_t line_instance,
+    uint32_t call_id);
</ins><span class="cx"> switch_status_t set_lamp(listener_t *listener,
</span><del>-        uint32_t stimulus,
-        uint32_t stimulus_instance,
-        uint32_t mode);
</del><ins>+    uint32_t stimulus,
+    uint32_t stimulus_instance,
+    uint32_t mode);
</ins><span class="cx"> switch_status_t set_speaker_mode(listener_t *listener,
</span><del>-        uint32_t mode);
</del><ins>+    uint32_t mode);
</ins><span class="cx"> switch_status_t start_media_transmission(listener_t *listener,
</span><del>-        uint32_t conference_id,
-        uint32_t pass_thru_party_id,
-        uint32_t remote_ip,
-        uint32_t remote_port,
-        uint32_t ms_per_packet,
-        uint32_t payload_capacity,
-        uint32_t precedence,
-        uint32_t silence_suppression,
-        uint16_t max_frames_per_packet,
-        uint32_t g723_bitrate);
</del><ins>+    uint32_t conference_id,
+    uint32_t pass_thru_party_id,
+    uint32_t remote_ip,
+    uint32_t remote_port,
+    uint32_t ms_per_packet,
+    uint32_t payload_capacity,
+    uint32_t precedence,
+    uint32_t silence_suppression,
+    uint16_t max_frames_per_packet,
+    uint32_t g723_bitrate);
</ins><span class="cx"> switch_status_t stop_media_transmission(listener_t *listener,
</span><del>-        uint32_t conference_id,
-        uint32_t pass_thru_party_id,
-        uint32_t conference_id2);
</del><ins>+    uint32_t conference_id,
+    uint32_t pass_thru_party_id,
+    uint32_t conference_id2);
</ins><span class="cx"> switch_status_t send_call_info(listener_t *listener,
</span><del>-        char calling_party_name[40],
-        char calling_party[24],
-        char called_party_name[40],
-        char called_party[24],
-        uint32_t line_instance,
-        uint32_t call_id,
-        uint32_t call_type,
-        char original_called_party_name[40],
-        char original_called_party[24],
-        char last_redirecting_party_name[40],
-        char last_redirecting_party[24],
-        uint32_t original_called_party_redirect_reason,
-        uint32_t last_redirecting_reason,
-        char calling_party_voice_mailbox[24],
-        char called_party_voice_mailbox[24],
-        char original_called_party_voice_mailbox[24],
-        char last_redirecting_voice_mailbox[24],
-        uint32_t call_instance,
-        uint32_t call_security_status,
-        uint32_t party_pi_restriction_bits);
</del><ins>+    char calling_party_name[40],
+    char calling_party[24],
+    char called_party_name[40],
+    char called_party[24],
+    uint32_t line_instance,
+    uint32_t call_id,
+    uint32_t call_type,
+    char original_called_party_name[40],
+    char original_called_party[24],
+    char last_redirecting_party_name[40],
+    char last_redirecting_party[24],
+    uint32_t original_called_party_redirect_reason,
+    uint32_t last_redirecting_reason,
+    char calling_party_voice_mailbox[24],
+    char called_party_voice_mailbox[24],
+    char original_called_party_voice_mailbox[24],
+    char last_redirecting_voice_mailbox[24],
+    uint32_t call_instance,
+    uint32_t call_security_status,
+    uint32_t party_pi_restriction_bits);
</ins><span class="cx"> switch_status_t open_receive_channel(listener_t *listener,
</span><del>-        uint32_t conference_id,
-        uint32_t pass_thru_party_id,
-        uint32_t packets,
-        uint32_t payload_capacity,
-        uint32_t echo_cancel_type,
-        uint32_t g723_bitrate,
-        uint32_t conference_id2,
-        uint32_t reserved[10]);
</del><ins>+    uint32_t conference_id,
+    uint32_t pass_thru_party_id,
+    uint32_t packets,
+    uint32_t payload_capacity,
+    uint32_t echo_cancel_type,
+    uint32_t g723_bitrate,
+    uint32_t conference_id2,
+    uint32_t reserved[10]);
</ins><span class="cx"> switch_status_t close_receive_channel(listener_t *listener,
</span><del>-        uint32_t conference_id,
-        uint32_t pass_thru_party_id,
-        uint32_t conference_id2);
</del><ins>+    uint32_t conference_id,
+    uint32_t pass_thru_party_id,
+    uint32_t conference_id2);
</ins><span class="cx"> switch_status_t send_select_soft_keys(listener_t *listener,
</span><del>-        uint32_t line_instance,
-        uint32_t call_id,
-        uint32_t soft_key_set,
-        uint32_t valid_key_mask);
</del><ins>+    uint32_t line_instance,
+    uint32_t call_id,
+    uint32_t soft_key_set,
+    uint32_t valid_key_mask);
</ins><span class="cx"> switch_status_t send_call_state(listener_t *listener,
</span><del>-        uint32_t call_state,
-        uint32_t line_instance,
-        uint32_t call_id);
</del><ins>+    uint32_t call_state,
+    uint32_t line_instance,
+    uint32_t call_id);
</ins><span class="cx"> switch_status_t display_prompt_status(listener_t *listener,
</span><del>-        uint32_t timeout,
-        char display[32],
-        uint32_t line_instance,
-        uint32_t call_id);
</del><ins>+    uint32_t timeout,
+    char display[32],
+    uint32_t line_instance,
+    uint32_t call_id);
</ins><span class="cx"> switch_status_t clear_prompt_status(listener_t *listener,
</span><del>-        uint32_t line_instance,
-        uint32_t call_id);
</del><ins>+    uint32_t line_instance,
+    uint32_t call_id);
</ins><span class="cx"> switch_status_t activate_call_plane(listener_t *listener,
</span><del>-        uint32_t line_instance);
</del><ins>+    uint32_t line_instance);
</ins><span class="cx"> switch_status_t send_dialed_number(listener_t *listener,
</span><del>-        char called_party[24],
-        uint32_t line_instance,
-        uint32_t call_id);
</del><ins>+    char called_party[24],
+    uint32_t line_instance,
+    uint32_t call_id);
</ins><span class="cx"> switch_status_t send_display_pri_notify(listener_t *listener,
</span><del>-        uint32_t message_timeout,
-        uint32_t priority,
-        char *notify);
</del><ins>+    uint32_t message_timeout,
+    uint32_t priority,
+    char *notify);
</ins><span class="cx"> switch_status_t send_reset(listener_t *listener,
</span><del>-        uint32_t reset_type);
</del><ins>+    uint32_t reset_type);
</ins><span class="cx"> 
</span><span class="cx"> #endif /* _SKINNY_PROTOCOL_H */
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skinnyskinny_tablesc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c (17173 => 17174)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c        2010-04-01 20:16:45 UTC (rev 17173)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c        2010-04-01 20:16:49 UTC (rev 17174)
</span><span class="lines">@@ -35,157 +35,157 @@
</span><span class="cx"> 
</span><span class="cx"> /* Translation tables */
</span><span class="cx"> struct skinny_table SKINNY_MESSAGE_TYPES[] = {
</span><del>-        {&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;CloseReceiveChannelMessage&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;DisplayPriNotifyMessage&quot;, DISPLAY_PRI_NOTIFY_MESSAGE},
-        {&quot;ServiceUrlStatMessage&quot;, SERVICE_URL_STAT_RES_MESSAGE},
-        {NULL, 0}
</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;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;CloseReceiveChannelMessage&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;DisplayPriNotifyMessage&quot;, DISPLAY_PRI_NOTIFY_MESSAGE},
+    {&quot;ServiceUrlStatMessage&quot;, SERVICE_URL_STAT_RES_MESSAGE},
+    {NULL, 0}
</ins><span class="cx"> };
</span><span class="cx"> SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, &quot;UnknownMessage&quot;)
</span><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><del>-        {&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}
</del><ins>+    {&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}
</ins><span class="cx"> };
</span><span class="cx"> SKINNY_DECLARE_ID2STR(skinny_ring_type2str, SKINNY_RING_TYPES, &quot;RingTypeUnknown&quot;)
</span><span class="cx"> SKINNY_DECLARE_STR2ID(skinny_str2ring_type, SKINNY_RING_TYPES, -1)
</span><span class="cx"> 
</span><span class="cx"> struct skinny_table SKINNY_RING_MODES[] = {
</span><del>-        {&quot;RingForever&quot;, SKINNY_RING_FOREVER},
-        {&quot;RingOnce&quot;, SKINNY_RING_ONCE},
-        {NULL, 0}
</del><ins>+    {&quot;RingForever&quot;, SKINNY_RING_FOREVER},
+    {&quot;RingOnce&quot;, SKINNY_RING_ONCE},
+    {NULL, 0}
</ins><span class="cx"> };
</span><span class="cx"> SKINNY_DECLARE_ID2STR(skinny_ring_mode2str, SKINNY_RING_MODES, &quot;RingModeUnknown&quot;)
</span><span class="cx"> SKINNY_DECLARE_STR2ID(skinny_str2ring_mode, SKINNY_RING_MODES, -1)
</span><span class="cx"> 
</span><span class="cx"> struct skinny_table SKINNY_BUTTONS[] = {
</span><del>-        {&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}
</del><ins>+    {&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}
</ins><span class="cx"> };
</span><span class="cx"> SKINNY_DECLARE_ID2STR(skinny_button2str, SKINNY_BUTTONS, &quot;Unknown&quot;)
</span><span class="cx"> SKINNY_DECLARE_STR2ID(skinny_str2button, SKINNY_BUTTONS, -1)
</span><span class="cx"> 
</span><span class="cx"> struct skinny_table SKINNY_LAMP_MODES[] = {
</span><del>-        {&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}
</del><ins>+    {&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}
</ins><span class="cx"> };
</span><span class="cx"> SKINNY_DECLARE_ID2STR(skinny_lamp_mode2str, SKINNY_LAMP_MODES, &quot;Unknown&quot;)
</span><span class="cx"> SKINNY_DECLARE_STR2ID(skinny_str2lamp_mode, SKINNY_LAMP_MODES, -1)
</span><span class="cx"> 
</span><span class="cx"> struct skinny_table SKINNY_SPEAKER_MODES[] = {
</span><del>-        {&quot;SpeakerOn&quot;, SKINNY_SPEAKER_ON},
-        {&quot;SpeakerOff&quot;, SKINNY_SPEAKER_OFF},
-        {NULL, 0}
</del><ins>+    {&quot;SpeakerOn&quot;, SKINNY_SPEAKER_ON},
+    {&quot;SpeakerOff&quot;, SKINNY_SPEAKER_OFF},
+    {NULL, 0}
</ins><span class="cx"> };
</span><span class="cx"> SKINNY_DECLARE_ID2STR(skinny_speaker_mode2str, SKINNY_SPEAKER_MODES, &quot;Unknown&quot;)
</span><span class="cx"> SKINNY_DECLARE_STR2ID(skinny_str2speaker_mode, SKINNY_SPEAKER_MODES, -1)
</span><span class="cx"> 
</span><span class="cx"> struct skinny_table SKINNY_KEY_SETS[] = {
</span><del>-        {&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}
</del><ins>+    {&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}
</ins><span class="cx"> };
</span><span class="cx"> SKINNY_DECLARE_ID2STR(skinny_soft_key_set2str, SKINNY_KEY_SETS, &quot;UNKNOWN_SOFT_KEY_SET&quot;)
</span><span class="cx"> SKINNY_DECLARE_STR2ID(skinny_str2soft_key_set, SKINNY_KEY_SETS, -1)
</span><span class="cx"> 
</span><span class="cx"> struct skinny_table SKINNY_CALL_STATES[] = {
</span><del>-        {&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;LineInUse&quot;, SKINNY_LINE_IN_USE},
-        {&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;InUseRemotely&quot;, SKINNY_IN_USE_REMOTELY},
-        {&quot;InvalidNumber&quot;, SKINNY_INVALID_NUMBER},
-        {NULL, 0}
</del><ins>+    {&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;LineInUse&quot;, SKINNY_LINE_IN_USE},
+    {&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;InUseRemotely&quot;, SKINNY_IN_USE_REMOTELY},
+    {&quot;InvalidNumber&quot;, SKINNY_INVALID_NUMBER},
+    {NULL, 0}
</ins><span class="cx"> };
</span><span class="cx"> SKINNY_DECLARE_ID2STR(skinny_call_state2str, SKINNY_CALL_STATES, &quot;CallStateUnknown&quot;)
</span><span class="cx"> SKINNY_DECLARE_STR2ID(skinny_str2call_state, SKINNY_CALL_STATES, -1)
</span><span class="cx"> 
</span><span class="cx"> struct skinny_table SKINNY_DEVICE_RESET_TYPES[] = {
</span><del>-        {&quot;DeviceReset&quot;, SKINNY_DEVICE_RESET},
-        {&quot;DeviceRestart&quot;, SKINNY_DEVICE_RESTART},
-        {NULL, 0}
</del><ins>+    {&quot;DeviceReset&quot;, SKINNY_DEVICE_RESET},
+    {&quot;DeviceRestart&quot;, SKINNY_DEVICE_RESTART},
+    {NULL, 0}
</ins><span class="cx"> };
</span><span class="cx"> SKINNY_DECLARE_ID2STR(skinny_device_reset_type2str, SKINNY_DEVICE_RESET_TYPES, &quot;DeviceResetTypeUnknown&quot;)
</span><span class="cx"> SKINNY_DECLARE_STR2ID(skinny_str2device_reset_type, SKINNY_DEVICE_RESET_TYPES, -1)
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skinnyskinny_tablesh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h (17173 => 17174)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h        2010-04-01 20:16:45 UTC (rev 17173)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h        2010-04-01 20:16:49 UTC (rev 17174)
</span><span class="lines">@@ -36,74 +36,74 @@
</span><span class="cx"> /* SKINNY TABLES */
</span><span class="cx"> /*****************************************************************************/
</span><span class="cx"> struct skinny_table {
</span><del>-        const char *name;
-        uint32_t id;
</del><ins>+    const char *name;
+    uint32_t id;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #define SKINNY_DECLARE_ID2STR(func, TABLE, DEFAULT_STR) \
</span><span class="cx"> const char *func(uint32_t id) \
</span><span class="cx"> { \
</span><del>-        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;\
</del><ins>+    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;\
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #define SKINNY_DECLARE_STR2ID(func, TABLE, DEFAULT_ID) \
</span><span class="cx"> uint32_t func(const char *str)\
</span><span class="cx"> {\
</span><del>-        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;\
</del><ins>+    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;\
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #define SKINNY_DECLARE_PUSH_MATCH(TABLE) \
</span><del>-        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;\
-        }
-        
</del><ins>+    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;\
+    }
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx"> struct skinny_table SKINNY_MESSAGE_TYPES[56];
</span><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 class="cx"> 
</span><span class="cx"> enum skinny_tone {
</span><del>-        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,
</del><ins>+    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,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum skinny_ring_type {
</span><del>-        SKINNY_RING_OFF = 1,
-        SKINNY_RING_INSIDE = 2,
-        SKINNY_RING_OUTSIDE = 3,
-        SKINNY_RING_FEATURE = 4
</del><ins>+    SKINNY_RING_OFF = 1,
+    SKINNY_RING_INSIDE = 2,
+    SKINNY_RING_OUTSIDE = 3,
+    SKINNY_RING_FEATURE = 4
</ins><span class="cx"> };
</span><span class="cx"> struct skinny_table SKINNY_RING_TYPES[5];
</span><span class="cx"> const char *skinny_ring_type2str(uint32_t id);
</span><span class="lines">@@ -111,8 +111,8 @@
</span><span class="cx"> #define SKINNY_PUSH_RING_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_RING_TYPES)
</span><span class="cx"> 
</span><span class="cx"> enum skinny_ring_mode {
</span><del>-        SKINNY_RING_FOREVER = 1,
-        SKINNY_RING_ONCE = 2,
</del><ins>+    SKINNY_RING_FOREVER = 1,
+    SKINNY_RING_ONCE = 2,
</ins><span class="cx"> };
</span><span class="cx"> struct skinny_table SKINNY_RING_MODES[3];
</span><span class="cx"> const char *skinny_ring_mode2str(uint32_t id);
</span><span class="lines">@@ -121,11 +121,11 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> enum skinny_lamp_mode {
</span><del>-        SKINNY_LAMP_OFF = 1,
-        SKINNY_LAMP_ON = 2,
-        SKINNY_LAMP_WINK = 3,
-        SKINNY_LAMP_FLASH = 4,
-        SKINNY_LAMP_BLINK = 5,
</del><ins>+    SKINNY_LAMP_OFF = 1,
+    SKINNY_LAMP_ON = 2,
+    SKINNY_LAMP_WINK = 3,
+    SKINNY_LAMP_FLASH = 4,
+    SKINNY_LAMP_BLINK = 5,
</ins><span class="cx"> };
</span><span class="cx"> struct skinny_table SKINNY_LAMP_MODES[6];
</span><span class="cx"> const char *skinny_lamp_mode2str(uint32_t id);
</span><span class="lines">@@ -133,8 +133,8 @@
</span><span class="cx"> #define SKINNY_PUSH_LAMP_MODES SKINNY_DECLARE_PUSH_MATCH(SKINNY_LAMP_MODES)
</span><span class="cx"> 
</span><span class="cx"> enum skinny_speaker_mode {
</span><del>-        SKINNY_SPEAKER_ON = 1,
-        SKINNY_SPEAKER_OFF = 2,
</del><ins>+    SKINNY_SPEAKER_ON = 1,
+    SKINNY_SPEAKER_OFF = 2,
</ins><span class="cx"> };
</span><span class="cx"> struct skinny_table SKINNY_SPEAKER_MODES[3];
</span><span class="cx"> const char *skinny_speaker_mode2str(uint32_t id);
</span><span class="lines">@@ -142,20 +142,20 @@
</span><span class="cx"> #define SKINNY_PUSH_SPEAKER_MODES SKINNY_DECLARE_PUSH_MATCH(SKINNY_SPEAKER_MODES)
</span><span class="cx"> 
</span><span class="cx"> enum skinny_call_type {
</span><del>-        SKINNY_INBOUND_CALL = 1,
-        SKINNY_OUTBOUND_CALL = 2,
-        SKINNY_FORWARD_CALL = 3,
</del><ins>+    SKINNY_INBOUND_CALL = 1,
+    SKINNY_OUTBOUND_CALL = 2,
+    SKINNY_FORWARD_CALL = 3,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum skinny_button_definition {
</span><del>-        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,
</del><ins>+    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,
</ins><span class="cx"> };
</span><span class="cx"> struct skinny_table SKINNY_BUTTONS[9];
</span><span class="cx"> const char *skinny_button2str(uint32_t id);
</span><span class="lines">@@ -163,39 +163,39 @@
</span><span class="cx"> #define SKINNY_PUSH_STIMULI SKINNY_DECLARE_PUSH_MATCH(SKINNY_BUTTONS)
</span><span class="cx"> 
</span><span class="cx"> enum skinny_soft_key_event {
</span><del>-        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,
</del><ins>+    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,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum skinny_key_set {
</span><del>-        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,
</del><ins>+    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,
</ins><span class="cx"> };
</span><span class="cx"> struct skinny_table SKINNY_KEY_SETS[11];
</span><span class="cx"> const char *skinny_soft_key_set2str(uint32_t id);
</span><span class="lines">@@ -204,20 +204,20 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> enum skinny_call_state {
</span><del>-        SKINNY_OFF_HOOK = 1,
-        SKINNY_ON_HOOK = 2,
-        SKINNY_RING_OUT = 3,
-        SKINNY_RING_IN = 4,
-        SKINNY_CONNECTED = 5,
-        SKINNY_BUSY = 6,
-        SKINNY_LINE_IN_USE = 7,
-        SKINNY_HOLD = 8,
-        SKINNY_CALL_WAITING = 9,
-        SKINNY_CALL_TRANSFER = 10,
-        SKINNY_CALL_PARK = 11,
-        SKINNY_PROCEED = 12,
-        SKINNY_IN_USE_REMOTELY = 13,
-        SKINNY_INVALID_NUMBER = 14
</del><ins>+    SKINNY_OFF_HOOK = 1,
+    SKINNY_ON_HOOK = 2,
+    SKINNY_RING_OUT = 3,
+    SKINNY_RING_IN = 4,
+    SKINNY_CONNECTED = 5,
+    SKINNY_BUSY = 6,
+    SKINNY_LINE_IN_USE = 7,
+    SKINNY_HOLD = 8,
+    SKINNY_CALL_WAITING = 9,
+    SKINNY_CALL_TRANSFER = 10,
+    SKINNY_CALL_PARK = 11,
+    SKINNY_PROCEED = 12,
+    SKINNY_IN_USE_REMOTELY = 13,
+    SKINNY_INVALID_NUMBER = 14
</ins><span class="cx"> };
</span><span class="cx"> struct skinny_table SKINNY_CALL_STATES[15];
</span><span class="cx"> const char *skinny_call_state2str(uint32_t id);
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>