switest 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/switest/escaper.rb +11 -11
- data/lib/switest/from_parser.rb +10 -10
- data/lib/switest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f22b40e3df64be66575f8c29e8b2346ebca600872a2d4ca92c2ad831dbc850f1
|
|
4
|
+
data.tar.gz: 2accbb207733cd37309198202987a6e80561a46a881cc13f288936ca444b3624
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75a8ef444edec410182b4252d984b28c8d85a67c285891bc5e8407f09e394e9ce057d6afae71a1395e1a77d6568a55dbaed445eebab3a29f041574a4a6975786
|
|
7
|
+
data.tar.gz: befe67ce657e104bab50b4c2215283917262794e0ee8a0e7b040a568341f3f9e24b55db45d482c04aeb8d9b982b9934ecf78d729da4212ff4145095a79fa1568
|
data/lib/switest/escaper.rb
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
module Switest
|
|
4
4
|
# Escapes values for use in FreeSWITCH channel variable strings.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
#
|
|
6
|
+
# FreeSWITCH originate syntax: {var1=value1,var2=value2}endpoint
|
|
7
|
+
#
|
|
8
|
+
# Escaping rules (per FreeSWITCH documentation):
|
|
9
|
+
# - Spaces: wrap value in single quotes
|
|
10
|
+
# - Commas in regular vars: use ^^<delim> syntax (e.g., ^^:val1:val2)
|
|
11
|
+
# - Commas in SIP headers (sip_h_*): escape with backslash (\,)
|
|
12
|
+
# - Single quotes in quoted values: escape with backslash (\')
|
|
13
|
+
#
|
|
14
|
+
# @see https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Dialplan/Channel-Variables_16352493/
|
|
15
|
+
module Escaper
|
|
16
16
|
module_function
|
|
17
17
|
|
|
18
18
|
# Characters that require the value to be quoted
|
data/lib/switest/from_parser.rb
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
module Switest
|
|
4
4
|
# Parses a `from` string into FreeSWITCH channel variables,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
# replicating mod_rayo's parse_dial_from() behavior.
|
|
6
|
+
#
|
|
7
|
+
# Algorithm (matching mod_rayo):
|
|
8
|
+
# 1. Split on last space — before = display name, after = URI
|
|
9
|
+
# 2. No space — entire string is URI, no display name
|
|
10
|
+
# 3. Strip "" from display name (if quoted)
|
|
11
|
+
# 4. Strip <> from URI (if angle-bracketed)
|
|
12
|
+
# 5. Detect scheme: sip:/sips: with @ → SIP, tel: → TEL, plain → TEL, empty → UNKNOWN
|
|
13
|
+
# 6. Map to FreeSWITCH variables accordingly
|
|
14
|
+
module FromParser
|
|
15
15
|
module_function
|
|
16
16
|
|
|
17
17
|
SIP_URI_PATTERN = /\Asips?:.+@/
|
data/lib/switest/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: switest
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Relatel A/S
|
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
88
|
version: '0'
|
|
89
89
|
requirements: []
|
|
90
|
-
rubygems_version: 4.0.
|
|
90
|
+
rubygems_version: 4.0.6
|
|
91
91
|
specification_version: 4
|
|
92
92
|
summary: Functional testing for voice applications via FreeSWITCH ESL
|
|
93
93
|
test_files: []
|