Compare commits

...

80 commits

Author SHA1 Message Date
micmac1
f2dc3c0878
Merge pull request #762 from micmac1/19.07-AST-2022-01-02-03
[19.07] asterish-16.x: bump to 16.25.2
2022-04-21 19:11:22 +02:00
Sebastian Kemper
445b5e5ff1 asterisk-16.x: bump to version 16.25.2
This bumps asterisk to version 16.25.2 to address the following security
concerns:

https://downloads.asterisk.org/pub/security/AST-2022-001.html
https://downloads.asterisk.org/pub/security/AST-2022-002.html
https://downloads.asterisk.org/pub/security/AST-2022-003.html

Other changes:

- add two new modules (app_sf and func_json)
- update 100-build-reproducibly.patch as upstream refactored some of the
  code
- refresh patches
- "--disable-xmldoc" does no longer prevent the linking to libxslt, if
  available. If that's the case one is greeted with the following error:

    Package asterisk is missing dependencies for the following libraries:
    libxslt.so.1

  This commit explicitly disables the use of libxslt, to avoid the
  dependency.
- backport 160-AST_EXT_TOOL_CHECK.patch from master for issue #672
- backport 180_build-fix-bininstall-launchd-issue-on-cross-platfrom.patch
  from master to fix a build issue on MacOS (patch from Sergey V.
  Lobanov <sergey@lobanov.in>)

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2022-04-20 23:32:27 +02:00
Sebastian Kemper
cc4fd2982f pjproject: sync patches with asterisk 16.25.2
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2022-04-20 23:13:10 +02:00
micmac1
c6bff940c0
Merge pull request #754 from micmac1/openwrt-19.07-AST
[19.07] pjproject: add upstream security fixes
2022-03-06 12:32:11 +01:00
Sebastian Kemper
302a22c6bb pjproject: add upstream security fixes
Details:

https://downloads.asterisk.org/pub/security/AST-2022-004.html
https://downloads.asterisk.org/pub/security/AST-2022-005.html
https://downloads.asterisk.org/pub/security/AST-2022-006.html

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit 623e5288f1)
2022-03-06 12:25:13 +01:00
micmac1
5ae3a58b26
Merge pull request #731 from micmac1/sof-1137-19
[19.07] sofia-sip: update to 1.13.7
2022-01-31 19:56:42 +01:00
Sebastian Kemper
cd42bc002a sofia-sip: update to 1.13.7
Contains DOS fix, see [1].

[1] https://github.com/signalwire/freeswitch/issues/1518

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2022-01-31 19:08:03 +01:00
Jiri Slachta
d88773392a
Merge pull request #717 from micmac1/restund-cve-19.07
[19.07] restund: fix CVE-2021-21382
2021-12-08 06:57:44 +01:00
Sebastian Kemper
4ca76cbccd restund: fix CVE-2021-21382
Patches taken from [1].

[1] https://github.com/wireapp/restund/pull/7

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit dec6316f2f)
2021-12-07 00:09:00 +01:00
micmac1
8de85c9588
Merge pull request #709 from micmac1/1907-sccp-mwi
[19.07] asterisk-chan-sccp: fix mwi header issue
2021-11-09 19:03:55 +01:00
Sebastian Kemper
d4043e133d asterisk-chan-sccp: fix mwi header issue
Asterisk, somewhere between release 16.3.0 and 16.22.0, added a new
header "mwi.h". This causes compile failure, because the chan-sccp
snapshot is not aware.

This adds a patch from upstream to resolve.

All patches refreshed.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-11-09 18:52:11 +01:00
micmac1
c2f7458131
Merge pull request #708 from micmac1/1907-fs1107
[19.07] freeswitch: security update to 1.10.7
2021-11-08 00:25:11 +01:00
Sebastian Kemper
d076f5a4fd freetdm: add package
It was moved from the freeswitch source tree into its own package.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-11-08 00:16:23 +01:00
Sebastian Kemper
87767edc22 freeswitch-stable: bump to 1.10.7
- freetdm is now external
- install libfreeswitch to staging directory for external freetdm
- fix pkgconfig file
- add dependency on libks to mod-verto
- add missing PKG_CONFIG_DEPENDS
- add build fixes
- refresh patches

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-11-08 00:12:45 +01:00
Sebastian Kemper
0732523916 sofia-sip: bump to 1.13.6
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-11-08 00:02:07 +01:00
micmac1
1b0861c248
Merge pull request #700 from micmac1/ast16.20
[19.07] bump pjproject, asterisk & chan-lantiq
2021-11-07 20:54:39 +01:00
Sebastian Kemper
87182ea560 asterisk-16.x-chan-lantiq: bump for DTMF fix
Patch and exports file dropped as included upstream.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-11-07 10:58:02 +01:00
Sebastian Kemper
abc7a17142 asterisk-16.x: bump to 16.22.0
- add new modules
- add res_timing_timerfd to base package (see commit e538fc3)
- update some module dependencies
- refresh patches
- remove upstreamed patches

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-11-07 10:57:36 +01:00
Sebastian Kemper
70937306b8 pjproject: bump to 2.10 + sync with asterisk
This is a squashed commit of the following:

01. revert of f42ce26555 to be able to
    cleanly cherry-pick from master
02. cherry pick from commit 9ea4a8b49b
03. cherry pick from commit 5cc8a67196
04. cherry pick from commit 93e08d1ad9
05. cherry pick from commit 80d0fbd405
06. cherry pick from commit a71a6666d2
07. cherry pick from commit f7fe759fe2
08. cherry pick from commit 6d6dd129aa
09. cherry pick from commit 5a916dc351
10. cherry pick from commit 95611304d9
11. cherry pick from commit 376473b38c
12. sync patches with asterisk 16.22.0

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-11-07 10:47:21 +01:00
micmac1
02b5c7b2d5
Merge pull request #669 from micmac1/19sof14
[19.07] sofia-sip: bump to 1.13.4
2021-08-11 23:00:42 +02:00
Sebastian Kemper
0f0ff11c6a sofia-sip: bump to 1.13.4
Fixes some issues, for instance a segfault during shutdown when
sofia-sip wasn't fully loaded, see [1]. The segfault was reproducible
by simply calling "freeswitch -help".

The added patch is to address a library versioning regression, patch is
from upstream.

[1] https://github.com/freeswitch/sofia-sip/issues/58

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-08-06 20:41:21 +02:00
micmac1
affee75bef
Merge pull request #646 from micmac1/fs1106-nua-mem-leak-19.07
[19.07] sofia-sip: add upstream fix for memory leak
2021-05-27 22:03:50 +02:00
Sebastian Kemper
8a21e28581 sofia-sip: add upstream fix for memory leak
Upstream provided a patch for a memory leak in Sofia SIP (see [1] for
more information).

[1] https://github.com/signalwire/freeswitch/issues/1174

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-05-27 20:24:04 +02:00
micmac1
61b7f93235
Merge pull request #636 from micmac1/fs-modmake-patch-19.07
[19.07] freeswitch-stable: fix 003-modmake-fix.patch
2021-04-08 22:02:51 +02:00
Sebastian Kemper
594cea401b freeswitch-stable: fix 003-modmake-fix.patch
Somehow this white space change slipped in unintentionally.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-04-07 20:55:46 +02:00
micmac1
99317b9341
Merge pull request #633 from micmac1/fs-1106-1907
[19.07] freeswitch-stable: bump to 1.10.6
2021-04-04 10:45:18 +02:00
Sebastian Kemper
094b0ab193 freeswitch-stable: bump to 1.10.6
- patches refreshed
- upstreamed patches removed
- hotplug script fix (ntpq output could print a plus that the script
  didn't expect)

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-04-03 10:44:04 +02:00
Sebastian Kemper
03ae16af5b spandsp3: bump to 2020-10-19
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-04-03 10:39:23 +02:00
Sebastian Kemper
efae548e6e sofia-sip: bump to 1.13.3
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-04-03 10:37:59 +02:00
Sebastian Kemper
1feaca4902 signalwire-client-c: bump to 1.3.0
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-04-03 10:36:17 +02:00
Sebastian Kemper
269cfc0836 libks: bump to 1.7.0
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-04-03 10:33:38 +02:00
Jiri Slachta
42605e413d
Merge pull request #620 from micmac1/ast-2021-1
[19.07] asterisk/pjproject: add patches for recently published Asterisk security notices
2021-03-09 17:29:57 +01:00
Sebastian Kemper
8f15bfbb0f asterisk-16.x: add patch for AST-2021-001
180-AST-2019-007-16.diff refreshed.

Upstream patch for AST-2021-001 added. This patch is mainly for
res_pjsip_diversion, but the part that is patched there was added later
("res_pjsip_diversion: implement support for History-Info"), so asterisk
16.3.0 is not affected. Hence the res_pjsip_diversion part was removed
from the patch. The patch resolves similar overflow situations in
res_pjsip_path and res_pjsip_outbound_registration, so these were kept.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-03-07 11:08:58 +01:00
Sebastian Kemper
f42ce26555 pjproject: add patch for AST-2021-005
https://downloads.asterisk.org/pub/security/AST-2021-005.html
https://issues.asterisk.org/jira/browse/ASTERISK-29196

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2021-03-07 11:06:26 +01:00
Jiri Slachta
6e019c94d0
Merge pull request #587 from micmac1/19.07AST
[19.07] asterisk-16.x: fix AST-2020-001 and 002
2020-11-23 21:52:23 +01:00
Sebastian Kemper
0394d0cbbd asterisk-16.x: fix AST-2020-001 and 002
Patches used:

http://downloads.asterisk.org/pub/security/AST-2020-001-16.diff
http://downloads.asterisk.org/pub/security/AST-2020-002-16.diff

Patch AST-2020-002-16.diff was amended a bit in res/res_pjsip_session.c:

if (++session->authentication_challenge_count > MAX_RX_CHALLENGES) {
	ast_debug(3, "%s: Initial INVITE reached maximum number of auth attempts.\n", ast_sip_session_get_name(session));
	return PJ_FALSE;
}

The above was not possible, because of missing bits introduced only in a
later version of Asterisk 16 (see upstream commit [1]). So the ast_debug
call was simplified accordingly.

Both patches were refreshed within OpenWrt SDK.

[1] 6abf6f345d

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-11-06 21:20:46 +01:00
Jiri Slachta
c1e923bcc0
Merge pull request #574 from guidosarducci/19.07-update-siproxd-0.8.3
[19.07] siproxd: update to version 0.8.3, improve logging and memory usage
2020-09-22 11:25:09 +02:00
Tony Ambardar
670c64193b siproxd: update to version 0.8.3, improve logging and memory usage
This release includes bug fixes and improvements accumulated over the last
4 years of development snapshots [1].

Bump upstream version, build new plugins 'stats' and 'blacklist', and add
an 'sqlite3' package dependency for siproxd-mod-blacklist.

Disable procd capturing stderr to syslog, since siproxd in 'foreground'
mode writes both to syslog and stderr, duplicating log messages.

Include a patch to drastically reduce memory usage (RSS from 17MB to 5MB
on ipq40xx platform):

  * 005-reduce-rtpproxy-urlmap-size.patch

Drop the following patches now included upstream:

  * 010-syslog-msg.patch
  * 100-musl-compat.patch

[1] http://siproxd.sourceforge.net/index.php?op=changelog.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2020-09-21 00:19:06 -07:00
micmac1
85cb5591de
Merge pull request #573 from micmac1/span3xml2-1907
[19.07] spandsp3: prevent host include search paths
2020-09-20 20:19:44 +02:00
Sebastian Kemper
64f5323a28 spandsp3: prevent host include search paths
Note the host include path for libxml2 below. This shouldn't cause an
issue because libxml2 is never used. But better safe than sorry as the
configure script probes other host include paths as well.

/bin/sh ../libtool  --tag=CC   --mode=compile ccache_cc -DHAVE_CONFIG_H -I.  -I.. -I/openwrt/staging_dir/target-mips_24kc_musl/usr/include -I/openwrt/staging_dir/toolchain-mips_24kc_gcc-10.2.0_musl/usr/include -I/openwrt/staging_dir/toolchain-mips_24kc_gcc-10.2.0_musl/include/fortify -I/openwrt/staging_dir/toolchain-mips_24kc_gcc-10.2.0_musl/include  -I/usr/include/libxml2 -DNDEBUG -Wunused-but-set-variable -std=gnu99 -ffast-math -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -DHAVE_VISIBILITY=1  -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/openwrt/build_dir/target-mips_24kc_musl/spandsp3-2020-08-14-6ec23e5a=spandsp3-2020-08-14-6ec23e5a -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro   -MT dds_float.lo -MD -MP -MF .deps/dds_float.Tpo -c -o dds_float.lo dds_float.c

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-09-20 13:46:01 +02:00
micmac1
10c68488ee
Merge pull request #570 from micmac1/1907fs10105
(19.07) freeswitch-stable: bump to 1.10.5
2020-09-17 19:15:38 +02:00
Sebastian Kemper
f7e7543393 freeswitch-stable: bump to 1.10.5
Includes some backports from master.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-09-11 14:01:37 +02:00
Sebastian Kemper
671b95efac spandsp3: backport from master
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-09-11 14:01:02 +02:00
Sebastian Kemper
be616aadf9 sofia-sip: backport from master
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-09-11 14:00:45 +02:00
micmac1
91b34e7eef
Merge pull request #539 from micmac1/fs-check-19
[19.07] freeswitch-stable: prevent libcheck use
2020-06-10 20:22:21 +02:00
Sebastian Kemper
377fd29660 freeswitch-stable: prevent libcheck use
Currently we disable some sofia tests to prevent build failure. An issue
was actually raised upstream ([1]) where this was discussed.

This cleared up some doubts. For instance it was established that
libcheck is used as a test framework, if the lib is detected. In OpenWrt
libcheck is available, so it may be in staging during the freeswitch
build.

Upstream also mentioned that libcheck is not always compatible with
freeswitch, which depends on the libcheck version.

This commit prevents libcheck detection. This is nicer than explicitly
disabling tests that fail.

[1] https://github.com/signalwire/freeswitch/issues/681

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-06-09 19:06:24 +02:00
micmac1
86a38f1cd4
Merge pull request #535 from micmac1/fs110319
[19.07] freeswitch-stable: bump to 1.10.3
2020-05-30 07:10:03 +02:00
Sebastian Kemper
e89be69988 freeswitch-stable: bump to 1.10.3
Minor version bump. Backport from master.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-05-26 21:38:43 +02:00
Jiri Slachta
036cd451c3
Merge pull request #513 from micmac1/ast-1907-keys
[openwrt-19.07] asterisk-16.x: update keys directory in init script
2020-04-04 10:15:59 +02:00
Sebastian Kemper
163faeff02 asterisk-16.x: update keys directory in init script
Currently the init script creates "/var/lib/asterisk/keys". But the
default keys directory is actually "/usr/share/asterisk/keys".

This commit amends the init script.

Resolves: #512

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-04-03 20:10:44 +02:00
Jiri Slachta
7d86caa898
Merge pull request #506 from BKPepe/fix-patch-for-aslr-pie
asterisk-16.x: 056-fix-check_expr2-build.patch - rebase
2020-03-08 13:17:00 +01:00
Josef Schlehofer
a92450d77b
asterisk-16.x: 056-fix-check_expr2-build.patch - rebase
Fixes: 1ea2095081 (asterisk-16.x: fix
compile with PKG_ASLR_PIE)

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2020-03-07 23:48:31 +01:00
Jiri Slachta
2d2ade3b8e
Merge pull request #505 from BKPepe/fix-hardening-asterisk-19.07
[19.07] asterisk-16.x: fix compile with PKG_ASLR_PIE
2020-03-07 13:11:29 +01:00
Sebastian Kemper
1ea2095081
asterisk-16.x: fix compile with PKG_ASLR_PIE
CFLAGS aren't used when compiling objects for check_expr2. This commits
adds the flags, which fixes the compilation when PKG_ASLR_PIE is
enabled. Note: The STANDALONE define is removed because it is already
defined in _ASTCFLAGS.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit 357949967f)
2020-03-07 11:58:39 +01:00
micmac1
6f95d6ab3f
Merge pull request #501 from micmac1/19.07-fs-1102
[19.07] freeswitch-stable: bump to 1.10.2
2020-01-01 15:24:49 +01:00
Sebastian Kemper
625b2c81a0 freeswitch-stable: bump to 1.10.2
Patches refreshed, two patches removed (included upstream), fixed one
typo (will send pull request to upstream if nobody did so yet).

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-01-01 15:18:10 +01:00
micmac1
f920139fea
Merge pull request #498 from micmac1/1907-fix-weak-md
[19.07] freeswitch-stable: fix weak md in gentls_cert
2019-12-20 10:11:54 +01:00
Sebastian Kemper
549cad72b2 freeswitch-stable: fix weak md in gentls_cert
gentls_cert generates certificates that are deemed too weak by Debian's
OpenSSL (on Buster and up). This patch upgrades the message digest to
SHA256 to address this.

See patch for details. Sent upstream ([1]).

[1] https://github.com/signalwire/freeswitch/pull/126

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-12-20 10:01:26 +01:00
micmac1
483bbd79b9
Merge pull request #496 from micmac1/backport-sigwire
[19.07] freeswitch-stable: backport mod-signalwire + libs from master
2019-12-17 19:10:45 +01:00
Sebastian Kemper
801735a0da freeswitch-stable: add mod_signalwire
This plugin allows to make a connection to the SignalWire CLOUD.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-12-17 19:06:46 +01:00
Sebastian Kemper
ff2bcbede5 signalwire-client-c: new package
signalwire-client-c is a dependency of mod-signalwire.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-12-17 19:05:06 +01:00
Sebastian Kemper
86e5f18408 libks: new package
libks is a dependency of signalwire-client-c.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-12-17 19:04:53 +01:00
Jiri Slachta
505fb3846d
Merge pull request #488 from micmac1/19.07-AST-2019-006_007
[19.07] asterisk-16.x: add fixes for AST-2019-006 and 007
2019-12-01 22:21:05 +01:00
micmac1
44d82fa226
Merge pull request #493 from micmac1/fs-vpx-cve-1907
(19.07) freeswitch-stable: fix libvpx CVEs + T38 patch
2019-11-29 21:15:49 +01:00
Sebastian Kemper
7dddd23802 freeswitch-stable: patch CVEs in included libvpx
Patch taken from Debian Buster, fixes:

CVE-2019-9232
CVE-2019-9325
CVE-2019-9371
CVE-2019-9433

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-11-29 20:58:00 +01:00
Sebastian Kemper
a4478106ab freeswitch-stable: add T.38 reINVITE fix
Patch sent upstream. It's a one-liner with a big explanation within the
patch.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-11-29 20:38:56 +01:00
Sebastian Kemper
fddfcd6b9e freeswitch-stable: remove warning
The warning can be removed, as 19.07 is not affected.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-11-29 20:37:41 +01:00
Sebastian Kemper
90a0684e60 asterisk-16.x: add fixes for AST-2019-006 and 007
https://downloads.asterisk.org/pub/security/AST-2019-006.html
https://downloads.asterisk.org/pub/security/AST-2019-007.html

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-11-22 18:53:30 +01:00
Jiri Slachta
821bcb7c58
Merge pull request #456 from micmac1/AST-2019-004-19.07
[19.07] asterisk-16.x: add patch for AST-2019-004
2019-09-20 18:18:10 +02:00
Jiri Slachta
b2bbba4be1
Merge pull request #454 from micmac1/1907-baresip-recurs
[19.07] baresip: fix recursive dependency
2019-09-20 18:03:49 +02:00
Sebastian Kemper
5b25b7821d asterisk-16.x: add patch for AST-2019-004
Add patch for a remote crash vulnerability. Crash can occur when
negotiating for T.38 with a declined stream.

CVE-2019-15297

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-09-05 19:58:55 +02:00
Sebastian Kemper
b2e7db645e baresip: fix recursive dependency
Since OpenWrt commit e82a4d9cfb ("config: regenerate *_shipped sources")
a few recursive dependencies have been discovered that were not visible
before.

$ make menuconfig
tmp/.config-package.in:103098:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:103098: symbol PACKAGE_baresip-mod-pulse depends on PACKAGE_baresip-mod-pulse
tmp/.config-package.in:121863:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:121863: symbol PACKAGE_pulseaudio-profiles depends on PACKAGE_pulseaudio-profiles
tmp/.config-package.in:121878:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:121878: symbol PACKAGE_pulseaudio-tools depends on PACKAGE_pulseaudio-tools

The recursive dependencies were reported at [1] and [2].

This commit addresses the recursive dependency of baresip-mod-pulse. The
new dependency string may look a bit peculiar, but it works and when
specified like this pulseaudio (when selected) doesn't get compiled
automatically when the intention is only to build baresip with mod-pulse
disabled (which in general is why we have the "patsubst" in the module
builder - but this is only triggered when the dependency has a leading
"+").

[1] https://github.com/openwrt/packages/issues/9300
[2] https://forum.openwrt.org/t/make-menuconfig-errors-this-day/38673/5

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-09-04 22:37:49 +02:00
micmac1
26b6fe1356
Merge pull request #453 from micmac1/19.07fs1.10.1
freeswitch-stable: import 1.10.1 from master
2019-09-01 11:57:30 +02:00
Sebastian Kemper
b755b01c70 freeswitch-stable: import 1.10.1 from master
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-09-01 11:51:05 +02:00
Jiri Slachta
956289cb10
Merge pull request #440 from jslachta/asterisk-13-removal-1907
asterisk-13.x: move package to abandoned packages
2019-07-14 20:35:28 +02:00
Jiri Slachta
996dd2bd21 asterisk-13.x: move package to abandoned packages
Signed-off-by: Jiri Slachta <jiri@slachta.eu>
2019-07-14 20:31:06 +02:00
Jiri Slachta
cb61e5e368
Merge pull request #437 from micmac1/19-ast13-AST-2019-002-and-003
(for 19.07) asterisk-1{3,6}.x: fix AST-2019-002 & AST-2019-003
2019-07-12 22:14:22 +02:00
Sebastian Kemper
ecde326753 asterisk-16.x: fix AST-2019-002 & AST-2019-003
https://downloads.asterisk.org/pub/security/AST-2019-002.html
https://downloads.asterisk.org/pub/security/AST-2019-003.html

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-07-12 20:44:53 +02:00
Sebastian Kemper
f4eaf906cc asterisk-13.x: fix AST-2019-002 & AST-2019-003
https://downloads.asterisk.org/pub/security/AST-2019-002.html
https://downloads.asterisk.org/pub/security/AST-2019-003.html

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-07-12 20:43:16 +02:00
Jiri Slachta
a5b136487e freeswitch: move to packages-abandoned repository
Signed-off-by: Jiri Slachta <jiri@slachta.eu>
2019-06-16 13:22:44 +02:00
165 changed files with 3868 additions and 5421 deletions

12
libs/freetdm/Config.in Normal file
View file

@ -0,0 +1,12 @@
menu "Configuration"
depends on PACKAGE_freetdm
config FREETDM_WITH_DEBUG
bool "Compile with debug information"
default n
help
Enable extra debug codepaths, like asserts and extra output. If you
want to get meaningful backtraces see
https://wiki.openwrt.org/doc/devel/debugging for starting points.
endmenu

155
libs/freetdm/Makefile Normal file
View file

@ -0,0 +1,155 @@
#
# Copyright (C) 2021 Sebastian Kemper <sebastian_ml@gmx.net>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=freetdm
PKG_RELEASE:=1
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/freeswitch/freetdm.git
PKG_SOURCE_DATE:=2021-08-30
PKG_SOURCE_VERSION:=8918ee1c3637cad0f9d41a402d26d3aa076fc202
PKG_MIRROR_HASH:=c910ff0fb62c8a174f6e0bbd749783da1ecd71634d4dcde48b118909f4981943
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_LICENSE:= \
BSD-2-Clause \
BSD-3-Clause \
BSD-4-Clause \
GPL-2.0+ \
MIT/X11 (BSD like) \
MPL-1.1
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=freeswitch-stable
FS_EXAMPLES_DIR:=/usr/share/freeswitch/examples
FS_LIB_DIR:=/usr/lib
FS_MOD_DIR:=$(FS_LIB_DIR)/freeswitch/mod
FS_PKGCONFIG_DIR:=$(FS_LIB_DIR)/pkgconfig
PKG_CONFIG_DEPENDS:= \
CONFIG_FS_STABLE_WITH_MODCONF \
CONFIG_FREETDM_WITH_DEBUG \
CONFIG_LIBC \
CONFIG_PACKAGE_libfreetdm-ftmod-libpri \
CONFIG_PACKAGE_libfreetdm-ftmod-pritap \
include $(INCLUDE_DIR)/package.mk
define Package/libfreetdm/install/ftmod
$(INSTALL_DIR) $(1)$(FS_MOD_DIR)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)$(FS_MOD_DIR)/ftmod_$(2).so \
$(1)$(FS_MOD_DIR)
endef
define Package/freetdm/config
source "$(SOURCE)/Config.in"
endef
define Package/libfreetdm/Default
SECTION:=libs
CATEGORY:=Libraries
SUBMENU:=Telephony
URL:=https://www.freeswitch.org
endef
define Package/libfreetdm
$(call Package/libfreetdm/Default)
DEPENDS:=
TITLE:=TDM signaling and media API
MENU:=1
endef
define Package/libfreetdm/description
Provides a unified interface to hardware TDM cards and SS7 stacks.
endef
define Package/libfreetdm/install
$(INSTALL_DIR) $(1)$(FS_LIB_DIR)
$(CP) $(PKG_INSTALL_DIR)$(FS_LIB_DIR)/libfreetdm.so.* \
$(1)$(FS_LIB_DIR)
endef
define Package/freeswitch-stable-mod-freetdm
$(call Package/libfreetdm/Default)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Telephony
DEPENDS:=freeswitch-stable +libfreetdm
TITLE:=FreeTDM endpoint module
endef
define Package/freeswitch-stable-mod-freetdm/description
This module is the glue between FreeSWITCH and FreeTDM.
endef
define Package/freeswitch-stable-mod-freetdm/install
$(INSTALL_DIR) $(1)$(FS_MOD_DIR)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)$(FS_MOD_DIR)/mod_freetdm.so \
$(1)$(FS_MOD_DIR)
ifeq ($(CONFIG_FS_STABLE_WITH_MODCONF),y)
$(INSTALL_DIR) \
$(1)$(FS_EXAMPLES_DIR)/mod_freetdm/freeswitch/autoload_configs
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/*.conf \
$(1)$(FS_EXAMPLES_DIR)/mod_freetdm
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/etc/freeswitch/autoload_configs/freetdm.conf.xml \
$(1)$(FS_EXAMPLES_DIR)/mod_freetdm/freeswitch/autoload_configs
endif
endef
define Package/libfreetdm/FTModule
define Package/libfreetdm-ftmod-$(subst _,-,$(1))
$(call Package/libfreetdm/Default)
DEPENDS:=libfreetdm \
$(patsubst +%,+PACKAGE_libfreetdm-ftmod-$(subst _,-,$(1)):%,$(4))
TITLE:=$(2) FreeTDM module
endef
define Package/libfreetdm-ftmod-$(subst _,-,$(1))/description
$(subst \n,$(newline),$(3))
endef
define Package/libfreetdm-ftmod-$(subst _,-,$(1))/install
$(call Package/libfreetdm/install/ftmod,$$(1),$(1))
endef
$$(eval $$(call BuildPackage,libfreetdm-ftmod-$(subst _,-,$(1))))
endef
CONFIGURE_ARGS+= \
--srcdir=$(PKG_BUILD_DIR) \
--disable-dependency-tracking \
--disable-static \
--with-modinstdir=$(FS_MOD_DIR) \
$(call autoconf_bool,CONFIG_FREETDM_WITH_DEBUG,debug) \
$(if $(CONFIG_PACKAGE_libfreetdm-ftmod-libpri),--with-libpri="$(STAGING_DIR)/usr",--without-libpri) \
$(if $(CONFIG_PACKAGE_libfreetdm-ftmod-pritap),--with-pritap,--without-pritap)
$(eval $(call BuildPackage,libfreetdm))
$(eval $(call BuildPackage,freeswitch-stable-mod-freetdm))
################################
# FreeTDM modules
# Params:
# 1 - Package subname
# 2 - Package title
# 3 - Module description
# 4 - Module dependencies
################################
$(eval $(call Package/libfreetdm/FTModule,analog,Analog,Offers generic FXO/FXS support for any type of card supported by FreeTDM.,))
$(eval $(call Package/libfreetdm/FTModule,analog_em,Analog EM,Offers generic E&M signaling for any type of card supported by FreeTDM.,))
$(eval $(call Package/libfreetdm/FTModule,libpri,LibPRI,Offers support for PRI lines using the open source libpri stack for any\ntype of card supported by FreeTDM. Supports both PRI and BRI signalling.,+libpri @!aarch64))
$(eval $(call Package/libfreetdm/FTModule,pritap,PRI tapping,This module is used to tap PRI lines.,+libfreetdm-ftmod-libpri))
$(eval $(call Package/libfreetdm/FTModule,skel,Skeleton,ftmod_skel is an example module.,))
$(eval $(call Package/libfreetdm/FTModule,zt,DAHDI I/O,This module supports the DAHDI interface. The DAHDI interface is used by\nseveral hardware vendors.,))

View file

@ -1,5 +1,5 @@
--- a/libs/freetdm/configure.ac
+++ b/libs/freetdm/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -88,7 +88,7 @@ AC_ARG_ENABLE([enable_64],
case "${ax_cv_c_compiler_vendor}" in

View file

@ -1,5 +1,5 @@
--- a/libs/freetdm/mod_freetdm/Makefile.in
+++ b/libs/freetdm/mod_freetdm/Makefile.in
--- a/mod_freetdm/Makefile.in
+++ b/mod_freetdm/Makefile.in
@@ -1,4 +1,4 @@
-FT_CFLAGS=@CFLAGS@ @COMP_VENDOR_CFLAGS@ @DEFS@
+FT_CFLAGS=@COMP_VENDOR_CFLAGS@ @DEFS@

View file

@ -0,0 +1,10 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -284,6 +284,7 @@ dox doxygen:
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(prefix)
$(mkinstalldirs) $(DESTDIR)@confdir@
+ $(mkinstalldirs) $(DESTDIR)@fsconfdir@/autoload_configs
@[ -f "$(DESTDIR)@confdir@/freetdm.conf" ] || ( cp conf/*.conf $(DESTDIR)@confdir@)
@[ -f "$(DESTDIR)@fsconfdir@/autoload_configs/freetdm.conf.xml" ] || ( cp -f conf/freetdm.conf.xml $(DESTDIR)@fsconfdir@/autoload_configs)
@echo FreeTDM Installed

66
libs/libks/Makefile Normal file
View file

@ -0,0 +1,66 @@
#
# Copyright (C) 2019 Sebastian Kemper <sebastian_ml@gmx.net>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libks
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/signalwire/$(PKG_NAME).git
PKG_SOURCE_DATE=2021-03-09
PKG_SOURCE_VERSION:=db9bfa746b1fffcaf062bbe060c8cef70c227116
PKG_RELEASE:=1
PKG_MIRROR_HASH:=616f8d9bb4daf40b8ec92b40348a88c821a668790f8f019ed9f1fb56bbb6e46b
PKG_BUILD_PARALLEL:=1
CMAKE_INSTALL:=1
PKG_LICENSE:= \
BSD-1-Clause \
BSD-3-Clause \
ISC \
MIT \
PUBLICDOMAIN \
twofish
PKG_LICENSE_FILES:=copyright
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/$(PKG_NAME)
SUBMENU:=Telephony
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Foundational support for SignalWire C products
URL:=https://github.com/signalwire/libks
ABI_VERSION:=1
DEPENDS:=+libatomic +libopenssl +libuuid
endef
# Otherwise OpenWrt's CPPFLAGS are ignored
TARGET_CFLAGS += $(TARGET_CPPFLAGS)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME)
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/*.h \
$(1)/usr/include/$(PKG_NAME)
$(INSTALL_DIR) $(1)/usr/lib/{cmake/$(PKG_NAME),pkgconfig}
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/cmake/* \
$(1)/usr/lib/cmake/$(PKG_NAME)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME).so* $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/$(PKG_NAME).pc \
$(1)/usr/lib/pkgconfig
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME).so.$(ABI_VERSION)* $(1)/usr/lib
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View file

@ -0,0 +1,15 @@
--- a/cmake/FindLibM.cmake
+++ b/cmake/FindLibM.cmake
@@ -8,11 +8,7 @@
# A user may set ``LIBM_ROOT`` to a math library installation root to tell this
# module where to look.
-find_path(LIBM_INCLUDE_DIRS
- NAMES math.h
- PATHS /usr/include /usr/local/include /usr/local/bic/include
- NO_DEFAULT_PATH
-)
+find_path(LIBM_INCLUDE_DIRS math.h)
find_library(LIBM_LIBRARIES m)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibM DEFAULT_MSG LIBM_LIBRARIES LIBM_INCLUDE_DIRS)

View file

@ -0,0 +1,11 @@
--- a/src/include/libks/ks_platform.h
+++ b/src/include/libks/ks_platform.h
@@ -91,7 +91,7 @@ KS_BEGIN_EXTERN_C
#include <sys/time.h>
#include <sys/select.h>
#include <netinet/tcp.h>
-#include <sys/signal.h>
+#include <signal.h>
#include <unistd.h>
#include <strings.h>
#include <stdint.h>

View file

@ -0,0 +1,24 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,10 @@ option(WITH_LIBBACKTRACE "Enables linkin
# Must include cotire before anything else for auto pch setup
#include(cmake/cotire.cmake)
+# Declare our project, libks
+project(LibKS VERSION 1.7.0 LANGUAGES C CXX)
+message("LibKS Version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
+
# Load our common utility api and setup the platfomrm and build
include(cmake/ksutil.cmake)
ksutil_setup_platform()
@@ -39,10 +43,6 @@ if (KS_PLAT_WIN OR WITH_KS_TEST)
endif()
endif()
-# Declare our project, libks
-project(LibKS VERSION 1.7.0 LANGUAGES C CXX)
-message("LibKS Version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
-
# Set package version
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})

View file

@ -0,0 +1,10 @@
--- a/cmake/ksutil.cmake
+++ b/cmake/ksutil.cmake
@@ -135,7 +135,6 @@ macro(ksutil_setup_platform)
set(KS_PLAT_LIN 1 CACHE INTERNAL "Platform definition" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
- add_compile_options("$<$<CONFIG:Release>:-O2>")
add_compile_options("$<$<CONFIG:Release>:-g>")
add_compile_options("$<$<CONFIG:Debug>:-O0>")

View file

@ -10,14 +10,15 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=pjproject
PKG_VERSION:=2.8
PKG_RELEASE:=2
PKG_VERSION:=2.10
PKG_RELEASE:=3
PKG_SOURCE:=pjproject-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.pjsip.org/release/$(PKG_VERSION)
PKG_HASH:=503d0bd7f9f13dc1492ac9b71b761b1089851fbb608b9a13996edc3c42006f79
# download "vX.Y.tar.gz" as "pjproject-vX.Y.tar.gz"
PKG_SOURCE_URL_FILE:=$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_URL_FILE)
PKG_SOURCE_URL:=https://github.com/pjsip/$(PKG_NAME)/archive
PKG_HASH:=936a4c5b98601b52325463a397ddf11ab4106c6a7b04f8dc7cdd377efbb597de
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
@ -34,7 +35,7 @@ define Package/pjproject/Default
SECTION:=lib
CATEGORY:=Libraries
SUBMENU:=Telephony
URL:=http://www.pjsip.org
URL:=https://www.pjsip.org
DEPENDS:=$(CXX_DEPENDS) +libopenssl +libuuid +libpthread
endef
@ -60,6 +61,7 @@ endef
CONFIGURE_ARGS+= \
$(if $(CONFIG_SOFT_FLOAT),--disable-floating-point) \
--disable-bcg729 \
--disable-darwin-ssl \
--disable-ext-sound \
--disable-ffmpeg \
--disable-g711-codec \
@ -92,6 +94,7 @@ CONFIGURE_ARGS+= \
TARGET_CFLAGS+=$(TARGET_CPPFLAGS)
define Build/Compile
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) dep
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
endef
@ -108,7 +111,8 @@ define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(SED) 's|$(TARGET_CFLAGS)||g' $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpjproject.pc
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpjproject.pc $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpjproject.pc \
$(1)/usr/lib/pkgconfig
endef
$(eval $(call PJSIPpackage,libpj,libpj,+librt))

View file

@ -58,13 +58,13 @@
+ Enabling it will result in SEGFAULTS when URIs containing escape sequences are encountered.
+*/
+#undef PJSIP_UNESCAPE_IN_PLACE
+#define PJSIP_MAX_PKT_LEN 32000
+#define PJSIP_MAX_PKT_LEN 65535
+
+#undef PJ_TODO
+#define PJ_TODO(x)
+
+/* Defaults too low for WebRTC */
+#define PJ_ICE_MAX_CAND 32
+#define PJ_ICE_MAX_CAND 64
+#define PJ_ICE_MAX_CHECKS (PJ_ICE_MAX_CAND * PJ_ICE_MAX_CAND)
+
+/* Increase limits to allow more formats */

