Commit Graph

39 Commits

Author SHA1 Message Date
Torrey Searle da24d425eb contrib/script/sip_to_pjsip: implement 'all' for allow/disallow
when 'all' is specified in an allow or disallow section, it should erase
all values from the inverse section in the default config. E.G.
allow=all should erase any deny values from default config &
vice-versa

ASTERISK-27333 #close

Change-Id: I99219478fb98f08751d769daaee0b7795118a5a6
2017-10-16 06:26:16 -05:00
Torrey Searle b1d9fc87bc contrib/thirdparty/sip_to_pjsip: add additional flag mappings
add mappings for udptl redundancy, rtptimeout, and debug flags

Change-Id: Ie73cf5c83c05dee01eb9624ede76c1a30225d73a
2017-10-10 10:50:24 -05:00
Joshua Colp 403c4f5833 pjsip: Support dual stack automatically.
This change adds support for dual stack automatically. No
configuration is required and the IP address and version
in the SIP messages and SDP will be automatically changed
based on the transport over which the message is being
sent. RTP usage has also been changed to listen on both
IPv4 and IPv6 simultaneously to allow media to flow, and
to allow ICE support on both simultaneously. This also
allows failover between IPv6 and IPv4 to work as expected.

ASTERISK-26309 #close

Change-Id: I235a421d8f9a326606d861b449fa6fe3a030572d
2016-10-23 13:53:55 +00:00
Richard Mudgett 82ec58aa91 sip_to_pjsip.py: Map legacy_useroption_parsing.
Map the sip.conf general section legacy_useroption_parsing to the
new pjsip.conf global ignore_uri_user_options.

ASTERISK-26316
Reported by: Kevin Harwell

Change-Id: I78108a31995db19d41f4e1a07b3324692c5363fc
2016-09-09 17:13:14 -05:00
zuul 05240e2b57 Merge "sip_to_pjsip.py: Map canreinvite as directmedia alias." 2016-09-06 16:30:33 -05:00
zuul eae37c3524 Merge "sip_to_pjsip.py: Fix typo converting outboundproxy registration." 2016-09-06 15:26:23 -05:00
Richard Mudgett edcf09e47c sip_to_pjsip.py: Map canreinvite as directmedia alias.
Change-Id: I48b8e150f96a3d2a24d8fc25fbe4f5aff9f4a6b2
2016-09-02 13:07:08 -05:00
Richard Mudgett 47336a0bdd sip_to_pjsip.py: Fix typo converting outboundproxy registration.
Change-Id: I6f30e5f9fcf8469ba0079fbf884047d54c2c0b15
2016-09-02 13:05:16 -05:00
Richard Mudgett dba02575fc sip_to_pjsip.py: Fix comment typo and tabs.
Change-Id: If35174614545727817d329c60ba4456c028941b5
2016-09-02 13:03:09 -05:00
Alexander Traud f35501b8c9 sip_to_pjsip: Migrate IPv4/IPv6 (Dual Stack) configurations.
When using the migration script sip_to_pjsip.py, and your sip.conf is
configured with bindaddr=::, two transports are written to pjsip.conf, one for
0.0.0.0 (IPv4) and one for [::] (IPv6). That way, PJProject listens on the IPv4
and IPv6 wildcards; a IPv4/IPv6 Dual Stack configuration on a single interface
like in chan_sip.

Furthermore, the script internal functions "build_host" and "split_hostport"
did not parse Literal IPv6 addresses as expected (like [::1]:5060). This change
makes sure, even such addresses are parsed correctly.

ASTERISK-26309

Change-Id: Ia4799a0f80fc30c0550fc373efc207c3330aeb48
2016-08-26 12:49:50 +02:00
zuul c6ed91a9c8 Merge "sip_to_pjsip: Map externhost/ip to Transports." 2016-08-19 17:54:48 -05:00
Alexander Traud 02a82f758e sip_to_pjsip: Add cert_file.
When using the migration script sip_to_pjsip.py, cert_file was not migrated to
pjsip.conf. A previous change regarding this contained a copy/paste error.

ASTERISK-22374

Change-Id: I0fa72e9412117d53b4284fc6b83fa5b2b95ba03b
2016-08-19 10:59:40 +02:00
Joshua Colp b544bfbbd5 Merge "sip_to_pjsip: Write cos and tos." 2016-08-18 18:55:35 -05:00
Kevin Harwell 966527249e sip_to_pjsip: Set correct tls transport method
A recent update had a copy/paste error where the unused variable 'val' was
being passed to the set_value function instead of the 'method' value itself.

