]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Unit-test] Use unique port numbers when running mod_sofia tests.
authorAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 16:27:17 +0000 (19:27 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:01:16 +0000 (22:01 +0300)
tests/unit/conf_sip/freeswitch.xml [new file with mode: 0644]
tests/unit/conf_test/freeswitch.xml
tests/unit/switch_sip.c

diff --git a/tests/unit/conf_sip/freeswitch.xml b/tests/unit/conf_sip/freeswitch.xml
new file mode 100644 (file)
index 0000000..df7d638
--- /dev/null
@@ -0,0 +1,166 @@
+<?xml version="1.0"?>
+<document type="freeswitch/xml">
+  <X-PRE-PROCESS cmd="exec-set" data="test=echo 1234"/>
+  <X-PRE-PROCESS cmd="set" data="default_password=$${test}"/>
+  <X-PRE-PROCESS cmd="set" data="core_video_blank_image=$${conf_dir}/freeswitch-logo.png"/>
+  <section name="configuration" description="Various Configuration">
+    <configuration name="modules.conf" description="Modules">
+               <modules>
+                       <load module="mod_sofia"/>
+                       <load module="mod_console"/>
+                       <load module="mod_loopback"/>
+                       <load module="mod_commands"/>
+                       <load module="mod_dptools"/>
+                       <load module="mod_dialplan_xml"/>
+                       <load module="mod_tone_stream"/>
+                       <load module="mod_commands"/>
+                       <load module="mod_sndfile"/>
+                       <load module="mod_hash"/>
+      </modules>
+    </configuration>
+
+    <configuration name="console.conf" description="Console Logger">
+      <mappings>
+        <map name="all" value="console,debug,info,notice,warning,err,crit,alert"/>
+      </mappings>
+      <settings>
+        <param name="colorize" value="true"/>
+        <param name="loglevel" value="debug"/>
+      </settings>
+    </configuration>
+
+    <configuration name="timezones.conf" description="Timezones">
+      <timezones>
+          <zone name="GMT" value="GMT0" />
+      </timezones>
+    </configuration>
+
+    <configuration name="sofia.conf" description="SofiaSIP">
+        <profiles>
+    <profile name="external">
+        <gateways>
+
+           <gateway name="test_gateway">
+                <param name="username" value="not-used"/>
+                <param name="password" value="not-used"/>
+                <param name="proxy" value="$${local_ip_v4}:63068"/>
+                <param name="register" value="false"/>
+                <param name="retry-seconds" value="30"/>
+                <param name="dtmf-type" value="rfc2833"/>
+                <variables>   
+                 <variable name="rtp_secure_media"  value="false"  direction="outbound"/>  
+                </variables>
+            </gateway>
+        </gateways>
+
+      <domains>
+        <domain name="all" alias="false" parse="true"/>
+      </domains>
+
+      <settings>
+        <param name="debug" value="1"/>
+        <param name="shutdown-on-fail" value="true"/>
+        <param name="p-asserted-id-parse" value="verbatim"/>
+        <param name="username" value="SignalWire-STACK"/>
+        <param name="user-agent-string" value="SignalWire STACK Unit Test"/>
+        <param name="sip-trace" value="no"/>
+        <param name="sip-capture" value="no"/>
+        <param name="rfc2833-pt" value="101"/>
+        <param name="sip-port" value="63068"/>
+        <param name="dialplan" value="XML"/>
+        <param name="context" value="default"/>
+        <param name="dtmf-duration" value="2000"/>
+        <param name="inbound-codec-prefs" value="PCMU"/>
+        <param name="outbound-codec-prefs" value="PCMU"/>
+        <param name="rtp-timer-name" value="soft"/>
+        <param name="local-network-acl" value="localnet.auto"/>
+        <param name="manage-presence" value="false"/>
+        <param name="inbound-codec-negotiation" value="generous"/>
+        <param name="nonce-ttl" value="60"/>
+        <param name="inbound-late-negotiation" value="true"/>
+        <param name="inbound-zrtp-passthru" value="false"/>
+        <param name="rtp-ip" value="$${local_ip_v4}"/>
+        <param name="sip-ip" value="$${local_ip_v4}"/>
+        <param name="ext-rtp-ip" value="$${local_ip_v4}"/>
+        <param name="ext-sip-ip" value="$${local_ip_v4}"/>
+        <param name="rtp-timeout-sec" value="300"/>
+        <param name="rtp-hold-timeout-sec" value="1800"/>
+        <param name="session-timeout" value="600"/>
+        <param name="minimum-session-expires" value="90"/>
+        <param name="tls" value="false"/>
+      </settings>
+  </profile>
+
+    <profile name="internal">
+        <gateways>
+    </gateways>
+
+      <domains>
+        <domain name="all" alias="false" parse="true"/>
+      </domains>
+
+      <settings>
+        <param name="debug" value="1"/>
+        <param name="shutdown-on-fail" value="true"/>
+        <param name="p-asserted-id-parse" value="verbatim"/>
+        <param name="username" value="SignalWire-STACK"/>
+        <param name="user-agent-string" value="SignalWire STACK Unit Test"/>
+        <param name="sip-trace" value="no"/>
+        <param name="sip-capture" value="no"/>
+        <param name="rfc2833-pt" value="101"/>
+        <param name="sip-port" value="61069"/>
+        <param name="dialplan" value="XML"/>
+        <param name="context" value="default"/>
+        <param name="dtmf-duration" value="2000"/>
+        <param name="inbound-codec-prefs" value="PCMU"/>
+        <param name="outbound-codec-prefs" value="PCMU"/>
+        <param name="rtp-timer-name" value="soft"/>
+        <param name="local-network-acl" value="localnet.auto"/>
+        <param name="manage-presence" value="false"/>
+        <param name="inbound-codec-negotiation" value="generous"/>
+        <param name="nonce-ttl" value="60"/>
+        <param name="inbound-late-negotiation" value="true"/>
+        <param name="inbound-zrtp-passthru" value="false"/>
+        <param name="rtp-ip" value="$${local_ip_v4}"/>
+        <param name="sip-ip" value="$${local_ip_v4}"/>
+        <param name="ext-rtp-ip" value="$${local_ip_v4}"/>
+        <param name="ext-sip-ip" value="$${local_ip_v4}"/>
+        <param name="rtp-timeout-sec" value="300"/>
+        <param name="rtp-hold-timeout-sec" value="1800"/>
+        <param name="session-timeout" value="600"/>
+        <param name="minimum-session-expires" value="90"/>
+        <param name="tls" value="false"/>
+      </settings>
+  </profile>
+
+  </profiles>
+   </configuration>
+
+   <configuration name="switch.conf" description="Switch">
+     <param name="rtp-start-port" value="20000"/>
+     <param name="rtp-end-port" value="30000"/>
+     <param name="threaded-system-exec" value="true"/>
+   </configuration>
+  </section>
+
+  <section name="dialplan" description="Regex/XML Dialplan">
+    <context name="default">
+               <extension name="two">
+                       <condition field="destination_number" expression="^\+15553332901$">
+                               <action application="log" data="${sip_h_identity}"/>
+                               <action application="hash" data="insert/realm/identity_check/${sip_h_identity}"/>
+                               <action application="answer"/>
+                               <action application="park"/>
+                       </condition>
+               </extension>
+               <extension name="one">
+                       <condition field="destination_number" expression="^\+15553332900$">
+                               <action application="set" data="absolute_codec_string=PCMU@20i"/>
+                               <action application="info"/>
+                               <action application="answer"/>
+                               <action application="park"/>
+                       </condition>
+               </extension>
+    </context>
+  </section>
+</document>
index 80216bbe7db9b7eba0390b8f15cf732875cc3924..a68c7c56e6bd35a02f701787088b6783e2f35b53 100644 (file)
@@ -43,7 +43,7 @@
            <gateway name="test_gateway">
                 <param name="username" value="not-used"/>
                 <param name="password" value="not-used"/>
-                <param name="proxy" value="$${local_ip_v4}:61068"/>
+                <param name="proxy" value="$${local_ip_v4}:62068"/>
                 <param name="register" value="false"/>
                 <param name="retry-seconds" value="30"/>
                 <param name="dtmf-type" value="rfc2833"/>
@@ -66,7 +66,7 @@
         <param name="sip-trace" value="no"/>
         <param name="sip-capture" value="no"/>
         <param name="rfc2833-pt" value="101"/>
-        <param name="sip-port" value="61068"/>
+        <param name="sip-port" value="62068"/>
         <param name="dialplan" value="XML"/>
         <param name="context" value="default"/>
         <param name="dtmf-duration" value="2000"/>
index 238f00a4d5473ef8d89b436d4164f11025162d51..bcb00eac2b6319f3ec16cd4bd18598d9865d4b84 100644 (file)
@@ -1,7 +1,7 @@
 #include <switch.h>
 #include <test/switch_test.h>
 
-FST_CORE_DB_BEGIN("./conf_test")
+FST_CORE_DB_BEGIN("./conf_sip")
 {
 FST_SUITE_BEGIN(switch_sip)
 {