View file

@ -1,6 +1,6 @@
--- a/build.mak.in
+++ b/build.mak.in
@@ -292,7 +292,6 @@ export APP_LDLIBS := $(PJSUA_LIB_LDLIB)
@@ -296,7 +296,6 @@ export APP_LDLIBS := $(PJSUA_LIB_LDLIB)
$(PJLIB_LDLIB) \
@LIBS@
export APP_LDXXLIBS := $(PJSUA2_LIB_LDLIB) \

View file

@ -0,0 +1,25 @@
--- a/libpjproject.pc.in
+++ b/libpjproject.pc.in
@@ -2,8 +2,8 @@
prefix=@PREFIX@
exec_prefix=${prefix}
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
Name: libpjproject
Description: Multimedia communication library
--- a/build.mak.in
+++ b/build.mak.in
@@ -314,8 +314,7 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FIL
# And here are the variables to use if application is using the
# library from the install location (i.e. --prefix)
export PJ_INSTALL_DIR := @prefix@
-export PJ_INSTALL_INC_DIR := @includedir@
export PJ_INSTALL_LIB_DIR := @libdir@
-export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
+export PJ_INSTALL_CFLAGS := -DPJ_AUTOCONF=1 @CFLAGS@
export PJ_INSTALL_CXXFLAGS := @CXXFLAGS@ $(PJ_INSTALL_CFLAGS)
export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS)

View file

@ -0,0 +1,37 @@
commit c3c1bf45cae2a35003aa16c267d59f97027f9c5e
Author: Kevin Harwell <kharwell@digium.com>
Date: Thu Jun 11 11:11:13 2020 -0500
sip_inv - fix invite session ref count crash
Ensure the session's ref count is only decremented under proper conditons.
For more details see the following issue report:
https://github.com/pjsip/pjproject/issues/2443
Patch supplied by sauwming
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -323,9 +323,19 @@ static void inv_set_state(pjsip_inv_sess
(*mod_inv.cb.on_state_changed)(inv, e);
pjsip_inv_dec_ref(inv);
- /* Only decrement when previous state is not already DISCONNECTED */
+ /* The above callback may change the state, so we need to be careful here
+ * and only decrement inv under the following conditions:
+ * 1. If the state parameter is DISCONNECTED, and previous state is not
+ * already DISCONNECTED.
+ * This is to make sure that dec_ref() is not called more than once.
+ * 2. If current state is PJSIP_INV_STATE_DISCONNECTED.
+ * This is to make sure that dec_ref() is not called if user restarts
+ * inv within the callback. Note that this check must be last since
+ * inv may have already been destroyed.
+ */
if (state == PJSIP_INV_STATE_DISCONNECTED &&
- prev_state != PJSIP_INV_STATE_DISCONNECTED)
+ prev_state != PJSIP_INV_STATE_DISCONNECTED &&
+ inv->state == PJSIP_INV_STATE_DISCONNECTED)
{
pjsip_inv_dec_ref(inv);
}

View file