This patch passes in the right variable.

ASTERISK-22374

Change-Id: I895b7b3779ce4442bc58b8ec40d59dd29bb43f06
2016-08-18 12:04:56 -05:00
Joshua Colp 2dba6d0371 Merge "sip_to_pjsip: Parse register even with transport." 2016-08-18 11:50:16 -05:00
Joshua Colp 71b3751093 Merge "sip_to_pjsip: Write local_net, contact_acl, contact_deny, and contact_permit." 2016-08-18 11:49:53 -05:00
Joshua Colp 54c5bb0287 Merge "sip_to_pjsip: Map (session-)timers correctly." 2016-08-18 11:49:15 -05:00
Joshua Colp 5899b4c593 Merge "sip_to_pjsip: Add cert_file and ca_list_path." 2016-08-18 11:48:32 -05:00
Joshua Colp 560c2abdec Merge "sip_to_pjsip: Write username even without authname." 2016-08-18 11:48:23 -05:00
Joshua Colp 14284aee45 Merge "sip_to_pjsip: Map the TLS method correctly." 2016-08-18 11:47:29 -05:00
Joshua Colp 0a09ab5b1c Merge "sip_to_pjsip: Add compactheaders, timerb, timert1, and useragent." 2016-08-18 11:46:39 -05:00
Joshua Colp 91624f439c Merge "sip_to_pjsip: Write media_encryption." 2016-08-18 11:45:56 -05:00
Alexander Traud e55d1e47aa sip_to_pjsip: Map the TLS method correctly.
When using the migration script sip_to_pjsip.py and tlsclientmethod is not set
in sip.conf, the default value of chan_sip (sslv23) is copied to pjsip.conf, to
overwrite the default of the PJProject (tlsv1). This makes sure, res_pjsip is
offering/using not just TLSv1.0 but TLSv1.2 as well.

ASTERISK-22374

Change-Id: Ie530a3dae9926ae14f3920a21be1e2edb15bda4f
2016-08-18 15:19:15 +02:00
Alexander Traud da14c439a3 sip_to_pjsip: Add compactheaders, timerb, timert1, and useragent.
When using the migration script sip_to_pjsip.py, no section of type=system or
type=general were created. Therefore the keys compactheaders, timerb, timert1,
and useragent were not migrated to pjsip.conf.

ASTERISK-22374

Change-Id: I318a453843227ea36bf130d392d4abd7bd26b5a1
2016-08-18 15:17:47 +02:00
Alexander Traud 675721a7ab sip_to_pjsip: Map (session-)timers correctly.
When using the migration script sip_to_pjsip.py, session-timers=accept and
session-timers=refuse were mapped to wrong values.

ASTERISK-22374

Change-Id: Ie4e90d5f6a29aff07837b7fe5bc8aea5fb6fc092
2016-08-18 15:16:45 +02:00
Alexander Traud acc5237e91 sip_to_pjsip: Write username even without authname.
When using the migration script sip_to_pjsip.py, now the (mandatory) username is
written to pjsip.conf, even if there was no (optional) authname in the register
string in sip.conf.

ASTERISK-22374

Change-Id: Ie53e1997104cd2674821688b8a8247249f5e156f
2016-08-18 15:15:38 +02:00
Alexander Traud 3eb02235f5 sip_to_pjsip: Parse register even with transport.
When using the migration script sip_to_pjsip.py and the register string
started with a transport in sip.conf - like tls://... - register was not parsed
correctly and therefore not migrated correctly to pjsip.conf.

ASTERISK-22374

Change-Id: I44c12104eea2bd8558ada6d25d77edfecd92edd2
2016-08-18 15:14:36 +02:00
Alexander Traud 9907e2b1c1 sip_to_pjsip: Write local_net, contact_acl, contact_deny, and contact_permit.
When using the migration script sip_to_pjsip.py, those keys got missing. These
keys might appear several times and the function "merge_value" tried to collect
those. However, because these keys have different names in sip.conf and
pjsip.conf, "merge_value" was not able to find the new key name in sip.conf.
This change lets "merge_value" search with the old key name in sip.conf and
write with the new key name in pjsip.conf.

ASTERISK-22374

