diff options
-rw-r--r-- | CHANGES | 12 | ||||
-rw-r--r-- | channels/chan_sip.c | 2 | ||||
-rw-r--r-- | configs/samples/codecs.conf.sample | 54 | ||||
-rw-r--r-- | include/asterisk.h | 9 | ||||
-rw-r--r-- | include/asterisk/stasis_app.h | 10 | ||||
-rw-r--r-- | main/netsock.c | 2 | ||||
-rw-r--r-- | res/ari/ari_websockets.c | 2 | ||||
-rw-r--r-- | res/res_stasis.c | 13 | ||||
-rw-r--r-- | res/stasis/app.c | 91 | ||||
-rw-r--r-- | res/stasis/app.h | 26 | ||||
-rw-r--r-- | res/stasis/cli.c | 216 | ||||
-rw-r--r-- | res/stasis/cli.h | 43 | ||||
-rw-r--r-- | third-party/pjproject/Makefile | 10 | ||||
-rw-r--r-- | third-party/pjproject/Makefile.rules | 4 | ||||
-rwxr-xr-x | third-party/pjproject/apply_patches | 10 | ||||
-rw-r--r-- | third-party/pjproject/patches/0000-remove-third-party.patch | 33 |
16 files changed, 499 insertions, 38 deletions
@@ -28,6 +28,18 @@ chan_pjsip to asymmetric using the "asymmetric_rtp_codec" endpoint option. If this option is set then the sending and received codec are allowed to differ. +CLI Commands +------------------ + * Three new CLI commands have been added for ARI: + - ari show apps: + Displays a listing of all registered ARI applications. + - ari show app <name>: + Display detailed information about a registered ARI application. + - ari set debug <name> <on|off>: + Enable/disable debugging of an ARI application. When debugged, verbose + information will be sent to the Asterisk CLI. + + ------------------------------------------------------------------------------ --- Functionality changes from Asterisk 13.11.0 to Asterisk 13.12.0 ---------- ------------------------------------------------------------------------------ diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1f3a2f470..4c742cefe 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -21585,7 +21585,7 @@ static char *sip_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_ ast_cli(a->fd, " Sub. max duration: %d secs\n", max_subexpiry); ast_cli(a->fd, " Outbound reg. timeout: %d secs\n", global_reg_timeout); ast_cli(a->fd, " Outbound reg. attempts: %d\n", global_regattempts_max); - ast_cli(a->fd, " Outbound reg. retry 403:%d\n", global_reg_retry_403); + ast_cli(a->fd, " Outbound reg. retry 403:%s\n", AST_CLI_YESNO(global_reg_retry_403)); ast_cli(a->fd, " Notify ringing state: %s\n", AST_CLI_YESNO(sip_cfg.notifyringing)); if (sip_cfg.notifyringing) { ast_cli(a->fd, " Include CID: %s%s\n", diff --git a/configs/samples/codecs.conf.sample b/configs/samples/codecs.conf.sample index 9b5738577..63d0352a8 100644 --- a/configs/samples/codecs.conf.sample +++ b/configs/samples/codecs.conf.sample @@ -151,3 +151,57 @@ packetloss_percentage=10; ;[celt32] ;type=celt ;samprate=32000 + +;============================ OPUS Section Options ============================ +; +;[opus] +;type= ; Must be of type "opus" (default: "") +;packet_loss= ; Encoder's packet loss percentage. Can be any number between 0 + ; and 100, inclusive. A higher value results in more loss + ; resistance. (default: 0) +;complexity= ; Encoder's computational complexity. Can be any number between 0 + ; and 10, inclusive. Note, 10 equals the highest complexity. + ; (default: 10) +;max_bandwitdth= ; Encoder's maximum bandwidth allowed. Sets an upper bandwidth + ; bound on the encoder. Can be any of the following: narrow, + ; medium, wide, super_wide, full. (default: full) +;signal= ; Encoder's signal type. Aids in mode selection on the encoder: Can + ; be any of the following: auto, voice, music. (default: auto) +;application= ; Encoder's application type. Can be any of the following: voip, + ; audio, low_delay. (default: voip) +;max_playback_rate= ; Override the maximum playback rate in the offer's SDP. + ; Any value between 8000 and 48000 (inclusive) is valid, + ; however typically it should match one of the usual opus + ; bandwidths. A value of "sdp" is also allowed. When set + ; to "sdp" then the value from the offer's SDP is used. + ; (default: "sdp") +;bitrate= ; Override the maximum average bitrate in the offer's SDP. Any value + ; between 500 and 512000 is valid. The following values are also + ; allowed: auto, max, sdp. When set to "sdp" then the value from + ; the offer's sdp is used. (default: "sdp") +;cbr= ; Override the constant bit rate parameter in the offer's SDP. A value of + ; 0/false/no represents a variable bit rate whereas 1/true/yes represents + ; a constant bit rate. A value of "sdp" is also allowed. When set to "sdp" + ; then the value from the offer's sdp is used. (default: "sdp") +;fec= ; Override the use inband fec parameter in the offer's SDP. A value of + ; 0/false/no represents disabled whereas 1/true/yes represents enabled. + ; A value of "sdp" is also allowed. When set to "sdp" then the value from + ; the offer's sdp is used. (default: "sdp") +;dtx= ; Override the use dtx parameter in the offer's SDP. A value of 0/false/no + ; represents disabled whereas 1/true/yes represents enabled. A value of + ; "sdp" is also allowed. When set to "sdp" then the value from the offer's + ; sdp is used. (default: "sdp") + +;=============================== OPUS Examples ================================ +; +;[opus] +;type=opus +;max_playback_rate=8000 ; Limit the maximum playback rate on the encoder +;fec=no ; Force no inband fec on the encoder (i.e don't use what's on the SDP) + +;[myopus] +;type=opus +;max_bandwidth=wide ; Maximum encoded bandwidth set to wide band (0-8000 Hz +; ; audio bandwidth at 16Khz sample rate) +;cbr=yes ; Force a constant bit rate (i.e don't use what's on the SDP) + diff --git a/include/asterisk.h b/include/asterisk.h index c4cdfab9a..041f177e6 100644 --- a/include/asterisk.h +++ b/include/asterisk.h @@ -36,6 +36,15 @@ #define AST_FILE_MODE 0666 #endif +/* Make sure PATH_MAX is defined on platforms (HURD) that don't define it. + * Also be sure to handle the case of a path larger than PATH_MAX + * (err safely) in the code. + */ +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif + + #define DEFAULT_LANGUAGE "en" #define DEFAULT_SAMPLE_RATE 8000 diff --git a/include/asterisk/stasis_app.h b/include/asterisk/stasis_app.h index 8ceeffba3..53ce116a9 100644 --- a/include/asterisk/stasis_app.h +++ b/include/asterisk/stasis_app.h @@ -77,6 +77,16 @@ typedef void (*stasis_app_cb)(void *data, const char *app_name, struct ao2_container *stasis_app_get_all(void); /*! + * \brief Retrieve a handle to a Stasis application by its name + * + * \param name The name of the registered Stasis application + * + * \return \c stasis_app on success. + * \return \c NULL on error. + */ +struct stasis_app *stasis_app_get_by_name(const char *name); + +/*! * \brief Register a new Stasis application. * * If an application is already registered with the given name, the old diff --git a/main/netsock.c b/main/netsock.c index c11f14a89..d16cf113f 100644 --- a/main/netsock.c +++ b/main/netsock.c @@ -33,7 +33,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") -#ifndef __linux__ +#if !defined (__linux__) && !defined (__GNU__) #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__) || defined(__GLIBC__) #include <net/if_dl.h> #endif diff --git a/res/ari/ari_websockets.c b/res/ari/ari_websockets.c index 8e11629ab..f06a66750 100644 --- a/res/ari/ari_websockets.c +++ b/res/ari/ari_websockets.c @@ -174,7 +174,9 @@ int ast_ari_websocket_session_write(struct ast_ari_websocket_session *session, return -1; } +#ifdef AST_DEVMODE ast_debug(3, "Examining ARI event (length %u): \n%s\n", (unsigned int) strlen(str), str); +#endif if (ast_websocket_write_string(session->ws_session, str)) { ast_log(LOG_NOTICE, "Problem occurred during websocket write, websocket closed\n"); return -1; diff --git a/res/res_stasis.c b/res/res_stasis.c index 11aeb438e..1183f67b8 100644 --- a/res/res_stasis.c +++ b/res/res_stasis.c @@ -67,6 +67,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "stasis/app.h" #include "stasis/control.h" #include "stasis/messaging.h" +#include "stasis/cli.h" #include "stasis/stasis_bridge.h" #include "asterisk/core_unreal.h" #include "asterisk/musiconhold.h" @@ -1475,6 +1476,11 @@ static struct stasis_app *find_app_by_name(const char *app_name) return res; } +struct stasis_app *stasis_app_get_by_name(const char *name) +{ + return find_app_by_name(name); +} + static int append_name(void *obj, void *arg, int flags) { struct stasis_app *app = obj; @@ -1947,6 +1953,8 @@ static int unload_module(void) { stasis_app_unregister_event_sources(); + cli_cleanup(); + messaging_cleanup(); cleanup(); @@ -2104,6 +2112,11 @@ static int load_module(void) return AST_MODULE_LOAD_FAILURE; } + if (cli_init()) { + unload_module(); + return AST_MODULE_LOAD_FAILURE; + } + bridge_stasis_init(); stasis_app_register_event_sources(); diff --git a/res/stasis/app.c b/res/stasis/app.c index 2689e5edf..b2d9529bf 100644 --- a/res/stasis/app.c +++ b/res/stasis/app.c @@ -32,6 +32,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "messaging.h" #include "asterisk/callerid.h" +#include "asterisk/cli.h" #include "asterisk/stasis_app.h" #include "asterisk/stasis_bridges.h" #include "asterisk/stasis_channels.h" @@ -61,6 +62,8 @@ struct stasis_app { void *data; /*! Subscription model for the application */ enum stasis_app_subscription_model subscription_model; + /*! Whether or not someone wants to see debug messages about this app */ + int debug; /*! Name of the Stasis application */ char name[]; }; @@ -833,6 +836,18 @@ static void bridge_default_handler(void *data, struct stasis_subscription *sub, } } +void app_set_debug(struct stasis_app *app, int debug) +{ + if (!app) { + return; + } + + { + SCOPED_AO2LOCK(lock, app); + app->debug = debug; + } +} + struct stasis_app *app_create(const char *name, stasis_app_cb handler, void *data, enum stasis_app_subscription_model subscription_model) { RAII_VAR(struct stasis_app *, app, NULL, ao2_cleanup); @@ -930,6 +945,7 @@ struct stasis_topic *ast_app_get_topic(struct stasis_app *app) void app_send(struct stasis_app *app, struct ast_json *message) { stasis_app_cb handler; + int debug; char eid[20]; RAII_VAR(void *, data, NULL, ao2_cleanup); @@ -942,6 +958,7 @@ void app_send(struct stasis_app *app, struct ast_json *message) /* Copy off mutable state with lock held */ { SCOPED_AO2LOCK(lock, app); + debug = app->debug; handler = app->handler; if (app->data) { ao2_ref(app->data, +1); @@ -950,6 +967,13 @@ void app_send(struct stasis_app *app, struct ast_json *message) /* Name is immutable; no need to copy */ } + if (debug) { + char *dump = ast_json_dump_string_format(message, AST_JSON_PRETTY); + ast_verb(0, "Dispatching message to Stasis app '%s':\n%s\n", + app->name, dump); + ast_json_free(dump); + } + if (!handler) { ast_verb(3, "Inactive Stasis app '%s' missed message\n", app->name); @@ -1027,6 +1051,73 @@ const char *app_name(const struct stasis_app *app) return app->name; } +static int forwards_filter_by_type(void *obj, void *arg, int flags) +{ + struct app_forwards *forward = obj; + enum forward_type *forward_type = arg; + + if (forward->forward_type == *forward_type) { + return CMP_MATCH; + } + + return 0; +} + +void app_to_cli(const struct stasis_app *app, struct ast_cli_args *a) +{ + struct ao2_iterator *channels; + struct ao2_iterator *endpoints; + struct ao2_iterator *bridges; + struct app_forwards *forward; + enum forward_type forward_type; + + ast_cli(a->fd, "Name: %s\n" + " Debug: %s\n" + " Subscription Model: %s\n", + app->name, + app->debug ? "Yes" : "No", + app->subscription_model == STASIS_APP_SUBSCRIBE_ALL ? + "Global Resource Subscription" : + "Application/Explicit Resource Subscription"); + ast_cli(a->fd, " Subscriptions: %d\n", ao2_container_count(app->forwards)); + + ast_cli(a->fd, " Channels:\n"); + forward_type = FORWARD_CHANNEL; + channels = ao2_callback(app->forwards, OBJ_MULTIPLE, + forwards_filter_by_type, &forward_type); + if (channels) { + while ((forward = ao2_iterator_next(channels))) { + ast_cli(a->fd, " %s (%d)\n", forward->id, forward->interested); + ao2_ref(forward, -1); + } + ao2_iterator_destroy(channels); + } + + ast_cli(a->fd, " Bridges:\n"); + forward_type = FORWARD_BRIDGE; + bridges = ao2_callback(app->forwards, OBJ_MULTIPLE, + forwards_filter_by_type, &forward_type); + if (bridges) { + while ((forward = ao2_iterator_next(bridges))) { + ast_cli(a->fd, " %s (%d)\n", forward->id, forward->interested); + ao2_ref(forward, -1); + } + ao2_iterator_destroy(bridges); + } + + ast_cli(a->fd, " Endpoints:\n"); + forward_type = FORWARD_ENDPOINT; + endpoints = ao2_callback(app->forwards, OBJ_MULTIPLE, + forwards_filter_by_type, &forward_type); + if (endpoints) { + while ((forward = ao2_iterator_next(endpoints))) { + ast_cli(a->fd, " %s (%d)\n", forward->id, forward->interested); + ao2_ref(forward, -1); + } + ao2_iterator_destroy(endpoints); + } +} + struct ast_json *app_to_json(const struct stasis_app *app) { RAII_VAR(struct ast_json *, json, NULL, ast_json_unref); diff --git a/res/stasis/app.h b/res/stasis/app.h index 2c8db1ccd..6ed6a295b 100644 --- a/res/stasis/app.h +++ b/res/stasis/app.h @@ -127,8 +127,26 @@ void app_send(struct stasis_app *app, struct ast_json *message); struct app_forwards; +/*! + * \brief Create a JSON representation of a \c stasis_app + * + * \param app The application + * + * \return \c JSON blob on success + * \return \c NULL on error + */ struct ast_json *app_to_json(const struct stasis_app *app); +struct ast_cli_args; + +/*! + * \brief Dump properties of a \c stasis_app to the CLI + * + * \param app The application + * \param a The CLI arguments + */ +void app_to_cli(const struct stasis_app *app, struct ast_cli_args *a); + /*! * \brief Subscribes an application to a channel. * @@ -282,4 +300,12 @@ char *app_get_replace_channel_app(struct ast_channel *chan); */ int app_send_end_msg(struct stasis_app *app, struct ast_channel *chan); +/*! + * \brief Enable/disable debugging on an application + * + * \param app The app to debug + * \param debug If non-zero, enable debugging. If zero, disable. + */ +void app_set_debug(struct stasis_app *app, int debug); + #endif /* _ASTERISK_RES_STASIS_APP_H */ diff --git a/res/stasis/cli.c b/res/stasis/cli.c new file mode 100644 index 000000000..f1dee5521 --- /dev/null +++ b/res/stasis/cli.c @@ -0,0 +1,216 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2016, Digium, Inc. + * + * Matt Jordan <mjordan@digium.com> + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * + * \brief Stasis CLI commands. + * + * \author Matt Jordan <mjordan@digium.com> + */ + +#include "asterisk.h" + +ASTERISK_FILE_VERSION(__FILE__, "$Revision$") + +#include "asterisk/cli.h" +#include "asterisk/astobj2.h" + +#include "cli.h" +#include "app.h" + + +static char *ari_show_apps(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +{ + struct ao2_container *apps; + struct ao2_iterator it_apps; + char *app; + + switch (cmd) { + case CLI_INIT: + e->command = "ari show apps"; + e->usage = + "Usage: ari show apps\n" + " Lists all registered applications.\n" + ; + return NULL; + case CLI_GENERATE: + return NULL; + default: + break; + } + + if (a->argc != 3) { + return CLI_SHOWUSAGE; + } + + apps = stasis_app_get_all(); + if (!apps) { + ast_cli(a->fd, "Unable to retrieve registered applications!\n"); + return CLI_FAILURE; + } + + ast_cli(a->fd, "Application Name \n"); + ast_cli(a->fd, "=========================\n"); + it_apps = ao2_iterator_init(apps, 0); + while ((app = ao2_iterator_next(&it_apps))) { + ast_cli(a->fd, "%-25.25s\n", app); + ao2_ref(app, -1); + } + + ao2_iterator_destroy(&it_apps); + ao2_ref(apps, -1); + + return CLI_SUCCESS; +} + +struct app_complete { + /*! Nth app to search for */ + int state; + /*! Which app currently on */ + int which; +}; + +static int complete_ari_app_search(void *obj, void *arg, void *data, int flags) +{ + struct app_complete *search = data; + + if (++search->which > search->state) { + return CMP_MATCH; + } + return 0; +} + +static char *complete_ari_app(struct ast_cli_args *a) +{ + RAII_VAR(struct ao2_container *, apps, stasis_app_get_all(), ao2_cleanup); + RAII_VAR(char *, app, NULL, ao2_cleanup); + + struct app_complete search = { + .state = a->n, + }; + + if (!apps) { + ast_cli(a->fd, "Error getting ARI applications\n"); + return CLI_FAILURE; + } + + app = ao2_callback_data(apps, + ast_strlen_zero(a->word) ? 0 : OBJ_PARTIAL_KEY, + complete_ari_app_search, (char*)a->word, &search); + + return app ? ast_strdup(app) : NULL; +} + +static char *complete_ari_show_app(struct ast_cli_args *a) +{ + if (a->pos == 3) { + return complete_ari_app(a); + } + + return NULL; +} + +static char *ari_show_app(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +{ + void *app; + + switch (cmd) { + case CLI_INIT: + e->command = "ari show app"; + e->usage = + "Usage: ari show app <application>\n" + " Provide detailed information about a registered application.\n" + ; + return NULL; + case CLI_GENERATE: + return complete_ari_show_app(a); + default: + break; + } + + if (a->argc != 4) { + return CLI_SHOWUSAGE; + } + + app = stasis_app_get_by_name(a->argv[3]); + if (!app) { + return CLI_FAILURE; + } + + app_to_cli(app, a); + + ao2_ref(app, -1); + + return CLI_SUCCESS; +} + +static char *ari_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +{ + void *app; + int debug; + + switch (cmd) { + case CLI_INIT: + e->command = "ari set debug"; + e->usage = + "Usage: ari set debug <application> <on|off>\n" + " Enable or disable debugging on a specific application.\n" + ; + return NULL; + case CLI_GENERATE: + return complete_ari_show_app(a); + default: + break; + } + + if (a->argc != 5) { + return CLI_SHOWUSAGE; + } + + app = stasis_app_get_by_name(a->argv[3]); + if (!app) { + return CLI_FAILURE; + } + + debug = !strcmp(a->argv[4], "on"); + app_set_debug(app, debug); + ast_cli(a->fd, "Debugging on '%s' %s\n", + app_name(app), + debug ? "enabled" : "disabled"); + + ao2_ref(app, -1); + + return CLI_SUCCESS; +} + +static struct ast_cli_entry cli_ari[] = { + AST_CLI_DEFINE(ari_show_apps, "List registered ARI applications"), + AST_CLI_DEFINE(ari_show_app, "Display details of a registered ARI application"), + AST_CLI_DEFINE(ari_set_debug, "Enable/disable debugging of an ARI application"), +}; + + +int cli_init(void) +{ + return ast_cli_register_multiple(cli_ari, ARRAY_LEN(cli_ari)); +} + +void cli_cleanup(void) +{ + ast_cli_unregister_multiple(cli_ari, ARRAY_LEN(cli_ari)); +} diff --git a/res/stasis/cli.h b/res/stasis/cli.h new file mode 100644 index 000000000..49235c7b3 --- /dev/null +++ b/res/stasis/cli.h @@ -0,0 +1,43 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2016, Digium, Inc. + * + * Matt Jordan <mjordan@digium.com> + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#ifndef _ASTERISK_RES_STASIS_CLI_H +#define _ASTERISK_RES_STASIS_CLI_H + +/*! \file + * + * \brief Internal API for Stasis application CLI commands + * + * \author Matt Jordan <mjordan@digium.com> + * \since 13.13.0 + */ + +/*! + * \brief Initialize the CLI commands + * + * \retval 0 on success + * \retval non-zero on error + */ +int cli_init(void); + +/*! + * \brief Cleanup the CLI commands + */ +void cli_cleanup(void); + +#endif /* _ASTERISK_RES_STASIS_CLI_H */ diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile index 07a6c9cd6..209e681cd 100644 --- a/third-party/pjproject/Makefile +++ b/third-party/pjproject/Makefile @@ -125,11 +125,17 @@ libpj%.a: .rebuild_needed source/build.mak $(CMD_PREFIX) $(MAKE) -C $(dir $(shell dirname $@))/build $(@F) $(REALLY_QUIET) -@rm -rf .rebuild_needed +# pjsua needs resample and g711 to successfully run the testsuite +libresample%.a: .rebuild_needed source/build.mak + $(ECHO_PREFIX) Compiling lib $(@F) + $(CMD_PREFIX) $(MAKE) -C $(dir $(shell dirname $@))/build/resample all $(REALLY_QUIET) + -@rm -rf .rebuild_needed + # We need to compile pjlib, then pjlib-util, then the rest # so we separate them out and create the dependencies PJLIB_LIB_FILES = $(foreach lib,$(PJ_LIB_FILES),$(if $(findstring libpj-,$(lib)),$(lib),)) PJLIB_UTIL_LIB_FILES = $(foreach lib,$(PJ_LIB_FILES),$(if $(findstring libpjlib-util,$(lib)),$(lib),)) -PJSIP_LIB_FILES = $(filter-out $(PJLIB_LIB_FILES) $(PJLIB_UTIL_LIB_FILES),$(PJ_LIB_FILES)) +PJSIP_LIB_FILES = $(filter-out $(PJLIB_LIB_FILES) $(PJLIB_UTIL_LIB_FILES) $(APP_THIRD_PARTY_LIB_FILES),$(PJ_LIB_FILES)) ALL_LIB_FILES = $(PJLIB_LIB_FILES) $(PJLIB_UTIL_LIB_FILES) $(PJSIP_LIB_FILES) $(PJLIB_UTIL_LIB_FILES): $(PJLIB_LIB_FILES) @@ -152,7 +158,7 @@ source/pjsip-apps/lib/libasterisk_malloc_debug.a: source/pjsip-apps/lib/asterisk $(CMD_PREFIX) ar qs $@ $< >/dev/null 2>&1 $(apps): APP = $(filter pj%,$(subst -, ,$(notdir $@))) -$(apps): pjproject.symbols +$(apps): pjproject.symbols $(APP_THIRD_PARTY_LIB_FILES) $(ECHO_PREFIX) Compiling $(APP) $(CMD_PREFIX) +$(MAKE) -C source/pjsip-apps/build $(filter pj%,$(subst -, ,$(notdir $@))) $(REALLY_QUIET) diff --git a/third-party/pjproject/Makefile.rules b/third-party/pjproject/Makefile.rules index 62d5a4653..531a259d3 100644 --- a/third-party/pjproject/Makefile.rules +++ b/third-party/pjproject/Makefile.rules @@ -9,7 +9,6 @@ PJPROJECT_CONFIG_OPTS = --prefix=/opt/pjproject \ --disable-gsm-codec \ --disable-ilbc-codec \ --disable-l16-codec \ - --disable-g711-codec \ --disable-g722-codec \ --disable-g7221-codec \ --disable-opencore-amr \ @@ -23,7 +22,6 @@ PJPROJECT_CONFIG_OPTS = --prefix=/opt/pjproject \ --disable-oss \ --disable-sdl \ --disable-libyuv \ - --disable-resample \ --disable-ffmpeg \ --disable-openh264 \ --disable-ipp \ @@ -31,5 +29,5 @@ PJPROJECT_CONFIG_OPTS = --prefix=/opt/pjproject \ --without-external-srtp ifeq ($(shell uname -s),Linux) - PJPROJECT_CONFIG_OPTS += --enable-epoll + PJPROJECT_CONFIG_OPTS += --enable-epoll endif diff --git a/third-party/pjproject/apply_patches b/third-party/pjproject/apply_patches index 69a0ad0c1..5f9fde283 100755 --- a/third-party/pjproject/apply_patches +++ b/third-party/pjproject/apply_patches @@ -28,16 +28,6 @@ if [ ! "$(ls -A $patchdir/*.patch 2>/dev/null)" ] ; then exit 0 fi -if patch --dry-run </dev/null >/dev/null 2>&1 ; then - DRY_RUN=--dry-run -else - DRY_RUN=-C -fi - -for patchfile in $patchdir/*.patch ; do - ${PATCH} -d $sourcedir -p1 -s -r- -f -N $DRY_RUN -i "$patchfile" || (echo "Patchfile $(basename $patchfile) failed to apply" >&2 ; exit 1) || exit 1 -done - for patchfile in "$patchdir"/*.patch ; do [ -z $quiet ] && echo "Applying patch $(basename $patchfile)" ${PATCH} -d "$sourcedir" -p1 -s -i "$patchfile" || exit 1 diff --git a/third-party/pjproject/patches/0000-remove-third-party.patch b/third-party/pjproject/patches/0000-remove-third-party.patch index aca7f0198..2e3bb5f9f 100644 --- a/third-party/pjproject/patches/0000-remove-third-party.patch +++ b/third-party/pjproject/patches/0000-remove-third-party.patch @@ -1,5 +1,5 @@ diff --git a/build.mak.in b/build.mak.in -index 802211c..006d887 100644 +index 802211c..25fd05e 100644 --- a/build.mak.in +++ b/build.mak.in @@ -1,4 +1,3 @@ @@ -7,7 +7,7 @@ index 802211c..006d887 100644 include $(PJDIR)/version.mak export PJ_DIR := $(PJDIR) -@@ -9,7 +9,7 @@ export HOST_NAME := unix +@@ -9,7 +8,7 @@ export HOST_NAME := unix export CC_NAME := gcc export TARGET_NAME := @target@ export CROSS_COMPILE := @ac_cross_compile@ @@ -16,7 +16,7 @@ index 802211c..006d887 100644 export SHLIB_SUFFIX := @ac_shlib_suffix@ export prefix := @prefix@ -@@ -28,114 +28,6 @@ export APP_THIRD_PARTY_EXT := +@@ -28,19 +27,6 @@ export APP_THIRD_PARTY_EXT := export APP_THIRD_PARTY_LIBS := export APP_THIRD_PARTY_LIB_FILES := @@ -33,22 +33,13 @@ index 802211c..006d887 100644 -endif -endif - --ifeq (@ac_pjmedia_resample@,libresample) --APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) --ifeq ($(PJ_SHARED_LIBRARIES),) --ifeq (@ac_resample_dll@,1) --export PJ_RESAMPLE_DLL := 1 --APP_THIRD_PARTY_LIBS += -lresample --APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX) --else --APP_THIRD_PARTY_LIBS += -lresample-$(TARGET_NAME) --endif --else --APP_THIRD_PARTY_LIBS += -lresample --APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX) --endif --endif -- + ifeq (@ac_pjmedia_resample@,libresample) + APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) + ifeq ($(PJ_SHARED_LIBRARIES),) +@@ -57,85 +43,6 @@ APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFI + endif + endif + -ifneq (@ac_no_gsm_codec@,1) -ifeq (@ac_external_gsm@,1) -# External GSM library @@ -131,7 +122,7 @@ index 802211c..006d887 100644 # Additional flags @ac_build_mak_vars@ -@@ -149,7 +41,7 @@ SDL_CFLAGS = @ac_sdl_cflags@ +@@ -149,7 +56,7 @@ SDL_CFLAGS = @ac_sdl_cflags@ SDL_LDFLAGS = @ac_sdl_ldflags@ # FFMPEG flags @@ -140,7 +131,7 @@ index 802211c..006d887 100644 FFMPEG_LDFLAGS = @ac_ffmpeg_ldflags@ # Video4Linux2 -@@ -157,7 +49,7 @@ V4L2_CFLAGS = @ac_v4l2_cflags@ +@@ -157,7 +64,7 @@ V4L2_CFLAGS = @ac_v4l2_cflags@ V4L2_LDFLAGS = @ac_v4l2_ldflags@ # OPENH264 flags |