@ -0,0 +1,35 @@
commit 40dd48d10911f4ff9b8dfbf16428fbc9acc434ba
Author: Riza Sulistyo <trengginas@users.noreply.github.com>
Date: Thu Jul 9 17:47:24 2020 +0700
Modify timer_id check on cancel() (#2463)
* modify timer_id check on cancel().
* modification based on comments.
--- a/pjlib/include/pj/timer.h
+++ b/pjlib/include/pj/timer.h
@@ -120,7 +120,10 @@ typedef struct pj_timer_entry
/**
* Internal unique timer ID, which is assigned by the timer heap.
- * Application should not touch this ID.
+ * Positive values indicate that the timer entry is running,
+ * while -1 means that it's not. Any other value may indicate that it
+ * hasn't been properly initialised or is in a bad state.
+ * Application should not touch this ID.
*/
pj_timer_id_t _timer_id;
--- a/pjlib/src/pj/timer.c
+++ b/pjlib/src/pj/timer.c
@@ -535,7 +535,7 @@ static int cancel( pj_timer_heap_t *ht,
PJ_CHECK_STACK();
// Check to see if the timer_id is out of range
- if (entry->_timer_id < 0 || (pj_size_t)entry->_timer_id > ht->max_size) {
+ if (entry->_timer_id < 1 || (pj_size_t)entry->_timer_id >= ht->max_size) {
entry->_timer_id = -1;
return 0;
}

View file

@ -0,0 +1,68 @@
From 78683646c8bc670ec730a42494e075f671a08e28 Mon Sep 17 00:00:00 2001
From: Guido Falsi <mad@madpilot.net>
Date: Mon, 11 May 2020 08:50:39 +0200
Subject: [PATCH] Fix race condition in parallel builds (#2426)
* Some targets residing in `OBJDIRS` are missing a dependency on that directory, which results in a race condition, causing build to fail sometimes due to the directory not existing when running parallel builds.
* The `PJSUA_LIB` variable is not defined anywhere, resulting in an empty value, and no correct dependency on the pjsua shared library for `pjsua2`. The correct variable seems to be `PJSUA_LIB_LIB`, defined at the start of this same `Makefile`.
---
build/rules.mak | 12 ++++++------
pjsip/build/Makefile | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
--- a/build/rules.mak
+++ b/build/rules.mak
@@ -129,7 +129,7 @@ endif
$(OBJDIR)/$(app).o: $(OBJDIRS) $(OBJS)
$(CROSS_COMPILE)ld -r -o $@ $(OBJS)
-$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o
+$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o | $(OBJDIRS)
@echo Creating kbuild Makefile...
@echo "# Our module name:" > $(OBJDIR)/Makefile
@echo 'obj-m += $(app).o' >> $(OBJDIR)/Makefile
@@ -154,27 +154,27 @@ $(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o
../lib/$(app).ko: $(LIB) $(OBJDIR)/$(app).ko
cp $(OBJDIR)/$(app).ko ../lib
-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m
+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m | $(OBJDIRS)
$(CC) $($(APP)_CFLAGS) \
$(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
$(subst /,$(HOST_PSEP),$<)
-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c
+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c | $(OBJDIRS)
$(CC) $($(APP)_CFLAGS) \
$(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
$(subst /,$(HOST_PSEP),$<)
-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S
+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S | $(OBJDIRS)
$(CC) $($(APP)_CFLAGS) \
$(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
$(subst /,$(HOST_PSEP),$<)
-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp
+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp | $(OBJDIRS)
$(CXX) $($(APP)_CXXFLAGS) \
$(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
$(subst /,$(HOST_PSEP),$<)
-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc
+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc | $(OBJDIRS)
$(CXX) $($(APP)_CXXFLAGS) \
$(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
$(subst /,$(HOST_PSEP),$<)
--- a/pjsip/build/Makefile
+++ b/pjsip/build/Makefile
@@ -261,7 +261,7 @@ $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME): $(
pjsua2-lib: $(PJSUA2_LIB_LIB)
$(PJSUA2_LIB_SONAME): $(PJSUA2_LIB_LIB)
-$(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME): $(PJSUA_LIB) $(PSJUA_LIB_SONAME) $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME)
+$(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME): $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME)
$(MAKE) -f $(RULES_MAK) APP=PJSUA2_LIB app=pjsua2-lib $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
pjsip-test: $(TEST_EXE)

View file

@ -0,0 +1,27 @@
--- a/pjmedia/src/pjmedia/sdp_neg.c
+++ b/pjmedia/src/pjmedia/sdp_neg.c
@@ -906,7 +906,7 @@ static pj_status_t process_m_answer( pj_
* after receiving remote answer.
*/
static pj_status_t process_answer(pj_pool_t *pool,
- pjmedia_sdp_session *offer,
+ pjmedia_sdp_session *local_offer,
pjmedia_sdp_session *answer,
pj_bool_t allow_asym,
pjmedia_sdp_session **p_active)
@@ -914,10 +914,14 @@ static pj_status_t process_answer(pj_poo
unsigned omi = 0; /* Offer media index */
unsigned ami = 0; /* Answer media index */
pj_bool_t has_active = PJ_FALSE;
+ pjmedia_sdp_session *offer;
pj_status_t status;
/* Check arguments. */
- PJ_ASSERT_RETURN(pool && offer && answer && p_active, PJ_EINVAL);
+ PJ_ASSERT_RETURN(pool && local_offer && answer && p_active, PJ_EINVAL);
+
+ /* Duplicate local offer SDP. */
+ offer = pjmedia_sdp_session_clone(pool, local_offer);
/* Check that media count match between offer and answer */
// Ticket #527, different media count is allowed for more interoperability,

View file

@ -0,0 +1,32 @@
From ce18018cc17bef8f80c08686e3a7b28384ef3ba5 Mon Sep 17 00:00:00 2001
From: sauwming <ming@teluu.com>
Date: Mon, 12 Oct 2020 13:31:25 +0800
Subject: [PATCH] Fix incorrect copying of destination info when creating
CANCEL (#2546)
---
pjsip/src/pjsip/sip_util.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/pjsip/src/pjsip/sip_util.c
+++ b/pjsip/src/pjsip/sip_util.c
@@ -779,14 +779,14 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_c
pjsip_hdr_clone(cancel_tdata->pool, req_tdata->saved_strict_route);
}
- /* Copy the destination host name from the original request */
- pj_strdup(cancel_tdata->pool, &cancel_tdata->dest_info.name,
- &req_tdata->dest_info.name);
-
- /* Finally copy the destination info from the original request */
+ /* Copy the destination info from the original request */
pj_memcpy(&cancel_tdata->dest_info, &req_tdata->dest_info,
sizeof(req_tdata->dest_info));
+ /* Finally, copy the destination host name from the original request */
+ pj_strdup(cancel_tdata->pool, &cancel_tdata->dest_info.name,
+ &req_tdata->dest_info.name);
+
/* Done.
* Return the transmit buffer containing the CANCEL request.
*/

View file

@ -0,0 +1,31 @@
--- a/pjmedia/src/pjmedia/sdp_neg.c
+++ b/pjmedia/src/pjmedia/sdp_neg.c
@@ -304,7 +304,6 @@ PJ_DEF(pj_status_t) pjmedia_sdp_neg_modi
{
pjmedia_sdp_session *new_offer;
pjmedia_sdp_session *old_offer;
- char media_used[PJMEDIA_MAX_SDP_MEDIA];
unsigned oi; /* old offer media index */
pj_status_t status;
@@ -323,8 +322,19 @@ PJ_DEF(pj_status_t) pjmedia_sdp_neg_modi
/* Change state to STATE_LOCAL_OFFER */
neg->state = PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER;
+ /* When there is no active local SDP in state PJMEDIA_SDP_NEG_STATE_DONE,
+ * it means that the previous initial SDP nego must have been failed,
+ * so we'll just set the local SDP offer here.
+ */
+ if (!neg->active_local_sdp) {
+ neg->initial_sdp_tmp = NULL;
+ neg->initial_sdp = pjmedia_sdp_session_clone(pool, local);
+ neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local);
+
+ return PJ_SUCCESS;
+ }
+
/* Init vars */
- pj_bzero(media_used, sizeof(media_used));
old_offer = neg->active_local_sdp;
new_offer = pjmedia_sdp_session_clone(pool, local);

View file

@ -0,0 +1,201 @@
From bdbeb7c4b2b11efc2e59f5dee7aa4360a2bc9fff Mon Sep 17 00:00:00 2001
From: sauwming <ming@teluu.com>
Date: Thu, 22 Apr 2021 14:03:28 +0800
Subject: [PATCH 90/90] Skip unsupported digest algorithm (#2408)
Co-authored-by: Nanang Izzuddin <nanang@teluu.com>
---
pjsip/src/pjsip/sip_auth_client.c | 32 +++++--
tests/pjsua/scripts-sipp/uas-auth-two-algo.py | 7 ++
.../pjsua/scripts-sipp/uas-auth-two-algo.xml | 83 +++++++++++++++++++
3 files changed, 117 insertions(+), 5 deletions(-)
create mode 100644 tests/pjsua/scripts-sipp/uas-auth-two-algo.py
create mode 100644 tests/pjsua/scripts-sipp/uas-auth-two-algo.xml
--- a/pjsip/src/pjsip/sip_auth_client.c
+++ b/pjsip/src/pjsip/sip_auth_client.c
@@ -1042,7 +1042,7 @@ static pj_status_t process_auth( pj_pool
pjsip_hdr *hdr;
pj_status_t status;
- /* See if we have sent authorization header for this realm */
+ /* See if we have sent authorization header for this realm (and scheme) */
hdr = tdata->msg->hdr.next;
while (hdr != &tdata->msg->hdr) {
if ((hchal->type == PJSIP_H_WWW_AUTHENTICATE &&
@@ -1052,7 +1052,8 @@ static pj_status_t process_auth( pj_pool
{
sent_auth = (pjsip_authorization_hdr*) hdr;
if (pj_stricmp(&hchal->challenge.common.realm,
- &sent_auth->credential.common.realm )==0)
+ &sent_auth->credential.common.realm)==0 &&
+ pj_stricmp(&hchal->scheme, &sent_auth->scheme)==0)
{
/* If this authorization has empty response, remove it. */
if (pj_stricmp(&sent_auth->scheme, &pjsip_DIGEST_STR)==0 &&
@@ -1062,6 +1063,14 @@ static pj_status_t process_auth( pj_pool
hdr = hdr->next;
pj_list_erase(sent_auth);
continue;
+ } else
+ if (pj_stricmp(&sent_auth->scheme, &pjsip_DIGEST_STR)==0 &&
+ pj_stricmp(&sent_auth->credential.digest.algorithm,
+ &hchal->challenge.digest.algorithm)!=0)
+ {
+ /* Same 'digest' scheme but different algo */
+ hdr = hdr->next;
+ continue;
} else {
/* Found previous authorization attempt */
break;
@@ -1155,9 +1164,10 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reini
{
pjsip_tx_data *tdata;
const pjsip_hdr *hdr;
- unsigned chal_cnt;
+ unsigned chal_cnt, auth_cnt;
pjsip_via_hdr *via;
pj_status_t status;
+ pj_status_t last_auth_err;
PJ_ASSERT_RETURN(sess && rdata && old_request && new_request,
PJ_EINVAL);
@@ -1178,6 +1188,8 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reini
*/
hdr = rdata->msg_info.msg->hdr.next;
chal_cnt = 0;
+ auth_cnt = 0;
+ last_auth_err = PJSIP_EAUTHNOAUTH;
while (hdr != &rdata->msg_info.msg->hdr) {
pjsip_cached_auth *cached_auth;
const pjsip_www_authenticate_hdr *hchal;
@@ -1222,8 +1234,13 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reini
*/
status = process_auth(tdata->pool, hchal, tdata->msg->line.req.uri,
tdata, sess, cached_auth, &hauth);
- if (status != PJ_SUCCESS)
- return status;
+ if (status != PJ_SUCCESS) {
+ last_auth_err = status;
+
+ /* Process next header. */
+ hdr = hdr->next;
+ continue;
+ }
if (pj_pool_get_used_size(cached_auth->pool) >
PJSIP_AUTH_CACHED_POOL_MAX_SIZE)
@@ -1236,12 +1253,17 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reini
/* Process next header. */
hdr = hdr->next;
+ auth_cnt++;
}
/* Check if challenge is present */
if (chal_cnt == 0)
return PJSIP_EAUTHNOCHAL;
+ /* Check if any authorization header has been created */
+ if (auth_cnt == 0)
+ return last_auth_err;
+
/* Remove branch param in Via header. */
via = (pjsip_via_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
via->branch_param.slen = 0;
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-auth-two-algo.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id=sip:a@localhost --username=a --realm=* --registrar=$SIPP_URI"]
+
+PJSUA_EXPECTS = [[0, "registration success", ""]]
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-auth-two-algo.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Basic UAS responder">
+ <recv request="REGISTER" crlf="true">
+ </recv>
+
+ <send>
+ <![CDATA[
+ SIP/2.0 100 Trying
+ [last_Via:];received=1.1.1.1;rport=1111
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <send>
+ <![CDATA[
+ SIP/2.0 401 Unauthorized
+ [last_Via:];received=1.1.1.1;rport=1111
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ WWW-Authenticate: Digest realm="sip.linphone.org", nonce="PARV4gAAAADgw3asAADW8zsi5BEAAAAA", opaque="+GNywA==", algorithm=SHA-256, qop="auth"
+ WWW-Authenticate: Digest realm="sip.linphone.org", nonce="PARV4gAAAADgw3asAADW8zsi5BEAAAAA", opaque="+GNywA==", algorithm=MD5, qop="auth"
+ WWW-Authenticate: Digest realm="sip.linphone.org", nonce="PARV4gAAAADgw3asAADW8zsi5BEAAAAA", opaque="+GNywA==", algorithm=MD2, qop="auth"
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <recv request="REGISTER" crlf="true">
+ <action>
+ <ereg regexp=".*"
+ search_in="hdr"
+ header="Authorization:"
+ assign_to="have_auth" />
+ </action>
+ </recv>
+
+ <nop next="resp_okay" test="have_auth" />
+
+ <send next="end">
+ <![CDATA[
+ SIP/2.0 403 no auth
+ [last_Via:];received=1.1.1.1;rport=1111
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ [last_Contact:]
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <label id="resp_okay" />
+
+ <send>
+ <![CDATA[
+ SIP/2.0 200 OK
+ [last_Via:];received=1.1.1.1;rport=1111
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ [last_Contact:]
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <label id="end" />
+
+ <!-- definition of the response time repartition table (unit is ms) -->
+ <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+ <!-- definition of the call length repartition table (unit is ms) -->
+ <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+

View file

@ -0,0 +1,78 @@
commit f0ff5817d0647bdecd1ec99488db9378e304cf83
Author: sauwming <ming@teluu.com>
Date: Mon May 17 09:56:27 2021 +0800
Fix double free of stun session (#2709)
--- a/pjnath/include/pjnath/stun_session.h
+++ b/pjnath/include/pjnath/stun_session.h
@@ -341,6 +341,7 @@ struct pj_stun_tx_data
pj_pool_t *pool; /**< Pool. */
pj_stun_session *sess; /**< The STUN session. */
pj_stun_msg *msg; /**< The STUN message. */
+ pj_bool_t is_destroying; /**< Is destroying? */
void *token; /**< The token. */
--- a/pjnath/src/pjnath/stun_session.c
+++ b/pjnath/src/pjnath/stun_session.c
@@ -167,16 +167,27 @@ static void tdata_on_destroy(void *arg)
{
pj_stun_tx_data *tdata = (pj_stun_tx_data*)arg;
+ if (tdata->grp_lock) {
+ pj_grp_lock_dec_ref(tdata->sess->grp_lock);
+ }
+
pj_pool_safe_release(&tdata->pool);
}
static void destroy_tdata(pj_stun_tx_data *tdata, pj_bool_t force)
{
- TRACE_((THIS_FILE, "tdata %p destroy request, force=%d, tsx=%p", tdata,
- force, tdata->client_tsx));
+ TRACE_((THIS_FILE,
+ "tdata %p destroy request, force=%d, tsx=%p, destroying=%d",
+ tdata, force, tdata->client_tsx, tdata->is_destroying));
+
+ /* Just return if destroy has been requested before */
+ if (tdata->is_destroying)
+ return;
/* STUN session may have been destroyed, except when tdata is cached. */
+ tdata->is_destroying = PJ_TRUE;
+
if (tdata->res_timer.id != PJ_FALSE) {
pj_timer_heap_cancel_if_active(tdata->sess->cfg->timer_heap,
&tdata->res_timer, PJ_FALSE);
@@ -189,7 +200,6 @@ static void destroy_tdata(pj_stun_tx_dat
pj_stun_client_tsx_set_data(tdata->client_tsx, NULL);
}
if (tdata->grp_lock) {
- pj_grp_lock_dec_ref(tdata->sess->grp_lock);
pj_grp_lock_dec_ref(tdata->grp_lock);
} else {
tdata_on_destroy(tdata);
@@ -200,11 +210,11 @@ static void destroy_tdata(pj_stun_tx_dat
/* "Probably" this is to absorb retransmission */
pj_time_val delay = {0, 300};
pj_stun_client_tsx_schedule_destroy(tdata->client_tsx, &delay);
+ tdata->is_destroying = PJ_FALSE;
} else {
pj_list_erase(tdata);
if (tdata->grp_lock) {
- pj_grp_lock_dec_ref(tdata->sess->grp_lock);
pj_grp_lock_dec_ref(tdata->grp_lock);
} else {
tdata_on_destroy(tdata);
@@ -238,7 +248,7 @@ static void on_cache_timeout(pj_timer_he
sess = tdata->sess;
pj_grp_lock_acquire(sess->grp_lock);
- if (sess->is_destroying) {
+ if (sess->is_destroying || tdata->is_destroying) {
pj_grp_lock_release(sess->grp_lock);
return;
}

View file

@ -0,0 +1,162 @@
From bb92c97ea512aa0ef316c9b2335c7d57b84dfc9a Mon Sep 17 00:00:00 2001
From: Nanang Izzuddin <nanang@teluu.com>
Date: Wed, 16 Jun 2021 12:12:35 +0700
Subject: [PATCH 1/2] - Avoid SSL socket parent/listener getting destroyed
during handshake by increasing parent's reference count. - Add missing SSL
socket close when the newly accepted SSL socket is discarded in SIP TLS
transport.
---
pjlib/src/pj/ssl_sock_imp_common.c | 44 +++++++++++++++++++++--------
pjsip/src/pjsip/sip_transport_tls.c | 23 ++++++++++++++-
2 files changed, 55 insertions(+), 12 deletions(-)
--- a/pjlib/src/pj/ssl_sock_imp_common.c
+++ b/pjlib/src/pj/ssl_sock_imp_common.c
@@ -224,6 +224,8 @@ static pj_bool_t on_handshake_complete(p
/* Accepting */
if (ssock->is_server) {
+ pj_bool_t ret = PJ_TRUE;
+
if (status != PJ_SUCCESS) {
/* Handshake failed in accepting, destroy our self silently. */
@@ -241,6 +243,12 @@ static pj_bool_t on_handshake_complete(p
status);
}
+ /* Decrement ref count of parent */
+ if (ssock->parent->param.grp_lock) {
+ pj_grp_lock_dec_ref(ssock->parent->param.grp_lock);
+ ssock->parent = NULL;
+ }
+
/* Originally, this is a workaround for ticket #985. However,
* a race condition may occur in multiple worker threads
* environment when we are destroying SSL objects while other
@@ -284,23 +292,29 @@ static pj_bool_t on_handshake_complete(p
return PJ_FALSE;
}
+
/* Notify application the newly accepted SSL socket */
if (ssock->param.cb.on_accept_complete2) {
- pj_bool_t ret;
ret = (*ssock->param.cb.on_accept_complete2)
(ssock->parent, ssock, (pj_sockaddr_t*)&ssock->rem_addr,
pj_sockaddr_get_len((pj_sockaddr_t*)&ssock->rem_addr),
status);
- if (ret == PJ_FALSE)
- return PJ_FALSE;
} else if (ssock->param.cb.on_accept_complete) {
- pj_bool_t ret;
ret = (*ssock->param.cb.on_accept_complete)
(ssock->parent, ssock, (pj_sockaddr_t*)&ssock->rem_addr,
pj_sockaddr_get_len((pj_sockaddr_t*)&ssock->rem_addr));
- if (ret == PJ_FALSE)
- return PJ_FALSE;
}
+
+ /* Decrement ref count of parent and reset parent (we don't need it
+ * anymore, right?).
+ */
+ if (ssock->parent->param.grp_lock) {
+ pj_grp_lock_dec_ref(ssock->parent->param.grp_lock);
+ ssock->parent = NULL;
+ }
+
+ if (ret == PJ_FALSE)
+ return PJ_FALSE;
}
/* Connecting */
@@ -864,9 +878,13 @@ static pj_bool_t asock_on_accept_complet
if (status != PJ_SUCCESS)
goto on_return;
+ /* Set parent and add ref count (avoid parent destroy during handshake) */
+ ssock->parent = ssock_parent;
+ if (ssock->parent->param.grp_lock)
+ pj_grp_lock_add_ref(ssock->parent->param.grp_lock);
+
/* Update new SSL socket attributes */
ssock->sock = newsock;
- ssock->parent = ssock_parent;
ssock->is_server = PJ_TRUE;
if (ssock_parent->cert) {
status = pj_ssl_sock_set_certificate(ssock, ssock->pool,
@@ -913,16 +931,20 @@ static pj_bool_t asock_on_accept_complet
ssock->asock_rbuf = (void**)pj_pool_calloc(ssock->pool,
ssock->param.async_cnt,
sizeof(void*));
- if (!ssock->asock_rbuf)
- return PJ_ENOMEM;
+ if (!ssock->asock_rbuf) {
+ status = PJ_ENOMEM;
+ goto on_return;
+ }
for (i = 0; i<ssock->param.async_cnt; ++i) {
- ssock->asock_rbuf[i] = (void*) pj_pool_alloc(
+ ssock->asock_rbuf[i] = (void*) pj_pool_alloc(
ssock->pool,
ssock->param.read_buffer_size +
sizeof(read_data_t*));
- if (!ssock->asock_rbuf[i])
- return PJ_ENOMEM;
+ if (!ssock->asock_rbuf[i]) {
+ status = PJ_ENOMEM;
+ goto on_return;
+ }
}
/* Create active socket */
--- a/pjsip/src/pjsip/sip_transport_tls.c
+++ b/pjsip/src/pjsip/sip_transport_tls.c
@@ -1325,9 +1325,26 @@ static pj_bool_t on_accept_complete2(pj_
PJ_UNUSED_ARG(src_addr_len);
listener = (struct tls_listener*) pj_ssl_sock_get_user_data(ssock);
+ if (!listener) {
+ /* Listener already destroyed, e.g: after TCP accept but before SSL
+ * handshake is completed.
+ */
+ if (new_ssock && accept_status == PJ_SUCCESS) {
+ /* Close the SSL socket if the accept op is successful */
+ PJ_LOG(4,(THIS_FILE,
+ "Incoming TLS connection from %s (sock=%d) is discarded "
+ "because listener is already destroyed",
+ pj_sockaddr_print(src_addr, addr, sizeof(addr), 3),
+ new_ssock));
+
+ pj_ssl_sock_close(new_ssock);
+ }
+
+ return PJ_FALSE;
+ }
if (accept_status != PJ_SUCCESS) {
- if (listener && listener->tls_setting.on_accept_fail_cb) {
+ if (listener->tls_setting.on_accept_fail_cb) {
pjsip_tls_on_accept_fail_param param;
pj_ssl_sock_info ssi;
@@ -1350,6 +1367,8 @@ static pj_bool_t on_accept_complete2(pj_
PJ_ASSERT_RETURN(new_ssock, PJ_TRUE);
if (!listener->is_registered) {
+ pj_ssl_sock_close(new_ssock);
+
if (listener->tls_setting.on_accept_fail_cb) {
pjsip_tls_on_accept_fail_param param;
pj_bzero(&param, sizeof(param));
@@ -1401,6 +1420,8 @@ static pj_bool_t on_accept_complete2(pj_
ssl_info.grp_lock, &tls);
if (status != PJ_SUCCESS) {
+ pj_ssl_sock_close(new_ssock);
+
if (listener->tls_setting.on_accept_fail_cb) {
pjsip_tls_on_accept_fail_param param;
pj_bzero(&param, sizeof(param));

View file

@ -0,0 +1,132 @@
From 68c69f516f95df1faa42e5647e9ce7cfdc41ac38 Mon Sep 17 00:00:00 2001
From: Nanang Izzuddin <nanang@teluu.com>
Date: Wed, 16 Jun 2021 12:15:29 +0700
Subject: [PATCH 2/2] - Fix silly mistake: accepted active socket created
without group lock in SSL socket. - Replace assertion with normal validation
check of SSL socket instance in OpenSSL verification callback (verify_cb())
to avoid crash, e.g: if somehow race condition with SSL socket destroy
happens or OpenSSL application data index somehow gets corrupted.
---
pjlib/src/pj/ssl_sock_imp_common.c | 3 +-
pjlib/src/pj/ssl_sock_ossl.c | 45 +++++++++++++++++++++++++-----
2 files changed, 40 insertions(+), 8 deletions(-)
--- a/pjlib/src/pj/ssl_sock_imp_common.c
+++ b/pjlib/src/pj/ssl_sock_imp_common.c
@@ -949,6 +949,7 @@ static pj_bool_t asock_on_accept_complet
/* Create active socket */
pj_activesock_cfg_default(&asock_cfg);
+ asock_cfg.grp_lock = ssock->param.grp_lock;
asock_cfg.async_cnt = ssock->param.async_cnt;
asock_cfg.concurrency = ssock->param.concurrency;
asock_cfg.whole_data = PJ_TRUE;
@@ -964,7 +965,7 @@ static pj_bool_t asock_on_accept_complet
goto on_return;
pj_grp_lock_add_ref(glock);
- asock_cfg.grp_lock = ssock->param.grp_lock = glock;
+ ssock->param.grp_lock = glock;
pj_grp_lock_add_handler(ssock->param.grp_lock, ssock->pool, ssock,
ssl_on_destroy);
}
--- a/pjlib/src/pj/ssl_sock_ossl.c
+++ b/pjlib/src/pj/ssl_sock_ossl.c
@@ -327,7 +327,8 @@ static pj_status_t STATUS_FROM_SSL_ERR(c
ERROR_LOG("STATUS_FROM_SSL_ERR", err, ssock);
}
- ssock->last_err = err;
+ if (ssock)
+ ssock->last_err = err;
return GET_STATUS_FROM_SSL_ERR(err);
}
@@ -344,7 +345,8 @@ static pj_status_t STATUS_FROM_SSL_ERR2(
/* Dig for more from OpenSSL error queue */
SSLLogErrors(action, ret, err, len, ssock);
- ssock->last_err = ssl_err;
+ if (ssock)
+ ssock->last_err = ssl_err;
return GET_STATUS_FROM_SSL_ERR(ssl_err);
}
@@ -587,6 +589,13 @@ static pj_status_t init_openssl(void)
/* Create OpenSSL application data index for SSL socket */
sslsock_idx = SSL_get_ex_new_index(0, "SSL socket", NULL, NULL, NULL);
+ if (sslsock_idx == -1) {
+ status = STATUS_FROM_SSL_ERR2("Init", NULL, -1, ERR_get_error(), 0);
+ PJ_LOG(1,(THIS_FILE,
+ "Fatal error: failed to get application data index for "
+ "SSL socket"));
+ return status;
+ }
return status;
}
@@ -614,21 +623,36 @@ static int password_cb(char *buf, int nu
}
-/* SSL password callback. */
+/* SSL certificate verification result callback.
+ * Note that this callback seems to be always called from library worker
+ * thread, e.g: active socket on_read_complete callback, which should have
+ * already been equipped with race condition avoidance mechanism (should not
+ * be destroyed while callback is being invoked).
+ */
static int verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx)
{
- pj_ssl_sock_t *ssock;
- SSL *ossl_ssl;
+ pj_ssl_sock_t *ssock = NULL;
+ SSL *ossl_ssl = NULL;
int err;
/* Get SSL instance */
ossl_ssl = X509_STORE_CTX_get_ex_data(x509_ctx,
SSL_get_ex_data_X509_STORE_CTX_idx());
- pj_assert(ossl_ssl);
+ if (!ossl_ssl) {
+ PJ_LOG(1,(THIS_FILE,
+ "SSL verification callback failed to get SSL instance"));
+ goto on_return;
+ }
/* Get SSL socket instance */
ssock = SSL_get_ex_data(ossl_ssl, sslsock_idx);
- pj_assert(ssock);
+ if (!ssock) {
+ /* SSL socket may have been destroyed */
+ PJ_LOG(1,(THIS_FILE,
+ "SSL verification callback failed to get SSL socket "
+ "instance (sslsock_idx=%d).", sslsock_idx));
+ goto on_return;
+ }
/* Store verification status */
err = X509_STORE_CTX_get_error(x509_ctx);
@@ -706,6 +730,7 @@ static int verify_cb(int preverify_ok, X
if (PJ_FALSE == ssock->param.verify_peer)
preverify_ok = 1;
+on_return:
return preverify_ok;
}
@@ -1213,6 +1238,12 @@ static void ssl_destroy(pj_ssl_sock_t *s
static void ssl_reset_sock_state(pj_ssl_sock_t *ssock)
{
ossl_sock_t *ossock = (ossl_sock_t *)ssock;
+
+ /* Detach from SSL instance */
+ if (ossock->ossl_ssl) {
+ SSL_set_ex_data(ossock->ossl_ssl, sslsock_idx, NULL);
+ }
+
/**
* Avoid calling SSL_shutdown() if handshake wasn't completed.
* OpenSSL 1.0.2f complains if SSL_shutdown() is called during an

View file

@ -0,0 +1,27 @@
From 2ae784030b0d9cf217c3d562af20e4967f19a3dc Mon Sep 17 00:00:00 2001
From: George Joseph <gjoseph@sangoma.com>
Date: Tue, 14 Sep 2021 10:47:29 -0600
Subject: [PATCH] pjmedia_sdp_attr_get_rtpmap: Strip param trailing whitespace
Use pj_scan_get() to parse the param part of rtpmap so
trailing whitespace is automatically stripped.
Fixes #2827
---
pjmedia/src/pjmedia/sdp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/pjmedia/src/pjmedia/sdp.c
+++ b/pjmedia/src/pjmedia/sdp.c
@@ -313,9 +313,9 @@ PJ_DEF(pj_status_t) pjmedia_sdp_attr_get
/* Expecting either '/' or EOF */
if (*scanner.curptr == '/') {
+ /* Skip the '/' */
pj_scan_get_char(&scanner);
- rtpmap->param.ptr = scanner.curptr;
- rtpmap->param.slen = scanner.end - scanner.curptr;
+ pj_scan_get(&scanner, &cs_token, &rtpmap->param);
} else {
rtpmap->param.slen = 0;
}

View file

@ -0,0 +1,653 @@
From 0ed41eb5fd0e4192e1b7dc374f819d17aef3e805 Mon Sep 17 00:00:00 2001
From: George Joseph <gtjoseph@users.noreply.github.com>
Date: Tue, 21 Dec 2021 19:32:22 -0700
Subject: [PATCH] sip_inv: Additional multipart support (#2919) (#2920)
---
pjsip/include/pjsip-ua/sip_inv.h | 108 ++++++++++-
pjsip/src/pjsip-ua/sip_inv.c | 240 ++++++++++++++++++++-----
pjsip/src/test/inv_offer_answer_test.c | 103 ++++++++++-
3 files changed, 394 insertions(+), 57 deletions(-)
--- a/pjsip/include/pjsip-ua/sip_inv.h
+++ b/pjsip/include/pjsip-ua/sip_inv.h
@@ -451,11 +451,11 @@ struct pjsip_inv_session
/**
- * This structure represents SDP information in a pjsip_rx_data. Application
- * retrieve this information by calling #pjsip_rdata_get_sdp_info(). This
+ * This structure represents SDP information in a pjsip_(rx|tx)_data. Application
+ * retrieve this information by calling #pjsip_get_sdp_info(). This
* mechanism supports multipart message body.
*/
-typedef struct pjsip_rdata_sdp_info
+typedef struct pjsip_sdp_info
{
/**
* Pointer and length of the text body in the incoming message. If
@@ -475,7 +475,15 @@ typedef struct pjsip_rdata_sdp_info
*/
pjmedia_sdp_session *sdp;
-} pjsip_rdata_sdp_info;
+} pjsip_sdp_info;
+
+/**
+ * For backwards compatibility and completeness,
+ * pjsip_rdata_sdp_info and pjsip_tdata_sdp_info
+ * are typedef'd to pjsip_sdp_info.
+ */
+typedef pjsip_sdp_info pjsip_rdata_sdp_info;
+typedef pjsip_sdp_info pjsip_tdata_sdp_info;
/**
@@ -1046,6 +1054,44 @@ PJ_DECL(pj_status_t) pjsip_create_sdp_bo
pjsip_msg_body **p_body);
/**
+ * This is a utility function to create a multipart body with the
+ * SIP body as the first part.
+ *
+ * @param pool Pool to allocate memory.
+ * @param sdp SDP session to be put in the SIP message body.
+ * @param p_body Pointer to receive SIP message body containing
+ * the SDP session.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjsip_create_multipart_sdp_body( pj_pool_t *pool,
+ pjmedia_sdp_session *sdp,
+ pjsip_msg_body **p_body);
+
+/**
+ * Retrieve SDP information from a message body. Application should
+ * prefer to use this function rather than parsing the SDP manually since
+ * this function supports multipart message body.
+ *
+ * This function will only parse the SDP once, the first time it is called
+ * on the same message. Subsequent call on the same message will just pick
+ * up the already parsed SDP from the message.
+ *
+ * @param pool Pool to allocate memory.
+ * @param body The message body.
+ * @param msg_media_type From the rdata or tdata Content-Type header, if available.
+ * If NULL, the content_type from the body will be used.
+ * @param search_media_type The media type to search for.
+ * If NULL, "application/sdp" will be used.
+ *
+ * @return The SDP info.
+ */
+PJ_DECL(pjsip_sdp_info*) pjsip_get_sdp_info(pj_pool_t *pool,
+ pjsip_msg_body *body,
+ pjsip_media_type *msg_media_type,
+ const pjsip_media_type *search_media_type);
+
+/**
* Retrieve SDP information from an incoming message. Application should
* prefer to use this function rather than parsing the SDP manually since
* this function supports multipart message body.
@@ -1061,6 +1107,60 @@ PJ_DECL(pj_status_t) pjsip_create_sdp_bo
PJ_DECL(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata);
+/**
+ * Retrieve SDP information from an incoming message. Application should
+ * prefer to use this function rather than parsing the SDP manually since
+ * this function supports multipart message body.
+ *
+ * This function will only parse the SDP once, the first time it is called
+ * on the same message. Subsequent call on the same message will just pick
+ * up the already parsed SDP from the message.
+ *
+ * @param rdata The incoming message.
+ * @param search_media_type The SDP media type to search for.
+ * If NULL, "application/sdp" will be used.
+ *
+ * @return The SDP info.
+ */
+PJ_DECL(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info2(
+ pjsip_rx_data *rdata,
+ const pjsip_media_type *search_media_type);
+
+/**
+ * Retrieve SDP information from an outgoing message. Application should
+ * prefer to use this function rather than parsing the SDP manually since
+ * this function supports multipart message body.
+ *
+ * This function will only parse the SDP once, the first time it is called
+ * on the same message. Subsequent call on the same message will just pick
+ * up the already parsed SDP from the message.
+ *
+ * @param tdata The outgoing message.
+ *
+ * @return The SDP info.
+ */
+PJ_DECL(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info(pjsip_tx_data *tdata);
+
+/**
+ * Retrieve SDP information from an outgoing message. Application should
+ * prefer to use this function rather than parsing the SDP manually since
+ * this function supports multipart message body.
+ *
+ * This function will only parse the SDP once, the first time it is called
+ * on the same message. Subsequent call on the same message will just pick
+ * up the already parsed SDP from the message.
+ *
+ * @param tdata The outgoing message.
+ * @param search_media_type The SDP media type to search for.
+ * If NULL, "application/sdp" will be used.
+ *
+ * @return The SDP info.
+ */
+PJ_DECL(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info2(
+ pjsip_tx_data *tdata,
+ const pjsip_media_type *search_media_type);
+
+
PJ_END_DECL
/**
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -118,6 +118,8 @@ static pj_status_t handle_timer_response
static pj_bool_t inv_check_secure_dlg(pjsip_inv_session *inv,
pjsip_event *e);
+static int print_sdp(pjsip_msg_body *body, char *buf, pj_size_t len);
+
static void (*inv_state_handler[])( pjsip_inv_session *inv, pjsip_event *e) =
{
&inv_on_state_null,
@@ -956,66 +958,170 @@ PJ_DEF(pj_status_t) pjsip_inv_create_uac
return PJ_SUCCESS;
}
-PJ_DEF(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata)
-{
- pjsip_rdata_sdp_info *sdp_info;
- pjsip_msg_body *body = rdata->msg_info.msg->body;
- pjsip_ctype_hdr *ctype_hdr = rdata->msg_info.ctype;
- pjsip_media_type app_sdp;
+PJ_DEF(pjsip_sdp_info*) pjsip_get_sdp_info(pj_pool_t *pool,
+ pjsip_msg_body *body,
+ pjsip_media_type *msg_media_type,
+ const pjsip_media_type *search_media_type)
+{
+ pjsip_sdp_info *sdp_info;
+ pjsip_media_type search_type;
+ pjsip_media_type multipart_mixed;
+ pjsip_media_type multipart_alternative;
+ pjsip_media_type *msg_type;
+ pj_status_t status;
- sdp_info = (pjsip_rdata_sdp_info*)
- rdata->endpt_info.mod_data[mod_inv.mod.id];
- if (sdp_info)
- return sdp_info;
+ sdp_info = PJ_POOL_ZALLOC_T(pool,
+ pjsip_sdp_info);
- sdp_info = PJ_POOL_ZALLOC_T(rdata->tp_info.pool,
- pjsip_rdata_sdp_info);
PJ_ASSERT_RETURN(mod_inv.mod.id >= 0, sdp_info);
- rdata->endpt_info.mod_data[mod_inv.mod.id] = sdp_info;
- pjsip_media_type_init2(&app_sdp, "application", "sdp");
+ if (!body) {
+ return sdp_info;
+ }
- if (body && ctype_hdr &&
- pj_stricmp(&ctype_hdr->media.type, &app_sdp.type)==0 &&
- pj_stricmp(&ctype_hdr->media.subtype, &app_sdp.subtype)==0)
+ if (msg_media_type) {
+ msg_type = msg_media_type;
+ } else {
+ if (body->content_type.type.slen == 0) {
+ return sdp_info;
+ }
+ msg_type = &body->content_type;
+ }
+
+ if (!search_media_type) {
+ pjsip_media_type_init2(&search_type, "application", "sdp");
+ } else {
+ pj_memcpy(&search_type, search_media_type, sizeof(search_type));
+ }
+
+ pjsip_media_type_init2(&multipart_mixed, "multipart", "mixed");
+ pjsip_media_type_init2(&multipart_alternative, "multipart", "alternative");
+
+ if (pjsip_media_type_cmp(msg_type, &search_type, PJ_FALSE) == 0)
{
- sdp_info->body.ptr = (char*)body->data;
- sdp_info->body.slen = body->len;
- } else if (body && ctype_hdr &&
- pj_stricmp2(&ctype_hdr->media.type, "multipart")==0 &&
- (pj_stricmp2(&ctype_hdr->media.subtype, "mixed")==0 ||
- pj_stricmp2(&ctype_hdr->media.subtype, "alternative")==0))
+ /*
+ * If the print_body function is print_sdp, we know that
+ * body->data is a pjmedia_sdp_session object and came from
+ * a tx_data. If not, it's the text representation of the
+ * sdp from an rx_data.
+ */
+ if (body->print_body == print_sdp) {
+ sdp_info->sdp = body->data;
+ } else {
+ sdp_info->body.ptr = (char*)body->data;
+ sdp_info->body.slen = body->len;
+ }
+ } else if (pjsip_media_type_cmp(&multipart_mixed, msg_type, PJ_FALSE) == 0 ||
+ pjsip_media_type_cmp(&multipart_alternative, msg_type, PJ_FALSE) == 0)
{
- pjsip_multipart_part *part;
+ pjsip_multipart_part *part;
+ part = pjsip_multipart_find_part(body, &search_type, NULL);
+ if (part) {
+ if (part->body->print_body == print_sdp) {
+ sdp_info->sdp = part->body->data;
+ } else {
+ sdp_info->body.ptr = (char*)part->body->data;
+ sdp_info->body.slen = part->body->len;
+ }
+ }
+ }
- part = pjsip_multipart_find_part(body, &app_sdp, NULL);
- if (part) {
- sdp_info->body.ptr = (char*)part->body->data;
- sdp_info->body.slen = part->body->len;
- }
+ /*
+ * If the body was already a pjmedia_sdp_session, we can just
+ * return it. If not and there wasn't a text representation
+ * of the sdp either, we can also just return.
+ */
+ if (sdp_info->sdp || !sdp_info->body.ptr) {
+ return sdp_info;
}
- if (sdp_info->body.ptr) {
- pj_status_t status;
- status = pjmedia_sdp_parse(rdata->tp_info.pool,
- sdp_info->body.ptr,
- sdp_info->body.slen,
- &sdp_info->sdp);
- if (status == PJ_SUCCESS)
- status = pjmedia_sdp_validate2(sdp_info->sdp, PJ_FALSE);
+ /*
+ * If the body was the text representation of teh SDP, we need
+ * to parse it to create a pjmedia_sdp_session object.
+ */
+ status = pjmedia_sdp_parse(pool,
+ sdp_info->body.ptr,
+ sdp_info->body.slen,
+ &sdp_info->sdp);
+ if (status == PJ_SUCCESS)
+ status = pjmedia_sdp_validate2(sdp_info->sdp, PJ_FALSE);
- if (status != PJ_SUCCESS) {
- sdp_info->sdp = NULL;
- PJ_PERROR(1,(THIS_FILE, status,
- "Error parsing/validating SDP body"));
- }
+ if (status != PJ_SUCCESS) {
+ sdp_info->sdp = NULL;
+ PJ_PERROR(1, (THIS_FILE, status,
+ "Error parsing/validating SDP body"));
+ }
+
+ sdp_info->sdp_err = status;
+
+ return sdp_info;
+}
+
+PJ_DEF(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info2(
+ pjsip_rx_data *rdata,
+ const pjsip_media_type *search_media_type)
+{
+ pjsip_media_type *msg_media_type = NULL;
+ pjsip_rdata_sdp_info *sdp_info;
- sdp_info->sdp_err = status;
+ if (rdata->endpt_info.mod_data[mod_inv.mod.id]) {
+ return (pjsip_rdata_sdp_info *)rdata->endpt_info.mod_data[mod_inv.mod.id];
+ }
+
+ /*
+ * rdata should have a Content-Type header at this point but we'll
+ * make sure.
+ */
+ if (rdata->msg_info.ctype) {
+ msg_media_type = &rdata->msg_info.ctype->media;
}
+ sdp_info = pjsip_get_sdp_info(rdata->tp_info.pool,
+ rdata->msg_info.msg->body,
+ msg_media_type,
+ search_media_type);
+ rdata->endpt_info.mod_data[mod_inv.mod.id] = sdp_info;
return sdp_info;
}
+PJ_DEF(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata)
+{
+ return pjsip_rdata_get_sdp_info2(rdata, NULL);
+}
+
+PJ_DEF(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info2(
+ pjsip_tx_data *tdata,
+ const pjsip_media_type *search_media_type)
+{
+ pjsip_ctype_hdr *ctype_hdr = NULL;
+ pjsip_media_type *msg_media_type = NULL;
+ pjsip_tdata_sdp_info *sdp_info;
+
+ if (tdata->mod_data[mod_inv.mod.id]) {
+ return (pjsip_tdata_sdp_info *)tdata->mod_data[mod_inv.mod.id];
+ }
+ /*
+ * tdata won't usually have a Content-Type header at this point
+ * but we'll check just the same,
+ */
+ ctype_hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTENT_TYPE, NULL);
+ if (ctype_hdr) {
+ msg_media_type = &ctype_hdr->media;
+ }
+
+ sdp_info = pjsip_get_sdp_info(tdata->pool,
+ tdata->msg->body,
+ msg_media_type,
+ search_media_type);
+ tdata->mod_data[mod_inv.mod.id] = sdp_info;
+
+ return sdp_info;
+}
+
+PJ_DEF(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info(pjsip_tx_data *tdata)
+{
+ return pjsip_tdata_get_sdp_info2(tdata, NULL);
+}
/*
* Verify incoming INVITE request.
@@ -1740,13 +1846,55 @@ PJ_DEF(pj_status_t) pjsip_create_sdp_bod
return PJ_SUCCESS;
}
+static pjsip_multipart_part* create_sdp_part(pj_pool_t *pool, pjmedia_sdp_session *sdp)
+{
+ pjsip_multipart_part *sdp_part;
+ pjsip_media_type media_type;
+
+ pjsip_media_type_init2(&media_type, "application", "sdp");
+
+ sdp_part = pjsip_multipart_create_part(pool);
+ PJ_ASSERT_RETURN(sdp_part != NULL, NULL);
+
+ sdp_part->body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body);
+ PJ_ASSERT_RETURN(sdp_part->body != NULL, NULL);
+
+ pjsip_media_type_cp(pool, &sdp_part->body->content_type, &media_type);
+
+ sdp_part->body->data = sdp;
+ sdp_part->body->clone_data = clone_sdp;
+ sdp_part->body->print_body = print_sdp;
+
+ return sdp_part;
+}
+
+PJ_DEF(pj_status_t) pjsip_create_multipart_sdp_body(pj_pool_t *pool,
+ pjmedia_sdp_session *sdp,
+ pjsip_msg_body **p_body)
+{
+ pjsip_media_type media_type;
+ pjsip_msg_body *multipart;
+ pjsip_multipart_part *sdp_part;
+
+ pjsip_media_type_init2(&media_type, "multipart", "mixed");
+ multipart = pjsip_multipart_create(pool, &media_type, NULL);
+ PJ_ASSERT_RETURN(multipart != NULL, PJ_ENOMEM);
+
+ sdp_part = create_sdp_part(pool, sdp);
+ PJ_ASSERT_RETURN(sdp_part != NULL, PJ_ENOMEM);
+ pjsip_multipart_add_part(pool, multipart, sdp_part);
+ *p_body = multipart;
+
+ return PJ_SUCCESS;
+}
+
static pjsip_msg_body *create_sdp_body(pj_pool_t *pool,
const pjmedia_sdp_session *c_sdp)
{
pjsip_msg_body *body;
pj_status_t status;
- status = pjsip_create_sdp_body(pool,
+ status = pjsip_create_sdp_body(pool,
pjmedia_sdp_session_clone(pool, c_sdp),
&body);
@@ -2069,6 +2217,7 @@ static pj_status_t inv_check_sdp_in_inco
)
)
{
+ pjsip_sdp_info *tdata_sdp_info;
const pjmedia_sdp_session *reoffer_sdp = NULL;
PJ_LOG(4,(inv->obj_name, "Received %s response "
@@ -2077,14 +2226,15 @@ static pj_status_t inv_check_sdp_in_inco
(st_code/10==18? "early" : "final" )));
/* Retrieve original SDP offer from INVITE request */
- reoffer_sdp = (const pjmedia_sdp_session*)
- tsx->last_tx->msg->body->data;
+ tdata_sdp_info = pjsip_tdata_get_sdp_info(tsx->last_tx);
+ reoffer_sdp = tdata_sdp_info->sdp;
/* Feed the original offer to negotiator */
status = pjmedia_sdp_neg_modify_local_offer2(inv->pool_prov,
inv->neg,
inv->sdp_neg_flags,
reoffer_sdp);
+
if (status != PJ_SUCCESS) {
PJ_LOG(1,(inv->obj_name, "Error updating local offer for "
"forked 2xx/18x response (err=%d)", status));
--- a/pjsip/src/test/inv_offer_answer_test.c
+++ b/pjsip/src/test/inv_offer_answer_test.c
@@ -137,6 +137,7 @@ typedef struct inv_test_param_t
pj_bool_t need_established;
unsigned count;
oa_t oa[4];
+ pj_bool_t multipart_body;
} inv_test_param_t;
typedef struct inv_test_t
@@ -257,6 +258,17 @@ static void on_media_update(pjsip_inv_se
}
}
+ /* Special handling for standard offer/answer */
+ if (inv_test.param.count == 1 &&
+ inv_test.param.oa[0] == OFFERER_UAC &&
+ inv_test.param.need_established)
+ {
+ jobs[job_cnt].type = ESTABLISH_CALL;
+ jobs[job_cnt].who = PJSIP_ROLE_UAS;
+ job_cnt++;
+ TRACE_((THIS_FILE, " C+++"));
+ }
+
pj_assert(job_cnt <= PJ_ARRAY_SIZE(jobs));
}
}
@@ -333,6 +345,15 @@ static pj_bool_t on_rx_request(pjsip_rx_
NULL, &tdata);
pj_assert(status == PJ_SUCCESS);
+ /* Use multipart body, if configured */
+ if (sdp && inv_test.param.multipart_body) {
+ status = pjsip_create_multipart_sdp_body(
+ tdata->pool,
+ pjmedia_sdp_session_clone(tdata->pool, sdp),
+ &tdata->msg->body);
+ }
+ pj_assert(status == PJ_SUCCESS);
+
status = pjsip_inv_send_msg(inv_test.uas, tdata);
pj_assert(status == PJ_SUCCESS);
@@ -426,6 +447,7 @@ static int perform_test(inv_test_param_t
sdp = NULL;
status = pjsip_inv_create_uac(dlg, sdp, inv_test.param.inv_option, &inv_test.uac);
+ //inv_test.uac->create_multipart = param->multipart_body;
PJ_ASSERT_RETURN(status==PJ_SUCCESS, -20);
TRACE_((THIS_FILE, " Sending INVITE %s offer", (sdp ? "with" : "without")));
@@ -436,8 +458,17 @@ static int perform_test(inv_test_param_t
status = pjsip_inv_invite(inv_test.uac, &tdata);
PJ_ASSERT_RETURN(status==PJ_SUCCESS, -30);
+ /* Use multipart body, if configured */
+ if (sdp && param->multipart_body) {
+ status = pjsip_create_multipart_sdp_body(
+ tdata->pool,
+ pjmedia_sdp_session_clone(tdata->pool, sdp),
+ &tdata->msg->body);
+ }
+ PJ_ASSERT_RETURN(status==PJ_SUCCESS, -40);
+
status = pjsip_inv_send_msg(inv_test.uac, tdata);
- PJ_ASSERT_RETURN(status==PJ_SUCCESS, -30);
+ PJ_ASSERT_RETURN(status==PJ_SUCCESS, -50);
/*
* Wait until test completes
@@ -525,13 +556,14 @@ static inv_test_param_t test_params[] =
200/INVITE (answer) <--
ACK -->
*/
-#if 0
+#if 1
{
"Standard INVITE with offer",
0,
PJ_TRUE,
1,
- { OFFERER_UAC }
+ { OFFERER_UAC },
+ PJ_FALSE
},
{
@@ -539,7 +571,25 @@ static inv_test_param_t test_params[] =
PJSIP_INV_REQUIRE_100REL,
PJ_TRUE,
1,
- { OFFERER_UAC }
+ { OFFERER_UAC },
+ PJ_FALSE
+ },
+ {
+ "Standard INVITE with offer, with Multipart",
+ 0,
+ PJ_TRUE,
+ 1,
+ { OFFERER_UAC },
+ PJ_TRUE
+ },
+
+ {
+ "Standard INVITE with offer, with 100rel, with Multipart",
+ PJSIP_INV_REQUIRE_100REL,
+ PJ_TRUE,
+ 1,
+ { OFFERER_UAC },
+ PJ_TRUE
},
#endif
@@ -555,7 +605,8 @@ static inv_test_param_t test_params[] =
0,
PJ_TRUE,
1,
- { OFFERER_UAS }
+ { OFFERER_UAS },
+ PJ_FALSE
},
{
@@ -563,7 +614,25 @@ static inv_test_param_t test_params[] =
PJSIP_INV_REQUIRE_100REL,
PJ_TRUE,
1,
- { OFFERER_UAS }
+ { OFFERER_UAS },
+ PJ_FALSE
+ },
+ {
+ "INVITE with no offer, with Multipart",
+ 0,
+ PJ_TRUE,
+ 1,
+ { OFFERER_UAS },
+ PJ_TRUE
+ },
+
+ {
+ "INVITE with no offer, with 100rel, with Multipart",
+ PJSIP_INV_REQUIRE_100REL,
+ PJ_TRUE,
+ 1,
+ { OFFERER_UAS },
+ PJ_TRUE
},
#endif
@@ -584,14 +653,24 @@ static inv_test_param_t test_params[] =
0,
PJ_TRUE,
2,
- { OFFERER_UAC, OFFERER_UAC }
+ { OFFERER_UAC, OFFERER_UAC },
+ PJ_FALSE
+ },
+ {
+ "INVITE and UPDATE by UAC, with Multipart",
+ 0,
+ PJ_TRUE,
+ 2,
+ { OFFERER_UAC, OFFERER_UAC },
+ PJ_TRUE
},
{
"INVITE and UPDATE by UAC, with 100rel",
PJSIP_INV_REQUIRE_100REL,
PJ_TRUE,
2,
- { OFFERER_UAC, OFFERER_UAC }
+ { OFFERER_UAC, OFFERER_UAC },
+ PJ_FALSE
},
#endif
@@ -617,6 +696,14 @@ static inv_test_param_t test_params[] =
4,
{ OFFERER_UAC, OFFERER_UAS, OFFERER_UAC, OFFERER_UAS }
},
+ {
+ "INVITE and many UPDATE by UAC and UAS, with Multipart",
+ 0,
+ PJ_TRUE,
+ 4,
+ { OFFERER_UAC, OFFERER_UAS, OFFERER_UAC, OFFERER_UAS },
+ PJ_TRUE
+ },
};

View file

@ -0,0 +1,116 @@
From 3faf1d2b4da553bbaee04f9a13a5d084b381e5fb Mon Sep 17 00:00:00 2001
From: sauwming <ming@teluu.com>
Date: Tue, 4 Jan 2022 15:28:49 +0800
Subject: [PATCH] Fix incorrect unescaping of tokens during parsing (#2933)
---
pjsip/src/pjsip/sip_parser.c | 29 +++++++++++++++++++++++++----
pjsip/src/test/msg_test.c | 6 +++---
2 files changed, 28 insertions(+), 7 deletions(-)
--- a/pjsip/src/pjsip/sip_parser.c
+++ b/pjsip/src/pjsip/sip_parser.c
@@ -378,17 +378,23 @@ static pj_status_t init_parser()
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
pj_cis_add_str( &pconst.pjsip_TOKEN_SPEC, TOKEN);
+ /* Token is allowed to have '%' so we do not need this. */
+ /*
status = pj_cis_dup(&pconst.pjsip_TOKEN_SPEC_ESC, &pconst.pjsip_TOKEN_SPEC);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
pj_cis_del_str(&pconst.pjsip_TOKEN_SPEC_ESC, "%");
+ */
status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC, &pconst.pjsip_TOKEN_SPEC);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC, "[:]");
+ /* Token is allowed to have '%' */
+ /*
status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC_ESC, &pconst.pjsip_TOKEN_SPEC_ESC);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC_ESC, "[:]");
+ */
status = pj_cis_dup(&pconst.pjsip_HOST_SPEC, &pconst.pjsip_ALNUM_SPEC);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
@@ -1210,7 +1216,11 @@ static void parse_param_imp( pj_scanner
unsigned option)
{
/* pname */
- parser_get_and_unescape(scanner, pool, spec, esc_spec, pname);
+ if (!esc_spec) {
+ pj_scan_get(scanner, spec, pname);
+ } else {
+ parser_get_and_unescape(scanner, pool, spec, esc_spec, pname);
+ }
/* init pvalue */
pvalue->ptr = NULL;
@@ -1240,7 +1250,12 @@ static void parse_param_imp( pj_scanner
// pj_scan_get_until_ch(scanner, ']', pvalue);
// pj_scan_get_char(scanner);
} else if(pj_cis_match(spec, *scanner->curptr)) {
- parser_get_and_unescape(scanner, pool, spec, esc_spec, pvalue);
+ if (!esc_spec) {
+ pj_scan_get(scanner, spec, pvalue);
+ } else {
+ parser_get_and_unescape(scanner, pool, spec, esc_spec,
+ pvalue);
+ }
}
}
}
@@ -1252,7 +1267,10 @@ PJ_DEF(void) pjsip_parse_param_imp(pj_sc
unsigned option)
{
parse_param_imp(scanner, pool, pname, pvalue, &pconst.pjsip_TOKEN_SPEC,
- &pconst.pjsip_TOKEN_SPEC_ESC, option);
+ // Token does not need to be unescaped.
+ // Refer to PR #2933.
+ // &pconst.pjsip_TOKEN_SPEC_ESC,
+ NULL, option);
}
@@ -2168,7 +2186,10 @@ static void int_parse_via_param( pjsip_v
pj_scan_get_char(scanner);
parse_param_imp(scanner, pool, &pname, &pvalue,
&pconst.pjsip_VIA_PARAM_SPEC,
- &pconst.pjsip_VIA_PARAM_SPEC_ESC,
+ // Token does not need to be unescaped.
+ // Refer to PR #2933.
+ // &pconst.pjsip_VIA_PARAM_SPEC_ESC,
+ NULL,
0);
if (!parser_stricmp(pname, pconst.pjsip_BRANCH_STR) && pvalue.slen) {
--- a/pjsip/src/test/msg_test.c
+++ b/pjsip/src/test/msg_test.c
@@ -953,7 +953,7 @@ static int hdr_test_subject_utf(pjsip_hd
#define GENERIC_PARAM "p0=a;p1=\"ab:;cd\";p2=ab%3acd;p3"
-#define GENERIC_PARAM_PARSED "p0=a;p1=\"ab:;cd\";p2=ab:cd;p3"
+#define GENERIC_PARAM_PARSED "p0=a;p1=\"ab:;cd\";p2=ab%3acd;p3"
#define PARAM_CHAR "][/:&+$"
#define SIMPLE_ADDR_SPEC "sip:host"
#define ADDR_SPEC SIMPLE_ADDR_SPEC ";"PARAM_CHAR"="PARAM_CHAR ";p1=\";\""
@@ -1401,7 +1401,7 @@ static int generic_param_test(pjsip_para
param = param->next;
if (pj_strcmp2(&param->name, "p2"))
return -956;
- if (pj_strcmp2(&param->value, "ab:cd"))
+ if (pj_strcmp2(&param->value, "ab%3acd"))
return -957;
param = param->next;
@@ -1621,7 +1621,7 @@ static int hdr_test_content_type(pjsip_h
prm = prm->next;
if (prm == &hdr->media.param) return -1960;
if (pj_strcmp2(&prm->name, "p2")) return -1961;
- if (pj_strcmp2(&prm->value, "ab:cd")) return -1962;
+ if (pj_strcmp2(&prm->value, "ab%3acd")) return -1962;
prm = prm->next;
if (prm == &hdr->media.param) return -1970;

View file

@ -0,0 +1,169 @@
From 7e3dfd8a15fd0f98dbf0e04d2d7a5bded90ee401 Mon Sep 17 00:00:00 2001
From: George Joseph <gjoseph@sangoma.com>
Date: Tue, 11 Jan 2022 09:27:23 -0700
Subject: [PATCH] Create generic pjsip_hdr_find functions
pjsip_msg_find_hdr(), pjsip_msg_find_hdr_by_name(), and
pjsip_msg_find_hdr_by_names() require a pjsip_msg to be passed in
so if you need to search a header list that's not in a pjsip_msg,
you have to do it yourself. This commit adds generic versions of
those 3 functions that take in the actual header list head instead
of a pjsip_msg so if you need to search a list of headers in
something like a pjsip_multipart_part, you can do so easily.
---
pjsip/include/pjsip/sip_msg.h | 53 +++++++++++++++++++++++++++++++++++
pjsip/src/pjsip/sip_msg.c | 51 +++++++++++++++++++++++----------
2 files changed, 89 insertions(+), 15 deletions(-)
--- a/pjsip/include/pjsip/sip_msg.h
+++ b/pjsip/include/pjsip/sip_msg.h
@@ -363,6 +363,59 @@ PJ_DECL(void*) pjsip_hdr_shallow_clone(
PJ_DECL(int) pjsip_hdr_print_on( void *hdr, char *buf, pj_size_t len);
/**
+ * Find a header in a header list by the header type.
+ *
+ * @param hdr_list The "head" of the header list.
+ * @param type The header type to find.
+ * @param start The first header field where the search should begin.
+ * If NULL is specified, then the search will begin from the
+ * first header, otherwise the search will begin at the
+ * specified header.
+ *
+ * @return The header field, or NULL if no header with the specified
+ * type is found.
+ */
+PJ_DECL(void*) pjsip_hdr_find( const void *hdr_list,
+ pjsip_hdr_e type,
+ const void *start);
+
+/**
+ * Find a header in a header list by its name.
+ *
+ * @param hdr_list The "head" of the header list.
+ * @param name The header name to find.
+ * @param start The first header field where the search should begin.
+ * If NULL is specified, then the search will begin from the
+ * first header, otherwise the search will begin at the
+ * specified header.
+ *
+ * @return The header field, or NULL if no header with the specified
+ * type is found.
+ */
+PJ_DECL(void*) pjsip_hdr_find_by_name( const void *hdr_list,
+ const pj_str_t *name,
+ const void *start);
+
+/**
+ * Find a header in a header list by its name and short name version.
+ *
+ * @param hdr_list The "head" of the header list.
+ * @param name The header name to find.
+ * @param sname The short name version of the header name.
+ * @param start The first header field where the search should begin.
+ * If NULL is specified, then the search will begin from the
+ * first header, otherwise the search will begin at the
+ * specified header.
+ *
+ * @return The header field, or NULL if no header with the specified
+ * type is found.
+ */
+PJ_DECL(void*) pjsip_hdr_find_by_names( const void *hdr_list,
+ const pj_str_t *name,
+ const pj_str_t *sname,
+ const void *start);
+
+/**
* @}
*/
--- a/pjsip/src/pjsip/sip_msg.c
+++ b/pjsip/src/pjsip/sip_msg.c
@@ -334,13 +334,13 @@ PJ_DEF(pjsip_msg*) pjsip_msg_clone( pj_p
return dst;
}
-PJ_DEF(void*) pjsip_msg_find_hdr( const pjsip_msg *msg,
- pjsip_hdr_e hdr_type, const void *start)
+PJ_DEF(void*) pjsip_hdr_find( const void *hdr_list,
+ pjsip_hdr_e hdr_type, const void *start)
{
- const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=&msg->hdr;
+ const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=hdr_list;
if (hdr == NULL) {
- hdr = msg->hdr.next;
+ hdr = end->next;
}
for (; hdr!=end; hdr = hdr->next) {
if (hdr->type == hdr_type)
@@ -349,14 +349,14 @@ PJ_DEF(void*) pjsip_msg_find_hdr( const
return NULL;
}
-PJ_DEF(void*) pjsip_msg_find_hdr_by_name( const pjsip_msg *msg,
- const pj_str_t *name,
- const void *start)
+PJ_DEF(void*) pjsip_hdr_find_by_name( const void *hdr_list,
+ const pj_str_t *name,
+ const void *start)
{
- const pjsip_hdr *hdr=(const pjsip_hdr*)start, *end=&msg->hdr;
+ const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=hdr_list;
if (hdr == NULL) {
- hdr = msg->hdr.next;
+ hdr = end->next;
}
for (; hdr!=end; hdr = hdr->next) {
if (pj_stricmp(&hdr->name, name) == 0)
@@ -365,15 +365,15 @@ PJ_DEF(void*) pjsip_msg_find_hdr_by_nam
return NULL;
}
-PJ_DEF(void*) pjsip_msg_find_hdr_by_names( const pjsip_msg *msg,
- const pj_str_t *name,
- const pj_str_t *sname,
- const void *start)
+PJ_DEF(void*) pjsip_hdr_find_by_names( const void *hdr_list,
+ const pj_str_t *name,
+ const pj_str_t *sname,
+ const void *start)
{
- const pjsip_hdr *hdr=(const pjsip_hdr*)start, *end=&msg->hdr;
+ const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=hdr_list;
if (hdr == NULL) {
- hdr = msg->hdr.next;
+ hdr = end->next;
}
for (; hdr!=end; hdr = hdr->next) {
if (pj_stricmp(&hdr->name, name) == 0)
@@ -384,6 +384,27 @@ PJ_DEF(void*) pjsip_msg_find_hdr_by_nam
return NULL;
}
+PJ_DEF(void*) pjsip_msg_find_hdr( const pjsip_msg *msg,
+ pjsip_hdr_e hdr_type, const void *start)
+{
+ return pjsip_hdr_find(&msg->hdr, hdr_type, start);
+}
+
+PJ_DEF(void*) pjsip_msg_find_hdr_by_name( const pjsip_msg *msg,
+ const pj_str_t *name,
+ const void *start)
+{
+ return pjsip_hdr_find_by_name(&msg->hdr, name, start);
+}
+
+PJ_DEF(void*) pjsip_msg_find_hdr_by_names( const pjsip_msg *msg,
+ const pj_str_t *name,
+ const pj_str_t *sname,
+ const void *start)
+{
+ return pjsip_hdr_find_by_names(&msg->hdr, name, sname, start);
+}
+
PJ_DEF(void*) pjsip_msg_find_remove_hdr( pjsip_msg *msg,
pjsip_hdr_e hdr_type, void *start)
{

View file

@ -0,0 +1,635 @@
From b7ecff22e77887626fd8e8608c4dd73bc7b7366f Mon Sep 17 00:00:00 2001
From: George Joseph <gjoseph@sangoma.com>
Date: Tue, 18 Jan 2022 06:14:31 -0700
Subject: [PATCH] Additional multipart improvements
Added the following APIs:
pjsip_multipart_find_part_by_header()
pjsip_multipart_find_part_by_header_str()
pjsip_multipart_find_part_by_cid_str()
pjsip_multipart_find_part_by_cid_uri()
---
pjsip/include/pjsip/sip_multipart.h | 83 ++++++++++
pjsip/src/pjsip/sip_multipart.c | 223 +++++++++++++++++++++++++++
pjsip/src/test/multipart_test.c | 225 +++++++++++++++++++++++++++-
3 files changed, 530 insertions(+), 1 deletion(-)
--- a/pjsip/include/pjsip/sip_multipart.h
+++ b/pjsip/include/pjsip/sip_multipart.h
@@ -154,6 +154,89 @@ pjsip_multipart_find_part( const pjsip_m
const pjsip_multipart_part *start);
/**
+ * Find a body inside multipart bodies which has a header matching the
+ * supplied one. Most useful for finding a part with a specific Content-ID.
+ *
+ * @param pool Memory pool to use for temp space.
+ * @param mp The multipart body.
+ * @param search_hdr Header to search for.
+ * @param start If specified, the search will begin at
+ * start->next part. Otherwise it will begin at
+ * the first part in the multipart bodies.
+ *
+ * @return The first part which has a header matching the
+ * specified one, or NULL if not found.
+ */
+PJ_DECL(pjsip_multipart_part*)
+pjsip_multipart_find_part_by_header(pj_pool_t *pool,
+ const pjsip_msg_body *mp,
+ void *search_hdr,
+ const pjsip_multipart_part *start);
+
+/**
+ * Find a body inside multipart bodies which has a header matching the
+ * supplied name and value. Most useful for finding a part with a specific
+ * Content-ID.
+ *
+ * @param pool Memory pool to use for temp space.
+ * @param mp The multipart body.
+ * @param hdr_name Header name to search for.
+ * @param hdr_value Header value search for.
+ * @param start If specified, the search will begin at
+ * start->next part. Otherwise it will begin at
+ * the first part in the multipart bodies.
+ *
+ * @return The first part which has a header matching the
+ * specified one, or NULL if not found.
+ */
+PJ_DECL(pjsip_multipart_part*)
+pjsip_multipart_find_part_by_header_str(pj_pool_t *pool,
+ const pjsip_msg_body *mp,
+ const pj_str_t *hdr_name,
+ const pj_str_t *hdr_value,
+ const pjsip_multipart_part *start);
+
+
+
+/**
+ * Find a body inside multipart bodies which has a Content-ID value matching the
+ * supplied "cid" URI in pj_str form. The "cid:" scheme will be assumed if the
+ * URL doesn't start with it. Enclosing angle brackets will also be handled
+ * correctly if they exist.
+ *
+ * @see RFC2392 Content-ID and Message-ID Uniform Resource Locators
+ *
+ * @param pool Memory pool to use for temp space.
+ * @param mp The multipart body.
+ * @param cid The "cid" URI to search for in pj_str form.
+ *
+ * @return The first part which has a Content-ID header matching the
+ * specified "cid" URI. or NULL if not found.
+ */
+PJ_DECL(pjsip_multipart_part*)
+pjsip_multipart_find_part_by_cid_str(pj_pool_t *pool,
+ const pjsip_msg_body *mp,
+ pj_str_t *cid);
+
+/**
+ * Find a body inside multipart bodies which has a Content-ID value matching the
+ * supplied "cid" URI.
+ *
+ * @see RFC2392 Content-ID and Message-ID Uniform Resource Locators
+ *
+ * @param pool Memory pool to use for temp space.
+ * @param mp The multipart body.
+ * @param cid The "cid" URI to search for.
+ *
+ * @return The first part which had a Content-ID header matching the
+ * specified "cid" URI. or NULL if not found.
+ */
+PJ_DECL(pjsip_multipart_part*)
+pjsip_multipart_find_part_by_cid_uri(pj_pool_t *pool,
+ const pjsip_msg_body *mp,
+ pjsip_other_uri *cid_uri);
+
+/**
* Parse multipart message.
*
* @param pool Memory pool.
--- a/pjsip/src/pjsip/sip_multipart.c
+++ b/pjsip/src/pjsip/sip_multipart.c
@@ -19,6 +19,7 @@
#include <pjsip/sip_multipart.h>
#include <pjsip/sip_parser.h>
#include <pjlib-util/scanner.h>
+#include <pjlib-util/string.h>
#include <pj/assert.h>
#include <pj/ctype.h>
#include <pj/errno.h>
@@ -416,6 +417,220 @@ pjsip_multipart_find_part( const pjsip_m
return NULL;
}
+/*
+ * Find a body inside multipart bodies which has the header and value.
+ */
+PJ_DEF(pjsip_multipart_part*)
+pjsip_multipart_find_part_by_header_str(pj_pool_t *pool,
+ const pjsip_msg_body *mp,
+ const pj_str_t *hdr_name,
+ const pj_str_t *hdr_value,
+ const pjsip_multipart_part *start)
+{
+ struct multipart_data *m_data;
+ pjsip_multipart_part *part;
+ pjsip_hdr *found_hdr;
+ pj_str_t found_hdr_str;
+ pj_str_t found_hdr_value;
+ pj_size_t expected_hdr_slen;
+ pj_size_t buf_size;
+ int hdr_name_len;
+#define REASONABLE_PADDING 32
+#define SEPARATOR_LEN 2
+ /* Must specify mandatory params */
+ PJ_ASSERT_RETURN(mp && hdr_name && hdr_value, NULL);
+
+ /* mp must really point to an actual multipart msg body */
+ PJ_ASSERT_RETURN(mp->print_body==&multipart_print_body, NULL);
+
+ /*
+ * We'll need to "print" each header we find to test it but
+ * allocating a buffer of PJSIP_MAX_URL_SIZE is overkill.
+ * Instead, we'll allocate one large enough to hold the search
+ * header name, the ": " separator, the search hdr value, and
+ * the NULL terminator. If we can't print the found header
+ * into that buffer then it can't be a match.
+ *
+ * Some header print functions such as generic_int require enough
+ * space to print the maximum possible header length so we'll
+ * add a reasonable amount to the print buffer size.
+ */
+ expected_hdr_slen = hdr_name->slen + SEPARATOR_LEN + hdr_value->slen;
+ buf_size = expected_hdr_slen + REASONABLE_PADDING;
+ found_hdr_str.ptr = pj_pool_alloc(pool, buf_size);
+ found_hdr_str.slen = 0;
+ hdr_name_len = hdr_name->slen + SEPARATOR_LEN;
+
+ m_data = (struct multipart_data*)mp->data;
+
+ if (start)
+ part = start->next;
+ else
+ part = m_data->part_head.next;
+
+ while (part != &m_data->part_head) {
+ found_hdr = NULL;
+ while ((found_hdr = pjsip_hdr_find_by_name(&part->hdr, hdr_name,
+ (found_hdr ? found_hdr->next : NULL))) != NULL) {
+
+ found_hdr_str.slen = pjsip_hdr_print_on((void*) found_hdr, found_hdr_str.ptr, buf_size);
+ /*
+ * If the buffer was too small (slen = -1) or the result wasn't
+ * the same length as the search header, it can't be a match.
+ */
+ if (found_hdr_str.slen != expected_hdr_slen) {
+ continue;
+ }
+ /*
+ * Set the value overlay to start at the found header value...
+ */
+ found_hdr_value.ptr = found_hdr_str.ptr + hdr_name_len;
+ found_hdr_value.slen = found_hdr_str.slen - hdr_name_len;
+ /* ...and compare it to the supplied header value. */
+ if (pj_strcmp(hdr_value, &found_hdr_value) == 0) {
+ return part;
+ }
+ }
+ part = part->next;
+ }
+ return NULL;
+#undef SEPARATOR_LEN
+#undef REASONABLE_PADDING
+}
+
+PJ_DEF(pjsip_multipart_part*)
+pjsip_multipart_find_part_by_header(pj_pool_t *pool,
+ const pjsip_msg_body *mp,
+ void *search_for,
+ const pjsip_multipart_part *start)
+{
+ struct multipart_data *m_data;
+ pjsip_hdr *search_hdr = search_for;
+ pj_str_t search_buf;
+
+ /* Must specify mandatory params */
+ PJ_ASSERT_RETURN(mp && search_hdr, NULL);
+
+ /* mp must really point to an actual multipart msg body */
+ PJ_ASSERT_RETURN(mp->print_body==&multipart_print_body, NULL);
+
+ /*
+ * Unfortunately, there isn't enough information to determine
+ * the maximum printed size of search_hdr at this point so we
+ * have to allocate a reasonable max.
+ */
+ search_buf.ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
+ search_buf.slen = pjsip_hdr_print_on(search_hdr, search_buf.ptr, PJSIP_MAX_URL_SIZE - 1);
+ if (search_buf.slen <= 0) {
+ return NULL;
+ }
+ /*
+ * Set the header value to start after the header name plus the ":", then
+ * strip leading and trailing whitespace.
+ */
+ search_buf.ptr += (search_hdr->name.slen + 1);
+ search_buf.slen -= (search_hdr->name.slen + 1);
+ pj_strtrim(&search_buf);
+
+ return pjsip_multipart_find_part_by_header_str(pool, mp, &search_hdr->name, &search_buf, start);
+}
+
+/*
+ * Convert a Content-ID URI to it's corresponding header value.
+ * RFC2392 says...
+ * A "cid" URL is converted to the corresponding Content-ID message
+ * header by removing the "cid:" prefix, converting the % encoded
+ * character(s) to their equivalent US-ASCII characters, and enclosing
+ * the remaining parts with an angle bracket pair, "<" and ">".
+ *
+ * This implementation will accept URIs with or without the "cid:"
+ * scheme and optional angle brackets.
+ */
+static pj_str_t cid_uri_to_hdr_value(pj_pool_t *pool, pj_str_t *cid_uri)
+{
+ pj_size_t cid_len = pj_strlen(cid_uri);
+ pj_size_t alloc_len = cid_len + 2 /* for the leading and trailing angle brackets */;
+ pj_str_t uri_overlay;
+ pj_str_t cid_hdr;
+ pj_str_t hdr_overlay;
+
+ pj_strassign(&uri_overlay, cid_uri);
+ /* If the URI is already enclosed in angle brackets, remove them. */
+ if (uri_overlay.ptr[0] == '<') {
+ uri_overlay.ptr++;
+ uri_overlay.slen -= 2;
+ }
+ /* If the URI starts with the "cid:" scheme, skip over it. */
+ if (pj_strncmp2(&uri_overlay, "cid:", 4) == 0) {
+ uri_overlay.ptr += 4;
+ uri_overlay.slen -= 4;
+ }
+ /* Start building */
+ cid_hdr.ptr = pj_pool_alloc(pool, alloc_len);
+ cid_hdr.ptr[0] = '<';
+ cid_hdr.slen = 1;
+ hdr_overlay.ptr = cid_hdr.ptr + 1;
+ hdr_overlay.slen = 0;
+ pj_strcpy_unescape(&hdr_overlay, &uri_overlay);
+ cid_hdr.slen += hdr_overlay.slen;
+ cid_hdr.ptr[cid_hdr.slen] = '>';
+ cid_hdr.slen++;
+
+ return cid_hdr;
+}
+
+PJ_DEF(pjsip_multipart_part*)
+pjsip_multipart_find_part_by_cid_str(pj_pool_t *pool,
+ const pjsip_msg_body *mp,
+ pj_str_t *cid)
+{
+ struct multipart_data *m_data;
+ pjsip_multipart_part *part;
+ pjsip_generic_string_hdr *found_hdr;
+ pj_str_t found_hdr_value;
+ static pj_str_t hdr_name = { "Content-ID", 10};
+ pj_str_t hdr_value;
+
+ PJ_ASSERT_RETURN(pool && mp && cid && (pj_strlen(cid) > 0), NULL);
+
+ hdr_value = cid_uri_to_hdr_value(pool, cid);
+ if (pj_strlen(&hdr_value) == 0) {
+ return NULL;
+ }
+
+ m_data = (struct multipart_data*)mp->data;
+ part = m_data->part_head.next;
+
+ while (part != &m_data->part_head) {
+ found_hdr = NULL;
+ while ((found_hdr = pjsip_hdr_find_by_name(&part->hdr, &hdr_name,
+ (found_hdr ? found_hdr->next : NULL))) != NULL) {
+ if (pj_strcmp(&hdr_value, &found_hdr->hvalue) == 0) {
+ return part;
+ }
+ }
+ part = part->next;
+ }
+ return NULL;
+}
+
+PJ_DEF(pjsip_multipart_part*)
+pjsip_multipart_find_part_by_cid_uri(pj_pool_t *pool,
+ const pjsip_msg_body *mp,
+ pjsip_other_uri *cid_uri)
+{
+ PJ_ASSERT_RETURN(pool && mp && cid_uri, NULL);
+
+ if (pj_strcmp2(&cid_uri->scheme, "cid") != 0) {
+ return NULL;
+ }
+ /*
+ * We only need to pass the URI content so we
+ * can do that directly.
+ */
+ return pjsip_multipart_find_part_by_cid_str(pool, mp, &cid_uri->content);
+}
+
/* Parse a multipart part. "pct" is parent content-type */
static pjsip_multipart_part *parse_multipart_part(pj_pool_t *pool,
char *start,
@@ -584,6 +799,7 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_
(int)boundary.slen, boundary.ptr));
}
+
/* Build the delimiter:
* delimiter = "--" boundary
*/
@@ -630,6 +846,8 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_
if (*curptr=='\r') ++curptr;
if (*curptr!='\n') {
/* Expecting a newline here */
+ PJ_LOG(2, (THIS_FILE, "Failed to find newline"));
+
return NULL;
}
++curptr;
@@ -645,6 +863,7 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_
curptr = pj_strstr(&subbody, &delim);
if (!curptr) {
/* We're really expecting end delimiter to be found. */
+ PJ_LOG(2, (THIS_FILE, "Failed to find end-delimiter"));
return NULL;
}
}
@@ -670,9 +889,13 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_
part = parse_multipart_part(pool, start_body, end_body - start_body,
ctype);
if (part) {
+ TRACE_((THIS_FILE, "Adding part"));
pjsip_multipart_add_part(pool, body, part);
+ } else {
+ PJ_LOG(2, (THIS_FILE, "Failed to add part"));
}
}
+ TRACE_((THIS_FILE, "pjsip_multipart_parse finished: %p", body));
return body;
}
--- a/pjsip/src/test/multipart_test.c
+++ b/pjsip/src/test/multipart_test.c
@@ -28,6 +28,7 @@
typedef pj_status_t (*verify_ptr)(pj_pool_t*,pjsip_msg_body*);
static pj_status_t verify1(pj_pool_t *pool, pjsip_msg_body *body);
+static pj_status_t verify2(pj_pool_t *pool, pjsip_msg_body *body);
static struct test_t
{
@@ -68,7 +69,41 @@ static struct test_t
"This is epilogue, which should be ignored too",
&verify1
+ },
+ {
+ /* Content-type */
+ "multipart", "mixed", "12345",
+
+ /* Body: */
+ "This is the prolog, which should be ignored.\r\n"
+ "--12345\r\n"
+ "Content-Type: text/plain\r\n"
+ "Content-ID: <header1@example.org>\r\n"
+ "Content-ID: <\"header1\"@example.org>\r\n"
+ "Content-Length: 13\r\n"
+ "\r\n"
+ "has header1\r\n"
+ "--12345 \t\r\n"
+ "Content-Type: application/pidf+xml\r\n"
+ "Content-ID: <my header2@example.org>\r\n"
+ "Content-ID: <my\xffheader2@example.org>\r\n"
+ "Content-Length: 13\r\n"
+ "\r\n"
+ "has header2\r\n"
+ "--12345\r\n"
+ "Content-Type: text/plain\r\n"
+ "Content-ID: <my header3@example.org>\r\n"
+ "Content-ID: <header1@example.org>\r\n"
+ "Content-ID: <my header4@example.org>\r\n"
+ "Content-Length: 13\r\n"
+ "\r\n"
+ "has header4\r\n"
+ "--12345--\r\n"
+ "This is epilogue, which should be ignored too",
+
+ &verify2
}
+
};
static void init_media_type(pjsip_media_type *mt,
@@ -87,6 +122,192 @@ static void init_media_type(pjsip_media_
}
}
+static int verify_hdr(pj_pool_t *pool, pjsip_msg_body *multipart_body,
+ void *hdr, char *part_body)
+{
+ pjsip_media_type mt;
+ pjsip_multipart_part *part;
+ pj_str_t the_body;
+
+
+ part = pjsip_multipart_find_part_by_header(pool, multipart_body, hdr, NULL);
+ if (!part) {
+ return -1;
+ }
+
+ the_body.ptr = (char*)part->body->data;
+ the_body.slen = part->body->len;
+
+ if (pj_strcmp2(&the_body, part_body) != 0) {
+ return -2;
+ }
+
+ return 0;
+}
+
+static int verify_cid_str(pj_pool_t *pool, pjsip_msg_body *multipart_body,
+ pj_str_t cid_url, char *part_body)
+{
+ pjsip_media_type mt;
+ pjsip_multipart_part *part;
+ pj_str_t the_body;
+
+ part = pjsip_multipart_find_part_by_cid_str(pool, multipart_body, &cid_url);
+ if (!part) {
+ return -3;
+ }
+
+ the_body.ptr = (char*)part->body->data;
+ the_body.slen = part->body->len;
+
+ if (pj_strcmp2(&the_body, part_body) != 0) {
+ return -4;
+ }
+
+ return 0;
+}
+
+static int verify_cid_uri(pj_pool_t *pool, pjsip_msg_body *multipart_body,
+ pjsip_other_uri *cid_uri, char *part_body)
+{
+ pjsip_media_type mt;
+ pjsip_multipart_part *part;
+ pj_str_t the_body;
+
+ part = pjsip_multipart_find_part_by_cid_uri(pool, multipart_body, cid_uri);
+ if (!part) {
+ return -5;
+ }
+
+ the_body.ptr = (char*)part->body->data;
+ the_body.slen = part->body->len;
+
+ if (pj_strcmp2(&the_body, part_body) != 0) {
+ return -6;
+ }
+
+ return 0;
+}
+
+static pj_status_t verify2(pj_pool_t *pool, pjsip_msg_body *body)
+{
+ int rc = 0;
+ int rcbase = 300;
+ pjsip_other_uri *cid_uri;
+ pjsip_ctype_hdr *ctype_hdr = pjsip_ctype_hdr_create(pool);
+
+ ctype_hdr->media.type = pj_str("application");
+ ctype_hdr->media.subtype = pj_str("pidf+xml");
+
+ rc = verify_hdr(pool, body, ctype_hdr, "has header2");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("cid:header1@example.org"), "has header1");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("%22header1%22@example.org"), "has header1");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ cid_uri = pjsip_uri_get_uri(pjsip_parse_uri(pool, "<cid:%22header1%22@example.org>",
+ strlen("<cid:%22header1%22@example.org>"), 0));
+ rcbase += 10;
+ rc = verify_cid_uri(pool, body, cid_uri, "has header1");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("<cid:my%20header2@example.org>"), "has header2");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("cid:my%ffheader2@example.org"), "has header2");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ cid_uri = pjsip_uri_get_uri(pjsip_parse_uri(pool, "<cid:my%ffheader2@example.org>",
+ strlen("<cid:my%ffheader2@example.org>"), 0));
+ rcbase += 10;
+ rc = verify_cid_uri(pool, body, cid_uri, "has header2");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("cid:my%20header3@example.org"), "has header4");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("<cid:my%20header4@example.org>"), "has header4");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ cid_uri = pjsip_uri_get_uri(pjsip_parse_uri(pool, "<cid:my%20header4@example.org>",
+ strlen("<cid:my%20header4@example.org>"), 0));
+ rcbase += 10;
+ rc = verify_cid_uri(pool, body, cid_uri, "has header4");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("<my%20header3@example.org>"), "has header4");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ /* These should all fail for malformed or missing URI */
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("cid:"), "has header4");
+ if (!rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str(""), "has header4");
+ if (!rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("<>"), "has header4");
+ if (!rc) {
+ return (rc - rcbase);
+ }
+
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("<cid>"), "has header4");
+ if (!rc) {
+ return (rc - rcbase);
+ }
+
+ /*
+ * This is going to pass but the ' ' in the uri is un-encoded which is invalid
+ * so we should never see it.
+ */
+ rcbase += 10;
+ rc = verify_cid_str(pool, body, pj_str("cid:my header3@example.org"), "has header4");
+ if (rc) {
+ return (rc - rcbase);
+ }
+
+ return 0;
+}
+
static int verify_part(pjsip_multipart_part *part,
char *h_content_type,
char *h_content_subtype,
@@ -236,8 +457,10 @@ static int parse_test(void)
pj_strdup2_with_null(pool, &str, p_tests[i].msg);
body = pjsip_multipart_parse(pool, str.ptr, str.slen, &ctype, 0);
- if (!body)
+ if (!body) {
+ pj_pool_release(pool);
return -100;
+ }
if (p_tests[i].verify) {
rc = p_tests[i].verify(pool, body);

View file

@ -0,0 +1,21 @@
From 15663e3f37091069b8c98a7fce680dc04bc8e865 Mon Sep 17 00:00:00 2001
From: sauwming <ming@teluu.com>
Date: Tue, 10 Aug 2021 11:53:25 +0800
Subject: [PATCH] Merge pull request from GHSA-2qpg-f6wf-w984
---
pjnath/src/pjnath/stun_msg.c | 3 +++
1 file changed, 3 insertions(+)
--- a/pjnath/src/pjnath/stun_msg.c
+++ b/pjnath/src/pjnath/stun_msg.c
@@ -1763,6 +1763,9 @@ static pj_status_t decode_errcode_attr(p
/* Get pointer to the string in the message */
value.ptr = ((char*)buf + ATTR_HDR_LEN + 4);
value.slen = attr->hdr.length - 4;
+ /* Make sure the length is never negative */
+ if (value.slen < 0)
+ value.slen = 0;
/* Copy the string to the attribute */
pj_strdup(pool, &attr->reason, &value);

View file

@ -0,0 +1,109 @@
From db3235953baa56d2fb0e276ca510fefca751643f Mon Sep 17 00:00:00 2001
From: Nanang Izzuddin <nanang@teluu.com>
Date: Mon, 21 Feb 2022 06:24:52 +0700
Subject: [PATCH] Merge pull request from GHSA-ffff-m5fm-qm62
* Update pjsip_ua_unregister_dlg():
- update the hash key if the dialog being unregistered is used as hash key.
- add an assertion check to make sure that the dlg_set to be removed is valid (can be found in the hash table).
* Change hash key string comparison method.
---
pjsip/src/pjsip/sip_ua_layer.c | 48 +++++++++++++++++++++++++++++-----
1 file changed, 42 insertions(+), 6 deletions(-)
--- a/pjsip/src/pjsip/sip_ua_layer.c
+++ b/pjsip/src/pjsip/sip_ua_layer.c
@@ -65,6 +65,9 @@ struct dlg_set
/* This is the buffer to store this entry in the hash table. */
pj_hash_entry_buf ht_entry;
+ /* Entry key in the hash table */
+ pj_str_t ht_key;
+
/* List of dialog in this dialog set. */
struct dlg_set_head dlg_list;
};
@@ -321,6 +324,7 @@ PJ_DEF(pj_status_t) pjsip_ua_register_dl
* Create the dialog set and add this dialog to it.
*/
dlg_set = alloc_dlgset_node();
+ dlg_set->ht_key = dlg->local.info->tag;
pj_list_init(&dlg_set->dlg_list);
pj_list_push_back(&dlg_set->dlg_list, dlg);
@@ -328,8 +332,8 @@ PJ_DEF(pj_status_t) pjsip_ua_register_dl
/* Register the dialog set in the hash table. */
pj_hash_set_np_lower(mod_ua.dlg_table,
- dlg->local.info->tag.ptr,
- (unsigned)dlg->local.info->tag.slen,
+ dlg_set->ht_key.ptr,
+ (unsigned)dlg_set->ht_key.slen,
dlg->local.tag_hval, dlg_set->ht_entry,
dlg_set);
}
@@ -339,14 +343,15 @@ PJ_DEF(pj_status_t) pjsip_ua_register_dl
struct dlg_set *dlg_set;
dlg_set = alloc_dlgset_node();
+ dlg_set->ht_key = dlg->local.info->tag;
pj_list_init(&dlg_set->dlg_list);
pj_list_push_back(&dlg_set->dlg_list, dlg);
dlg->dlg_set = dlg_set;
pj_hash_set_np_lower(mod_ua.dlg_table,
- dlg->local.info->tag.ptr,
- (unsigned)dlg->local.info->tag.slen,
+ dlg_set->ht_key.ptr,
+ (unsigned)dlg_set->ht_key.slen,
dlg->local.tag_hval, dlg_set->ht_entry, dlg_set);
}
@@ -391,12 +396,43 @@ PJ_DEF(pj_status_t) pjsip_ua_unregister_
/* If dialog list is empty, remove the dialog set from the hash table. */
if (pj_list_empty(&dlg_set->dlg_list)) {
- pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg->local.info->tag.ptr,
- (unsigned)dlg->local.info->tag.slen,
+
+ /* Verify that the dialog set is valid */
+ pj_assert(pj_hash_get_lower(mod_ua.dlg_table, dlg_set->ht_key.ptr,
+ (unsigned)dlg_set->ht_key.slen,
+ &dlg->local.tag_hval) == dlg_set);
+
+ pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg_set->ht_key.ptr,
+ (unsigned)dlg_set->ht_key.slen,
dlg->local.tag_hval, NULL);
/* Return dlg_set to free nodes. */
pj_list_push_back(&mod_ua.free_dlgset_nodes, dlg_set);
+ } else {
+ /* If the just unregistered dialog is being used as hash key,
+ * reset the dlg_set entry with a new key (i.e: from the first dialog
+ * in dlg_set).
+ */
+ if (dlg_set->ht_key.ptr == dlg->local.info->tag.ptr &&
+ dlg_set->ht_key.slen == dlg->local.info->tag.slen)
+ {
+ pjsip_dialog* key_dlg = dlg_set->dlg_list.next;
+
+ /* Verify that the old & new keys share the hash value */
+ pj_assert(key_dlg->local.tag_hval == dlg->local.tag_hval);
+
+ pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg_set->ht_key.ptr,
+ (unsigned)dlg_set->ht_key.slen,
+ dlg->local.tag_hval, NULL);
+
+ dlg_set->ht_key = key_dlg->local.info->tag;
+
+ pj_hash_set_np_lower(mod_ua.dlg_table,
+ dlg_set->ht_key.ptr,
+ (unsigned)dlg_set->ht_key.slen,
+ key_dlg->local.tag_hval, dlg_set->ht_entry,
+ dlg_set);
+ }
}
/* Unlock user agent. */

View file

@ -0,0 +1,37 @@
From 077b465c33f0aec05a49cd2ca456f9a1b112e896 Mon Sep 17 00:00:00 2001
From: sauwming <ming@teluu.com>
Date: Wed, 26 Jan 2022 13:28:57 +0800
Subject: [PATCH] Merge pull request from GHSA-7fw8-54cv-r7pm
---
pjlib-util/src/pjlib-util/scanner.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- a/pjlib-util/src/pjlib-util/scanner.c
+++ b/pjlib-util/src/pjlib-util/scanner.c
@@ -444,16 +444,21 @@ PJ_DEF(void) pj_scan_get_n( pj_scanner *
PJ_DEF(int) pj_scan_get_char( pj_scanner *scanner )
{
- int chr = *scanner->curptr;
+ register char *s = scanner->curptr;
+ int chr;
- if (!chr) {
+ if (s >= scanner->end || !*s) {
pj_scan_syntax_err(scanner);
return 0;
}
- ++scanner->curptr;
+ chr = *s;
- if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) {
+ ++s;
+ scanner->curptr = s;
+ if (PJ_SCAN_CHECK_EOF(s) && PJ_SCAN_IS_PROBABLY_SPACE(*s) &&
+ scanner->skip_ws)
+ {
pj_scan_skip_whitespace(scanner);
}
return chr;

View file

@ -1,35 +0,0 @@
From 42e5ee52e1113d24b7125e29669022c35e87693f Mon Sep 17 00:00:00 2001
From: Sauw Ming <ming@teluu.com>
Date: Wed, 26 Sep 2018 00:56:51 +0000
Subject: [PATCH] Re #2147 (misc): Fixed build error of undefined reference to
`pjmedia_srtp_enum_crypto' if PJMEDIA_HAS_SRTP is disabled.
Thanks to Alexei Gradinari for the patch
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5891 74dad513-b988-da41-8d7b-12977e46ad98
---
pjsip/src/pjsua2/endpoint.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/pjsip/src/pjsua2/endpoint.cpp
+++ b/pjsip/src/pjsua2/endpoint.cpp
@@ -2145,14 +2145,16 @@ void Endpoint::resetVideoCodecParam(cons
*/
StringVector Endpoint::srtpCryptoEnum() throw(Error)
{
+ StringVector result;
+#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0)
unsigned cnt = PJMEDIA_SRTP_MAX_CRYPTOS;
pjmedia_srtp_crypto cryptos[PJMEDIA_SRTP_MAX_CRYPTOS];
- StringVector result;
PJSUA2_CHECK_EXPR(pjmedia_srtp_enum_crypto(&cnt, cryptos));
for (unsigned i = 0; i < cnt; ++i)
result.push_back(pj2Str(cryptos[i].name));
+#endif
return result;
}

View file

@ -1,32 +0,0 @@
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -4185,6 +4185,29 @@ static void inv_on_state_calling( pjsip_
if (tsx->status_code != 100) {
+ if (inv->role == PJSIP_ROLE_UAC) {
+ pjsip_rx_data *rdata = e->body.tsx_state.src.rdata;
+ pjsip_allow_hdr *allow = NULL;
+ pjsip_msg *msg = rdata->msg_info.msg;
+
+ if (msg) {
+ allow = (pjsip_allow_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_ALLOW,
+ NULL);
+ }
+ if (allow) {
+ unsigned i;
+ const pj_str_t STR_UPDATE = { "UPDATE", 6 };
+
+ for (i=0; i<allow->count; ++i) {
+ if (pj_stricmp(&allow->values[i], &STR_UPDATE)==0) {
+ /* UPDATE is present in Allow */
+ inv->options |= PJSIP_INV_SUPPORT_UPDATE;
+ break;
+ }
+ }
+ }
+ }
+
if (dlg->remote.info->tag.slen)
inv_set_state(inv, PJSIP_INV_STATE_EARLY, e);

View file

@ -1,37 +0,0 @@
From 1fed39fe1488abd654a5488b5e6ad59b4b973331 Mon Sep 17 00:00:00 2001
From: nanang <nanang@localhost>
Date: Tue, 8 Jan 2019 09:07:47 +0000
Subject: [PATCH 1/5] Fixed #2172: Avoid double reference counter decrements in
timer in the scenario of race condition between pj_timer_heap_cancel() and
pj_timer_heap_poll().
---
pjlib/src/pj/timer.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
--- a/pjlib/src/pj/timer.c
+++ b/pjlib/src/pj/timer.c
@@ -580,13 +580,16 @@ static int cancel_timer(pj_timer_heap_t
lock_timer_heap(ht);
count = cancel(ht, entry, flags | F_DONT_CALL);
- if (flags & F_SET_ID) {
- entry->id = id_val;
- }
- if (entry->_grp_lock) {
- pj_grp_lock_t *grp_lock = entry->_grp_lock;
- entry->_grp_lock = NULL;
- pj_grp_lock_dec_ref(grp_lock);
+ if (count > 0) {
+ /* Timer entry found & cancelled */
+ if (flags & F_SET_ID) {
+ entry->id = id_val;
+ }
+ if (entry->_grp_lock) {
+ pj_grp_lock_t *grp_lock = entry->_grp_lock;
+ entry->_grp_lock = NULL;
+ pj_grp_lock_dec_ref(grp_lock);
+ }
}
unlock_timer_heap(ht);

View file

@ -1,32 +0,0 @@
From 9f57a5728aaec1949908bf7bbd15768fce74e315 Mon Sep 17 00:00:00 2001
From: Nanang Izzuddin <nanang@teluu.com>
Date: Wed, 13 Feb 2019 06:51:09 +0000
Subject: [PATCH] Re #2176: Removed pop_freelist() + push_freelist() after
remove_node() as they are not only unnecessary, they cause problem.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5934 74dad513-b988-da41-8d7b-12977e46ad98
---
pjlib/src/pj/timer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/pjlib/src/pj/timer.c
+++ b/pjlib/src/pj/timer.c
@@ -633,7 +633,8 @@ PJ_DEF(unsigned) pj_timer_heap_poll( pj_
{
pj_timer_entry *node = remove_node(ht, 0);
/* Avoid re-use of this timer until the callback is done. */
- pj_timer_id_t node_timer_id = pop_freelist(ht);
+ ///Not necessary, even causes problem (see also #2176).
+ ///pj_timer_id_t node_timer_id = pop_freelist(ht);
pj_grp_lock_t *grp_lock;
++count;
@@ -653,7 +654,7 @@ PJ_DEF(unsigned) pj_timer_heap_poll( pj_
lock_timer_heap(ht);
/* Now, the timer is really free for re-use. */
- push_freelist(ht, node_timer_id);
+ ///push_freelist(ht, node_timer_id);
}
if (ht->cur_size && next_delay) {
*next_delay = ht->heap[0]->_timer_value;

View file

@ -0,0 +1,66 @@
#
# Copyright (C) 2019 Sebastian Kemper <sebastian_ml@gmx.net>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=signalwire-client-c
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/signalwire/signalwire-c.git
PKG_SOURCE_DATE=2020-04-06
PKG_SOURCE_VERSION:=e2f3abf59c800c6d39234e9f0a85fb15d1486d8d
PKG_RELEASE:=1
PKG_MIRROR_HASH:=f70c6131fa7ea6291c31c543d1c8e77f5658d5a14f5d30b2d742fb6cb224f2ff
PKG_BUILD_PARALLEL:=1
CMAKE_INSTALL:=1
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=copyright
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/$(PKG_NAME)
SUBMENU:=Telephony
SECTION:=libs
CATEGORY:=Libraries
TITLE:=SignalWire C client library
URL:=https://github.com/signalwire/signalwire-c
ABI_VERSION:=1
DEPENDS:=+libatomic +libks +libopenssl
endef
# Otherwise OpenWrt's CPPFLAGS are ignored
TARGET_CFLAGS += $(TARGET_CPPFLAGS)
define Package/$(PKG_NAME)/install/headers
$(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME)/$(2)
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/$(2)/*.h \
$(1)/usr/include/$(PKG_NAME)/$(2)
endef
define Build/InstallDev
$(foreach s,./ JSON blade signalwire transport,$(call Package/$(PKG_NAME)/install/headers,$(1),$(s));)
$(INSTALL_DIR) $(1)/usr/lib/{cmake/$(PKG_NAME),pkgconfig}
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/cmake/* \
$(1)/usr/lib/cmake/$(PKG_NAME)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsignalwire_client.so* $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/signalwire_client.pc \
$(1)/usr/lib/pkgconfig
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsignalwire_client.so.$(ABI_VERSION)* \
$(1)/usr/lib
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View file

@ -0,0 +1,11 @@
--- a/cmake/FindLibKS.cmake
+++ b/cmake/FindLibKS.cmake
@@ -19,7 +19,7 @@ if (NOT TARGET ks)
endif()
# From here we can bootstrap into cmake stuff
- set(LIBKS_CMAKE_DIR ${LIBKS_INCLUDE_DIRS}/cmake)
+ set(LIBKS_CMAKE_DIR ${LIBKS_LIBRARY_DIRS}/cmake/libks)
# Load ks utils for our build macros
include(${LIBKS_CMAKE_DIR}/ksutil.cmake)

90
libs/sofia-sip/Makefile Normal file
View file

@ -0,0 +1,90 @@
#
# Copyright (C) 2020 Sebastian Kemper <sebastian_ml@gmx.net>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=sofia-sip
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/freeswitch/sofia-sip.git
PKG_SOURCE_DATE=2022-01-26
PKG_SOURCE_VERSION:=1607ade8b6d1c4f82379c7489e7573a769b61994
PKG_RELEASE:=1
PKG_MIRROR_HASH:=560049069c43a8c0652a6f7034c005fb889b4ba3139dd79e0389e6e7d575dd97
# sofia-sip adds a version to include path
# need to update this when the version changes
VERSION_EQUIVALENT:=1.13
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/sofia-sip/Default
SUBMENU:=Telephony
URL:=http://sofia-sip.sourceforge.net/index.html
endef
define Package/sofia-sip
$(call Package/sofia-sip/Default)
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Sofia-SIP open-source SIP User-Agent library
ABI_VERSION:=0
DEPENDS:= \
+libopenssl \
+zlib
endef
define Package/sofia-sip/description
Sofia-SIP is an open-source SIP User-Agent library, compliant with the
IETF RFC3261 specification (see the feature table). It can be used as a
building block for SIP client software for uses such as VoIP, IM, and
many other real-time and person-to-person communication services. The
primary target platform for Sofia-SIP is GNU/Linux. Sofia-SIP is based
on a SIP stack developed at the Nokia Research Center. Sofia-SIP is
licensed under the LGPL.
endef
CONFIGURE_ARGS+= \
--disable-stun \
--without-doxygen \
--without-glib
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/sofia-sip-$(VERSION_EQUIVALENT)/sofia-{sip,resolv} \
$(1)/usr/share/sofia-sip
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/include/sofia-sip-$(VERSION_EQUIVALENT)/sofia-sip/*.h{,.in} \
$(1)/usr/include/sofia-sip-$(VERSION_EQUIVALENT)/sofia-sip
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/include/sofia-sip-$(VERSION_EQUIVALENT)/sofia-resolv/*.h \
$(1)/usr/include/sofia-sip-$(VERSION_EQUIVALENT)/sofia-resolv
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsofia-sip-ua.{a,so*} $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sofia-sip-ua.pc \
$(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/sofia-sip/{msg_parser,tag_dll}.awk \
$(1)/usr/share/sofia-sip
endef
define Package/sofia-sip/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsofia-sip-ua.so.$(ABI_VERSION)* \
$(1)/usr/lib
endef
$(eval $(call BuildPackage,sofia-sip))

View file

@ -0,0 +1,11 @@
--- a/configure.ac
+++ b/configure.ac
@@ -247,7 +247,7 @@ SAC_OPENSSL
SAC_TPORT
dnl Check is used for testing
-PKG_CHECK_MODULES(CHECK, check >= 0.9.4, have_check="yes", have_check="no")
+PKG_CHECK_MODULES(CHECK, we_do_not_want_check >= 0.9.4, have_check="yes", have_check="no")
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
if test x"$have_check" = "xyes"; then
AC_DEFINE([HAVE_CHECK], 1, [Define to 1 if check library is available])

74
libs/spandsp3/Makefile Normal file
View file

@ -0,0 +1,74 @@
#
# Copyright (C) 2020 Sebastian Kemper <sebastian_ml@gmx.net>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=spandsp3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/freeswitch/spandsp.git
PKG_SOURCE_DATE=2020-10-19
PKG_SOURCE_VERSION:=e08c74db3f072db893c4d37de733f03c27bf7ed3
PKG_RELEASE:=1
PKG_MIRROR_HASH:=4c2b29f71e130548a539cb86e47b34a5bda19896d96050868193e5aa86860db0
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:= \
Jiri Slachta <jiri@slachta.eu> \
Sebastian Kemper <sebastian_ml@gmx.net>
include $(INCLUDE_DIR)/package.mk
define Package/libspandsp3
SUBMENU:=Telephony
SECTION:=libs
CATEGORY:=Libraries
TITLE:=spandsp3 library
DEPENDS:=+libjpeg +libtiff
URL:=https://github.com/freeswitch/spandsp
ABI_VERSION:=3
endef
# Use fixed point math when soft float support is enabled for target devices.
ifeq ($(CONFIG_SOFT_FLOAT),y)
CONFIGURE_ARGS+= \
--enable-fixed-point
endif
define Build/InstallDev
$(INSTALL_DIR) \
$(1)/usr/lib/spandsp3/{include/spandsp/private,lib}
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp* \
$(1)/usr/lib/spandsp3/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/spandsp.h \
$(1)/usr/lib/spandsp3/include
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/spandsp/*.h \
$(1)/usr/lib/spandsp3/include/spandsp
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/spandsp/private/*.h \
$(1)/usr/lib/spandsp3/include/spandsp/private
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/spandsp.pc \
$(1)/usr/lib/pkgconfig/spandsp3.pc
endef
define Package/libspandsp3/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp.so.$(ABI_VERSION)* \
$(1)/usr/lib
endef
$(eval $(call BuildPackage,libspandsp3))

View file

@ -0,0 +1,18 @@
--- a/spandsp.pc.in
+++ b/spandsp.pc.in
@@ -1,12 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+libdir=${exec_prefix}/lib/spandsp3/lib
+includedir=${prefix}/lib/spandsp3/include
Name: spandsp
Description: A DSP library for telephony.
Requires:
Version: @VERSION@
-Libs: -L${libdir} -lspandsp
+Libs: -L${libdir} -l:libspandsp.so.3
Libs.private: -ltiff -lm
Cflags: -I${includedir}

View file

@ -0,0 +1,20 @@
--- a/configure.ac
+++ b/configure.ac
@@ -231,6 +231,9 @@ then
AC_CHECK_HEADERS([X11/X.h])
fi
+# Note: the libxml2 checks below introduce host include paths into the
+# build, so we turn them off.
+if test -n "$enable_tests" ; then # OpenWrt doesn't build the tests
# Determine XML2 include path
AC_MSG_CHECKING(for libxml/xmlmemory.h)
@@ -259,6 +262,7 @@ fi
AC_CHECK_HEADERS([libxml/xmlmemory.h])
AC_CHECK_HEADERS([libxml/parser.h])
AC_CHECK_HEADERS([libxml/xinclude.h])
+fi # OpenWrt doesn't build the tests
AC_LANG([C++])
AC_CHECK_HEADERS([FL/Fl.H])

View file

@ -1,77 +0,0 @@
#
# Copyright (C) 2018 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=asterisk13-chan-lantiq
PKG_VERSION:=20180215
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/kochstefan/asterisk_channel_lantiq.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=f0d7ca7df8e5df802c5bcb79643e3bdc3956c190
PKG_MIRROR_HASH:=aaf5ce87a2e23b801318add79eaaa1b7c4a8aa497ca8e2a71ef5d452a7595a73
PKG_SOURCE_PROTO:=git
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
PKG_FLAGS:=nonshared
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SUBMENU:=Telephony Lantiq
SECTION:=net
CATEGORY:=Network
TITLE:=Lantiq channel driver
URL:=https://github.com/kochstefan/asterisk_channel_lantiq
DEPENDS:=+asterisk13 +kmod-ltq-vmmc
endef
define Package/$(PKG_NAME)/description
An implementation of a Lantiq TAPI channel driver for Asterisk 13.
endef
define Package/$(PKG_NAME)/conffiles
/etc/asterisk/lantiq.conf
endef
define Build/Prepare
$(call Build/Prepare/Default)
$(INSTALL_DATA) ./files/default.exports \
$(PKG_BUILD_DIR)/src/channels/chan_lantiq.exports
endef
define Build/Compile
cd $(PKG_BUILD_DIR)/src/channels && \
$(TARGET_CC) -o chan_lantiq.o -c chan_lantiq.c -MD -MT chan_lantiq.o \
-MF .chan_lantiq.o.d -MP -pthread \
$(TARGET_CFLAGS) -DAST_MODULE_SELF_SYM=__internal_chan_lantiq_self \
-I$(STAGING_DIR)/usr/include/asterisk-13/include \
$(TARGET_CPPFLAGS) \
-Wall -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations $(FPIC) -DAST_MODULE=\"chan_lantiq\" && \
$(TARGET_CC) -o chan_lantiq.so -pthread $(TARGET_LDFLAGS) -shared \
-Wl,--version-script,chan_lantiq.exports,--warn-common \
chan_lantiq.o
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_CONF) \
$(PKG_BUILD_DIR)/src/configs/samples/lantiq.conf.sample \
$(1)/etc/asterisk/lantiq.conf
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/src/channels/chan_lantiq.so \
$(1)/usr/lib/asterisk/modules
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View file

@ -1,8 +0,0 @@
{
global:
/* See main/asterisk.exports.in for an explanation why this is
* needed. */
_IO_stdin_used;
local:
*;
};

View file

@ -1,11 +0,0 @@
menu "Advanced configuration"
depends on PACKAGE_asterisk13
config ASTERISK13_LOW_MEMORY
bool "Optimize Asterisk 13 for low memory usage"
default n
help
Warning: this feature is known to cause problems with some modules.
Disable it if you experience problems like segmentation faults.
endmenu

File diff suppressed because it is too large Load diff

View file

@ -1,4 +0,0 @@
## startup options for /etc/init.d/asterisk
ENABLE_ASTERISK="yes"
OPTIONS=""

View file

@ -1,33 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2014 OpenWrt.org
START=99
APP=asterisk
OPTIONS=
DEST=
DEFAULT=$DEST/etc/default/$APP
BIN_FILE=$DEST/usr/sbin/$APP
PID_FILE=$DEST/var/run/$APP/$APP.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
[ -d $DEST/var/run/asterisk ] || mkdir -p $DEST/var/run/asterisk
[ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk
[ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk
[ -d $DEST/var/lib/asterisk ] || mkdir -p $DEST/var/lib/asterisk
[ -d $DEST/var/lib/asterisk/keys ] || mkdir -p $DEST/var/lib/asterisk/keys
[ -d $DEST/var/log/asterisk/cdr-csv ] || mkdir -p $DEST/var/log/asterisk/cdr-csv
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \
service_start $BIN_FILE $OPTIONS
}
stop() {
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \
service_stop $BIN_FILE
}
reload() {
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \
service_reload $BIN_FILE
}

View file

@ -1,22 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1030,19 +1030,6 @@ AC_LINK_IFELSE(
]
)
-# Some platforms define sem_init(), but only support sem_open(). joyous.
-AC_MSG_CHECKING(for working unnamed semaphores)
-AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([#include <semaphore.h>],
- [sem_t sem; return sem_init(&sem, 0, 0);])],
- AC_MSG_RESULT(yes)
- AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]),
- AC_MSG_RESULT(no),
- AC_MSG_RESULT(cross-compile)
- AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation])
- AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.])
-)
-
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
if test "${ac_cv_pthread_rwlock_timedwrlock}" = "yes"; then

View file

@ -1,10 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1377,7 +1377,6 @@ AC_LINK_IFELSE(
#include <resolv.h>],
[int foo = res_ninit(NULL);])],
AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
AC_SEARCH_LIBS(res_9_ndestroy, resolv)
AC_MSG_CHECKING(for res_ndestroy)
AC_LINK_IFELSE(

View file

@ -1,101 +0,0 @@
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -51,9 +51,11 @@
#include <pthread.h>
#include <time.h>
#include <sys/param.h>
+#ifndef __UCLIBC__
#ifdef HAVE_BKTR
#include <execinfo.h>
#endif
+#endif
#ifndef HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK
#include "asterisk/time.h"
@@ -86,11 +88,15 @@
#define __AST_RWLOCK_INIT_VALUE {0}
#endif /* HAVE_PTHREAD_RWLOCK_INITIALIZER */
+#ifndef __UCLIBC__
#ifdef HAVE_BKTR
#define AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, {{{ 0 }}}, PTHREAD_MUTEX_INIT_VALUE }
#else
#define AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, PTHREAD_MUTEX_INIT_VALUE }
#endif
+#else
+#define AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, PTHREAD_MUTEX_INIT_VALUE }
+#endif
#define AST_MUTEX_INIT_VALUE { PTHREAD_MUTEX_INIT_VALUE, NULL, {1, 0} }
#define AST_MUTEX_INIT_VALUE_NOTRACKING { PTHREAD_MUTEX_INIT_VALUE, NULL, {0, 0} }
@@ -114,9 +120,11 @@ struct ast_lock_track {
int reentrancy;
const char *func[AST_MAX_REENTRANCY];
pthread_t thread_id[AST_MAX_REENTRANCY];
+#ifndef __UCLIBC__
#ifdef HAVE_BKTR
struct ast_bt backtrace[AST_MAX_REENTRANCY];
#endif
+#endif
pthread_mutex_t reentr_mutex;
};
@@ -264,6 +272,7 @@ enum ast_lock_type {
* on the lock. ast_mark_lock_acquired() will mark it as held by this thread.
*/
#if !defined(LOW_MEMORY)
+#ifndef HAVE_BKTR
#ifdef HAVE_BKTR
void ast_store_lock_info(enum ast_lock_type type, const char *filename,
int line_num, const char *func, const char *lock_name, void *lock_addr, struct ast_bt *bt);
@@ -271,14 +280,22 @@ void ast_store_lock_info(enum ast_lock_t
void ast_store_lock_info(enum ast_lock_type type, const char *filename,
int line_num, const char *func, const char *lock_name, void *lock_addr);
#endif /* HAVE_BKTR */
+#else
+void ast_store_lock_info(enum ast_lock_type type, const char *filename,
+ int line_num, const char *func, const char *lock_name, void *lock_addr);
+#endif
#else
+#ifndef __UCLIBC__
#ifdef HAVE_BKTR
#define ast_store_lock_info(I,DONT,CARE,ABOUT,THE,PARAMETERS,BUD)
#else
#define ast_store_lock_info(I,DONT,CARE,ABOUT,THE,PARAMETERS)
#endif /* HAVE_BKTR */
+#else
+#define ast_store_lock_info(I,DONT,CARE,ABOUT,THE,PARAMETERS)
+#endif
#endif /* !defined(LOW_MEMORY) */
/*!
@@ -306,19 +323,27 @@ void ast_mark_lock_failed(void *lock_add
* be removed from the current thread's lock info struct.
*/
#if !defined(LOW_MEMORY)
+#ifndef __UCLIBC__
#ifdef HAVE_BKTR
void ast_remove_lock_info(void *lock_addr, struct ast_bt *bt);
#else
void ast_remove_lock_info(void *lock_addr);
#endif /* HAVE_BKTR */
+#else
+void ast_remove_lock_info(void *lock_addr);
+#endif
void ast_suspend_lock_info(void *lock_addr);
void ast_restore_lock_info(void *lock_addr);
#else
+#ifndef __UCLIBC
#ifdef HAVE_BKTR
#define ast_remove_lock_info(ignore,me)
#else
#define ast_remove_lock_info(ignore)
#endif /* HAVE_BKTR */
+#else
+#define ast_remove_lock_info(ignore)
+#endif
#define ast_suspend_lock_info(ignore);
#define ast_restore_lock_info(ignore);
#endif /* !defined(LOW_MEMORY) */

View file

@ -1,22 +0,0 @@
--- a/res/ael/ael.flex
+++ b/res/ael/ael.flex
@@ -595,7 +595,7 @@ includes { STORE_POS; return KW_INCLUDES
snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf);
ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf));
}
-#ifdef SOLARIS
+#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU)
glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);
#else
glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);
--- a/res/ael/ael_lex.c
+++ b/res/ael/ael_lex.c
@@ -1976,7 +1976,7 @@ YY_RULE_SETUP
snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf);
ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf));
}
-#ifdef SOLARIS
+#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU)
glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);
#else
glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);

View file

@ -1,30 +0,0 @@
--- a/res/ael/ael.flex
+++ b/res/ael/ael.flex
@@ -79,6 +79,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
#if !defined(GLOB_ABORTED)
#define GLOB_ABORTED GLOB_ABEND
#endif
+#if !defined(GLOB_BRACE)
+#define GLOB_BRACE 0
+#endif
+#if !defined(GLOB_NOMAGIC)
+#define GLOB_NOMAGIC 0
+#endif
#include "asterisk/logger.h"
#include "asterisk/utils.h"
--- a/res/ael/ael_lex.c
+++ b/res/ael/ael_lex.c
@@ -838,6 +838,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
#if !defined(GLOB_ABORTED)
#define GLOB_ABORTED GLOB_ABEND
#endif
+#if !defined(GLOB_BRACE)
+#define GLOB_BRACE 0
+#endif
+#if !defined(GLOB_NOMAGIC)
+#define GLOB_NOMAGIC 0
+#endif
#include "asterisk/logger.h"
#include "asterisk/utils.h"

View file

@ -1,37 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -175,6 +175,9 @@ case "${host_os}" in
linux-gnu*)
OSARCH=linux-gnu
;;
+ linux-musl*)
+ OSARCH=linux-musl
+ ;;
kfreebsd*-gnu)
OSARCH=kfreebsd-gnu
;;
@@ -1509,9 +1512,11 @@ AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_ope
# openSUSE requires -lz
AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty -lz])
-if test "x${OSARCH}" = "xlinux-gnu" ; then
+case "${OSARCH}" in
+linux*)
AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
-fi
+ ;;
+esac
AST_C_DEFINE_CHECK([DAHDI], [DAHDI_RESET_COUNTERS], [dahdi/user.h], [230])
AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220])
--- a/main/Makefile
+++ b/main/Makefile
@@ -47,7 +47,7 @@ AST_LIBS+=$(AST_CLANG_BLOCKS_LIBS)
AST_LIBS+=$(RT_LIB)
AST_LIBS+=$(SYSTEMD_LIB)
-ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc kfreebsd-gnu),)
+ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc linux-musl kfreebsd-gnu),)
AST_LIBS+=-ldl
ifneq (x$(CAP_LIB),x)
AST_LIBS+=$(CAP_LIB)

View file

@ -1,11 +0,0 @@
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -68,7 +68,7 @@
#define AST_PTHREADT_NULL (pthread_t) -1
#define AST_PTHREADT_STOP (pthread_t) -2
-#if (defined(SOLARIS) || defined(BSD))
+#if (defined(SOLARIS) || defined(BSD) || !defined(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP))
#define AST_MUTEX_INIT_W_CONSTRUCTORS
#endif /* SOLARIS || BSD */

View file

@ -1,10 +0,0 @@
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -180,7 +180,6 @@ check_expr2: $(ASTTOPDIR)/main/ast_expr2
$(CC) -g -o check_expr2 ast_expr2fz.o ast_expr2z.o -lm $(_ASTLDFLAGS)
$(ECHO_PREFIX) echo " [RM] ast_expr2fz.o ast_expr2z.o"
rm ast_expr2z.o ast_expr2fz.o
- ./check_expr2 expr2.testinput
smsq: smsq.o strcompat.o
smsq: LIBS+=$(POPT_LIB)

View file

@ -1,28 +0,0 @@
--- a/build_tools/make_build_h
+++ b/build_tools/make_build_h
@@ -5,6 +5,14 @@ MACHINE=`uname -m | sed 's/\\\\/\\\\\\\
OS=`uname -s`
USER=`id | awk -F")" '{print $1}'| awk -F"(" '{print $2}' | sed 's/\\\\/\\\\\\\\/g'`
DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
+if [ -n "${SOURCE_DATE_EPOCH}" ]; then
+ # building reproducibly, faking some data
+ HOSTNAME='buildd.debian.org'
+ KERNEL='unknown'
+ MACHINE='unknown'
+ USER='nobody'
+ DATE=`date -u "+%Y-%m-%d %H:%M:%S" -d @${SOURCE_DATE_EPOCH}`
+fi
cat << END
/*
* build.h
--- a/Makefile
+++ b/Makefile
@@ -488,7 +488,7 @@ doc/core-en_US.xml: makeopts .lastclean
@echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
@for x in $(MOD_SUBDIRS); do \
printf "$$x " ; \
- for i in `find $$x -name '*.c'`; do \
+ for i in `find $$x -name '*.c' | LC_ALL=C sort`; do \
$(AWK) -f build_tools/get_documentation $$i >> $@ ; \
done ; \
done

View file

@ -8,14 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=asterisk16-chan-lantiq
PKG_VERSION:=20180215
PKG_RELEASE:=2
PKG_VERSION:=20210911
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/kochstefan/asterisk_channel_lantiq.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=c9d68dd06fcd46ac7985df45f8c2b8833e658f8e
PKG_MIRROR_HASH:=8666c18b24adf9da3ddf12306fcf0a8b4f56860c256b172bd0ba5c2a7a3ab25e
PKG_SOURCE_VERSION:=2f029ec8778420538c8151c6aceba0f7b44b07c9
PKG_MIRROR_HASH:=72ce3cb4a081c6ea39c9814fba03997ef32b48e927469508222f5641fe987c65
PKG_SOURCE_PROTO:=git
PKG_LICENSE:=GPL-2.0
@ -43,12 +43,6 @@ define Package/$(PKG_NAME)/conffiles
/etc/asterisk/lantiq.conf
endef
define Build/Prepare
$(call Build/Prepare/Default)
$(INSTALL_DATA) ./files/default.exports \
$(PKG_BUILD_DIR)/src/channels/chan_lantiq.exports
endef
define Build/Compile
cd $(PKG_BUILD_DIR)/src/channels && \
$(TARGET_CC) -o chan_lantiq.o -c chan_lantiq.c -MD -MT chan_lantiq.o \

View file

@ -1,8 +0,0 @@
{
global:
/* See main/asterisk.exports.in for an explanation why this is
* needed. */
_IO_stdin_used;
local:
*;
};

View file

@ -1,43 +0,0 @@
commit 30f9a094c1c60e0d68e4ea189f48ecb47aebb485
Author: arny <arnysch@gmx.net>
Date: Thu May 2 20:07:28 2019 +0200
Use ast_malloc and ast_free instead of malloc and free
in order to get rid of build errors with asterisk16 in OpenWrt
Signed-off-by: arny <arnysch@gmx.net>
diff --git a/src/channels/chan_lantiq.c b/src/channels/chan_lantiq.c
index a8fc869..90002ab 100644
--- a/src/channels/chan_lantiq.c
+++ b/src/channels/chan_lantiq.c
@@ -563,9 +563,9 @@ lantiq_dev_binary_buffer_create(const char *path, uint8_t **ppBuf, uint32_t *pBu
goto on_exit;
}
- *ppBuf = malloc(file_stat.st_size);
+ *ppBuf = ast_malloc(file_stat.st_size);
if (*ppBuf == NULL) {
- ast_log(LOG_ERROR, "binary file %s memory allocation failed\n", path);
+ // Message already logged by ast_malloc
goto on_exit;
}
@@ -583,7 +583,7 @@ on_exit:
fclose(fd);
if (*ppBuf != NULL && status)
- free(*ppBuf);
+ ast_free(*ppBuf);
return status;
}
@@ -609,7 +609,7 @@ static int32_t lantiq_dev_firmware_download(int32_t fd, const char *path)
}
if (firmware != NULL)
- free(firmware);
+ ast_free(firmware);
return 0;
}

View file

@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
AST_MAJOR_VERSION:=16
PKG_NAME:=asterisk$(AST_MAJOR_VERSION)
PKG_VERSION:=$(AST_MAJOR_VERSION).3.0
PKG_RELEASE:=2
PKG_VERSION:=$(AST_MAJOR_VERSION).25.2
PKG_RELEASE:=1
PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases
PKG_HASH:=8b22ee7c0c0b5557eff273118703c6fce8b743c12bbeb679ed86b3f197444a8e
PKG_HASH:=158f5f84b25580f9f780507092c9cf6a92f6a60c731f159859ac11d2fe98d204
PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=libxml2/host
@ -43,7 +43,9 @@ MODULES_AVAILABLE:= \
app-agent-pool \
app-alarmreceiver \
app-amd \
app-attended-transfer \
app-authenticate \
app-blind-transfer \
app-bridgeaddchan \
app-bridgewait \
app-celgenuserevent \
@ -57,6 +59,7 @@ MODULES_AVAILABLE:= \
app-directed-pickup \
app-directory \
app-disa \
app-dtmfstore \
app-dumpchan \
app-exec \
app-externalivr \
@ -67,6 +70,7 @@ MODULES_AVAILABLE:= \
app-ices \
app-image \
app-ivrdemo \
app-mf \
app-milliwatt \
app-minivm \
app-mixmonitor \
@ -80,10 +84,12 @@ MODULES_AVAILABLE:= \
app-read \
app-readexten \
app-record \
app-reload \
app-saycounted \
app-sayunixtime \
app-senddtmf \
app-sendtext \
app-sf \
app-skel \
app-sms \
app-softhangup \
@ -99,6 +105,7 @@ MODULES_AVAILABLE:= \
app-url \
app-userevent \
app-verbose \
app-waitforcond \
app-waitforring \
app-waitforsilence \
app-waituntil \
@ -176,6 +183,7 @@ MODULES_AVAILABLE:= \
func-enum \
func-env \
func-extstate \
func-frame-drop \
func-frame-trace \
func-global \
func-groupcount \
@ -183,6 +191,7 @@ MODULES_AVAILABLE:= \
func-holdintercept \
func-iconv \
func-jitterbuffer \
func-json \
func-lock \
func-math \
func-md5 \
@ -192,6 +201,8 @@ MODULES_AVAILABLE:= \
func-presencestate \
func-rand \
func-realtime \
func-sayfiles \
func-scramble \
func-sha1 \
func-shell \
func-sorcery \
@ -271,6 +282,7 @@ MODULES_AVAILABLE:= \
res-parking \
res-phoneprov \
res-pjsip-phoneprov \
res-pjsip-stir-shaken \
res-pjproject \
res-pktccops \
res-realtime \
@ -293,10 +305,11 @@ MODULES_AVAILABLE:= \
res-stasis-recording \
res-stasis-snoop \
res-statsd \
res-stir-shaken \
res-stun-monitor \
res-timing-dahdi \
res-timing-pthread \
res-timing-timerfd \
res-tonedetect \
res-xmpp \
voicemail
@ -485,7 +498,7 @@ AST_CFG_FILES:= \
AST_EMB_MODULES:=\
app_dial app_echo app_macro app_playback \
func_callerid func_logic func_strings func_timeout \
pbx_config res_crypto
pbx_config res_crypto res_timing_timerfd
define Package/$(PKG_NAME)/install
$(call Package/$(PKG_NAME)/install/lib,$(1),libasteriskssl)
@ -554,6 +567,7 @@ CONFIGURE_ARGS+= \
--without-pjproject-bundled \
--with-libedit="$(STAGING_DIR)/usr" \
--with-libxml2 \
--without-libxslt \
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-res-snmp),--with-netsnmp="$(STAGING_DIR)/usr",--without-netsnmp) \
--without-newt \
--without-osptk \
@ -757,7 +771,9 @@ $(eval $(call BuildAsteriskModule,app-adsiprog,ADSI programming,Asterisk ADSI pr
$(eval $(call BuildAsteriskModule,app-agent-pool,Call center agent pool,Call center agent pool applications.,,agents.conf,app_agent_pool,,))
$(eval $(call BuildAsteriskModule,app-alarmreceiver,Alarm receiver,Alarm receiver for Asterisk.,,,app_alarmreceiver,,))
$(eval $(call BuildAsteriskModule,app-amd,Answering machine detection,Answering Machine Detection application.,,amd.conf,app_amd,,))
$(eval $(call BuildAsteriskModule,app-attended-transfer,Attended transfer,Queues up an attended transfer to a given extension.,,,app_attended_transfer,,))
$(eval $(call BuildAsteriskModule,app-authenticate,Authenticate commands,Authentication application.,,,app_authenticate,,))
$(eval $(call BuildAsteriskModule,app-blind-transfer,Blind transfer,Redirects all channels currently bridged to the caller channel to a specified destination.,,,app_blind_transfer,,))
$(eval $(call BuildAsteriskModule,app-bridgeaddchan,Bridge add channel,Bridge-add-channel application.,,,app_bridgeaddchan,,))
$(eval $(call BuildAsteriskModule,app-bridgewait,Holding bridge,Application to place a channel into a holding bridge.,+$(PKG_NAME)-bridge-holding,,app_bridgewait,,))
$(eval $(call BuildAsteriskModule,app-celgenuserevent,User-defined CEL event,Generate a user defined CEL event.,,,app_celgenuserevent,,))
@ -771,16 +787,18 @@ $(eval $(call BuildAsteriskModule,app-dictate,Virtual dictation machine,Virtual
$(eval $(call BuildAsteriskModule,app-directed-pickup,Directed call pickup,Directed call pickup application.,,,app_directed_pickup,,))
$(eval $(call BuildAsteriskModule,app-directory,Extension directory,Extension directory.,,,app_directory,,))
$(eval $(call BuildAsteriskModule,app-disa,Direct Inward System Access,Direct Inward System Access application.,,,app_disa,,))
$(eval $(call BuildAsteriskModule,app-dtmfstore,DTMF storage,Technology independent async DTMF storage.,,,app_dtmfstore,,))
$(eval $(call BuildAsteriskModule,app-dumpchan,Dump info about channel,Dump info about the calling channel.,,,app_dumpchan,,))
$(eval $(call BuildAsteriskModule,app-exec,Exec application,Executes dialplan applications.,,,app_exec,,))
$(eval $(call BuildAsteriskModule,app-externalivr,External IVR interface,External IVR interface application.,,,app_externalivr,,))
$(eval $(call BuildAsteriskModule,app-festival,Simple festival interface,Simple Festival interface.,,festival.conf,app_festival,,))
$(eval $(call BuildAsteriskModule,app-flash,Flash channel,Flash channel application.,+$(PKG_NAME)-chan-dahdi,,app_flash,,))
$(eval $(call BuildAsteriskModule,app-followme,Find-me/follow-me,Find-Me/Follow-Me application.,,followme.conf,app_followme,,))
$(eval $(call BuildAsteriskModule,app-getcpeid,Get ADSI CPE ID,Get ADSI CPE ID.,,,app_getcpeid,,))
$(eval $(call BuildAsteriskModule,app-getcpeid,Get ADSI CPE ID,Get ADSI CPE ID.,+$(PKG_NAME)-res-adsi,,app_getcpeid,,))
$(eval $(call BuildAsteriskModule,app-ices,Encode and stream,Encode and stream via Icecast and IceS.,,,app_ices,,))
$(eval $(call BuildAsteriskModule,app-image,Image transmission,Image transmission application.,,,app_image,,))
$(eval $(call BuildAsteriskModule,app-ivrdemo,IVR demo,IVR demo application.,,,app_ivrdemo,,))
$(eval $(call BuildAsteriskModule,app-mf,MF digits,Send MF digits Application.,,,app_mf,,))
$(eval $(call BuildAsteriskModule,app-milliwatt,Digital milliwatt [mu-law] test app,Digital milliwatt test application.,,,app_milliwatt,,))
$(eval $(call BuildAsteriskModule,app-minivm,Minimal voicemail system,A minimal voicemail e-mail system.,,extensions_minivm.conf minivm.conf,app_minivm,,))
$(eval $(call BuildAsteriskModule,app-mixmonitor,Record a call and mix the audio,Mixed audio monitoring application.,,,app_mixmonitor,,))
@ -794,10 +812,12 @@ $(eval $(call BuildAsteriskModule,app-queue,True Call Queueing,True call queuein
$(eval $(call BuildAsteriskModule,app-read,Variable read,Read variable application.,,,app_read,,))
$(eval $(call BuildAsteriskModule,app-readexten,Extension to variable,Read and evaluate extension validity.,,,app_readexten,,))
$(eval $(call BuildAsteriskModule,app-record,Record sound file,Trivial record application.,,,app_record,,))
$(eval $(call BuildAsteriskModule,app-reload,Reload,Reload module[s].,,,app_reload,,))
$(eval $(call BuildAsteriskModule,app-saycounted,Decline words,Decline words according to channel language.,,,app_saycounted,,))
$(eval $(call BuildAsteriskModule,app-sayunixtime,Say Unix time,Say time.,,,app_sayunixtime,,))
$(eval $(call BuildAsteriskModule,app-senddtmf,Send DTMF digits,Send DTMF digits application.,,,app_senddtmf,,))
$(eval $(call BuildAsteriskModule,app-sendtext,Send text,Send text applications.,,,app_sendtext,,))
$(eval $(call BuildAsteriskModule,app-sf,SF Sender and Receiver Applications,SF Sender and Receiver Applications.,,,app_sf,,))
$(eval $(call BuildAsteriskModule,app-skel,Skeleton [sample],Skeleton application.,,app_skel.conf,app_skel,,))
$(eval $(call BuildAsteriskModule,app-sms,SMS,SMS/PSTN handler.,,,app_sms,,))
$(eval $(call BuildAsteriskModule,app-softhangup,Hang up requested channel,Hangs up the requested channel.,,,app_softhangup,,))
@ -813,6 +833,7 @@ $(eval $(call BuildAsteriskModule,app-transfer,Transfers caller to other ext,Tra
$(eval $(call BuildAsteriskModule,app-url,Send URL,Send URL applications.,,,app_url,,))
$(eval $(call BuildAsteriskModule,app-userevent,Custom user event,Custom user event application.,,,app_userevent,,))
$(eval $(call BuildAsteriskModule,app-verbose,Verbose logging,Send verbose output.,,,app_verbose,,))
$(eval $(call BuildAsteriskModule,app-waitforcond,Wait for condition,Wait until condition is true.,,,app_waitforcond,,))
$(eval $(call BuildAsteriskModule,app-waitforring,Wait for first ring,Waits until first ring after time.,,,app_waitforring,,))
$(eval $(call BuildAsteriskModule,app-waitforsilence,Wait for silence/noise,Wait for silence/noise.,,,app_waitforsilence,,))
$(eval $(call BuildAsteriskModule,app-waituntil,Sleep,Wait until specified time.,,,app_waituntil,,))
@ -834,14 +855,14 @@ $(eval $(call BuildAsteriskModule,chan-alsa,ALSA channel,ALSA console channel dr
$(eval $(call BuildAsteriskModule,chan-bridge-media,Bridge media channel driver,Bridge media channel driver.,,,chan_bridge_media,,))
$(eval $(call BuildAsteriskModule,chan-console,Console channel driver,Console channel driver.,+portaudio,console.conf,chan_console,,))
$(eval $(call BuildAsteriskModule,chan-dahdi,DAHDI channel,DAHDI telephony.,+dahdi-tools-libtonezone +kmod-dahdi +libpri @!aarch64,chan_dahdi.conf,chan_dahdi,,))
$(eval $(call BuildAsteriskModule,chan-iax2,IAX2 channel,Inter Asterisk eXchange.,+$(PKG_NAME)-res-timing-timerfd,iax.conf iaxprov.conf,chan_iax2,,))
$(eval $(call BuildAsteriskModule,chan-iax2,IAX2 channel,Inter Asterisk eXchange.,,iax.conf iaxprov.conf,chan_iax2,,))
$(eval $(call BuildAsteriskModule,chan-mgcp,MGCP,Media Gateway Control Protocol.,,mgcp.conf,chan_mgcp,,))
$(eval $(call BuildAsteriskModule,chan-mobile,Bluetooth channel,Bluetooth mobile device channel driver.,+bluez-libs,chan_mobile.conf,chan_mobile,,))
$(eval $(call BuildAsteriskModule,chan-motif,Jingle channel,Motif Jingle channel driver.,+$(PKG_NAME)-res-xmpp,motif.conf,chan_motif,,))
$(eval $(call BuildAsteriskModule,chan-ooh323,H.323 channel,Objective Systems H.323 channel.,,ooh323.conf,chan_ooh323,,))
$(eval $(call BuildAsteriskModule,chan-oss,OSS channel,OSS console channel driver.,,oss.conf,chan_oss,,))
$(eval $(call BuildAsteriskModule,chan-phone,Linux telephony API,Linux telephony API support.,,phone.conf,chan_phone,,))
$(eval $(call BuildAsteriskModule,chan-rtp,RTP media channel,RTP media channel.,,,chan_rtp,,))
$(eval $(call BuildAsteriskModule,chan-rtp,RTP media channel,RTP media channel.,+$(PKG_NAME)-res-rtp-multicast,,chan_rtp,,))
$(eval $(call BuildAsteriskModule,chan-sip,SIP channel,Session Initiation Protocol.,+$(PKG_NAME)-app-confbridge,sip.conf sip_notify.conf,chan_sip,,))
$(eval $(call BuildAsteriskModule,chan-skinny,Skinny channel,Skinny Client Control Protocol.,,skinny.conf,chan_skinny,,))
$(eval $(call BuildAsteriskModule,chan-unistim,Unistim channel,UNISTIM protocol.,,unistim.conf,chan_unistim,,))
@ -890,6 +911,7 @@ $(eval $(call BuildAsteriskModule,func-dialplan,Dialplan context/extension/prior
$(eval $(call BuildAsteriskModule,func-enum,ENUM,ENUM related dialplan functions.,,enum.conf,func_enum,,))
$(eval $(call BuildAsteriskModule,func-env,Environment functions,Environment/filesystem dialplan functions.,,,func_env,,))
$(eval $(call BuildAsteriskModule,func-extstate,Hinted extension state,Gets the state of an extension in the dialplan.,,,func_extstate,,))
$(eval $(call BuildAsteriskModule,func-frame-drop,Frame drop,Function to drop frames on a channel.,,,func_frame_drop,,))
$(eval $(call BuildAsteriskModule,func-frame-trace,Frame trace for internal ast_frame debugging,Frame trace for internal ast_frame debugging.,,,func_frame_trace,,))
$(eval $(call BuildAsteriskModule,func-global,Global variable,Variable dialplan functions.,,,func_global,,))
$(eval $(call BuildAsteriskModule,func-groupcount,Group count,Channel group dialplan functions.,,,func_groupcount,,))
@ -897,6 +919,7 @@ $(eval $(call BuildAsteriskModule,func-hangupcause,HANGUPCAUSE related functions
$(eval $(call BuildAsteriskModule,func-holdintercept,Hold interception dialplan function,Hold interception dialplan function.,,,func_holdintercept,,))
$(eval $(call BuildAsteriskModule,func-iconv,Charset conversion,Charset conversions.,,,func_iconv,,,$(ICONV_DEPENDS)))
$(eval $(call BuildAsteriskModule,func-jitterbuffer,Jitter buffer for read side of channel,Jitter buffer for read side of channel.,,,func_jitterbuffer,,))
$(eval $(call BuildAsteriskModule,func-json,JSON decoding function,JSON decoding function.,,,func_json,,))
$(eval $(call BuildAsteriskModule,func-lock,Dialplan mutexes,Dialplan mutexes.,,,func_lock,,))
$(eval $(call BuildAsteriskModule,func-math,Math functions,Mathematical dialplan function.,,,func_math,,))
$(eval $(call BuildAsteriskModule,func-md5,MD5 digest dialplan functions,MD5 digest dialplan functions.,,,func_md5,,))
@ -906,6 +929,8 @@ $(eval $(call BuildAsteriskModule,func-pitchshift,Audio effects dialplan functio
$(eval $(call BuildAsteriskModule,func-presencestate,Hinted presence state,Gets or sets a presence state in the dialplan.,,,func_presencestate,,))
$(eval $(call BuildAsteriskModule,func-rand,RAND dialplan function,Random number dialplan function.,,,func_rand,,))
$(eval $(call BuildAsteriskModule,func-realtime,REALTIME dialplan function,Read/write/store/destroy values from a realtime repository.,,,func_realtime,,))
$(eval $(call BuildAsteriskModule,func-sayfiles,Say files,Say application files.,,,func_sayfiles,,))
$(eval $(call BuildAsteriskModule,func-scramble,Scramble,Frequency inverting voice scrambler.,,,func_scramble,,))
$(eval $(call BuildAsteriskModule,func-sha1,SHA-1 computation dialplan function,SHA-1 computation dialplan function.,,,func_sha1,,))
$(eval $(call BuildAsteriskModule,func-shell,Shell,Collects the output generated by a command executed by the system shell.,,,func_shell,,))
$(eval $(call BuildAsteriskModule,func-sorcery,Get a field from a sorcery object,Get a field from a sorcery object.,,,func_sorcery,,))
@ -960,7 +985,7 @@ $(eval $(call BuildAsteriskModule,res-hep,HEPv3 API,HEPv3 API.,,hep.conf,res_hep
$(eval $(call BuildAsteriskModule,res-hep-pjsip,PJSIP HEPv3 Logger,PJSIP HEPv3 logger.,+$(PKG_NAME)-res-hep +$(PKG_NAME)-pjsip,,res_hep_pjsip,,))
$(eval $(call BuildAsteriskModule,res-hep-rtcp,RTCP HEPv3 Logger,RTCP HEPv3 logger.,+$(PKG_NAME)-res-hep,,res_hep_rtcp,,))
$(eval $(call BuildAsteriskModule,res-fax-spandsp,Spandsp T.38 and G.711,Spandsp G.711 and T.38 FAX technologies.,+$(PKG_NAME)-res-fax +libspandsp +libtiff,,res_fax_spandsp,,))
$(eval $(call BuildAsteriskModule,res-fax,FAX modules,Generic FAX applications.,+$(PKG_NAME)-res-timing-pthread,res_fax.conf,res_fax,,))
$(eval $(call BuildAsteriskModule,res-fax,FAX modules,Generic FAX applications.,,res_fax.conf,res_fax,,))
$(eval $(call BuildAsteriskModule,res-format-attr-celt,CELT format attribute module,CELT format attribute module.,,,res_format_attr_celt,,))
$(eval $(call BuildAsteriskModule,res-format-attr-g729,G.729 format attribute module,G.729 format attribute module.,,,res_format_attr_g729,,))
$(eval $(call BuildAsteriskModule,res-format-attr-h263,H.263 format attribute module,H.263 format attribute module.,,,res_format_attr_h263,,))
@ -984,8 +1009,9 @@ $(eval $(call BuildAsteriskModule,res-mwi-external,Core external MWI resource,Co
$(eval $(call BuildAsteriskModule,res-mwi-external-ami,AMI for external MWI,AMI support for external MWI.,+$(PKG_NAME)-res-mwi-external,,res_mwi_external_ami,,))
$(eval $(call BuildAsteriskModule,res-parking,Phone Parking,Call parking resource.,+$(PKG_NAME)-bridge-holding,res_parking.conf,res_parking,,))
$(eval $(call BuildAsteriskModule,res-phoneprov,Phone Provisioning,HTTP phone provisioning.,,phoneprov.conf,res_phoneprov,,))
$(eval $(call BuildAsteriskModule,res-pjsip-stir-shaken,PJSIP STIR/SHAKEN resource,PJSIP STIR/SHAKEN resource module.,+$(PKG_NAME)-pjsip +$(PKG_NAME)-res-stir-shaken,,res_pjsip_stir_shaken,,))
$(eval $(call BuildAsteriskModule,res-pjsip-phoneprov,PJSIP Phone Provisioning,PJSIP phone provisioning.,+$(PKG_NAME)-pjsip +$(PKG_NAME)-res-phoneprov,,res_pjsip_phoneprov_provider,,))
$(eval $(call BuildAsteriskModule,res-pjproject,Bridge PJPROJECT to Asterisk logging,PJProject log and utility support.,+libpj +libpjlib-util +libpjmedia +libpjmedia +libpjnath +libpjsip-simple +libpjsip-ua +libpjsip +libpjsua +libpjsua2 +libsrtp2,pjproject.conf,res_pjproject,,))
$(eval $(call BuildAsteriskModule,res-pjproject,Bridge PJPROJECT to Asterisk logging,PJProject log and utility support.,+libpj +libpjlib-util +libpjmedia +libpjmedia +libpjnath +libpjsip-simple +libpjsip-ua +libpjsip +libpjsua +libpjsua2 +libsrtp2 +$(PKG_NAME)-res-sorcery,pjproject.conf,res_pjproject,,))
$(eval $(call BuildAsteriskModule,res-pktccops,PktcCOPS manager for MGCP,PktcCOPS manager for MGCP.,,res_pktccops.conf,res_pktccops,,))
$(eval $(call BuildAsteriskModule,res-realtime,RealTime CLI,Realtime data lookup/rewrite.,,,res_realtime,,))
$(eval $(call BuildAsteriskModule,res-remb-modifier,REMB modifier,REMB modifier module.,,,res_remb_modifier,,))
@ -1007,10 +1033,11 @@ $(eval $(call BuildAsteriskModule,res-stasis-playback,Stasis application playbac
$(eval $(call BuildAsteriskModule,res-stasis-recording,Stasis application recording,Stasis application recording support.,+$(PKG_NAME)-res-stasis,,res_stasis_recording,,))
$(eval $(call BuildAsteriskModule,res-stasis-snoop,Stasis application snoop,Stasis application snoop support.,+$(PKG_NAME)-res-stasis-recording,,res_stasis_snoop,,))
$(eval $(call BuildAsteriskModule,res-statsd,statsd client,Statsd client support.,,statsd.conf,res_statsd,,))
$(eval $(call BuildAsteriskModule,res-stir-shaken,STIR/SHAKEN resource module,STIR/SHAKEN resource module.,+$(PKG_NAME)-curl,stir_shaken.conf,res_stir_shaken,,))
$(eval $(call BuildAsteriskModule,res-stun-monitor,STUN monitoring,STUN network monitor.,,res_stun_monitor.conf,res_stun_monitor,,))
$(eval $(call BuildAsteriskModule,res-timing-dahdi,DAHDI Timing Interface,DAHDI timing interface.,+$(PKG_NAME)-chan-dahdi,,res_timing_dahdi,,))
$(eval $(call BuildAsteriskModule,res-timing-pthread,pthread Timing Interface,pthread timing interface.,,,res_timing_pthread,,))
$(eval $(call BuildAsteriskModule,res-timing-timerfd,Timerfd Timing Interface,Timerfd timing interface.,,,res_timing_timerfd,,))
$(eval $(call BuildAsteriskModule,res-tonedetect,Tone detection,Tone detection module.,,,res_tonedetect,,))
$(eval $(call BuildAsteriskModule,res-xmpp,XMPP client and component module,Asterisk XMPP interface.,+libiksemel +libopenssl,xmpp.conf,res_xmpp,,))
$(eval $(call BuildAsteriskModule,voicemail,Voicemail,Voicemail modules.,+$(PKG_NAME)-res-adsi +$(PKG_NAME)-res-smdi,voicemail.conf,app_voicemail,vm-*,))

View file

@ -15,7 +15,7 @@ start() {
[ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk
[ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk
[ -d $DEST/var/lib/asterisk ] || mkdir -p $DEST/var/lib/asterisk
[ -d $DEST/var/lib/asterisk/keys ] || mkdir -p $DEST/var/lib/asterisk/keys
[ -d $DEST/usr/share/asterisk/keys ] || mkdir -p $DEST/usr/share/asterisk/keys
[ -d $DEST/var/log/asterisk/cdr-csv ] || mkdir -p $DEST/var/log/asterisk/cdr-csv
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \

View file

@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1018,15 +1018,18 @@ AC_LINK_IFELSE(
@@ -1088,15 +1088,18 @@ AC_LINK_IFELSE(
# Some platforms define sem_init(), but only support sem_open(). joyous.
AC_MSG_CHECKING(for working unnamed semaphores)

View file

@ -18,7 +18,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
--- a/configure.ac
+++ b/configure.ac
@@ -1412,7 +1412,11 @@ AC_LINK_IFELSE(
@@ -1482,7 +1482,11 @@ AC_LINK_IFELSE(
#include <arpa/nameser.h>
#endif
#include <resolv.h>],

View file

@ -1,10 +0,0 @@
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -187,7 +187,6 @@ check_expr2: $(ASTTOPDIR)/main/ast_expr2
$(CC) -g -o check_expr2 ast_expr2fz.o ast_expr2z.o astmm.o -lm $(_ASTLDFLAGS)
$(ECHO_PREFIX) echo " [RM] ast_expr2fz.o ast_expr2z.o"
rm ast_expr2z.o ast_expr2fz.o
- ./check_expr2 expr2.testinput
smsq: smsq.o strcompat.o
smsq: LIBS+=$(POPT_LIB)

View file

@ -15,14 +15,14 @@
cat << END
/*
* build.h
--- a/Makefile
+++ b/Makefile
@@ -484,7 +484,7 @@ doc/core-en_US.xml: makeopts .lastclean
@echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
@for x in $(MOD_SUBDIRS); do \
printf "$$x " ; \
- for i in `find $$x -name '*.c'`; do \
+ for i in `find $$x -name '*.c' | LC_ALL=C sort`; do \
$(AWK) -f build_tools/get_documentation $$i >> $@ ; \
done ; \
done
--- a/build_tools/make_xml_documentation
+++ b/build_tools/make_xml_documentation
@@ -187,7 +187,7 @@ printf "Building Documentation For: "
for subdir in ${mod_subdirs} ; do
printf "%s " "${subdir}"
subdir_path="${source_tree}/${subdir}"
- for i in $(${FIND} "${subdir_path}" -name '*.c' -or -name '*.cc'); do
+ for i in $(${FIND} "${subdir_path}" -name '*.c' -or -name '*.cc' | LC_ALL=C sort); do
if [ "${with_moduleinfo}" -eq "1" ] ; then
MODULEINFO=$(${AWK} -f "${source_tree}/build_tools/get_moduleinfo" "${i}")
if [ "${MODULEINFO}" != "" ] ; then

View file

@ -1,247 +0,0 @@
commit 02fda2b478f98cf3b8a1df76f772bf0be73bddd5
Author: Sebastian Kemper <sebastian_ml@gmx.net>
Date: Tue Apr 2 22:49:52 2019 +0200
loader: support for permanent dlopen()
Asterisk assumes that dlopen() will always run the constructor of a
shared library and every dlclose() will run its destructor. But dlopen()
may be permanent, meaning the constructor will only be run once, as is
the case with musl libc.
With a permanent dlopen() the Asterisk module loader does not work
correctly, because it's expectations regarding when the constructors and
destructors are run are not met. In fact a segmentation fault will occur
when the first module is "re-opened" that has AST_MODFLAG_GLOBAL_SYMBOLS
set (the dlopen() does not call the constructor, resource_being_loaded
is not set to NULL, then strlen is called with NULL instead of a string,
see issue ASTERISK-28319).
This commit adds code to the loader that will manually run the
constructors/destructors of the (non-builtin) modules where needed. To
achieve this a new ao2 container (linked list) is started and filled
with objects that contain the names of the modules and the pointers to
their respective info structs.
This behavior can be activated when configuring Asterisk
(--enable-permanent-dlopen). By default this is disabled, of course.
ASTERISK-28319 #close
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Change-Id: I86693a0ecf25d5ba81c73773a03df4abc3426875
--- a/configure.ac
+++ b/configure.ac
@@ -727,6 +727,20 @@ if test "${DISABLE_XMLDOC}" != "yes"; th
fi
+AC_ARG_ENABLE([permanent-dlopen],
+ [AS_HELP_STRING([--enable-permanent-dlopen],
+ [Enable when your libc has a permanent dlopen like musl])],
+ [case "${enableval}" in
+ y|ye|yes) PERMANENT_DLOPEN=yes ;;
+ n|no) PERMANENT_DLOPEN=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-permanent-dlopen) ;;
+ esac], [PERMANENT_DLOPEN=no])
+
+AC_SUBST([PERMANENT_DLOPEN])
+if test "${PERMANENT_DLOPEN}" == "yes"; then
+ AC_DEFINE([HAVE_PERMANENT_DLOPEN], 1, [Define to support libc with permanent dlopen.])
+fi
+
# some embedded systems omit internationalization (locale) support
AC_CHECK_HEADERS([xlocale.h])
--- a/main/loader.c
+++ b/main/loader.c
@@ -153,6 +153,117 @@ static unsigned int loader_ready;
static struct ast_vector_string startup_errors;
static struct ast_str *startup_error_builder;
+#if defined(HAVE_PERMANENT_DLOPEN)
+#define FIRST_DLOPEN 999
+
+struct ao2_container *info_list = NULL;
+
+struct info_list_obj {
+ const struct ast_module_info *info;
+ int dlopened;
+ char name[0];
+};
+
+static struct info_list_obj *info_list_obj_alloc(const char *name,
+ const struct ast_module_info *info)
+{
+ struct info_list_obj *new_entry;
+
+ new_entry = ao2_alloc(sizeof(*new_entry) + strlen(name) + 1, NULL);
+
+ if (!new_entry) {
+ return NULL;
+ }
+
+ strcpy(new_entry->name, name); /* SAFE */
+ new_entry->info = info;
+ new_entry->dlopened = FIRST_DLOPEN;
+
+ return new_entry;
+}
+
+AO2_STRING_FIELD_CMP_FN(info_list_obj, name)
+
+static char *get_name_from_resource(const char *resource)
+{
+ int len;
+ const char *last_three;
+ char *mod_name;
+
+ if (!resource) {
+ return NULL;
+ }
+
+ len = strlen(resource);
+ if (len > 3) {
+ last_three = &resource[len-3];
+ if (!strcasecmp(last_three, ".so")) {
+ mod_name = ast_calloc(1, len - 2);
+ if (mod_name) {
+ ast_copy_string(mod_name, resource, len - 2);
+ return mod_name;
+ } else {
+ /* Unable to allocate memory. */
+ return NULL;
+ }
+ }
+ }
+
+ /* Resource is the name - happens when manually unloading a module. */
+ mod_name = ast_calloc(1, len + 1);
+ if (mod_name) {
+ ast_copy_string(mod_name, resource, len + 1);
+ return mod_name;
+ }
+
+ /* Unable to allocate memory. */
+ return NULL;
+}
+
+static void manual_mod_reg(const void *lib, const char *resource)
+{
+ struct info_list_obj *obj_tmp;
+ char *mod_name;
+
+ if (lib) {
+ mod_name = get_name_from_resource(resource);
+ if (mod_name) {
+ obj_tmp = ao2_find(info_list, mod_name, OBJ_SEARCH_KEY);
+ if (obj_tmp) {
+ if (obj_tmp->dlopened == FIRST_DLOPEN) {
+ obj_tmp->dlopened = 1;
+ } else {
+ ast_module_register(obj_tmp->info);
+ }
+ ao2_ref(obj_tmp, -1);
+ }
+ ast_free(mod_name);
+ }
+ }
+}
+
+static void manual_mod_unreg(const char *resource)
+{
+ struct info_list_obj *obj_tmp;
+ char *mod_name;
+
+ /* When Asterisk shuts down the destructor is called automatically. */
+ if (ast_shutdown_final()) {
+ return;
+ }
+
+ mod_name = get_name_from_resource(resource);
+ if (mod_name) {
+ obj_tmp = ao2_find(info_list, mod_name, OBJ_SEARCH_KEY);
+ if (obj_tmp) {
+ ast_module_unregister(obj_tmp->info);
+ ao2_ref(obj_tmp, -1);
+ }
+ ast_free(mod_name);
+ }
+}
+#endif
+
static __attribute__((format(printf, 1, 2))) void module_load_error(const char *fmt, ...)
{
char *copy = NULL;
@@ -597,6 +708,23 @@ void ast_module_register(const struct as
/* give the module a copy of its own handle, for later use in registrations and the like */
*((struct ast_module **) &(info->self)) = mod;
+
+#if defined(HAVE_PERMANENT_DLOPEN)
+ if (mod->flags.builtin != 1) {
+ struct info_list_obj *obj_tmp = ao2_find(info_list, info->name,
+ OBJ_SEARCH_KEY);
+
+ if (!obj_tmp) {
+ obj_tmp = info_list_obj_alloc(info->name, info);
+ if (obj_tmp) {
+ ao2_link(info_list, obj_tmp);
+ ao2_ref(obj_tmp, -1);
+ }
+ } else {
+ ao2_ref(obj_tmp, -1);
+ }
+ }
+#endif
}
static int module_post_register(struct ast_module *mod)
@@ -843,6 +971,10 @@ static void logged_dlclose(const char *n
error = dlerror();
ast_log(AST_LOG_ERROR, "Failure in dlclose for module '%s': %s\n",
S_OR(name, "unknown"), S_OR(error, "Unknown error"));
+#if defined(HAVE_PERMANENT_DLOPEN)
+ } else {
+ manual_mod_unreg(name);
+#endif
}
}
@@ -949,6 +1081,9 @@ static struct ast_module *load_dlopen(co
resource_being_loaded = mod;
mod->lib = dlopen(filename, flags);
+#if defined(HAVE_PERMANENT_DLOPEN)
+ manual_mod_reg(mod->lib, mod->resource);
+#endif
if (resource_being_loaded) {
struct ast_str *list;
int c = 0;
@@ -968,6 +1103,9 @@ static struct ast_module *load_dlopen(co
resource_being_loaded = mod;
mod->lib = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+#if defined(HAVE_PERMANENT_DLOPEN)
+ manual_mod_reg(mod->lib, mod->resource);
+#endif
if (resource_being_loaded) {
resource_being_loaded = NULL;
@@ -2206,6 +2344,15 @@ int load_modules(void)
ast_verb(1, "Asterisk Dynamic Loader Starting:\n");
+#if defined(HAVE_PERMANENT_DLOPEN)
+ info_list = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, 0, NULL,
+ info_list_obj_cmp_fn); /* must not be cleaned at shutdown */
+ if (!info_list) {
+ fprintf(stderr, "Module info list allocation failure.\n");
+ return 1;
+ }
+#endif
+
AST_LIST_HEAD_INIT_NOLOCK(&load_order);
AST_DLLIST_LOCK(&module_list);

View file

@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1205,7 +1205,7 @@ if test "${ac_cv_have_variable_fdset}x"
@@ -1261,7 +1261,7 @@ if test "${ac_cv_have_variable_fdset}x"
fi
AC_MSG_CHECKING([if we have usable eventfd support])

View file

@ -0,0 +1,22 @@
--- a/autoconf/ast_ext_tool_check.m4
+++ b/autoconf/ast_ext_tool_check.m4
@@ -8,13 +8,16 @@ AC_DEFUN([AST_EXT_TOOL_CHECK],
AC_REQUIRE([AST_PROG_SED])dnl
if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
PBX_$1=0
- AC_PATH_TOOL(CONFIG_$1, $2, No, [${$1_DIR}/bin:$PATH])
+ if test "x${$1_DIR}" != "x"; then
+ AC_PATH_TOOL(CONFIG_$1, $2, No, [${$1_DIR}/bin:$PATH])
+ else
+ AC_PATH_TOOL(CONFIG_$1, $2, No, [$PATH])
+ fi
if test ! "x${CONFIG_$1}" = xNo; then
$1_INCLUDE=$(${CONFIG_$1} m4_default([$3],[--cflags]))
- $1_INCLUDE=$(echo ${$1_INCLUDE} | $SED -e "s|-I|-I${$1_DIR}|g" -e "s|-std=c99||g")
+ $1_INCLUDE=$(echo ${$1_INCLUDE} | $SED -e "s|-std=c99||g")
$1_LIB=$(${CONFIG_$1} m4_default([$4],[--libs]))
- $1_LIB=$(echo ${$1_LIB} | $SED -e "s|-L|-L${$1_DIR}|g")
m4_ifval([$5], [
saved_cppflags="${CPPFLAGS}"

View file

@ -0,0 +1,55 @@
From: https://issues.asterisk.org/jira/browse/ASTERISK-29905
From d27d75ad8058f6ed35197737b949bac57202dd54 Mon Sep 17 00:00:00 2001
From: "Sergey V. Lobanov" <sergey@lobanov.in>
Date: Wed, 9 Feb 2022 01:29:46 +0300
Subject: [PATCH] build: fix bininstall launchd issue on cross-platfrom build
configure script detects /sbin/launchd, but the result of this
check is not used in Makefile (bininstall). Makefile also detects
/sbin/launchd file to decide if it is required to install
safe_asterisk.
configure script correctly detects cross compile build and sets
PBX_LAUNCHD=0
In case of building asterisk on MacOS host for Linux target using
external toolchain (e.g. OpenWrt toolchain), bininstall does not
install safe_asterisk (due to /sbin/launchd detection in Makefile),
but it is required on target (Linux).
This patch adds HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@ to makeopts.in to
use the result of /sbin/launchd detection from configure script in
Makefile.
Also this patch uses HAVE_SBIN_LAUNCHD in Makefile (bininstall) to
decide if it is required to install safe_asterisk.
Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
---
Makefile | 6 +++---
makeopts.in | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -558,9 +558,9 @@ bininstall: _all installdirs $(SUBDIRS_I
$(INSTALL) -m 755 contrib/scripts/astversion "$(DESTDIR)$(ASTSBINDIR)/"
$(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"
$(INSTALL) -m 755 contrib/scripts/autosupport "$(DESTDIR)$(ASTSBINDIR)/"
- if [ ! -f /sbin/launchd ]; then \
- ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk"; \
- fi
+ifneq ($(HAVE_SBIN_LAUNCHD),1)
+ ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk";
+endif
ifneq ($(DISABLE_XMLDOC),yes)
$(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"
--- a/makeopts.in
+++ b/makeopts.in
@@ -373,3 +373,5 @@ SNDFILE_LIB=@SNDFILE_LIB@
BEANSTALK_INCLUDE=@BEANSTALK_INCLUDE@
BEANSTALK_LIB=@BEANSTALK_LIB@
+
+HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@

View file

@ -41,12 +41,6 @@ define Package/asterisk-chan-dongle/Default
TITLE:=Huawei UMTS 3G dongle support
endef
define Package/asterisk13-chan-dongle
$(call Package/asterisk-chan-dongle/Default)
DEPENDS+=asterisk13
VARIANT:=asterisk13
endef
define Package/asterisk16-chan-dongle
$(call Package/asterisk-chan-dongle/Default)
DEPENDS+=asterisk16
@ -57,15 +51,8 @@ define Package/description/Default
Asterisk channel driver for Huawei UMTS 3G dongle.
endef
Package/asterisk13-chan-dongle/description = $(Package/description/Default)
Package/asterisk16-chan-dongle/description = $(Package/description/Default)
ifeq ($(BUILD_VARIANT),asterisk13)
CHAN_DONGLE_AST_HEADERS:=$(STAGING_DIR)/usr/include/asterisk-13/include
CONFIGURE_ARGS+= \
--with-astversion=13
endif
ifeq ($(BUILD_VARIANT),asterisk16)
CHAN_DONGLE_AST_HEADERS:=$(STAGING_DIR)/usr/include/asterisk-16/include
CONFIGURE_ARGS+= \
@ -89,7 +76,6 @@ define Package/conffiles/Default
/etc/asterisk/dongle.conf
endef
Package/asterisk13-chan-dongle/conffiles = $(Package/conffiles/Default)
Package/asterisk16-chan-dongle/conffiles = $(Package/conffiles/Default)
define Package/Install/Default
@ -99,8 +85,6 @@ define Package/Install/Default
$(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_dongle.so $(1)$(MODULES_DIR)
endef
Package/asterisk13-chan-dongle/install = $(Package/Install/Default)
Package/asterisk16-chan-dongle/install = $(Package/Install/Default)
$(eval $(call BuildPackage,asterisk13-chan-dongle))
$(eval $(call BuildPackage,asterisk16-chan-dongle))

View file

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=chan-sccp
PKG_VERSION:=v4.3.2-20190411
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/chan-sccp/chan-sccp.git
@ -42,19 +42,6 @@ define Package/chan-sccp/Default
DEPENDS:=$(ICONV_DEPENDS) +libltdl
endef
define Package/asterisk13-chan-sccp
$(call Package/chan-sccp/Default)
DEPENDS += asterisk13 \
+asterisk13-bridge-holding \
+asterisk13-bridge-native-rtp \
+asterisk13-bridge-simple \
+asterisk13-bridge-softmix \
+asterisk13-res-stasis-device-state \
+asterisk13-voicemail
VARIANT:=asterisk13
CONFLICTS:=asterisk13-chan-skinny
endef
define Package/asterisk16-chan-sccp
$(call Package/chan-sccp/Default)
DEPENDS += asterisk16 \
@ -74,7 +61,6 @@ Extended features include shared lines, presence / BLF, customizable
feature buttons and custom device state.
endef
Package/asterisk13-chan-sccp/description = $(Package/description/Default)
Package/asterisk16-chan-sccp/description = $(Package/description/Default)
CONFIGURE_ARGS += \
@ -83,10 +69,6 @@ CONFIGURE_ARGS += \
--enable-conference \
--enable-video
ifeq ($(BUILD_VARIANT),asterisk13)
CONFIGURE_ARGS += --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-13
endif
ifeq ($(BUILD_VARIANT),asterisk16)
CONFIGURE_ARGS += --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-16
endif
@ -95,7 +77,6 @@ define Package/conffiles/Default
/etc/asterisk/sccp.conf
endef
Package/asterisk13-chan-sccp/conffiles = $(Package/conffiles/Default)
Package/asterisk16-chan-sccp/conffiles = $(Package/conffiles/Default)
define Package/Install/Default
@ -105,8 +86,6 @@ define Package/Install/Default
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_sccp.so $(1)/usr/lib/asterisk/modules/
endef
Package/asterisk13-chan-sccp/install = $(Package/Install/Default)
Package/asterisk16-chan-sccp/install = $(Package/Install/Default)
$(eval $(call BuildPackage,asterisk13-chan-sccp))
$(eval $(call BuildPackage,asterisk16-chan-sccp))

View file

@ -1,6 +1,6 @@
--- a/autoconf/extra.m4
+++ b/autoconf/extra.m4
@@ -491,17 +491,6 @@ AC_DEFUN([CS_ENABLE_OPTIMIZATION], [
@@ -493,17 +493,6 @@ AC_DEFUN([CS_ENABLE_OPTIMIZATION], [
], SUPPORTED_CFLAGS)
])
AC_SUBST([strip_binaries])

View file

@ -1,7 +1,5 @@
Index: chan-sccp-v4.3.0-20171123/src/chan_sccp.c
===================================================================
--- chan-sccp-v4.3.0-20171123.orig/src/chan_sccp.c
+++ chan-sccp-v4.3.0-20171123/src/chan_sccp.c
--- a/src/chan_sccp.c
+++ b/src/chan_sccp.c
@@ -186,7 +186,7 @@ boolean_t sccp_postPBX_load(void)
#else
snprintf(SCCP_REVISIONSTR, sizeof(SCCP_REVISIONSTR), "%s", SCCP_REVISION);

View file

@ -24,8 +24,6 @@ Date: Mon May 6 21:07:48 2019 +0200
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
diff --git a/src/sccp_utils.c b/src/sccp_utils.c
index df043d1a..f917c0c9 100644
--- a/src/sccp_utils.c
+++ b/src/sccp_utils.c
@@ -10,6 +10,7 @@

View file

@ -0,0 +1,77 @@
From 9684efb7709c1be23c99f555f61b5a3ad15b0675 Mon Sep 17 00:00:00 2001
From: Diederik de Groot <dkgroot@talon.nl>
Date: Thu, 16 May 2019 17:48:55 +0200
Subject: [PATCH] Add support for new asterisk mwi.h header file
---
autoconf/asterisk.m4 | 6 ++++++
configure | 13 +++++++++++++
src/config.h.in | 3 +++
src/sccp_mwi.c | 4 ++++
4 files changed, 26 insertions(+)
--- a/autoconf/asterisk.m4
+++ b/autoconf/asterisk.m4
@@ -1112,6 +1112,12 @@ dnl CFLAGS="${CFLAGS_saved} -Werror=imp
],,[
$HEADER_INCLUDE
])
+ AC_CHECK_HEADER([asterisk/mwi.h],
+ [
+ AC_DEFINE([HAVE_PBX_MWI_H],1,[Found 'asterisk/mwi.h'])
+ ],,[
+ $HEADER_INCLUDE
+ ])
AC_CHECK_HEADER([asterisk/utils.h],
[
AC_DEFINE([HAVE_PBX_UTILS_H],1,[Found 'asterisk/utils.h'])
--- a/configure
+++ b/configure
@@ -28793,6 +28793,19 @@ $as_echo "#define HAVE_PBX_MESSAGE_H 1"
fi
+ ac_fn_c_check_header_compile "$LINENO" "asterisk/mwi.h" "ac_cv_header_asterisk_mwi_h" "
+ $HEADER_INCLUDE
+
+"
+if test "x$ac_cv_header_asterisk_mwi_h" = xyes; then :
+
+
+$as_echo "#define HAVE_PBX_MWI_H 1" >>confdefs.h
+
+
+fi
+
+
ac_fn_c_check_header_compile "$LINENO" "asterisk/utils.h" "ac_cv_header_asterisk_utils_h" "
$HEADER_INCLUDE
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -571,6 +571,9 @@
/* Found 'asterisk/message.h' */
#undef HAVE_PBX_MESSAGE_H
+/* Found 'asterisk/mwi.h' */
+#undef HAVE_PBX_MWI_H
+
/* Found 'asterisk/pbx.h' */
#undef HAVE_PBX_PBX_H
--- a/src/sccp_mwi.c
+++ b/src/sccp_mwi.c
@@ -25,9 +25,13 @@ SCCP_FILE_VERSION(__FILE__, "");
#elif HAVE_PBX_STASIS_H
#include <asterisk/stasis.h>
#endif
+#ifdef HAVE_PBX_MWI_H // ast_mwi_state_type
+#include <asterisk/mwi.h>
+#else
#ifdef HAVE_PBX_APP_H // ast_mwi_state_type
#include <asterisk/app.h>
#endif
+#endif
#include <asterisk/cli.h>
pbx_mutex_t subscriptions_lock;

View file

@ -36,12 +36,6 @@ define Package/asterisk-g72x/Default
DEPENDS:=+bcg729
endef
define Package/asterisk13-codec-g729
$(call Package/asterisk-g72x/Default)
DEPENDS+=asterisk13
VARIANT:=asterisk13
endef
define Package/asterisk16-codec-g729
$(call Package/asterisk-g72x/Default)
DEPENDS+=asterisk16
@ -52,19 +46,12 @@ define Package/description/Default
Asterisk G.729 codec based on bcg729 implementation.
endef
Package/asterisk13-codec-g729/description = $(Package/description/Default)
Package/asterisk16-codec-g729/description = $(Package/description/Default)
CONFIGURE_ARGS+= \
--with-bcg729 \
--enable-shared
ifeq ($(BUILD_VARIANT),asterisk13)
CONFIGURE_ARGS+= \
--with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-13/include \
--with-asterisk130
endif
ifeq ($(BUILD_VARIANT),asterisk16)
CONFIGURE_ARGS+= \
--with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-16/include \
@ -77,8 +64,6 @@ define Package/Install/Default
$(1)/usr/lib/asterisk/modules/
endef
Package/asterisk13-codec-g729/install = $(Package/Install/Default)
Package/asterisk16-codec-g729/install = $(Package/Install/Default)
$(eval $(call BuildPackage,asterisk13-codec-g729))
$(eval $(call BuildPackage,asterisk16-codec-g729))

View file

@ -41,12 +41,6 @@ define Package/$(PKG_NAME)/Default
DEPENDS:=+libopus
endef
define Package/asterisk13-codec-opus
$(call Package/$(PKG_NAME)/Default)
DEPENDS+=asterisk13
VARIANT:=asterisk13
endef
define Package/asterisk16-codec-opus
$(call Package/$(PKG_NAME)/Default)
DEPENDS+=asterisk16
@ -67,13 +61,8 @@ define Package/description/Default
well.
endef
Package/asterisk13-codec-opus/description = $(Package/description/Default)
Package/asterisk16-codec-opus/description = $(Package/description/Default)
ifeq ($(BUILD_VARIANT),asterisk13)
TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/asterisk-13/include
endif
ifeq ($(BUILD_VARIANT),asterisk16)
TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/asterisk-16/include
endif
@ -84,11 +73,9 @@ define Package/Install/Default
$(1)/usr/lib/asterisk/modules
endef
Package/asterisk13-codec-opus/install = $(Package/Install/Default)
Package/asterisk16-codec-opus/install = $(Package/Install/Default)
define Build/Configure
endef
$(eval $(call BuildPackage,asterisk13-codec-opus))
$(eval $(call BuildPackage,asterisk16-codec-opus))

View file

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=baresip
PKG_VERSION:=0.6.2
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.creytiv.com/pub
@ -199,7 +199,7 @@ $(eval $(call BuildPlugin,oss,OSS audio driver,oss,))
$(eval $(call BuildPlugin,plc,Packet Loss Concealment,plc,+libspandsp))
$(eval $(call BuildPlugin,portaudio,Portaudio audio driver,portaudio,+portaudio))
$(eval $(call BuildPlugin,presence,Presence module,presence,))
$(eval $(call BuildPlugin,pulse,Pulseaudio audio driver,pulse,+pulseaudio))
$(eval $(call BuildPlugin,pulse,Pulseaudio audio driver,pulse,PACKAGE_$(PKG_NAME)-mod-pulse:pulseaudio))
$(eval $(call BuildPlugin,rtcpsummary,RTCP summary module,rtcpsummary,))
$(eval $(call BuildPlugin,selfview,Video selfview module,selfview,))
$(eval $(call BuildPlugin,sndfile,Audio dumper using libsndfile,sndfile,+libsndfile))

View file

@ -27,12 +27,6 @@ config FS_STABLE_WITH_ODBC
help
Enable ODBC support.
config FS_STABLE_WITH_PGSQL
bool "Compile with PGSQL support"
default y if x86_64
help
Enable PostgreSQL support.
config FS_STABLE_WITH_PNG
bool "Compile with PNG support"
default y if x86_64

View file

@ -9,29 +9,25 @@ include $(TOPDIR)/rules.mk
PRG_NAME:=freeswitch
PKG_NAME:=$(PRG_NAME)-stable
PKG_VERSION:=1.8.6
PKG_VERSION:=1.10.7
PKG_RELEASE:=1
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
PKG_SOURCE:=$(PRG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PRG_NAME)-$(PKG_VERSION).-release.tar.xz
PKG_SOURCE_URL:=https://files.$(PRG_NAME).org/releases/$(PRG_NAME)
PKG_HASH:=b87f47e57d13de2b901bd1e4eb85491178e59a159a2831d7430abe7947f0d3a4
PKG_HASH:=0919bddc2ea9cab2e4944314e71637bea9dd4f40d510722a74ea032104594c41
PKG_CPE_ID:=cpe:/a:freeswitch:freeswitch
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PRG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PRG_NAME)-$(PKG_VERSION).-release
# configure in libs/spandsp fails without libjpeg and tiff
PKG_BUILD_DEPENDS:= \
libjpeg \
tiff \
perl/host \
python/host
PKG_FIXUP:=autoreconf
# With mod_ssml and mod_rayo enabled the parallel compiles always failed
PKG_BUILD_PARALLEL:=0
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_LICENSE:= \
@ -77,9 +73,6 @@ FS_STABLE_SYSCONF_DIR:=/etc
FS_STABLE_TLS_DIR:=$(FS_STABLE_SYSCONF_DIR)/$(PRG_NAME)/tls
FS_STABLE_TZ_DIR:=$(FS_STABLE_DATA_DIR)/tz
FTDM:=freetdm
PKG_LIBFTDM:=lib$(FTDM)-stable
FS_STABLE_MOD_AVAILABLE:= \
abstraction \
alsa \
@ -126,7 +119,6 @@ FS_STABLE_MOD_AVAILABLE:= \
fail2ban \
fifo \
format_cdr \
$(FTDM) \
fsk \
fsv \
g723_1 \
@ -147,6 +139,7 @@ FS_STABLE_MOD_AVAILABLE:= \
logfile \
loopback \
lua \
mariadb \
mp4v \
native_file \
nibblebill \
@ -155,6 +148,7 @@ FS_STABLE_MOD_AVAILABLE:= \
opusfile \
oreka \
perl \
pgsql \
png \
pocketsphinx \
portaudio \
@ -190,6 +184,7 @@ FS_STABLE_MOD_AVAILABLE:= \
say_zh \
shell_stream \
shout \
signalwire \
skinny \
sms \
snapshot \
@ -227,16 +222,13 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_FS_STABLE_WITH_DEBUG \
CONFIG_FS_STABLE_WITH_FREETYPE \
CONFIG_FS_STABLE_WITH_LIBYUV \
CONFIG_FS_STABLE_WITH_MODCONF \
CONFIG_FS_STABLE_WITH_ODBC \
CONFIG_FS_STABLE_WITH_PGSQL \
CONFIG_FS_STABLE_WITH_PNG \
CONFIG_FS_STABLE_WITH_SRTP \
CONFIG_FS_STABLE_WITH_VPX \
CONFIG_FS_STABLE_WITH_ZRTP \
CONFIG_LIBC \
CONFIG_PACKAGE_$(PKG_LIBFTDM) \
CONFIG_PACKAGE_$(PKG_LIBFTDM)-ftmod-libpri \
CONFIG_PACKAGE_$(PKG_LIBFTDM)-ftmod-pritap \
CONFIG_PACKAGE_$(PKG_NAME)-misc-perl-esl \
CONFIG_PACKAGE_$(PKG_NAME)-misc-python-esl \
CONFIG_SOFT_FLOAT
@ -279,6 +271,10 @@ endef
$$(eval $$(call Download,$(1)))
endef
define Package/$(PKG_NAME)/enable/plugin
$(SED) '/$(1)$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf
endef
define Package/$(PKG_NAME)/install/bin
$(INSTALL_DIR) $(1)$(FS_STABLE_BIN_DIR)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)$(FS_STABLE_BIN_DIR)/$(2) \
@ -297,15 +293,9 @@ define Package/$(PKG_NAME)/install/dir
done
endef
define Package/$(PKG_LIBFTDM)/install/ftmod
$(INSTALL_DIR) $(1)$(FS_STABLE_MOD_DIR)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)$(FS_STABLE_MOD_DIR)/ftmod_$(2).so \
$(1)$(FS_STABLE_MOD_DIR)
endef
define Package/$(PKG_NAME)/install/lib
$(INSTALL_DIR) $(1)$(FS_STABLE_LIB_DIR)
$(CP) $(PKG_INSTALL_DIR)$(FS_STABLE_LIB_DIR)/$(2).so* \
$(CP) $(PKG_INSTALL_DIR)$(FS_STABLE_LIB_DIR)/$(2).so.* \
$(1)$(FS_STABLE_LIB_DIR)
endef
@ -319,45 +309,6 @@ define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
define Package/$(PKG_LIBFTDM)/Default
SECTION:=libs
CATEGORY:=Libraries
SUBMENU:=Telephony
URL:=https://www.$(PRG_NAME).org
endef
define Package/$(PKG_LIBFTDM)
$(call Package/$(PKG_LIBFTDM)/Default)
DEPENDS:=
TITLE:=TDM signaling and media API
MENU:=1
URL:=https://www.$(PRG_NAME).org
endef
define Package/$(PKG_LIBFTDM)/description
Provides a unified interface to hardware TDM cards and SS7 stacks.
endef
define Package/$(PKG_LIBFTDM)/install
$(call Package/$(PKG_NAME)/install/lib,$(1),lib$(FTDM))
endef
define Package/$(PKG_LIBFTDM)/FTModule
define Package/$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1))
$(call Package/$(PKG_LIBFTDM)/Default)
DEPENDS:=PACKAGE_$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1)):$(PKG_LIBFTDM) \
$(patsubst +%,+PACKAGE_$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1)):%,$(4))
TITLE:=$(2) FreeTDM module
endef
define Package/$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1))/description
$(subst \n,$(newline),$(3))
endef
define Package/$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1))/install
$(call Package/$(PKG_LIBFTDM)/install/ftmod,$$(1),$(1))
endef
$$(eval $$(call BuildPackage,$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1))))
endef
define Package/$(PKG_NAME)/Default
SUBMENU:=Telephony
SECTION:=net
@ -375,7 +326,6 @@ $(call Package/$(PKG_NAME)/Default)
$(ICONV_DEPENDS) \
+FS_STABLE_WITH_FREETYPE:libfreetype \
+FS_STABLE_WITH_ODBC:unixodbc \
+FS_STABLE_WITH_PGSQL:libpq \
+FS_STABLE_WITH_PNG:libpng \
+libcurl \
+libedit \
@ -383,10 +333,12 @@ $(call Package/$(PKG_NAME)/Default)
+libpcre \
+libpthread \
+librt \
+libspandsp3 \
+libspeex \
+libspeexdsp \
+libsqlite3 \
+libuuid \
+sofia-sip \
+zlib
CONFLICTS:=$(PRG_NAME)
endef
@ -420,7 +372,7 @@ $(call Package/$(PKG_NAME)/install/lib,$(1),lib$(PRG_NAME))
$(1)$(FS_STABLE_SYSCONF_DIR)/init.d/$(PRG_NAME)
$(INSTALL_BIN) ./files/$(PRG_NAME).hotplug \
$(1)$(FS_STABLE_SYSCONF_DIR)/hotplug.d/iface/90-$(PRG_NAME)
$(INSTALL_CONF) ./files/$(PRG_NAME).config \
$(INSTALL_CONF) ./files/$(PRG_NAME).conf \
$(1)$(FS_STABLE_SYSCONF_DIR)/config/$(PRG_NAME)
endef
@ -437,17 +389,6 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
echo "| https://openwrt.org/docs/guide-user/services/voip/freeswitch |"
echo "o-------------------------------------------------------------=^_^=-o"
echo
[ -f /etc/hotplug.d/iface/99-freeswitch ] && {
echo "o-------------------------------------------------------------------o"
echo "| WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |"
echo "o-------------------------------------------------------------------o"
echo "| Please remove freeswitch-stable-misc-hotplug. The hotplug script |"
echo "| is now part of the main freeswitch-stable package. Please run: |"
echo "| |"
echo "| opkg remove freeswitch-stable-misc-hotplug |"
echo "o-------------------------------------------------------------=^_^=-o"
echo
}
fi
exit 0
endef
@ -641,22 +582,19 @@ CONFIGURE_ARGS+= \
--with-dbdir=/tmp/$(PRG_NAME)/db \
--with-imagesdir=$(FS_STABLE_IMAGES_DIR) \
--with-logfiledir=/tmp/$(PRG_NAME)/log \
--with-python3=no \
--with-recordingsdir=/tmp/$(PRG_NAME)/recordings \
--with-storagedir=/tmp/$(PRG_NAME)/storage \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_DEBUG,debug) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_LIBYUV,libyuv) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_ODBC,core-odbc-support) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_PGSQL,core-pgsql-support) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_SRTP,srtp) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_VPX,libvpx) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_ZRTP,zrtp) \
$(if $(CONFIG_FS_STABLE_WITH_FREETYPE),,--without-freetype) \
$(if $(CONFIG_FS_STABLE_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)$(FS_STABLE_LIB_DIR)") \
$(if $(CONFIG_FS_STABLE_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \
$(if $(CONFIG_FS_STABLE_WITH_PGSQL),,--without-pgsql) \
$(if $(CONFIG_FS_STABLE_WITH_PNG),,--without-png) \
$(if $(CONFIG_PACKAGE_$(PKG_LIBFTDM)-ftmod-libpri),--with-libpri="$(STAGING_DIR)/usr",--without-libpri) \
$(if $(CONFIG_PACKAGE_$(PKG_LIBFTDM)-ftmod-pritap),--with-pritap,--without-pritap)
$(if $(CONFIG_FS_STABLE_WITH_PNG),,--without-png)
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-python-esl)$(CONFIG_PACKAGE_$(PKG_NAME)-mod-python),)
CONFIGURE_ARGS+= \
@ -671,12 +609,12 @@ CONFIGURE_ARGS+= \
--with-erlang=no
endif
# Make mod_spandsp use fixed point math when soft float support is
# enabled on target devices.
ifeq ($(CONFIG_SOFT_FLOAT),y)
# FreeSWITCH dropped postgresql support from the core. postgresql
# support is now available via mod_pgsql. We still need to pass
# '--without-pgsql', otherwise apr-util links to libpq and we still
# would have the core link to it.
CONFIGURE_ARGS+= \
--enable-fixed-point
endif
--without-pgsql
# Don't want host-php
CONFIGURE_VARS+= \
@ -713,8 +651,7 @@ CONFIGURE_VARS+= \
# Regarding apr_cv_mutex_robust_shared=no see
# http://www.openwall.com/lists/musl/2016/11/26/1
# _Don't_ remove quotes below!
ifeq ($(CONFIG_LIBC),"musl")
ifeq ($(call qstrip,$(CONFIG_LIBC)),musl)
CONFIGURE_VARS+= \
apr_cv_mutex_robust_shared=no \
ac_cv_strerror_r_rc_int=yes
@ -817,27 +754,36 @@ define Build/Configure
$(SED) '/^#/!s/^/#/' $(PKG_BUILD_DIR)/modules.conf
$(foreach m,$(FS_STABLE_MOD_AVAILABLE),
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(subst _,-,$(m))),
$(SED) '/mod_$(m)$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf))
$(call Package/$(PKG_NAME)/enable/plugin,mod_$(m))))
# Some of the dependencies that necessitate below hacks are documented in
# src/mod/Makefile.am.
# Hack for misc-grammar - needs mod_pocketsphinx to provide grammar files
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-grammar),)
ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-pocketsphinx),)
$(SED) '/mod_pocketsphinx$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf
endif
$(call Package/$(PKG_NAME)/enable/plugin,mod_pocketsphinx)
endif
# Hack for mod_gsmopen - it has a build-time dep on mod_spandsp
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-gsmopen),)
ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp),)
$(SED) '/mod_spandsp$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf
$(call Package/$(PKG_NAME)/enable/plugin,mod_spandsp)
endif
# Hack for mod_rayo - it has a build-time dep on mod_dingaling
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-rayo),)
$(call Package/$(PKG_NAME)/enable/plugin,mod_dingaling)
endif
# Hack for mod_ssml - it has a build-time dep on mod_rayo. And mod_rayo needs
# mod_dingaling :)
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-ssml),)
$(call Package/$(PKG_NAME)/enable/plugin,mod_rayo)
$(call Package/$(PKG_NAME)/enable/plugin,mod_dingaling)
endif
# Hack for mod_unimrcp - it has a build-time dep on mod_sofia
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-unimrcp),)
ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-sofia),)
$(SED) '/mod_sofia$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf
endif
$(call Package/$(PKG_NAME)/enable/plugin,mod_sofia)
endif
$(call Build/Configure/Default)
@ -858,14 +804,7 @@ endif
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-radius-cdr),)
$(CP) $(DL_DIR)/$(FS_STABLE_FREERADIUS_CLIENT_FILE) $(PKG_BUILD_DIR)/libs
endif
# Compile FreeTDM first
ifneq ($(CONFIG_PACKAGE_$(PKG_LIBFTDM)),)
$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/$(FTDM))
endif
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)),)
$(call Build/Compile/Default)
endif
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-perl-esl),)
$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl perlmod)
endif
@ -875,13 +814,7 @@ endif
endef
define Build/Install
# Again, FreeTDM first
ifneq ($(CONFIG_PACKAGE_$(PKG_LIBFTDM)),)
$(call Build/Install/Default,-C $(PKG_BUILD_DIR)/libs/$(FTDM) install)
endif
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)),)
$(call Build/Install/Default)
endif
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-perl-esl),)
$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl DESTDIR=$(PKG_INSTALL_DIR) perlmod-install)
endif
@ -890,34 +823,18 @@ ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-python-esl),)
endif
endef
define Build/InstallDev/$(PKG_LIBFTDM)
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)$(FS_STABLE_PKGCONFIG_DIR)/$(FTDM).pc \
define Build/InstallDev
$(INSTALL_DIR) $(1)$(FS_STABLE_INCLUDES_DIR) $(1)$(FS_STABLE_LIB_DIR) \
$(1)$(FS_STABLE_PKGCONFIG_DIR)
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
endef
define Build/InstallDev/$(PKG_NAME)
$(INSTALL_DIR) $(1)$(FS_STABLE_INCLUDES_DIR)
$(INSTALL_DATA) $(PKG_INSTALL_DIR)$(FS_STABLE_INCLUDES_DIR)/*.h \
$(1)$(FS_STABLE_INCLUDES_DIR)
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)$(FS_STABLE_PKGCONFIG_DIR)/$(PRG_NAME).pc \
$(1)$(FS_STABLE_PKGCONFIG_DIR)
$(CP) $(PKG_INSTALL_DIR)$(FS_STABLE_LIB_DIR)/libfreeswitch.so* \
$(1)$(FS_STABLE_LIB_DIR)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)$(FS_STABLE_PKGCONFIG_DIR)
ifneq ($(CONFIG_PACKAGE_$(PKG_LIBFTDM)),)
$(call Build/InstallDev/$(PKG_LIBFTDM),$(1))
endif
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)),)
$(call Build/InstallDev/$(PKG_NAME),$(1))
endif
endef
$(eval $(call BuildPackage,$(PKG_LIBFTDM)))
$(eval $(call BuildPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME)-misc-perl-esl))
$(eval $(call BuildPackage,$(PKG_NAME)-misc-python-esl))
@ -938,22 +855,6 @@ $(eval $(call Package/$(PKG_NAME)/Example,softphone))
$(eval $(call Package/$(PKG_NAME)/Example,testing))
$(eval $(call Package/$(PKG_NAME)/Example,vanilla))
################################
# FreeTDM modules
# Params:
# 1 - Package subname
# 2 - Package title
# 3 - Module description
# 4 - Module dependencies
################################
$(eval $(call Package/$(PKG_LIBFTDM)/FTModule,analog,Analog,Offers generic FXO/FXS support for any type of card supported by FreeTDM.,))
$(eval $(call Package/$(PKG_LIBFTDM)/FTModule,analog_em,Analog EM,Offers generic E&M signaling for any type of card supported by FreeTDM.,))
$(eval $(call Package/$(PKG_LIBFTDM)/FTModule,libpri,LibPRI,Offers support for PRI lines using the open source libpri stack for any\ntype of card supported by FreeTDM. Supports both PRI and BRI signalling.,+libpri @!aarch64))
$(eval $(call Package/$(PKG_LIBFTDM)/FTModule,pritap,PRI tapping,This module is used to tap PRI lines.,+$(PKG_LIBFTDM)-ftmod-libpri))
$(eval $(call Package/$(PKG_LIBFTDM)/FTModule,skel,Skeleton,ftmod_skel is an example module.,))
$(eval $(call Package/$(PKG_LIBFTDM)/FTModule,zt,DAHDI I/O,This module supports the DAHDI interface. The DAHDI interface is used by\nseveral hardware vendors.,))
################################
# FreeSWITCH language files
# Params:
@ -1008,7 +909,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,blacklist,Blacklist helper,This module
$(eval $(call Package/$(PKG_NAME)/Module,callcenter,Call center,This module implements Automated Call Distribution queues.,))
$(eval $(call Package/$(PKG_NAME)/Module,cdr_csv,CSV CDR,CSV Call Detail Record handler.,))
$(eval $(call Package/$(PKG_NAME)/Module,cdr_mongodb,MongoDB CDR,MongoDB Call Detail Record handler.,))
$(eval $(call Package/$(PKG_NAME)/Module,cdr_pg_csv,PostgreSQL CDR,PostgreSQL Call Detail Record handler.,@FS_STABLE_WITH_PGSQL))
$(eval $(call Package/$(PKG_NAME)/Module,cdr_pg_csv,PostgreSQL CDR,PostgreSQL Call Detail Record handler.,+libpq))
$(eval $(call Package/$(PKG_NAME)/Module,cdr_sqlite,SQLite CDR,SQLite Call Detail Record handler.,))
$(eval $(call Package/$(PKG_NAME)/Module,cidlookup,Caller ID lookup,This module provides an API for querying caller ID name and location\ndata.,))
$(eval $(call Package/$(PKG_NAME)/Module,clearmode,Clearmode,Clearmode codec passthrough support.,))
@ -1040,7 +941,6 @@ $(eval $(call Package/$(PKG_NAME)/Module,expr,Expr,This module adds expr support
$(eval $(call Package/$(PKG_NAME)/Module,fail2ban,Fail2ban logging,Provides support for Fail2ban logging.,))
$(eval $(call Package/$(PKG_NAME)/Module,fifo,FIFO,This module adds a first-in first-out queue system.,))
$(eval $(call Package/$(PKG_NAME)/Module,format_cdr,Multiformat CDR,A superset of mod_json_cdr and mod_xml_cdr.,))
$(eval $(call Package/$(PKG_NAME)/Module,$(FTDM),FreeTDM endpoint,This module is the glue between FreeSWITCH and FreeTDM.,+$(PKG_LIBFTDM)))
$(eval $(call Package/$(PKG_NAME)/Module,fsk,FSK,This module adds frequency-shift keying support which can be used to\nsend and receive caller ID.,))
$(eval $(call Package/$(PKG_NAME)/Module,fsv,FSV,This module provides dialplan applications for recording and playing\nvideos.,))
$(eval $(call Package/$(PKG_NAME)/Module,g723_1,G.723.1 passthrough,G.723.1 codec passthrough.,))
@ -1061,7 +961,8 @@ $(eval $(call Package/$(PKG_NAME)/Module,local_stream,Local stream,Connects mult
$(eval $(call Package/$(PKG_NAME)/Module,logfile,File logger,Logs FreeSWITCH output to a file.,))
$(eval $(call Package/$(PKG_NAME)/Module,loopback,Loopback,A loopback channel driver.,))
$(eval $(call Package/$(PKG_NAME)/Module,lua,Lua,Lua language interface for FreeSWITCH.,+liblua))
$(eval $(call Package/$(PKG_NAME)/Module,mp4v,MP4 video passthrough,MP4 video passthrough..,))
$(eval $(call Package/$(PKG_NAME)/Module,mariadb,MariaDB,Adds MariaDB support.,+libmariadb @!USE_UCLIBCXX))
$(eval $(call Package/$(PKG_NAME)/Module,mp4v,MP4 video passthrough,MP4 video passthrough.,))
$(eval $(call Package/$(PKG_NAME)/Module,native_file,Native file,Plays files that are already encoded in the right format.,))
$(eval $(call Package/$(PKG_NAME)/Module,nibblebill,Nibblebill,This module allows for real-time accounting of a cash balance and\nusing that information for call routing.,))
$(eval $(call Package/$(PKG_NAME)/Module,odbc_cdr,ODBC CDR,ODBC Call Detail Record handler.,))
@ -1069,6 +970,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,opus,Opus,Opus codec support.,+libopus)
$(eval $(call Package/$(PKG_NAME)/Module,opusfile,Opus file,Read and Write OGG/Opus files.,+libopusenc +libopusfile))
$(eval $(call Package/$(PKG_NAME)/Module,oreka,Oreka,This module provides media recording with the Oreka cross-platform\naudio stream recording and retrieval system.,))
$(eval $(call Package/$(PKG_NAME)/Module,perl,Perl,This package contains mod_perl for FreeSWITCH.,+libdb47 +libgdbm +perlbase-essential @PERL_THREADS))
$(eval $(call Package/$(PKG_NAME)/Module,pgsql,PostgreSQL,Adds PostgreSQL support.,+libpq))
$(eval $(call Package/$(PKG_NAME)/Module,png,PNG,Allows playback of video using PNG files.,@FS_STABLE_WITH_PNG))
$(eval $(call Package/$(PKG_NAME)/Module,pocketsphinx,Pocketsphinx,This module allows speech recognition. You might want to install\n$(PKG_NAME)-misc-grammar as well.,+libsamplerate)) # When libsamplerate is found it'll be linked against, there is no switch to turn it off
$(eval $(call Package/$(PKG_NAME)/Module,portaudio,Portaudio,Voice through a local soundcard.,+portaudio))
@ -1104,6 +1006,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,say_th,Thai Say,Uses prerecorded sounds
$(eval $(call Package/$(PKG_NAME)/Module,say_zh,Chinese Say,Uses prerecorded sounds to read or say various things.,))
$(eval $(call Package/$(PKG_NAME)/Module,shell_stream,Shell stream,Allows to stream audio from an arbitrary shell command.,))
$(eval $(call Package/$(PKG_NAME)/Module,shout,Shout,Allows to stream audio from MP3s or Shoutcast streams.,+lame-lib +libmpg123 +libshout))
$(eval $(call Package/$(PKG_NAME)/Module,signalwire,SignalWire,SignalWire CLOUD - FreeSWITCH connector.,+signalwire-client-c))
$(eval $(call Package/$(PKG_NAME)/Module,skinny,Skinny,Skinny Call Control Protocol endpoint support.,))
$(eval $(call Package/$(PKG_NAME)/Module,sms,SMS,This module provides an abstract facility for interfacing with SMS\nsystems.,))
$(eval $(call Package/$(PKG_NAME)/Module,snapshot,Snapshot,This module can record a sliding window of audio and take snapshots\nto disk.,))
@ -1123,7 +1026,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,translate,Number translation,This modul
$(eval $(call Package/$(PKG_NAME)/Module,tts_commandline,TTS command-line,Run a command-line and play the output file.,))
$(eval $(call Package/$(PKG_NAME)/Module,unimrcp,UniMRCP,Allows communication with Media Resource Control Protocol servers.,))
$(eval $(call Package/$(PKG_NAME)/Module,valet_parking,Valet parking,This module implements the valet call parking strategy.,))
$(eval $(call Package/$(PKG_NAME)/Module,verto,Verto,Verto signaling protocol.,))
$(eval $(call Package/$(PKG_NAME)/Module,verto,Verto,Verto signaling protocol.,+libks))
$(eval $(call Package/$(PKG_NAME)/Module,video_filter,Video filter chromakey,This module provides a media bug for chromakey functionality.,))
$(eval $(call Package/$(PKG_NAME)/Module,vmd,Voicemail detection,This module detects voicemail beeps.,))
$(eval $(call Package/$(PKG_NAME)/Module,voicemail,Voicemail,This module provides a voicemail system.,))
@ -1149,5 +1052,6 @@ $(eval $(call Package/$(PKG_NAME)/Module,yuv,Raw YUV,Raw YUV I420 video codec su
$(eval $(call Package/$(PKG_NAME)/Util,fs_cli,CLI,The fs_cli program is a Command-Line Interface that allows a user to\nconnect to a FreeSWITCH instance running on the local or a remote\nsystem.,,n))
$(eval $(call Package/$(PKG_NAME)/Util,fs_encode,Sound file conversion,Format conversion of sound files so the result can be used by\nmod_native_file.,+$(PKG_NAME)-mod-native-file +$(PKG_NAME)-mod-sndfile +$(PKG_NAME)-mod-spandsp,n))
$(eval $(call Package/$(PKG_NAME)/Util,fs_ivrd,IVR daemon,The FreeSWITCH IVR daemon is an abstraction layer that sits on top of\nthe ESL. The basic idea is that the ivrd will allow the user to have\na STDIN/STDOUT interface for simple call control.,,n))
$(eval $(call Package/$(PKG_NAME)/Util,fs_tts,TTS to sound file,Use TTS to generate a sound file.,,n))
$(eval $(call Package/$(PKG_NAME)/Util,gentls_cert,TLS certificate,Can be used to create TLS certificates and setup CAs.,+openssl-util,y))
$(eval $(call Package/$(PKG_NAME)/Util,tone2wav,Sound file generation,Generates a sound file from a teletone script. The output can be in\nany format that is supported by libsndfile.,+$(PKG_NAME)-mod-sndfile,n))

View file

@ -103,7 +103,7 @@ config_get_bool ntpd hotplug ntpd 0
$LOG_NOTICE ntpd stratum $result
if [ $result -lt 16 ] 2> /dev/null; then
result=$(ntpq -c 'timeout 300' -c 'rv 0 offset' 2> /dev/null \
| awk -F '=' '{print $2}' | grep -o -E '^-?[0-9]+')
| awk -F '=' '{print $2}' | grep -o -E '^[-+]?[0-9]+')
if [ -z $result ]; then
$LOG_ERR failed to extract offset from ntpd
notReady="unable to extract offset"

View file

@ -1,8 +1,10 @@
--- a/build/modmake.rulesam
+++ b/build/modmake.rulesam
@@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = foreign subdir-object
@@ -1,8 +1,8 @@
AUTOMAKE_OPTIONS = foreign subdir-objects
AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS)
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
-AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
+AM_CPPFLAGS = $(SWITCH_AM_CPPFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
-DEFAULT_VARS = CFLAGS="$(CFLAGS)" CPPFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)" CXX="$(CXX)"
+DEFAULT_VARS = CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)" CXX="$(CXX)"

View file

@ -1,27 +0,0 @@
commit f76230b16ed6e28847a00e1fa4edd46d19a52251
Author: Sebastian Kemper <sebastian_ml@gmx.net>
Date: Thu Aug 2 23:38:43 2018 +0200
FS-11309: [fs_cli] fix typo
Commit bc3e1c9e7de1855eec454bba467fd2586e5e251b introduced a typo that
results in EL_REFRESH never being used, even if available. This can
cause the screen to garble.
This fixes the typo.
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c
index b4a5838175..d52422dd4c 100644
--- a/libs/esl/fs_cli.c
+++ b/libs/esl/fs_cli.c
@@ -674,7 +674,7 @@ static void redisplay(void)
esl_mutex_lock(MUTEX);
{
#ifdef HAVE_LIBEDIT
-#ifdef XHAVE_DECL_EL_REFRESH
+#ifdef HAVE_DECL_EL_REFRESH
#ifdef HAVE_EL_WSET
/* Current libedit versions don't implement EL_REFRESH in eln.c so
* use the wide version instead. */

View file

@ -31,16 +31,16 @@
else
CC_FOR_BUILD='$(CC)'
fi
@@ -649,7 +625,7 @@ AC_ARG_ENABLE(core-pgsql-pkgconfig,
[AS_HELP_STRING([--disable-core-pgsql-pkgconfig], [Use pg_config to get PGQSL build options])],[enable_core_pgsql_pkgconfig="$enableval"],[enable_core_pgsql_pkgconfig="yes"])
@@ -659,7 +635,7 @@ path_push_unique () {
fi
}
if test x"$enable_core_pgsql_support" = x"yes" ; then
- AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
+ AC_PATH_PROG([PG_CONFIG], [pg_config], [no], ["${STAGING_DIR}"/usr/bin])
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
if test "$PKG_CONFIG" = "no" \
|| test x"$enable_core_pgsql_pkgconfig" = x"no" \
@@ -1613,13 +1589,7 @@ AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl
-AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
+AC_PATH_PROG([PG_CONFIG], [pg_config], [no], ["${STAGING_DIR}"/usr/bin])
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
case $host in
@@ -1660,13 +1636,7 @@ AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl
# -a "x$ac_cv_have_EXTERN_h" != "xno"
if test "x$ac_cv_have_perl" != "xno"; then
@ -55,7 +55,7 @@
save_CFLAGS="$CFLAGS"
CFLAGS="$PERL_CFLAGS"
@@ -1714,24 +1684,12 @@ then
@@ -1761,24 +1731,12 @@ then
if test "$python_has_distutils" != "no" ; then
AC_MSG_CHECKING([location of site-packages])

View file

@ -12,7 +12,7 @@
#include <errno.h>
#include <string.h>
#include <stdio.h>
@@ -531,14 +532,10 @@ int main(void)
@@ -534,14 +535,10 @@ int main(void)
}], [
ac_cv_strerror_r_rc_int=yes ], [
ac_cv_strerror_r_rc_int=no ], [
@ -42,7 +42,7 @@
#include <errno.h>
#include <string.h>
#include <stdio.h>
@@ -531,14 +532,10 @@ int main(void)
@@ -534,14 +535,10 @@ int main(void)
}], [
ac_cv_strerror_r_rc_int=yes ], [
ac_cv_strerror_r_rc_int=no ], [

View file

@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
@@ -2018,7 +2018,12 @@ AC_SUBST(OUR_DISABLED_INSTALL_MODS)
@@ -2251,7 +2251,12 @@ AC_SUBST(OUR_DISABLED_INSTALL_MODS)
AC_SUBST(OUR_DISABLED_UNINSTALL_MODS)
AC_SUBST(AM_MAKEFLAGS)
@ -82,45 +82,9 @@
#Set default language
AC_LANG_C
--- a/libs/sofia-sip/configure.ac
+++ b/libs/sofia-sip/configure.ac
@@ -13,9 +13,12 @@ dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
AC_INIT([sofia-sip], [1.12.10devel])
-CFLAGS="$CFLAGS $CONFIGURE_CFLAGS"
-CXXFLAGS="$CXXFLAGS $CONFIGURE_CXXFLAGS"
-LDFLAGS="$LDFLAGS $CONFIGURE_LDFLAGS"
+m4_include(../apr/build/apr_common.m4)
+
+APR_ADDTO(CFLAGS, [$CONFIGURE_CFLAGS])
+APR_ADDTO(CPPFLAGS, [$CONFIGURE_CPPFLAGS])
+APR_ADDTO(CXXFLAGS, [$CONFIGURE_CXXFLAGS])
+APR_ADDTO(LDFLAGS, [$CONFIGURE_LDFLAGS])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_CONFIG_MACRO_DIR([m4])
--- a/libs/spandsp/configure.ac
+++ b/libs/spandsp/configure.ac
@@ -21,9 +21,12 @@
AC_PREREQ([2.59])
AC_INIT([spandsp], [1.99.0])
-CFLAGS="$CFLAGS $CONFIGURE_CFLAGS"
-CXXFLAGS="$CXXFLAGS $CONFIGURE_CXXFLAGS"
-LDFLAGS="$LDFLAGS $CONFIGURE_LDFLAGS"
+m4_include(../apr/build/apr_common.m4)
+
+APR_ADDTO(CFLAGS, [$CONFIGURE_CFLAGS])
+APR_ADDTO(CPPFLAGS, [$CONFIGURE_CPPFLAGS])
+APR_ADDTO(CXXFLAGS, [$CONFIGURE_CXXFLAGS])
+APR_ADDTO(LDFLAGS, [$CONFIGURE_LDFLAGS])
SPANDSP_LT_CURRENT=3
SPANDSP_LT_REVISION=0
--- a/libs/srtp/configure.ac
+++ b/libs/srtp/configure.ac
@@ -3,9 +3,12 @@ AC_INIT(srtp, 1.4.2, mcgrew@cisco.com)
@@ -3,9 +3,12 @@ AC_INIT(srtp, 2.4.0, mcgrew@cisco.com)
AC_CONFIG_AUX_DIR(build)
AM_INIT_AUTOMAKE

View file

@ -1,6 +1,6 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -577,8 +577,13 @@ libs/libedit/src/.libs/libedit.a:
@@ -585,8 +585,15 @@ libs/libedit/src/.libs/libedit.a:
libs/libzrtp/libzrtp.a:
cd libs/libzrtp && $(MAKE)
@ -8,10 +8,12 @@
+# - added CROSS and set target to generic-gnu for cross-compile
+# - added CPPFLAGS to CFLAGS, otherwise they would be ignored
+# - disabled optimizations that would override OpenWrt's CFLAGS
+# - disabled the building of tools (because they fail to build and we
+# don't need them anyway)
+
libs/libvpx/Makefile:
- cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384 --extra-cflags="$(VISIBILITY_FLAG)"
+ cd libs/libvpx && CROSS="$(CROSS)" CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --target=generic-gnu --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384 --extra-cflags="$(VISIBILITY_FLAG)" --disable-optimizations
libs/libvpx/Makefile: libs/libvpx/.update
- cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(VISIBILITY_FLAG)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384
+ cd libs/libvpx && CROSS="$(CROSS)" CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(CPPFLAGS) $(VISIBILITY_FLAG)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --target=generic-gnu --disable-optimizations --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-tools --disable-unit-tests --size-limit=16384x16384
libs/libvpx/libvpx.a: libs/libvpx/Makefile
libs/libvpx/libvpx.a: libs/libvpx/Makefile libs/libvpx/.update
@cd libs/libvpx && $(MAKE)

View file

@ -1,9 +1,9 @@
--- a/libs/esl/python/Makefile
+++ b/libs/esl/python/Makefile
@@ -1,6 +1,4 @@
-LOCAL_CFLAGS=`python ./python-config --includes`
-LOCAL_LDFLAGS=`python ./python-config --ldflags`
-SITE_DIR=$(DESTDIR)/`python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)"`
-LOCAL_CFLAGS=`$(PYTHON) ./python-config --includes`
-LOCAL_LDFLAGS=`$(PYTHON) ./python-config --ldflags`
-SITE_DIR=$(DESTDIR)/`$(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)"`
+SITE_DIR=$(DESTDIR)/$(PYTHON_SITE_DIR)
all: _ESL.so
@ -23,21 +23,21 @@
mkdir -p $(SITE_DIR)
--- a/libs/esl/Makefile.am
+++ b/libs/esl/Makefile.am
@@ -77,7 +77,7 @@ luamod: $(MYLIB)
@@ -79,7 +79,7 @@ luamod: $(MYLIB)
$(MAKE) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS)" CXXFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" LUA_CFLAGS="$(LUA_CFLAGS)" LUA_LIBS="$(LUA_LIBS)" -C lua
pymod: $(MYLIB)
- $(MAKE) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS)" CXXFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C python
+ $(MAKE) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS)" CXXFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" PYTHON_CFLAGS="$(PYTHON_CFLAGS)" PYTHON_LDFLAGS="$(PYTHON_LDFLAGS)" -C python
- $(MAKE) PYTHON=$(PYTHON) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS)" CXXFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C python
+ $(MAKE) PYTHON=$(PYTHON) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS)" CXXFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" PYTHON_CFLAGS="$(PYTHON_CFLAGS)" PYTHON_LDFLAGS="$(PYTHON_LDFLAGS)" -C python
tclmod: $(MYLIB)
$(MAKE) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS)" CXXFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C tcl
@@ -98,7 +98,7 @@ phpmod-install: phpmod
py3mod: $(MYLIB)
$(MAKE) PYTHON3=$(PYTHON3) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS)" CXXFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C python3
@@ -103,7 +103,7 @@ phpmod-install: phpmod
$(MAKE) -C php install
pymod-install: pymod
- $(MAKE) -C python install
+ $(MAKE) PYTHON_SITE_DIR="$(PYTHON_SITE_DIR)" -C python install
- $(MAKE) PYTHON=$(PYTHON) -C python install
+ $(MAKE) PYTHON=$(PYTHON) PYTHON_SITE_DIR="$(PYTHON_SITE_DIR)" -C python install
rubymod-install: rubymod
$(MAKE) -C ruby install
py3mod-install: py3mod
$(MAKE) PYTHON3=$(PYTHON3) -C python3 install

View file

@ -1,37 +0,0 @@
From ae56352cfff570f1b7ac0748aa339bd7bf373794 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Sat, 9 Jun 2018 19:02:41 -0300
Subject: [PATCH] mod_event_multicast.c: fix memory leak
Fixed two memory leaks with openssl 1.1.
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
---
src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
index f591855a3e..fb952ce740 100644
--- a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
+++ b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
@@ -324,7 +324,7 @@ static void event_handler(switch_event_t *event)
&tmplen, (unsigned char *) MAGIC, (int) strlen((char *) MAGIC));
outlen += tmplen;
EVP_EncryptFinal(ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH + outlen, &tmplen);
- EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
#else
EVP_CIPHER_CTX_init(&ctx);
EVP_EncryptInit(&ctx, EVP_bf_cbc(), NULL, NULL);
@@ -570,7 +570,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime)
EVP_DecryptInit(ctx, NULL, (unsigned char *) globals.psk, (unsigned char *) uuid_str);
EVP_DecryptUpdate(ctx, (unsigned char *) tmp, &outl, (unsigned char *) packet, (int) len);
EVP_DecryptFinal(ctx, (unsigned char *) tmp + outl, &tmplen);
- EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
#else
EVP_CIPHER_CTX_init(&ctx);
EVP_DecryptInit(&ctx, EVP_bf_cbc(), NULL, NULL);
--
2.16.4

View file

@ -1,10 +0,0 @@
--- a/libs/freetdm/mod_freetdm/Makefile.in
+++ b/libs/freetdm/mod_freetdm/Makefile.in
@@ -15,7 +15,6 @@ $(FTLA): $(FT_DIR)/.update
cd $(FT_DIR) && $(MAKE)
local_install:
- cd $(FT_DIR) && $(MAKE) install
[ -f $(DESTDIR)@confdir@/autoload_configs/freetdm.conf.xml ] || cp -f $(FT_DIR)/conf/freetdm.conf.xml $(DESTDIR)@confdir@/autoload_configs
local_clean:

View file

@ -1,6 +1,6 @@
--- a/src/switch_console.c
+++ b/src/switch_console.c
@@ -1053,10 +1053,12 @@ static void *SWITCH_THREAD_FUNC console_
@@ -1052,10 +1052,12 @@ static void *SWITCH_THREAD_FUNC console_
while (running) {
int32_t arg = 0;

Some files were not shown because too many files have changed in this diff Show more