Change-Id: Ie53c5278ae6f1cb8fa7e96c5289877d46981d9d2
2016-08-18 15:13:03 +02:00
Alexander Traud c0e0075718 sip_to_pjsip: Map externhost/ip to Transports.
When using the migration script sip_to_pjsip.py, the externhost or externip of
sip.conf were erroneously written to Endpoints instead to Transports.

ASTERISK-22374

Change-Id: I2c5873386cfc388899fa9cf2368639dd12f1b8e4
2016-08-18 15:11:02 +02:00
Alexander Traud a937c2ccb1 sip_to_pjsip: Add defaultexpiry, maxexpiry, and minexpiry.
When using the migration script sip_to_pjsip.py, defaultexpiry, maxexpiry, and
minexpiry were not migrated to pjsip.conf.

ASTERISK-22374

Change-Id: I007fbf543dcadc96fc3ed71c54da502bcb209b7b
2016-08-18 15:04:53 +02:00
Alexander Traud 163cc2d68f sip_to_pjsip: Write media_encryption.
When using the migration script sip_to_pjsip.py, encryption=yes got missing and
media_encryption=sdes was not written to pjsip.conf, because of a typo.

ASTERISK-22374

Change-Id: I0fc3e55dc512a57603ae0fef41baacccf2a35c05
2016-08-18 15:03:24 +02:00
Alexander Traud d8b5970749 sip_to_pjsip: Write cos and tos.
When using the migration script sip_to_pjsip.py, both tos_sip and cos_sip got
missed, because of a typo. Therefore, cos and tos were not written to
pjsip.conf. Furthermore, that revealed a misuse of an internal function, caused
by a copy-and-paste error.

ASTERISK-22374

Change-Id: Id245ebadf70ab9776eb280c026288540af3af5c2
2016-08-18 15:02:07 +02:00
Alexander Traud 38491401b5 sip_to_pjsip: Add cert_file and ca_list_path.
When using the migration script sip_to_pjsip.py, cert_file and ca_list_path were
not migrated to pjsip.conf.

ASTERISK-22374

Change-Id: I4612877d190b7f86a48698cefbf5c4db6c265825
2016-08-18 14:55:58 +02:00
Joshua Colp 90b30b21ac astconfigparser: Really handle case where line is simply a comment.
The regular expression would match causing the code that handled
the line if it was merely a comment to never get executed.

Change-Id: I3e4022481037ebcba9905587fe8c764b4ce21819
2016-08-03 09:49:45 -05:00
Joshua Colp a7ae48441f astconfigparser: Handle case where line is simply a comment.
Change-Id: I2dea5815363f4d787d709228a04f33baee383ef5
2016-07-29 04:49:06 -05:00
Joshua Colp 1e7168aee0 astconfigparser.py: Update with realtime fixes.
When configuring SIP URIs in the pjsip.conf file it is
necessary to escape the semicolon so the parser does not
treat it as a comment. This change allows this to work in
the astconfigparser implementation.

A secondary bug where some data was lost if a configuration
option included a "=" in its value was also fixed.

A bug where sections would be considered equal despite
being different has also been fixed.

Change-Id: If229f656ef22050b50e7b34e90c4bffe796431f8
2016-07-26 17:31:06 -05:00
Scott Griepentrog fba836cc02 sip_to_pjsip: improve ability to parse input files
General improvements to SIP to PJSIP conversion utility:

1) track default section of input file to allow parsing
   an include file that doesn't specify a [section]

2) informatively handle case of assignment without [section]

3) correctly handle getting sections from included files
   - [section]'s are inherited by included file

4) provide null string as default transport bind ip

5) gracefully handle missing portions of registration string

6) denote steps of operation during conversion and confirm
   top level files as a convenience

ASTERISK-24474 #close
Review: https://reviewboard.asterisk.org/r/4280/
Reported by: John Kiniston
........

Merged revisions 430469 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 22:09:04 +00:00
Kevin Harwell 1c45a32ee8 res_pjsip: convert configuration settings names to snake case
Renamed, where appropriate, the configuration options for chan/res_pjsip to use
snake case (compound words separated by an underscore).  For example, faxdetect
will become fax_detect, recordofffeature will become record_off_feature, etc...

Review: https://reviewboard.asterisk.org/r/3002/
........

Merged revisions 403022 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-22 17:27:55 +00:00
Mark Michelson dd221c74c5 Update the conversion script from sip.conf to pjsip.conf
(closes issue ASTERISK-22374)
Reported by Matt Jordan

Review: https://reviewboard.asterisk.org/r/2846
........

Merged revisions 402327 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-31 22:09:47 +00:00