]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
More work on qsettings. Still get problem when expanding a template with no variables.
authorJoão Mesquita <jmesquita@freeswitch.org>
Tue, 5 Jan 2010 04:57:25 +0000 (04:57 +0000)
committerJoão Mesquita <jmesquita@freeswitch.org>
Tue, 5 Jan 2010 04:57:25 +0000 (04:57 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16146 d0543943-73ff-0310-b7d9-9358b9ac24b2

fscomm/conf/event_socket.conf.xml
fscomm/conf/freeswitch.xml
fscomm/conf/portaudio.conf.xml
fscomm/fshost.cpp
fscomm/mainwindow.ui
fscomm/mod_qsettings/mod_qsettings.cpp
fscomm/resources/splash.png

index 8f780ecf8f5bff3d44448a13e9962a4549cab176..613bfc68f51c50b660e9cefaf6d6b6cdec136661 100644 (file)
@@ -1,3 +1,5 @@
+<document type="freeswitch/xml">
+    <section name="configuration">
 <configuration name="event_socket.conf" description="Socket Client">
          <settings>
                <param name="nat-map" value="false"/>
@@ -5,4 +7,6 @@
                <param name="listen-port" value="8021"/>
                <param name="password" value="ClueCon"/>
          </settings>
-</configuration>
+    </configuration>
+  </section>
+</document>
index 3ae6b1c81d921f7dcb3bf10ef08f91bbd9940312..7f2912f061974ec269bc86054d1e83974865d985 100644 (file)
@@ -49,7 +49,7 @@
     </configuration>
 
     <configuration name="qsettings.conf" description="configures our mod_qsettings">
-               <bindings value="dialplan" />
+                <bindings value="configuration" />
     </configuration>
 
     <configuration name="local_stream.conf" description="stream files from local dir">
@@ -83,7 +83,6 @@
        <load module="mod_logfile"/>
        <load module="mod_enum"/>
        <load module="mod_cdr_csv"/>
-       <load module="mod_portaudio"/>
        <load module="mod_sofia"/>
        <load module="mod_loopback"/>
        <load module="mod_commands"/>
index 61a1f289d348ed268ac6bff096a8b0a56880c30a..39caf9243b87340dcea415041bb59cafd3569547 100644 (file)
@@ -1,17 +1,22 @@
-<configuration name="portaudio.conf" description="Soundcard Endpoint">
-    <settings>
-        <param name="indev" value="${indev}"/>
-        <!-- device to use for output -->
-        <param name="outdev" value="${outdev}"/>
-        <!--<param name="ringdev" value="${ringdev}"/>-->
-        <param name="ring-file" value="${ring-file}"/>
-        <param name="ring-interval" value="${ring-interval}"/>
-        <param name="hold-file" value="$${hold_music}"/>
-        <!--<param name="timer-name" value="soft"/>-->
-        <param name="dialplan" value="XML"/>
-        <param name="cid-name" value="$${outbound_caller_name}"/>
-        <param name="cid-num" value="$${outbound_caller_number}"/>
-        <param name="sample-rate" value="48000"/>
-        <param name="codec-ms" value="10"/>
-    </settings>
-</configuration>
+<document type="freeswitch/xml">
+    <section name="configuration">
+        <configuration name="portaudio.conf" description="Soundcard Endpoint">
+            <settings>
+                <param name="indev" value="${indev}"/>
+                <!-- device to use for output -->
+                <param name="outdev" value="${outdev}"/>
+                <!--<param name="ringdev" value="${ringdev}"/>-->
+                <param name="ring-file" value="${ring-file}"/>
+                <param name="ring-interval" value="${ring-interval}"/>
+                <param name="hold-file" value="$${hold_music}"/>
+                <!--<param name="timer-name" value="soft"/>-->
+                <param name="dialplan" value="XML"/>
+                <param name="cid-name" value="$${outbound_caller_name}"/>
+                <param name="cid-num" value="$${outbound_caller_number}"/>
+                <param name="sample-rate" value="48000"/>
+                <param name="codec-ms" value="10"/>
+            </settings>
+        </configuration>
+    </section>
+</document>
+
index 77641c59d8f6534fa3391a06cb850c29123b2d31..06db32c3215d41229baea579cfb8de9d3f140037 100644 (file)
@@ -130,6 +130,7 @@ void FSHost::run(void)
     }
     QString res;
     sendCmd("load", "mod_event_socket", &res);
