Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
bcd07a86
Commit
bcd07a86
authored
6 years ago
by
George Joseph
Committed by
Gerrit Code Review
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "contrib/sip_to_pjsip: handle setvar in conversion"
parents
f1f4450b
b0155f7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/scripts/sip_to_pjsip/sip_to_pjsip.py
+20
-0
20 additions, 0 deletions
contrib/scripts/sip_to_pjsip/sip_to_pjsip.py
with
20 additions
and
0 deletions
contrib/scripts/sip_to_pjsip/sip_to_pjsip.py
+
20
−
0
View file @
bcd07a86
...
...
@@ -40,6 +40,11 @@ def section_by_type(section, pjsip, type):
return
sect
def
ignore
(
key
=
None
,
val
=
None
,
section
=
None
,
pjsip
=
None
,
nmapped
=
None
,
type
=
'
endpoint
'
):
"""
Ignore a key and mark it as mapped
"""
def
set_value
(
key
=
None
,
val
=
None
,
section
=
None
,
pjsip
=
None
,
nmapped
=
None
,
type
=
'
endpoint
'
):
"""
Sets the key to the value within the section in pjsip.conf
"""
...
...
@@ -508,6 +513,7 @@ peer_map = [
[
'
dtlscapath
'
,
set_value
(
'
dtls_ca_path
'
)],
[
'
dtlssetup
'
,
set_value
(
'
dtls_setup
'
)],
[
'
encryption_taglen
'
,
from_encryption_taglen
],
[
'
setvar
'
,
ignore
],
############################ maps to an aor ###################################
...
...
@@ -1117,6 +1123,19 @@ def map_registrations(sip, pjsip, nmapped):
reg
.
write
(
pjsip
,
nmapped
)
def
map_setvars
(
sip
,
section
,
pjsip
,
nmapped
):
"""
Map all setvar in peer section to the appropriate endpoint set_var
"""
try
:
setvars
=
sip
.
section
(
section
)[
0
].
get
(
'
setvar
'
)
except
LookupError
:
return
for
setvar
in
setvars
:
set_value
(
'
set_var
'
,
setvar
,
section
,
pjsip
,
nmapped
)
def
map_peer
(
sip
,
section
,
pjsip
,
nmapped
):
"""
Map the options from a peer section in sip.conf into the appropriate
...
...
@@ -1218,6 +1237,7 @@ def convert(sip, filename, non_mappings, include):
pass
else
:
map_peer
(
sip
,
section
,
pjsip
,
nmapped
)
map_setvars
(
sip
,
section
,
pjsip
,
nmapped
)
find_non_mapped
(
sip
.
defaults
(),
nmapped
)
find_non_mapped
(
sip
.
sections
(),
nmapped
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment