<!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][15030] </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=15030">15030</a></dd>
<dt>Author</dt> <dd>gmaruzz</dd>
<dt>Date</dt> <dd>2009-10-01 06:20:48 -0500 (Thu, 01 Oct 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>celliax: added setmixers, a script that sets the audio levels for GSMopen interfaces</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchbranchesgmaruzzmod_celliaxmod_celliaxc">freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchbranchesgmaruzzmod_celliaxmod_celliaxc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c (15029 => 15030)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c        2009-10-01 00:45:17 UTC (rev 15029)
+++ freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c        2009-10-01 11:20:48 UTC (rev 15030)
</span><span class="lines">@@ -1104,6 +1104,8 @@
</span><span class="cx">  *
</span><span class="cx">  */
</span><span class="cx"> /* BEGIN: Changes heres */
</span><ins>+
+
</ins><span class="cx"> static switch_status_t load_config(int reload_type)
</span><span class="cx"> /* END: Changes heres */
</span><span class="cx"> {
</span><span class="lines">@@ -1142,6 +1144,1331 @@
</span><span class="cx">                                 set_global_context(val);
</span><span class="cx">                                 DEBUGA_CELLIAX(&quot;globals.context=%s\n&quot;, CELLIAX_P_LOG, globals.context);
</span><span class="cx"> 
</span><ins>+                        }
+
+                }
+        }
+
+        if ((interfaces = switch_xml_child(cfg, &quot;per_interface_settings&quot;))) {
+                int i = 0;
+
+                for (myinterface = switch_xml_child(interfaces, &quot;interface&quot;); myinterface; myinterface = myinterface-&gt;next) {
+                        char *id = (char *) switch_xml_attr(myinterface, &quot;id&quot;);
+                        char *name = (char *) switch_xml_attr(myinterface, &quot;name&quot;);
+                        char *context = &quot;default&quot;;
+                        char *dialplan = &quot;XML&quot;;
+                        char *destination = &quot;5000&quot;;
+                        char *controldevice_name = &quot;/dev/ttyACM0&quot;;
+                        char *digit_timeout = NULL;
+                        char *max_digits = NULL;
+                        char *hotline = NULL;
+                        char *dial_regex = NULL;
+                        char *hold_music = NULL;
+                        char *fail_dial_regex = NULL;
+                        char *enable_callerid = &quot;true&quot;;
+
+
+                        char *at_dial_pre_number= &quot;ATD&quot;;
+                        char *at_dial_post_number= &quot;;&quot;;
+                        char *at_dial_expect= &quot;OK&quot;;
+                        char *at_hangup= &quot;ATH&quot;;
+                        char *at_hangup_expect= &quot;OK&quot;;
+                        char *at_answer= &quot;ATA&quot;;
+                        char *at_answer_expect= &quot;OK&quot;;
+                        char *at_send_dtmf= &quot;AT+VTS&quot;;
+                        char *at_preinit_1= &quot;&quot;;
+                        char *at_preinit_1_expect= &quot;&quot;;
+                        char *at_preinit_2= &quot;&quot;;
+                        char *at_preinit_2_expect= &quot;&quot;;
+                        char *at_preinit_3= &quot;&quot;;
+                        char *at_preinit_3_expect= &quot;&quot;;
+                        char *at_preinit_4= &quot;&quot;;
+                        char *at_preinit_4_expect= &quot;&quot;;
+                        char *at_preinit_5= &quot;&quot;;
+                        char *at_preinit_5_expect= &quot;&quot;;
+                        char *at_postinit_1= &quot;at+cmic=0,9&quot;;
+                        char *at_postinit_1_expect= &quot;OK&quot;;
+                        char *at_postinit_2= &quot;AT+CKPD=\&quot;EEE\&quot;&quot;;
+                        char *at_postinit_2_expect= &quot;OK&quot;;
+                        char *at_postinit_3= &quot;AT+CSSN=1,0&quot;;
+                        char *at_postinit_3_expect= &quot;OK&quot;;
+                        char *at_postinit_4= &quot;at+sidet=0&quot;;
+                        char *at_postinit_4_expect= &quot;OK&quot;;
+                        char *at_postinit_5= &quot;at+clvl=99&quot;;
+                        char *at_postinit_5_expect= &quot;OK&quot;;
+                        char *at_query_battchg= &quot;AT+CBC&quot;;
+                        char *at_query_battchg_expect= &quot;OK&quot;;
+                        char *at_query_signal= &quot;AT+CSQ&quot;;
+                        char *at_query_signal_expect= &quot;OK&quot;;
+                        char *at_call_idle= &quot;+MCST: 1&quot;;
+                        char *at_call_incoming= &quot;+MCST: 2&quot;;
+                        char *at_call_active= &quot;+CSSI: 7&quot;;
+                        char *at_call_failed= &quot;+MCST: 65&quot;;
+                        char *at_call_calling= &quot;+CSSI: 1&quot;;
+                        char *at_indicator_noservice_string= &quot;CIEV: 2;0&quot;;
+                        char *at_indicator_nosignal_string= &quot;CIEV: 5;0&quot;;
+                        char *at_indicator_lowsignal_string= &quot;CIEV: 5;1&quot;;
+                        char *at_indicator_lowbattchg_string= &quot;CIEV: 0;1&quot;;
+                        char *at_indicator_nobattchg_string= &quot;CIEV: 0;0&quot;;
+                        char *at_indicator_callactive_string= &quot;CIEV: 3;1&quot;;
+                        char *at_indicator_nocallactive_string= &quot;CIEV: 3;0&quot;;
+                        char *at_indicator_nocallsetup_string= &quot;CIEV: 6;0&quot;;
+                        char *at_indicator_callsetupincoming_string= &quot;CIEV: 6;1&quot;;
+                        char *at_indicator_callsetupoutgoing_string= &quot;CIEV: 6;2&quot;;
+                        char *at_indicator_callsetupremoteringing_string= &quot;CIEV: 6;3&quot;;
+                        char *sms_receiving_program= &quot;/usr/local/bin/ciapalo&quot;;
+                        char *alsacname= &quot;plughw:1&quot;;
+                        char *alsapname= &quot;plughw:1&quot;;
+
+                        uint32_t interface_id = 0, to = 0, max = 0;
+                        uint32_t controldevice_speed = B115200;
+                        uint32_t controldevprotocol = PROTOCOL_AT;
+                        uint32_t running =1;
+                        uint32_t at_early_audio =0;
+                        uint32_t at_after_preinit_pause=500000;
+                        uint32_t at_initial_pause=500000;
+                        uint32_t at_has_clcc=0;
+                        uint32_t at_has_ecam=0;
+                        uint32_t alsa_period_size=160;
+                        uint32_t alsa_periods_in_buffer=4;
+                        uint32_t celliax_sound_rate=8000;
+                        uint32_t alsa_play_is_mono=1;
+                        uint32_t alsa_capture_is_mono=1;
+                        uint32_t capture_boost=5;
+                        uint32_t playback_boost=10;
+
+
+                        tech_pvt = NULL;
+
+                        for (param = switch_xml_child(myinterface, &quot;param&quot;); param; param = param-&gt;next) {
+                                char *var = (char *) switch_xml_attr_soft(param, &quot;name&quot;);
+                                char *val = (char *) switch_xml_attr_soft(param, &quot;value&quot;);
+
+                                if (!strcasecmp(var, &quot;id&quot;)) {
+                                        id = val;
+                                } else if (!strcasecmp(var, &quot;name&quot;)) {
+                                        name = val;
+                                } else if (!strcasecmp(var, &quot;context&quot;)) {
+                                        context = val;
+                                } else if (!strcasecmp(var, &quot;dialplan&quot;)) {
+                                        dialplan = val;
+                                } else if (!strcasecmp(var, &quot;destination&quot;)) {
+                                        destination = val;
+                                } else if (!strcasecmp(var, &quot;controldevice_name&quot;)) {
+                                        controldevice_name = val;
+                                } else if (!strcasecmp(var, &quot;digit_timeout&quot;)) {
+                                        digit_timeout = val;
+                                } else if (!strcasecmp(var, &quot;max_digits&quot;)) {
+                                        max_digits = val;
+                                } else if (!strcasecmp(var, &quot;hotline&quot;)) {
+                                        hotline = val;
+                                } else if (!strcasecmp(var, &quot;dial_regex&quot;)) {
+                                        dial_regex = val;
+                                } else if (!strcasecmp(var, &quot;hold_music&quot;)) {
+                                        hold_music = val;
+                                } else if (!strcasecmp(var, &quot;fail_dial_regex&quot;)) {
+                                        fail_dial_regex = val;
+                                } else if (!strcasecmp(var, &quot;enable_callerid&quot;)) {
+                                        enable_callerid = val;
+                                } else if (!strcasecmp(var, &quot;at_dial_pre_number&quot;)) {
+                                        at_dial_pre_number = val;
+                                } else if (!strcasecmp(var, &quot;at_dial_post_number&quot;)) {
+                                        at_dial_post_number = val;
+                                } else if (!strcasecmp(var, &quot;at_dial_expect&quot;)) {
+                                        at_dial_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_hangup&quot;)) {
+                                        at_hangup = val;
+                                } else if (!strcasecmp(var, &quot;at_hangup_expect&quot;)) {
+                                        at_hangup_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_answer&quot;)) {
+                                        at_answer = val;
+                                } else if (!strcasecmp(var, &quot;at_answer_expect&quot;)) {
+                                        at_answer_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_send_dtmf&quot;)) {
+                                        at_send_dtmf = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_1&quot;)) {
+                                        at_preinit_1 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_1_expect&quot;)) {
+                                        at_preinit_1_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_2&quot;)) {
+                                        at_preinit_2 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_2_expect&quot;)) {
+                                        at_preinit_2_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_3&quot;)) {
+                                        at_preinit_3 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_3_expect&quot;)) {
+                                        at_preinit_3_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_4&quot;)) {
+                                        at_preinit_4 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_4_expect&quot;)) {
+                                        at_preinit_4_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_5&quot;)) {
+                                        at_preinit_5 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_5_expect&quot;)) {
+                                        at_preinit_5_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_1&quot;)) {
+                                        at_postinit_1 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_1_expect&quot;)) {
+                                        at_postinit_1_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_2&quot;)) {
+                                        at_postinit_2 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_2_expect&quot;)) {
+                                        at_postinit_2_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_3&quot;)) {
+                                        at_postinit_3 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_3_expect&quot;)) {
+                                        at_postinit_3_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_4&quot;)) {
+                                        at_postinit_4 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_4_expect&quot;)) {
+                                        at_postinit_4_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_5&quot;)) {
+                                        at_postinit_5 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_5_expect&quot;)) {
+                                        at_postinit_5_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_query_battchg&quot;)) {
+                                        at_query_battchg = val;
+                                } else if (!strcasecmp(var, &quot;at_query_battchg_expect&quot;)) {
+                                        at_query_battchg_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_query_signal&quot;)) {
+                                        at_query_signal = val;
+                                } else if (!strcasecmp(var, &quot;at_query_signal_expect&quot;)) {
+                                        at_query_signal_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_call_idle&quot;)) {
+                                        at_call_idle = val;
+                                } else if (!strcasecmp(var, &quot;at_call_incoming&quot;)) {
+                                        at_call_incoming = val;
+                                } else if (!strcasecmp(var, &quot;at_call_active&quot;)) {
+                                        at_call_active = val;
+                                } else if (!strcasecmp(var, &quot;at_call_failed&quot;)) {
+                                        at_call_failed = val;
+                                } else if (!strcasecmp(var, &quot;at_call_calling&quot;)) {
+                                        at_call_calling = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_noservice_string&quot;)) {
+                                        at_indicator_noservice_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_nosignal_string&quot;)) {
+                                        at_indicator_nosignal_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_lowsignal_string&quot;)) {
+                                        at_indicator_lowsignal_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_lowbattchg_string&quot;)) {
+                                        at_indicator_lowbattchg_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_nobattchg_string&quot;)) {
+                                        at_indicator_nobattchg_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_callactive_string&quot;)) {
+                                        at_indicator_callactive_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_nocallactive_string&quot;)) {
+                                        at_indicator_nocallactive_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_nocallsetup_string&quot;)) {
+                                        at_indicator_nocallsetup_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_callsetupincoming_string&quot;)) {
+                                        at_indicator_callsetupincoming_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_callsetupoutgoing_string&quot;)) {
+                                        at_indicator_callsetupoutgoing_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_callsetupremoteringing_string&quot;)) {
+                                        at_indicator_callsetupremoteringing_string = val;
+                                } else if (!strcasecmp(var, &quot;sms_receiving_program&quot;)) {
+                                        sms_receiving_program = val;
+                                } else if (!strcasecmp(var, &quot;alsacname&quot;)) {
+                                        alsacname = val;
+                                } else if (!strcasecmp(var, &quot;alsapname&quot;)) {
+                                        alsapname = val;
+
+#ifdef NOT_NUMBERS_NOW
+                                        interface_id 
+                                                controldevice_speed 
+                                                controldevprotocol 
+                                                at_early_audio 
+                                                at_after_preinit_pause
+                                                at_initial_pause
+                                                at_has_clcc
+                                                at_has_ecam
+                                                alsa_period_size
+                                                alsa_periods_in_buffer
+                                                celliax_sound_rate
+                                                alsa_play_is_mono
+                                                alsa_capture_is_mono
+                                                capture_boost
+                                                playback_boost
+#endif// NOT_NUMBERS_NOW
+
+
+                                }
+
+                        }
+
+                        /* BEGIN: Changes here */
+                        if (reload_type == SOFT_RELOAD) {
+                                char the_interface[256];
+                                sprintf(the_interface, &quot;#%s&quot;, name);
+
+                                if (interface_exists(the_interface) == SWITCH_STATUS_SUCCESS) {
+                                        continue;
+                                }
+                        }
+                        /* END: Changes here */
+
+                        if (!id) {
+                                ERRORA(&quot;interface missing REQUIRED param 'id'\n&quot;, CELLIAX_P_LOG);
+                                continue;
+                        }
+                        if (switch_is_number(id)) {
+                                interface_id = atoi(id);
+                                DEBUGA_CELLIAX(&quot;interface_id=%d\n&quot;, CELLIAX_P_LOG, interface_id);
+                        } else {
+                                ERRORA(&quot;interface param 'id' MUST be a number, now id='%s'\n&quot;, CELLIAX_P_LOG, id);
+                                continue;
+                        }
+
+                        if (!name) {
+                                WARNINGA(&quot;interface missing param 'name', not nice, but works\n&quot;, CELLIAX_P_LOG);
+                        }
+
+                        if (digit_timeout) {
+                                to = atoi(digit_timeout);
+                        }
+
+                        if (max_digits) {
+                                max = atoi(max_digits);
+                        }
+
+                        if (name) {
+                                DEBUGA_CELLIAX(&quot;name=%s\n&quot;, CELLIAX_P_LOG, name);
+                        }
+                        if (interface_id &amp;&amp; interface_id &lt; CELLIAX_MAX_INTERFACES) {
+                                private_t newconf;
+                                switch_threadattr_t *celliax_api_thread_attr = NULL;
+
+                                memset(&amp;newconf, '\0', sizeof(newconf));
+                                globals.CELLIAX_INTERFACES[interface_id] = newconf;
+
+
+                                tech_pvt = &amp;globals.CELLIAX_INTERFACES[interface_id];
+
+                                switch_mutex_init(&amp;globals.CELLIAX_INTERFACES[interface_id].controldev_lock, SWITCH_MUTEX_NESTED, celliax_module_pool);
+
+
+                                //FIXME switch_set_string(globals.CELLIAX_INTERFACES[interface_id].id , id );
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].name , name );
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].context , context );
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].dialplan , dialplan );
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].destination , destination );
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].controldevice_name , controldevice_name );
+                                //FIXME switch_set_string(globals.CELLIAX_INTERFACES[interface_id].digit_timeout , digit_timeout );
+                                //FIXME switch_set_string(globals.CELLIAX_INTERFACES[interface_id].max_digits , max_digits );
+                                //FIXME switch_set_string(globals.CELLIAX_INTERFACES[interface_id].hotline , hotline );
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].dial_regex , dial_regex );
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].hold_music , hold_music );
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].fail_dial_regex , fail_dial_regex );
+                                //FIXME switch_set_string(globals.CELLIAX_INTERFACES[interface_id].enable_callerid , enable_callerid );
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_pre_number, at_dial_pre_number);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_post_number, at_dial_post_number);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_expect, at_dial_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_hangup, at_hangup);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_hangup_expect, at_hangup_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_answer, at_answer);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_answer_expect, at_answer_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_send_dtmf, at_send_dtmf);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_1, at_preinit_1);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_1_expect, at_preinit_1_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_2, at_preinit_2);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_2_expect, at_preinit_2_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_3, at_preinit_3);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_3_expect, at_preinit_3_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_4, at_preinit_4);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_4_expect, at_preinit_4_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_5, at_preinit_5);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_5_expect, at_preinit_5_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_1, at_postinit_1);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_1_expect, at_postinit_1_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_2, at_postinit_2);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_2_expect, at_postinit_2_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_3, at_postinit_3);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_3_expect, at_postinit_3_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_4, at_postinit_4);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_4_expect, at_postinit_4_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_5, at_postinit_5);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_5_expect, at_postinit_5_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_battchg, at_query_battchg);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_battchg_expect, at_query_battchg_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_signal, at_query_signal);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_signal_expect, at_query_signal_expect);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_idle, at_call_idle);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_incoming, at_call_incoming);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_active, at_call_active);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_failed, at_call_failed);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_calling, at_call_calling);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_noservice_string, at_indicator_noservice_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nosignal_string, at_indicator_nosignal_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_lowsignal_string, at_indicator_lowsignal_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_lowbattchg_string, at_indicator_lowbattchg_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nobattchg_string, at_indicator_nobattchg_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callactive_string, at_indicator_callactive_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nocallactive_string, at_indicator_nocallactive_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nocallsetup_string, at_indicator_nocallsetup_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupincoming_string, at_indicator_callsetupincoming_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupoutgoing_string, at_indicator_callsetupoutgoing_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string, at_indicator_callsetupremoteringing_string);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].sms_receiving_program, sms_receiving_program);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].alsacname, alsacname);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].alsapname, alsapname);
+
+
+#ifdef NOTDEF
+                                if (name) {
+                                        switch_set_string(globals.CELLIAX_INTERFACES[interface_id].name, name);
+                                } else {
+                                        switch_set_string(globals.CELLIAX_INTERFACES[interface_id].name, &quot;N/A&quot;);
+                                }
+                                DEBUGA_CELLIAX(&quot;CONFIGURING interface_id=%d name=%s\n&quot;, CELLIAX_P_LOG, interface_id, name);
+
+                                switch_mutex_init(&amp;globals.CELLIAX_INTERFACES[interface_id].controldev_lock, SWITCH_MUTEX_NESTED, celliax_module_pool);
+
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].interface_id, id);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].context, context);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].dialplan, dialplan);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].destination, destination);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].controldevice_name, controldevice_name);
+
+                                globals.CELLIAX_INTERFACES[interface_id].controldevice_speed = controldevice_speed;
+                                globals.CELLIAX_INTERFACES[interface_id].controldevprotocol = controldevprotocol;
+                                globals.CELLIAX_INTERFACES[interface_id].running = 1;
+                                globals.CELLIAX_INTERFACES[interface_id].at_early_audio = 0;
+                                globals.CELLIAX_INTERFACES[interface_id].at_after_preinit_pause = 500000;
+                                globals.CELLIAX_INTERFACES[interface_id].at_initial_pause = 500000;
+                                globals.CELLIAX_INTERFACES[interface_id].at_has_clcc = 0;
+                                globals.CELLIAX_INTERFACES[interface_id].at_has_ecam = 0;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_period_size = 160;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_periods_in_buffer = 4;
+                                globals.CELLIAX_INTERFACES[interface_id].celliax_sound_rate = 8000;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_play_is_mono = 1;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_capture_is_mono = 1;
+                                globals.CELLIAX_INTERFACES[interface_id].capture_boost = 0;
+                                globals.CELLIAX_INTERFACES[interface_id].playback_boost = 0;
+
+
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_pre_number, &quot;ATD&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_post_number, &quot;;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_hangup, &quot;ATH&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_hangup_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_answer, &quot;ATA&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_answer_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_send_dtmf, &quot;AT+VTS&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_1, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_1_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_2, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_2_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_3, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_3_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_4, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_4_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_5, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_5_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_1, &quot;at+cmic=0,9&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_1_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_2, &quot;AT+CKPD=\&quot;EEE\&quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_2_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_3, &quot;AT+CSSN=1,0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_3_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_4, &quot;at+sidet=0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_4_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_5, &quot;at+clvl=99&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_5_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_battchg, &quot;AT+CBC&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_battchg_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_signal, &quot;AT+CSQ&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_signal_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_idle, &quot;+MCST: 1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_incoming, &quot;+MCST: 2&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_active, &quot;+CSSI: 7&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_failed, &quot;+MCST: 65&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_calling, &quot;+CSSI: 1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_noservice_string, &quot;CIEV: 2;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nosignal_string, &quot;CIEV: 5;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_lowsignal_string, &quot;CIEV: 5;1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_lowbattchg_string, &quot;CIEV: 0;1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nobattchg_string, &quot;CIEV: 0;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callactive_string, &quot;CIEV: 3;1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nocallactive_string, &quot;CIEV: 3;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nocallsetup_string, &quot;CIEV: 6;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupincoming_string, &quot;CIEV: 6;1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupoutgoing_string, &quot;CIEV: 6;2&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string, &quot;CIEV: 6;3&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].sms_receiving_program, &quot;/usr/local/bin/ciapalo&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].alsacname, &quot;plughw:1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].alsapname, &quot;plughw:1&quot;);
+#endif//NOTDEF
+
+
+
+                                globals.CELLIAX_INTERFACES[interface_id].controldevice_speed = controldevice_speed;
+                                globals.CELLIAX_INTERFACES[interface_id].controldevprotocol = controldevprotocol;
+                                globals.CELLIAX_INTERFACES[interface_id].at_early_audio = at_early_audio;
+                                globals.CELLIAX_INTERFACES[interface_id].at_after_preinit_pause = at_after_preinit_pause;
+                                globals.CELLIAX_INTERFACES[interface_id].at_initial_pause = at_initial_pause;
+                                globals.CELLIAX_INTERFACES[interface_id].at_has_clcc = at_has_clcc;
+                                globals.CELLIAX_INTERFACES[interface_id].at_has_ecam = at_has_ecam;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_period_size = alsa_period_size;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_periods_in_buffer = alsa_periods_in_buffer;
+                                globals.CELLIAX_INTERFACES[interface_id].celliax_sound_rate = celliax_sound_rate;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_play_is_mono = alsa_play_is_mono;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_capture_is_mono = alsa_capture_is_mono;
+                                globals.CELLIAX_INTERFACES[interface_id].capture_boost = capture_boost;
+                                globals.CELLIAX_INTERFACES[interface_id].playback_boost = playback_boost;
+                                globals.CELLIAX_INTERFACES[interface_id].running = running; //FIXME
+
+                                celliax_store_boost(&quot;5&quot;, &amp;globals.CELLIAX_INTERFACES[interface_id].capture_boost); //FIXME
+                                celliax_store_boost(&quot;10&quot;, &amp;globals.CELLIAX_INTERFACES[interface_id].playback_boost); //FIXME
+
+
+                                DEBUGA_CELLIAX(&quot;interface_id=%d globals.CELLIAX_INTERFACES[interface_id].name=%s\n&quot;,
+                                                CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].name);
+                                DEBUGA_CELLIAX
+                                        (&quot;interface_id=%d globals.CELLIAX_INTERFACES[interface_id].dialplan=%s\n&quot;,
+                                         CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].dialplan);
+                                DEBUGA_CELLIAX
+                                        (&quot;interface_id=%d globals.CELLIAX_INTERFACES[interface_id].destination=%s\n&quot;,
+                                         CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].destination);
+                                DEBUGA_CELLIAX
+                                        (&quot;interface_id=%d globals.CELLIAX_INTERFACES[interface_id].context=%s\n&quot;,
+                                         CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].context);
+                                WARNINGA(&quot;STARTING interface_id=%d\n&quot;, CELLIAX_P_LOG, interface_id);
+
+                                int res = 0;
+
+                                /* init the serial port */
+                                if (globals.CELLIAX_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
+                                        globals.CELLIAX_INTERFACES[interface_id].controldevfd =
+                                                celliax_serial_init(&amp;globals.CELLIAX_INTERFACES[interface_id], globals.CELLIAX_INTERFACES[interface_id].controldevice_speed);
+                                        if (globals.CELLIAX_INTERFACES[interface_id].controldevfd &lt; 1) {
+                                                ERRORA(&quot;celliax_serial_init failed\n&quot;, CELLIAX_P_LOG);
+                                                return SWITCH_STATUS_FALSE;
+                                                //celliax_sound_shutdown(tmp);
+                                                //if (tmp)
+                                                //free(tmp);
+                                                //return NULL;
+                                        }
+                                }
+
+                                /* config the phone/modem on the serial port */
+                                if (globals.CELLIAX_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
+                                        //int res;
+                                        res = celliax_serial_config(&amp;globals.CELLIAX_INTERFACES[interface_id]);
+                                        if (res) {
+                                                ERRORA(&quot;celliax_serial_config failed\n&quot;, CELLIAX_P_LOG);
+                                                return SWITCH_STATUS_FALSE;
+                                                //celliax_sound_shutdown(tmp);
+                                                //if (tmp)
+                                                //free(tmp);
+                                                //return NULL;
+                                        }
+                                }
+
+
+                                switch_sleep(100000);
+                                switch_threadattr_create(&amp;celliax_api_thread_attr, celliax_module_pool);
+                                switch_threadattr_stacksize_set(celliax_api_thread_attr, SWITCH_THREAD_STACKSIZE);
+                                switch_thread_create(&amp;globals.CELLIAX_INTERFACES[interface_id].celliax_api_thread, celliax_api_thread_attr, celliax_do_celliaxapi_thread,
+                                                &amp;globals.CELLIAX_INTERFACES[interface_id], celliax_module_pool);
+
+                                switch_sleep(100000);
+
+                        } else {
+                                ERRORA(&quot;interface id %d is higher than CELLIAX_MAX_INTERFACES (%d)\n&quot;, CELLIAX_P_LOG, interface_id, CELLIAX_MAX_INTERFACES);
+                                continue;
+                        }
+
+                }
+
+                for (i = 0; i &lt; CELLIAX_MAX_INTERFACES; i++) {
+                        if (strlen(globals.CELLIAX_INTERFACES[i].name)) {
+                                /* How many real intterfaces */
+                                globals.real_interfaces = i + 1;
+
+                                tech_pvt = &amp;globals.CELLIAX_INTERFACES[i];
+
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].interface_id=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].interface_id);
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].name=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].name);
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].context=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].context);
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].dialplan=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].dialplan);
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].destination=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].destination);
+                        }
+                }
+        }
+
+        switch_mutex_unlock(globals.mutex);
+        switch_xml_free(xml);
+
+        return SWITCH_STATUS_SUCCESS;
+}
+#ifdef NOTDEF
+                                } else if (!strcasecmp(var, &quot;context&quot;)) {
+                                        context = val;
+                                } else if (!strcasecmp(var, &quot;dialplan&quot;)) {
+                                        dialplan = val;
+                                } else if (!strcasecmp(var, &quot;destination&quot;)) {
+                                        destination = val;
+                                } else if (!strcasecmp(var, &quot;dial-regex&quot;)) {
+                                        dial_regex = val;
+                                } else if (!strcasecmp(var, &quot;enable-callerid&quot;)) {
+                                        enable_callerid = val;
+                                } else if (!strcasecmp(var, &quot;fail-dial-regex&quot;)) {
+                                        fail_dial_regex = val;
+                                } else if (!strcasecmp(var, &quot;hold-music&quot;)) {
+                                        hold_music = val;
+                                } else if (!strcasecmp(var, &quot;max_digits&quot;) || !strcasecmp(var, &quot;max-digits&quot;)) {
+                                        max_digits = val;
+                                } else if (!strcasecmp(var, &quot;hotline&quot;)) {
+                                        hotline = val;
+
+
+                        id 
+                        name 
+                        context 
+                        dialplan 
+                        destination 
+                        controldevice_name 
+                        digit_timeout 
+                        max_digits 
+                        hotline 
+                        dial_regex 
+                        hold_music 
+                        fail_dial_regex 
+                        enable_callerid 
+
+
+                        at_dial_pre_number
+                        at_dial_post_number
+                        at_dial_expect
+                        at_hangup
+                        at_hangup_expect
+                        at_answer
+                        at_answer_expect
+                        at_send_dtmf
+                        at_preinit_1
+                        at_preinit_1_expect
+                        at_preinit_2
+                        at_preinit_2_expect
+                        at_preinit_3
+                        at_preinit_3_expect
+                        at_preinit_4
+                        at_preinit_4_expect
+                        at_preinit_5
+                        at_preinit_5_expect
+                        at_postinit_1
+                        at_postinit_1_expect
+                        at_postinit_2
+                        at_postinit_2_expect
+                        at_postinit_3
+                        at_postinit_3_expect
+                        at_postinit_4
+                        at_postinit_4_expect
+                        at_postinit_5
+                        at_postinit_5_expect
+                        at_query_battchg
+                        at_query_battchg_expect
+                        at_query_signal
+                        at_query_signal_expect
+                        at_call_idle
+                        at_call_incoming
+                        at_call_active
+                        at_call_failed
+                        at_call_calling
+                        at_indicator_noservice_string
+                        at_indicator_nosignal_string
+                        at_indicator_lowsignal_string
+                        at_indicator_lowbattchg_string
+                        at_indicator_nobattchg_string
+                        at_indicator_callactive_string
+                        at_indicator_nocallactive_string
+                        at_indicator_nocallsetup_string
+                        at_indicator_callsetupincoming_string
+                        at_indicator_callsetupoutgoing_string
+                        at_indicator_callsetupremoteringing_string
+                        sms_receiving_program
+                        alsacname
+                        alsapname
+
+                        interface_id 
+                        controldevice_speed 
+                        controldevprotocol 
+                        at_early_audio 
+                        at_after_preinit_pause
+                        at_initial_pause
+                        at_has_clcc
+                        at_has_ecam
+                        alsa_period_size
+                        alsa_periods_in_buffer
+                        celliax_sound_rate
+                        alsa_play_is_mono
+                        alsa_capture_is_mono
+                        capture_boost
+                        playback_boost
+
+
+#endif //NOTDEF
+
+
+#ifdef NEW_OLD
+static switch_status_t load_config(int reload_type)
+/* END: Changes heres */
+{
+        char *cf = &quot;celliax.conf&quot;;
+        switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface;
+        private_t *tech_pvt = NULL;
+
+        switch_mutex_init(&amp;globals.mutex, SWITCH_MUTEX_NESTED, celliax_module_pool);
+        if (!(xml = switch_xml_open_cfg(cf, &amp;cfg, NULL))) {
+                ERRORA(&quot;open of %s failed\n&quot;, CELLIAX_P_LOG, cf);
+                running = 0;
+                switch_xml_free(xml);
+                return SWITCH_STATUS_TERM;
+        }
+
+        switch_mutex_lock(globals.mutex);
+        if ((global_settings = switch_xml_child(cfg, &quot;global_settings&quot;))) {
+                for (param = switch_xml_child(global_settings, &quot;param&quot;); param; param = param-&gt;next) {
+                        char *var = (char *) switch_xml_attr_soft(param, &quot;name&quot;);
+                        char *val = (char *) switch_xml_attr_soft(param, &quot;value&quot;);
+
+                        if (!strcasecmp(var, &quot;debug&quot;)) {
+                                DEBUGA_CELLIAX(&quot;globals.debug=%d\n&quot;, CELLIAX_P_LOG, globals.debug);
+                                globals.debug = atoi(val);
+                                DEBUGA_CELLIAX(&quot;globals.debug=%d\n&quot;, CELLIAX_P_LOG, globals.debug);
+                        } else if (!strcasecmp(var, &quot;hold-music&quot;)) {
+                                switch_set_string(globals.hold_music, val);
+                                DEBUGA_CELLIAX(&quot;globals.hold_music=%s\n&quot;, CELLIAX_P_LOG, globals.hold_music);
+                        } else if (!strcmp(var, &quot;dialplan&quot;)) {
+                                set_global_dialplan(val);
+                                DEBUGA_CELLIAX(&quot;globals.dialplan=%s\n&quot;, CELLIAX_P_LOG, globals.dialplan);
+                        } else if (!strcmp(var, &quot;destination&quot;)) {
+                                set_global_destination(val);
+                                DEBUGA_CELLIAX(&quot;globals.destination=%s\n&quot;, CELLIAX_P_LOG, globals.destination);
+                        } else if (!strcmp(var, &quot;context&quot;)) {
+                                set_global_context(val);
+                                DEBUGA_CELLIAX(&quot;globals.context=%s\n&quot;, CELLIAX_P_LOG, globals.context);
+
+                        }
+
+                }
+        }
+
+        if ((interfaces = switch_xml_child(cfg, &quot;per_interface_settings&quot;))) {
+                int i = 0;
+
+                for (myinterface = switch_xml_child(interfaces, &quot;interface&quot;); myinterface; myinterface = myinterface-&gt;next) {
+                        char *id = (char *) switch_xml_attr(myinterface, &quot;id&quot;);
+                        char *name = (char *) switch_xml_attr(myinterface, &quot;name&quot;);
+                        char *context = &quot;default&quot;;
+                        char *dialplan = &quot;XML&quot;;
+                        char *destination = &quot;5000&quot;;
+                        char *controldevice_name = &quot;/dev/ttyACM0&quot;;
+                        char *digit_timeout = NULL;
+                        char *max_digits = NULL;
+                        char *hotline = NULL;
+                        char *dial_regex = NULL;
+                        char *hold_music = NULL;
+                        char *fail_dial_regex = NULL;
+                        char *enable_callerid = &quot;true&quot;;
+
+
+                        char *at_dial_pre_number= &quot;ATD&quot;;
+                        char *at_dial_post_number= &quot;;&quot;;
+                        char *at_dial_expect= &quot;OK&quot;;
+                        char *at_hangup= &quot;ATH&quot;;
+                        char *at_hangup_expect= &quot;OK&quot;;
+                        char *at_answer= &quot;ATA&quot;;
+                        char *at_answer_expect= &quot;OK&quot;;
+                        char *at_send_dtmf= &quot;AT+VTS&quot;;
+                        char *at_preinit_1= &quot;&quot;;
+                        char *at_preinit_1_expect= &quot;&quot;;
+                        char *at_preinit_2= &quot;&quot;;
+                        char *at_preinit_2_expect= &quot;&quot;;
+                        char *at_preinit_3= &quot;&quot;;
+                        char *at_preinit_3_expect= &quot;&quot;;
+                        char *at_preinit_4= &quot;&quot;;
+                        char *at_preinit_4_expect= &quot;&quot;;
+                        char *at_preinit_5= &quot;&quot;;
+                        char *at_preinit_5_expect= &quot;&quot;;
+                        char *at_postinit_1= &quot;at+cmic=0,9&quot;;
+                        char *at_postinit_1_expect= &quot;OK&quot;;
+                        char *at_postinit_2= &quot;AT+CKPD=\&quot;EEE\&quot;&quot;;
+                        char *at_postinit_2_expect= &quot;OK&quot;;
+                        char *at_postinit_3= &quot;AT+CSSN=1,0&quot;;
+                        char *at_postinit_3_expect= &quot;OK&quot;;
+                        char *at_postinit_4= &quot;at+sidet=0&quot;;
+                        char *at_postinit_4_expect= &quot;OK&quot;;
+                        char *at_postinit_5= &quot;at+clvl=99&quot;;
+                        char *at_postinit_5_expect= &quot;OK&quot;;
+                        char *at_query_battchg= &quot;AT+CBC&quot;;
+                        char *at_query_battchg_expect= &quot;OK&quot;;
+                        char *at_query_signal= &quot;AT+CSQ&quot;;
+                        char *at_query_signal_expect= &quot;OK&quot;;
+                        char *at_call_idle= &quot;+MCST: 1&quot;;
+                        char *at_call_incoming= &quot;+MCST: 2&quot;;
+                        char *at_call_active= &quot;+CSSI: 7&quot;;
+                        char *at_call_failed= &quot;+MCST: 65&quot;;
+                        char *at_call_calling= &quot;+CSSI: 1&quot;;
+                        char *at_indicator_noservice_string= &quot;CIEV: 2;0&quot;;
+                        char *at_indicator_nosignal_string= &quot;CIEV: 5;0&quot;;
+                        char *at_indicator_lowsignal_string= &quot;CIEV: 5;1&quot;;
+                        char *at_indicator_lowbattchg_string= &quot;CIEV: 0;1&quot;;
+                        char *at_indicator_nobattchg_string= &quot;CIEV: 0;0&quot;;
+                        char *at_indicator_callactive_string= &quot;CIEV: 3;1&quot;;
+                        char *at_indicator_nocallactive_string= &quot;CIEV: 3;0&quot;;
+                        char *at_indicator_nocallsetup_string= &quot;CIEV: 6;0&quot;;
+                        char *at_indicator_callsetupincoming_string= &quot;CIEV: 6;1&quot;;
+                        char *at_indicator_callsetupoutgoing_string= &quot;CIEV: 6;2&quot;;
+                        char *at_indicator_callsetupremoteringing_string= &quot;CIEV: 6;3&quot;;
+                        char *sms_receiving_program= &quot;/usr/local/bin/ciapalo&quot;;
+                        char *alsacname= &quot;plughw:1&quot;;
+                        char *alsapname= &quot;plughw:1&quot;;
+
+                        uint32_t interface_id = 0, to = 0, max = 0;
+                        uint32_t controldevice_speed = B115200;
+                        uint32_t controldevprotocol = PROTOCOL_AT;
+#ifdef NOT_NUMBERS_NOW
+                        uint32_t running =1;
+                        uint32_t at_early_audio =0;
+                        uint32_t at_after_preinit_pause=500000;
+                        uint32_t at_initial_pause=500000;
+                        uint32_t at_has_clcc=0;
+                        uint32_t at_has_ecam=0;
+                        uint32_t alsa_period_size=160;
+                        uint32_t alsa_periods_in_buffer=4;
+                        uint32_t celliax_sound_rate=8000;
+                        uint32_t alsa_play_is_mono=1;
+                        uint32_t alsa_capture_is_mono=1;
+                        uint32_t capture_boost=5;
+                        uint32_t playback_boost=10;
+#endif// NOT_NUMBERS_NOW
+
+
+                        tech_pvt = NULL;
+
+                        for (param = switch_xml_child(myinterface, &quot;param&quot;); param; param = param-&gt;next) {
+                                char *var = (char *) switch_xml_attr_soft(param, &quot;name&quot;);
+                                char *val = (char *) switch_xml_attr_soft(param, &quot;value&quot;);
+
+                                if (!strcasecmp(var, &quot;id&quot;)) {
+                                        id = val;
+                                } else if (!strcasecmp(var, &quot;name&quot;)) {
+                                        name = val;
+                                } else if (!strcasecmp(var, &quot;context&quot;)) {
+                                        context = val;
+                                } else if (!strcasecmp(var, &quot;dialplan&quot;)) {
+                                        dialplan = val;
+                                } else if (!strcasecmp(var, &quot;destination&quot;)) {
+                                        destination = val;
+                                } else if (!strcasecmp(var, &quot;controldevice_name&quot;)) {
+                                        controldevice_name = val;
+                                } else if (!strcasecmp(var, &quot;digit_timeout&quot;)) {
+                                        digit_timeout = val;
+                                } else if (!strcasecmp(var, &quot;max_digits&quot;)) {
+                                        max_digits = val;
+                                } else if (!strcasecmp(var, &quot;hotline&quot;)) {
+                                        hotline = val;
+                                } else if (!strcasecmp(var, &quot;dial_regex&quot;)) {
+                                        dial_regex = val;
+                                } else if (!strcasecmp(var, &quot;hold_music&quot;)) {
+                                        hold_music = val;
+                                } else if (!strcasecmp(var, &quot;fail_dial_regex&quot;)) {
+                                        fail_dial_regex = val;
+                                } else if (!strcasecmp(var, &quot;enable_callerid&quot;)) {
+                                        enable_callerid = val;
+                                } else if (!strcasecmp(var, &quot;at_dial_pre_number&quot;)) {
+                                        at_dial_pre_number = val;
+                                } else if (!strcasecmp(var, &quot;at_dial_post_number&quot;)) {
+                                        at_dial_post_number = val;
+                                } else if (!strcasecmp(var, &quot;at_dial_expect&quot;)) {
+                                        at_dial_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_hangup&quot;)) {
+                                        at_hangup = val;
+                                } else if (!strcasecmp(var, &quot;at_hangup_expect&quot;)) {
+                                        at_hangup_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_answer&quot;)) {
+                                        at_answer = val;
+                                } else if (!strcasecmp(var, &quot;at_answer_expect&quot;)) {
+                                        at_answer_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_send_dtmf&quot;)) {
+                                        at_send_dtmf = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_1&quot;)) {
+                                        at_preinit_1 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_1_expect&quot;)) {
+                                        at_preinit_1_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_2&quot;)) {
+                                        at_preinit_2 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_2_expect&quot;)) {
+                                        at_preinit_2_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_3&quot;)) {
+                                        at_preinit_3 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_3_expect&quot;)) {
+                                        at_preinit_3_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_4&quot;)) {
+                                        at_preinit_4 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_4_expect&quot;)) {
+                                        at_preinit_4_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_5&quot;)) {
+                                        at_preinit_5 = val;
+                                } else if (!strcasecmp(var, &quot;at_preinit_5_expect&quot;)) {
+                                        at_preinit_5_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_1&quot;)) {
+                                        at_postinit_1 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_1_expect&quot;)) {
+                                        at_postinit_1_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_2&quot;)) {
+                                        at_postinit_2 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_2_expect&quot;)) {
+                                        at_postinit_2_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_3&quot;)) {
+                                        at_postinit_3 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_3_expect&quot;)) {
+                                        at_postinit_3_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_4&quot;)) {
+                                        at_postinit_4 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_4_expect&quot;)) {
+                                        at_postinit_4_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_5&quot;)) {
+                                        at_postinit_5 = val;
+                                } else if (!strcasecmp(var, &quot;at_postinit_5_expect&quot;)) {
+                                        at_postinit_5_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_query_battchg&quot;)) {
+                                        at_query_battchg = val;
+                                } else if (!strcasecmp(var, &quot;at_query_battchg_expect&quot;)) {
+                                        at_query_battchg_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_query_signal&quot;)) {
+                                        at_query_signal = val;
+                                } else if (!strcasecmp(var, &quot;at_query_signal_expect&quot;)) {
+                                        at_query_signal_expect = val;
+                                } else if (!strcasecmp(var, &quot;at_call_idle&quot;)) {
+                                        at_call_idle = val;
+                                } else if (!strcasecmp(var, &quot;at_call_incoming&quot;)) {
+                                        at_call_incoming = val;
+                                } else if (!strcasecmp(var, &quot;at_call_active&quot;)) {
+                                        at_call_active = val;
+                                } else if (!strcasecmp(var, &quot;at_call_failed&quot;)) {
+                                        at_call_failed = val;
+                                } else if (!strcasecmp(var, &quot;at_call_calling&quot;)) {
+                                        at_call_calling = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_noservice_string&quot;)) {
+                                        at_indicator_noservice_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_nosignal_string&quot;)) {
+                                        at_indicator_nosignal_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_lowsignal_string&quot;)) {
+                                        at_indicator_lowsignal_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_lowbattchg_string&quot;)) {
+                                        at_indicator_lowbattchg_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_nobattchg_string&quot;)) {
+                                        at_indicator_nobattchg_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_callactive_string&quot;)) {
+                                        at_indicator_callactive_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_nocallactive_string&quot;)) {
+                                        at_indicator_nocallactive_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_nocallsetup_string&quot;)) {
+                                        at_indicator_nocallsetup_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_callsetupincoming_string&quot;)) {
+                                        at_indicator_callsetupincoming_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_callsetupoutgoing_string&quot;)) {
+                                        at_indicator_callsetupoutgoing_string = val;
+                                } else if (!strcasecmp(var, &quot;at_indicator_callsetupremoteringing_string&quot;)) {
+                                        at_indicator_callsetupremoteringing_string = val;
+                                } else if (!strcasecmp(var, &quot;sms_receiving_program&quot;)) {
+                                        sms_receiving_program = val;
+                                } else if (!strcasecmp(var, &quot;alsacname&quot;)) {
+                                        alsacname = val;
+                                } else if (!strcasecmp(var, &quot;alsapname&quot;)) {
+                                        alsapname = val;
+
+#ifdef NOT_NUMBERS_NOW
+                                        interface_id 
+                                                controldevice_speed 
+                                                controldevprotocol 
+                                                at_early_audio 
+                                                at_after_preinit_pause
+                                                at_initial_pause
+                                                at_has_clcc
+                                                at_has_ecam
+                                                alsa_period_size
+                                                alsa_periods_in_buffer
+                                                celliax_sound_rate
+                                                alsa_play_is_mono
+                                                alsa_capture_is_mono
+                                                capture_boost
+                                                playback_boost
+#endif// NOT_NUMBERS_NOW
+
+
+                                }
+
+                        }
+
+                        /* BEGIN: Changes here */
+                        if (reload_type == SOFT_RELOAD) {
+                                char the_interface[256];
+                                sprintf(the_interface, &quot;#%s&quot;, name);
+
+                                if (interface_exists(the_interface) == SWITCH_STATUS_SUCCESS) {
+                                        continue;
+                                }
+                        }
+                        /* END: Changes here */
+
+                        if (!id) {
+                                ERRORA(&quot;interface missing REQUIRED param 'id'\n&quot;, CELLIAX_P_LOG);
+                                continue;
+                        }
+                        if (switch_is_number(id)) {
+                                interface_id = atoi(id);
+                                DEBUGA_CELLIAX(&quot;interface_id=%d\n&quot;, CELLIAX_P_LOG, interface_id);
+                        } else {
+                                ERRORA(&quot;interface param 'id' MUST be a number, now id='%s'\n&quot;, CELLIAX_P_LOG, id);
+                                continue;
+                        }
+
+                        if (!name) {
+                                WARNINGA(&quot;interface missing param 'name', not nice, but works\n&quot;, CELLIAX_P_LOG);
+                        }
+
+                        if (!controldevice_name) {
+                                controldevice_name = &quot;/dev/ttyACM0&quot;;
+                        }
+
+                        if (digit_timeout) {
+                                to = atoi(digit_timeout);
+                        }
+
+                        if (max_digits) {
+                                max = atoi(max_digits);
+                        }
+
+                        if (name) {
+                                DEBUGA_CELLIAX(&quot;name=%s\n&quot;, CELLIAX_P_LOG, name);
+                        }
+                        if (interface_id &amp;&amp; interface_id &lt; CELLIAX_MAX_INTERFACES) {
+                                private_t newconf;
+                                switch_threadattr_t *celliax_api_thread_attr = NULL;
+
+                                memset(&amp;newconf, '\0', sizeof(newconf));
+                                globals.CELLIAX_INTERFACES[interface_id] = newconf;
+
+
+                                tech_pvt = &amp;globals.CELLIAX_INTERFACES[interface_id];
+
+                                if (name) {
+                                        switch_set_string(globals.CELLIAX_INTERFACES[interface_id].name, name);
+                                } else {
+                                        switch_set_string(globals.CELLIAX_INTERFACES[interface_id].name, &quot;N/A&quot;);
+                                }
+                                DEBUGA_CELLIAX(&quot;CONFIGURING interface_id=%d name=%s\n&quot;, CELLIAX_P_LOG, interface_id, name);
+
+                                switch_mutex_init(&amp;globals.CELLIAX_INTERFACES[interface_id].controldev_lock, SWITCH_MUTEX_NESTED, celliax_module_pool);
+
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].interface_id, id);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].context, context);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].dialplan, dialplan);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].destination, destination);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].controldevice_name, controldevice_name);
+
+                                globals.CELLIAX_INTERFACES[interface_id].controldevice_speed = controldevice_speed;
+                                globals.CELLIAX_INTERFACES[interface_id].controldevprotocol = controldevprotocol;
+                                globals.CELLIAX_INTERFACES[interface_id].running = 1;
+                                globals.CELLIAX_INTERFACES[interface_id].at_early_audio = 0;
+                                globals.CELLIAX_INTERFACES[interface_id].at_after_preinit_pause = 500000;
+                                globals.CELLIAX_INTERFACES[interface_id].at_initial_pause = 500000;
+                                globals.CELLIAX_INTERFACES[interface_id].at_has_clcc = 0;
+                                globals.CELLIAX_INTERFACES[interface_id].at_has_ecam = 0;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_period_size = 160;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_periods_in_buffer = 4;
+                                globals.CELLIAX_INTERFACES[interface_id].celliax_sound_rate = 8000;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_play_is_mono = 1;
+                                globals.CELLIAX_INTERFACES[interface_id].alsa_capture_is_mono = 1;
+                                globals.CELLIAX_INTERFACES[interface_id].capture_boost = 0;
+                                globals.CELLIAX_INTERFACES[interface_id].playback_boost = 0;
+
+
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_pre_number, &quot;ATD&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_post_number, &quot;;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_hangup, &quot;ATH&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_hangup_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_answer, &quot;ATA&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_answer_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_send_dtmf, &quot;AT+VTS&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_1, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_1_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_2, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_2_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_3, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_3_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_4, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_4_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_5, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_5_expect, &quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_1, &quot;at+cmic=0,9&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_1_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_2, &quot;AT+CKPD=\&quot;EEE\&quot;&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_2_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_3, &quot;AT+CSSN=1,0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_3_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_4, &quot;at+sidet=0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_4_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_5, &quot;at+clvl=99&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_5_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_battchg, &quot;AT+CBC&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_battchg_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_signal, &quot;AT+CSQ&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_signal_expect, &quot;OK&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_idle, &quot;+MCST: 1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_incoming, &quot;+MCST: 2&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_active, &quot;+CSSI: 7&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_failed, &quot;+MCST: 65&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_calling, &quot;+CSSI: 1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_noservice_string, &quot;CIEV: 2;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nosignal_string, &quot;CIEV: 5;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_lowsignal_string, &quot;CIEV: 5;1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_lowbattchg_string, &quot;CIEV: 0;1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nobattchg_string, &quot;CIEV: 0;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callactive_string, &quot;CIEV: 3;1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nocallactive_string, &quot;CIEV: 3;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nocallsetup_string, &quot;CIEV: 6;0&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupincoming_string, &quot;CIEV: 6;1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupoutgoing_string, &quot;CIEV: 6;2&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string, &quot;CIEV: 6;3&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].sms_receiving_program, &quot;/usr/local/bin/ciapalo&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].alsacname, &quot;plughw:1&quot;);
+                                switch_set_string(globals.CELLIAX_INTERFACES[interface_id].alsapname, &quot;plughw:1&quot;);
+
+                                celliax_store_boost(&quot;5&quot;, &amp;globals.CELLIAX_INTERFACES[interface_id].capture_boost); //FIXME
+                                celliax_store_boost(&quot;10&quot;, &amp;globals.CELLIAX_INTERFACES[interface_id].playback_boost); //FIXME
+
+
+                                DEBUGA_CELLIAX(&quot;interface_id=%d globals.CELLIAX_INTERFACES[interface_id].name=%s\n&quot;,
+                                                CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].name);
+                                DEBUGA_CELLIAX
+                                        (&quot;interface_id=%d globals.CELLIAX_INTERFACES[interface_id].dialplan=%s\n&quot;,
+                                         CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].dialplan);
+                                DEBUGA_CELLIAX
+                                        (&quot;interface_id=%d globals.CELLIAX_INTERFACES[interface_id].destination=%s\n&quot;,
+                                         CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].destination);
+                                DEBUGA_CELLIAX
+                                        (&quot;interface_id=%d globals.CELLIAX_INTERFACES[interface_id].context=%s\n&quot;,
+                                         CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].context);
+                                WARNINGA(&quot;STARTING interface_id=%d\n&quot;, CELLIAX_P_LOG, interface_id);
+
+                                int res = 0;
+
+                                /* init the serial port */
+                                if (globals.CELLIAX_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
+                                        globals.CELLIAX_INTERFACES[interface_id].controldevfd =
+                                                celliax_serial_init(&amp;globals.CELLIAX_INTERFACES[interface_id], globals.CELLIAX_INTERFACES[interface_id].controldevice_speed);
+                                        if (globals.CELLIAX_INTERFACES[interface_id].controldevfd &lt; 1) {
+                                                ERRORA(&quot;celliax_serial_init failed\n&quot;, CELLIAX_P_LOG);
+                                                return SWITCH_STATUS_FALSE;
+                                                //celliax_sound_shutdown(tmp);
+                                                //if (tmp)
+                                                //free(tmp);
+                                                //return NULL;
+                                        }
+                                }
+
+                                /* config the phone/modem on the serial port */
+                                if (globals.CELLIAX_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
+                                        //int res;
+                                        res = celliax_serial_config(&amp;globals.CELLIAX_INTERFACES[interface_id]);
+                                        if (res) {
+                                                ERRORA(&quot;celliax_serial_config failed\n&quot;, CELLIAX_P_LOG);
+                                                return SWITCH_STATUS_FALSE;
+                                                //celliax_sound_shutdown(tmp);
+                                                //if (tmp)
+                                                //free(tmp);
+                                                //return NULL;
+                                        }
+                                }
+
+
+                                switch_sleep(100000);
+                                switch_threadattr_create(&amp;celliax_api_thread_attr, celliax_module_pool);
+                                switch_threadattr_stacksize_set(celliax_api_thread_attr, SWITCH_THREAD_STACKSIZE);
+                                switch_thread_create(&amp;globals.CELLIAX_INTERFACES[interface_id].celliax_api_thread, celliax_api_thread_attr, celliax_do_celliaxapi_thread,
+                                                &amp;globals.CELLIAX_INTERFACES[interface_id], celliax_module_pool);
+
+                                switch_sleep(100000);
+
+                        } else {
+                                ERRORA(&quot;interface id %d is higher than CELLIAX_MAX_INTERFACES (%d)\n&quot;, CELLIAX_P_LOG, interface_id, CELLIAX_MAX_INTERFACES);
+                                continue;
+                        }
+
+                }
+
+                for (i = 0; i &lt; CELLIAX_MAX_INTERFACES; i++) {
+                        if (strlen(globals.CELLIAX_INTERFACES[i].name)) {
+                                /* How many real intterfaces */
+                                globals.real_interfaces = i + 1;
+
+                                tech_pvt = &amp;globals.CELLIAX_INTERFACES[i];
+
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].interface_id=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].interface_id);
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].name=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].name);
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].context=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].context);
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].dialplan=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].dialplan);
+                                DEBUGA_CELLIAX(&quot;i=%d globals.CELLIAX_INTERFACES[%d].destination=%s\n&quot;, CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].destination);
+                        }
+                }
+        }
+
+        switch_mutex_unlock(globals.mutex);
+        switch_xml_free(xml);
+
+        return SWITCH_STATUS_SUCCESS;
+}
+#endif// NEW_OLD
+#ifdef NOTDEF
+                                } else if (!strcasecmp(var, &quot;context&quot;)) {
+                                        context = val;
+                                } else if (!strcasecmp(var, &quot;dialplan&quot;)) {
+                                        dialplan = val;
+                                } else if (!strcasecmp(var, &quot;destination&quot;)) {
+                                        destination = val;
+                                } else if (!strcasecmp(var, &quot;dial-regex&quot;)) {
+                                        dial_regex = val;
+                                } else if (!strcasecmp(var, &quot;enable-callerid&quot;)) {
+                                        enable_callerid = val;
+                                } else if (!strcasecmp(var, &quot;fail-dial-regex&quot;)) {
+                                        fail_dial_regex = val;
+                                } else if (!strcasecmp(var, &quot;hold-music&quot;)) {
+                                        hold_music = val;
+                                } else if (!strcasecmp(var, &quot;max_digits&quot;) || !strcasecmp(var, &quot;max-digits&quot;)) {
+                                        max_digits = val;
+                                } else if (!strcasecmp(var, &quot;hotline&quot;)) {
+                                        hotline = val;
+
+
+                        id 
+                        name 
+                        context 
+                        dialplan 
+                        destination 
+                        controldevice_name 
+                        digit_timeout 
+                        max_digits 
+                        hotline 
+                        dial_regex 
+                        hold_music 
+                        fail_dial_regex 
+                        enable_callerid 
+
+
+                        at_dial_pre_number
+                        at_dial_post_number
+                        at_dial_expect
+                        at_hangup
+                        at_hangup_expect
+                        at_answer
+                        at_answer_expect
+                        at_send_dtmf
+                        at_preinit_1
+                        at_preinit_1_expect
+                        at_preinit_2
+                        at_preinit_2_expect
+                        at_preinit_3
+                        at_preinit_3_expect
+                        at_preinit_4
+                        at_preinit_4_expect
+                        at_preinit_5
+                        at_preinit_5_expect
+                        at_postinit_1
+                        at_postinit_1_expect
+                        at_postinit_2
+                        at_postinit_2_expect
+                        at_postinit_3
+                        at_postinit_3_expect
+                        at_postinit_4
+                        at_postinit_4_expect
+                        at_postinit_5
+                        at_postinit_5_expect
+                        at_query_battchg
+                        at_query_battchg_expect
+                        at_query_signal
+                        at_query_signal_expect
+                        at_call_idle
+                        at_call_incoming
+                        at_call_active
+                        at_call_failed
+                        at_call_calling
+                        at_indicator_noservice_string
+                        at_indicator_nosignal_string
+                        at_indicator_lowsignal_string
+                        at_indicator_lowbattchg_string
+                        at_indicator_nobattchg_string
+                        at_indicator_callactive_string
+                        at_indicator_nocallactive_string
+                        at_indicator_nocallsetup_string
+                        at_indicator_callsetupincoming_string
+                        at_indicator_callsetupoutgoing_string
+                        at_indicator_callsetupremoteringing_string
+                        sms_receiving_program
+                        alsacname
+                        alsapname
+
+                        interface_id 
+                        controldevice_speed 
+                        controldevprotocol 
+                        at_early_audio 
+                        at_after_preinit_pause
+                        at_initial_pause
+                        at_has_clcc
+                        at_has_ecam
+                        alsa_period_size
+                        alsa_periods_in_buffer
+                        celliax_sound_rate
+                        alsa_play_is_mono
+                        alsa_capture_is_mono
+                        capture_boost
+                        playback_boost
+
+
+#endif //NOTDEF
+
+#ifdef WANT_OLD
+static switch_status_t load_config(int reload_type)
+/* END: Changes heres */
+{
+        char *cf = &quot;celliax.conf&quot;;
+        switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface;
+        private_t *tech_pvt = NULL;
+
+        switch_mutex_init(&amp;globals.mutex, SWITCH_MUTEX_NESTED, celliax_module_pool);
+        if (!(xml = switch_xml_open_cfg(cf, &amp;cfg, NULL))) {
+                ERRORA(&quot;open of %s failed\n&quot;, CELLIAX_P_LOG, cf);
+                running = 0;
+                switch_xml_free(xml);
+                return SWITCH_STATUS_TERM;
+        }
+
+        switch_mutex_lock(globals.mutex);
+        if ((global_settings = switch_xml_child(cfg, &quot;global_settings&quot;))) {
+                for (param = switch_xml_child(global_settings, &quot;param&quot;); param; param = param-&gt;next) {
+                        char *var = (char *) switch_xml_attr_soft(param, &quot;name&quot;);
+                        char *val = (char *) switch_xml_attr_soft(param, &quot;value&quot;);
+
+                        if (!strcasecmp(var, &quot;debug&quot;)) {
+                                DEBUGA_CELLIAX(&quot;globals.debug=%d\n&quot;, CELLIAX_P_LOG, globals.debug);
+                                globals.debug = atoi(val);
+                                DEBUGA_CELLIAX(&quot;globals.debug=%d\n&quot;, CELLIAX_P_LOG, globals.debug);
+                        } else if (!strcasecmp(var, &quot;hold-music&quot;)) {
+                                switch_set_string(globals.hold_music, val);
+                                DEBUGA_CELLIAX(&quot;globals.hold_music=%s\n&quot;, CELLIAX_P_LOG, globals.hold_music);
+                        } else if (!strcmp(var, &quot;dialplan&quot;)) {
+                                set_global_dialplan(val);
+                                DEBUGA_CELLIAX(&quot;globals.dialplan=%s\n&quot;, CELLIAX_P_LOG, globals.dialplan);
+                        } else if (!strcmp(var, &quot;destination&quot;)) {
+                                set_global_destination(val);
+                                DEBUGA_CELLIAX(&quot;globals.destination=%s\n&quot;, CELLIAX_P_LOG, globals.destination);
+                        } else if (!strcmp(var, &quot;context&quot;)) {
+                                set_global_context(val);
+                                DEBUGA_CELLIAX(&quot;globals.context=%s\n&quot;, CELLIAX_P_LOG, globals.context);
+
</ins><span class="cx"> /*
</span><span class="cx">                         } else if (!strcmp(var, &quot;port&quot;)) {
</span><span class="cx">                                 globals.port = atoi(val);
</span><span class="lines">@@ -1506,6 +2833,7 @@
</span><span class="cx"> 
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><ins>+#endif //WANT_OLD
</ins><span class="cx"> static switch_status_t chat_send(const char *proto, const char *from, const char *to, const char *subject, const char *body, const char *type, const char *hint)
</span><span class="cx"> {
</span><span class="cx">         char *user, *host, *f_user = NULL, *f_host = NULL, *f_resource = NULL;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>