+    sendCmd("load", "mod_portaudio", &res);
     emit ready();
     /* Go into the runtime loop. If the argument is true, this basically sets runtime.running = 1 and loops while that is set
      * If its false, it initializes the libedit for the console, then does the same thing
index 3d08c612c774147bf28847d8ae6ba35157b2736d..c7d5dc6510789f8767f59812de79af954fc9c938 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>580</width>
-    <height>563</height>
+    <width>670</width>
+    <height>541</height>
    </rect>
   </property>
   <property name="windowTitle">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>580</width>
-     <height>22</height>
+     <width>670</width>
+     <height>24</height>
     </rect>
    </property>
    <widget class="QMenu" name="menu_File">
index b09b305fc471820bbf903a981076ec1b20cf3a28..38fbd9733efc4dfd84ef111e686db199fd45b967 100644 (file)
@@ -45,19 +45,25 @@ switch_xml_t XMLBinding::getConfigXML(QString tmpl)
     switch_event_create_plain(&e, SWITCH_EVENT_REQUEST_PARAMS);
     switch_assert(e);
 
-    QFile tmplFile(QString("%1/templates/%2.xml").arg(QApplication::applicationDirPath(),tmpl));
-
-    if (!tmplFile.exists()) {
+    if (QFile::exists(QString("%1/.fscomm/templates/%2.xml").arg(QDir::homePath(),tmpl))) {
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-                          "Template %s.xml, doesn't exist on directory, falling back to embedded template.\n",
+                          "Using template %s.xml on .fscomm/.\n",
                           tmpl.toAscii().constData());
-        tmplFile.setFileName(QString(":/confs/%1.xml").arg(tmpl));
-        return NULL;
+    }
+    else if(QFile::exists(QString(":/confs/%1.xml").arg(tmpl)))
+    {
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
+                          "Template %s.xml, doesn't exist on directory, copying embedded template.\n",
+                          tmpl.toAscii().constData());
+        QString dest = QString("%1/.fscomm/templates/%2.xml").arg(QDir::homePath(),tmpl);
+        QString orig = QString(":/confs/%1.xml").arg(tmpl);
+        QFile::copy(orig, dest);
     }
 
-    if (tmplFile.open(QIODevice::ReadOnly | QIODevice::Text))
+    QFile tmplFile(QString("%1/.fscomm/templates/%2.xml").arg(QDir::homePath(),tmpl));
+    if (!tmplFile.open(QIODevice::ReadOnly | QIODevice::Text))
     {
-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Template %s could not be read.!\n", tmpl.toAscii().constData());
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Template %s could not be read!\n", tmpl.toAscii().constData());
         return NULL;
     }
 
@@ -72,6 +78,7 @@ switch_xml_t XMLBinding::getConfigXML(QString tmpl)
     }
 
     char *res = switch_event_expand_headers(e, tmplContents.toAscii().constData());
+    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Template %s as follows:\n%s", tmpl.toAscii().constData(), res);
     switch_safe_free(e);
     return switch_xml_parse_str(res, strlen(res));
 }
@@ -81,6 +88,8 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
 {
     XMLBinding *binding = (XMLBinding *) user_data;
 
+    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "We are being requested -> section: %s | tag_name: %s | key_name: %s | key_value: %s!\n",
+                      section, tag_name, key_name, key_value);
     if (!binding) {
         return NULL;
     }
index 47e7acb06dde54644201f586dad45748e3ebfcc0..4fa579ca4e331bae415b67875e4c5fabf0afd3ed 100644 (file)
Binary files a/fscomm/resources/splash.png and b/fscomm/resources/splash.png differ