Merge branch 'signalwire:master' into execute_on_hold
This commit is contained in:
commit
0b03fecf7a
|
@ -8,7 +8,7 @@ Visit [https://signalwire.com](https://signalwire.com/) or https://github.com/
|
|||
|
||||
FreeSWITCH is available on [Github](https://github.com/signalwire/freeswitch) in source code format. You can checkout the development branch and build for many popular platforms including Linux, Windows, MacOSX and BSD. There is an issue tracker and pull request system available as part of the repo online.
|
||||
|
||||
See [https://freeswitch.com/#getting-started](https://freeswitch.com/#getting-started) for more detailed instructions.
|
||||
See https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/ for more detailed instructions.
|
||||
|
||||
## Additional Help
|
||||
|
||||
|
@ -40,7 +40,7 @@ Step by step tutorials to install FreeSWITCH from packages:
|
|||
### Build from source
|
||||
|
||||
Example Dockerfiles to build FreeSWITCH and dependencies from source:
|
||||
* https://github.com/signalwire/freeswitch/tree/dockerfile/docker/examples
|
||||
* https://github.com/signalwire/freeswitch/tree/master/docker/examples
|
||||
|
||||
Step by step tutorials to build FreeSWITCH with provided dependency packages:
|
||||
* [Debian](https://freeswitch.org/confluence/display/FREESWITCH/Debian#Debian-buildfromsource) [<b>Recommended</b>]
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Send an e-mail to security@signalwire.com to report a vulnerability. If accepted, we'll create a security advisory and add you and your team as collaborators. Please allow our team sufficient time to resolve the vulnerability before disclosing it; we'll remain in contact about the fix and may ask for your assistance to verify it is resolved.
|
|
@ -1 +1 @@
|
|||
1.10.9-dev
|
||||
1.10.10-dev
|
||||
|
|
|
@ -137,13 +137,13 @@
|
|||
By default without specifying any crypto suites FreeSWITCH will offer
|
||||
crypto suites from strongest to weakest accepting the strongest each
|
||||
endpoint has in common. If you wish to force specific crypto suites you
|
||||
can do so by appending the suites in a comma separated list in the order
|
||||
can do so by appending the suites in a colon separated list in the order
|
||||
that you wish to offer them in.
|
||||
|
||||
Examples:
|
||||
|
||||
rtp_secure_media=mandatory:AES_CM_256_HMAC_SHA1_80,AES_CM_256_HMAC_SHA1_32
|
||||
rtp_secure_media=true:AES_CM_256_HMAC_SHA1_80,AES_CM_256_HMAC_SHA1_32
|
||||
rtp_secure_media=mandatory:AES_CM_256_HMAC_SHA1_80:AES_CM_256_HMAC_SHA1_32
|
||||
rtp_secure_media=true:AES_CM_256_HMAC_SHA1_80:AES_CM_256_HMAC_SHA1_32
|
||||
rtp_secure_media=optional:AES_CM_256_HMAC_SHA1_80
|
||||
rtp_secure_media=true:AES_CM_256_HMAC_SHA1_80
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
# Must change all of the below together
|
||||
# For a release, set revision for that tagged release as well and uncomment
|
||||
AC_INIT([freeswitch], [1.10.9-dev], bugs@freeswitch.org)
|
||||
AC_INIT([freeswitch], [1.10.10-dev], bugs@freeswitch.org)
|
||||
AC_SUBST(SWITCH_VERSION_MAJOR, [1])
|
||||
AC_SUBST(SWITCH_VERSION_MINOR, [10])
|
||||
AC_SUBST(SWITCH_VERSION_MICRO, [9-dev])
|
||||
AC_SUBST(SWITCH_VERSION_MICRO, [10-dev])
|
||||
AC_SUBST(SWITCH_VERSION_REVISION, [])
|
||||
AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, [])
|
||||
|
||||
|
@ -716,7 +716,7 @@ PKG_CHECK_MODULES([SPANDSP], [spandsp >= 3.0],[
|
|||
AC_MSG_ERROR([no usable spandsp; please install spandsp3 devel package or equivalent])
|
||||
])
|
||||
|
||||
PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.13.6],[
|
||||
PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.13.14],[
|
||||
AM_CONDITIONAL([HAVE_SOFIA_SIP],[true])],[
|
||||
AC_MSG_ERROR([no usable sofia-sip; please install sofia-sip-ua devel package or equivalent])
|
||||
])
|
||||
|
@ -1518,7 +1518,7 @@ PKG_CHECK_MODULES([V8FS_STATIC], [v8-6.1_static >= 6.1.298],[
|
|||
])
|
||||
])
|
||||
|
||||
PKG_CHECK_MODULES([KS], [libks >= 1.1.0],[
|
||||
PKG_CHECK_MODULES([KS], [libks >= 1.8.2],[
|
||||
AM_CONDITIONAL([HAVE_KS],[true])],[
|
||||
if module_enabled mod_verto; then
|
||||
AC_MSG_ERROR([You need to either install libks or disable mod_verto in modules.conf])
|
||||
|
|
|
@ -332,7 +332,7 @@ Build-Depends:
|
|||
uuid-dev, libexpat1-dev, libgdbm-dev, libdb-dev,
|
||||
# used by many modules
|
||||
libcurl4-openssl-dev | libcurl4-gnutls-dev | libcurl-dev,
|
||||
bison, zlib1g-dev, libsofia-sip-ua-dev (>= 1.13.6),
|
||||
bison, zlib1g-dev, libsofia-sip-ua-dev (>= 1.13.14),
|
||||
libspandsp3-dev,
|
||||
# used to format the private freeswitch apt-repo key properly
|
||||
gnupg,
|
||||
|
@ -371,7 +371,7 @@ Description: Cross-Platform Scalable Multi-Protocol Soft Switch
|
|||
|
||||
Package: libfreeswitch1
|
||||
Architecture: amd64 armhf
|
||||
Depends: \${shlibs:Depends}, \${misc:Depends}, libsofia-sip-ua0 (>= 1.13.6)
|
||||
Depends: \${shlibs:Depends}, \${misc:Depends}, libsofia-sip-ua0 (>= 1.13.14)
|
||||
Recommends:
|
||||
Suggests: libfreeswitch1-dbg
|
||||
Conflicts: freeswitch-all (<= 1.6.7)
|
||||
|
|
|
@ -31,13 +31,18 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install \
|
|||
# mod_pgsql
|
||||
libpq-dev \
|
||||
# mod_sndfile
|
||||
libsndfile1-dev libflac-dev libogg-dev libvorbis-dev
|
||||
|
||||
libsndfile1-dev libflac-dev libogg-dev libvorbis-dev \
|
||||
# mod_shout
|
||||
libshout3-dev libmpg123-dev libmp3lame-dev
|
||||
|
||||
RUN cd /usr/src/libs/libks && cmake . -DCMAKE_INSTALL_PREFIX=/usr -DWITH_LIBBACKTRACE=1 && make install
|
||||
RUN cd /usr/src/libs/sofia-sip && ./bootstrap.sh && ./configure CFLAGS="-g -ggdb" --with-pic --with-glib=no --without-doxygen --disable-stun --prefix=/usr && make -j`nproc --all` && make install
|
||||
RUN cd /usr/src/libs/spandsp && ./bootstrap.sh && ./configure CFLAGS="-g -ggdb" --with-pic --prefix=/usr && make -j`nproc --all` && make install
|
||||
RUN cd /usr/src/libs/signalwire-c && PKG_CONFIG_PATH=/usr/lib/pkgconfig cmake . -DCMAKE_INSTALL_PREFIX=/usr && make install
|
||||
|
||||
# Enable modules
|
||||
RUN sed -i 's|#formats/mod_shout|formats/mod_shout|' /usr/src/freeswitch/build/modules.conf.in
|
||||
|
||||
RUN cd /usr/src/freeswitch && ./bootstrap.sh -j
|
||||
RUN cd /usr/src/freeswitch && ./configure
|
||||
RUN cd /usr/src/freeswitch && make -j`nproc` && make install
|
||||
|
@ -46,4 +51,4 @@ RUN cd /usr/src/freeswitch && make -j`nproc` && make install
|
|||
RUN apt-get clean
|
||||
|
||||
# Uncomment to cleanup even more
|
||||
#RUN rm -rf /usr/src/*
|
||||
#RUN rm -rf /usr/src/*
|
||||
|
|
|
@ -140,7 +140,7 @@ BuildRequires: curl-devel >= 7.19
|
|||
BuildRequires: gcc-c++
|
||||
BuildRequires: libtool >= 1.5.17
|
||||
BuildRequires: openssl-devel >= 1.0.1e
|
||||
BuildRequires: sofia-sip-devel >= 1.13.6
|
||||
BuildRequires: sofia-sip-devel >= 1.13.14
|
||||
BuildRequires: spandsp3-devel >= 3.0
|
||||
BuildRequires: pcre-devel
|
||||
BuildRequires: speex-devel
|
||||
|
|
|
@ -617,6 +617,7 @@ srtp/build/compile
|
|||
/curl-*/
|
||||
/sqlite-*.zip
|
||||
/sqlite-*/
|
||||
/sqlite/
|
||||
/ldns/
|
||||
/portaudio/
|
||||
portaudio.*.log
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "fspr_pools.h"
|
||||
#include "fspr_errno.h"
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && defined(_DARWIN_C_SOURCE)
|
||||
#if !defined(NSIG) && !defined(_ANSI_SOURCE) && defined(_DARWIN_C_SOURCE)
|
||||
#define NSIG __DARWIN_NSIG
|
||||
#endif
|
||||
|
||||
|
|
|
@ -323,10 +323,10 @@
|
|||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\sqlite-amalgamation-3080401\sqlite3.c" />
|
||||
<ClCompile Include="..\..\sqlite\sqlite3.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\sqlite-amalgamation-3080401\sqlite3.h" />
|
||||
<ClInclude Include="..\..\sqlite\sqlite3.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
|
@ -310,7 +310,7 @@ extern struct switch_session_manager session_manager;
|
|||
|
||||
|
||||
switch_status_t switch_core_sqldb_init(const char **err);
|
||||
void switch_core_sqldb_destroy();
|
||||
void switch_core_sqldb_destroy(void);
|
||||
switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_t manage);
|
||||
void switch_core_sqldb_stop(void);
|
||||
void switch_core_session_init(switch_memory_pool_t *pool);
|
||||
|
|
|
@ -448,7 +448,7 @@ SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *des
|
|||
* \param[in] width The raw data width
|
||||
* \param[in] height The raw data height
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_img_from_raw(switch_image_t *dest, void *src, switch_img_fmt_t fmt, int width, int height);
|
||||
SWITCH_DECLARE(switch_status_t) switch_img_from_raw(switch_image_t** destP, void *src, switch_img_fmt_t fmt, int width, int height);
|
||||
SWITCH_DECLARE(switch_image_t *) switch_img_write_text_img(int w, int h, switch_bool_t full, const char *text);
|
||||
|
||||
SWITCH_DECLARE(switch_image_t *) switch_img_read_file(const char* file_name);
|
||||
|
|
|
@ -1591,6 +1591,8 @@ GCC_DIAG_ON(deprecated-declarations)
|
|||
context->vid_ready = 1;
|
||||
switch_queue_push(context->eh.video_queue, img);
|
||||
context->last_vid_push = switch_time_now();
|
||||
} else {
|
||||
switch_img_free(&img);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1969,9 +1969,10 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
|
|||
playback_array(agent_session, o_announce);
|
||||
}
|
||||
|
||||
/* This is used for the waiting caller to quit waiting for a agent */
|
||||
/* This is used to set the reason for callcenter_function breakout */
|
||||
switch_channel_set_variable(member_channel, "cc_agent_found", "true");
|
||||
switch_channel_set_variable(member_channel, "cc_agent_uuid", agent_uuid);
|
||||
|
||||
if (switch_true(switch_channel_get_variable(member_channel, SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE)) || switch_true(switch_channel_get_variable(agent_channel, SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE))) {
|
||||
switch_channel_set_flag(member_channel, CF_BYPASS_MEDIA_AFTER_BRIDGE);
|
||||
}
|
||||
|
@ -1990,6 +1991,12 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
|
|||
switch_channel_set_variable(agent_channel, "cc_agent_bridged", "false");
|
||||
switch_channel_set_variable(member_channel, "cc_agent_bridged", "false");
|
||||
|
||||
/* Set member to Abandoned state, previous Trying */
|
||||
sql = switch_mprintf("UPDATE members SET state = '%q', session_uuid = '', abandoned_epoch = '%" SWITCH_TIME_T_FMT "' WHERE uuid = '%q' AND instance_id = '%q'",
|
||||
cc_member_state2str(CC_MEMBER_STATE_ABANDONED), local_epoch_time_now(NULL), h->member_uuid, globals.cc_instance_id);
|
||||
cc_execute_sql(NULL, sql, NULL);
|
||||
switch_safe_free(sql);
|
||||
|
||||
if ((o_announce = switch_channel_get_variable(member_channel, "cc_bridge_failed_outbound_announce"))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_DEBUG, "Playing bridge failed audio to agent %s, audio: %s\n", h->agent_name, o_announce);
|
||||
playback_array(agent_session, o_announce);
|
||||
|
@ -2008,9 +2015,15 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
|
|||
bridged = 1;
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_DEBUG, "Member \"%s\" %s is bridged to agent %s\n",
|
||||
h->member_cid_name, h->member_cid_number, h->agent_name);
|
||||
|
||||
switch_channel_set_variable(member_channel, "cc_agent_bridged", "true");
|
||||
switch_channel_set_variable(agent_channel, "cc_agent_bridged", "true");
|
||||
switch_channel_set_variable(member_channel, "cc_agent_uuid", agent_uuid);
|
||||
|
||||
/* Update member to Answered state, previous Trying */
|
||||
sql = switch_mprintf("UPDATE members SET state = '%q', bridge_epoch = '%" SWITCH_TIME_T_FMT "' WHERE uuid = '%q' AND instance_id = '%q'",
|
||||
cc_member_state2str(CC_MEMBER_STATE_ANSWERED), local_epoch_time_now(NULL), h->member_uuid, globals.cc_instance_id);
|
||||
cc_execute_sql(NULL, sql, NULL);
|
||||
switch_safe_free(sql);
|
||||
}
|
||||
|
||||
if (bridged) {
|
||||
|
@ -2111,7 +2124,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
|
|||
}
|
||||
|
||||
} else {
|
||||
/* Agent didn't answer or originate failed */
|
||||
/* Agent didn't answer or originate/bridge failed */
|
||||
int delay_next_agent_call = 0;
|
||||
switch_channel_t *member_channel = switch_core_session_get_channel(member_session);
|
||||
switch_channel_clear_app_flag_key(CC_APP_KEY, member_channel, CC_APP_AGENT_CONNECTING);
|
||||
|
@ -3051,6 +3064,10 @@ SWITCH_STANDARD_APP(callcenter_function)
|
|||
switch_channel_set_variable(member_channel, "cc_side", "member");
|
||||
switch_channel_set_variable(member_channel, "cc_member_uuid", member_uuid);
|
||||
|
||||
/* Clear flags in case previously set */
|
||||
switch_channel_set_variable(member_channel, "cc_agent_found", NULL);
|
||||
switch_channel_set_variable(member_channel, "cc_agent_bridged", NULL);
|
||||
|
||||
/* Add manually imported score */
|
||||
if (cc_base_score) {
|
||||
cc_base_score_int += atoi(cc_base_score);
|
||||
|
@ -3178,8 +3195,8 @@ SWITCH_STANDARD_APP(callcenter_function)
|
|||
args.buf = (void *) &ht;
|
||||
args.buflen = sizeof(h);
|
||||
|
||||
/* An agent was found, time to exit and let the bridge do it job */
|
||||
if ((p = switch_channel_get_variable(member_channel, "cc_agent_found")) && (agent_found = switch_true(p))) {
|
||||
/* If the bridge didn't break the loop, break out now */
|
||||
if ((p = switch_channel_get_variable(member_channel, "cc_agent_bridged")) && (agent_found = switch_true(p))) {
|
||||
break;
|
||||
}
|
||||
/* If the member thread set a different reason, we monitor it so we can quit the wait */
|
||||
|
@ -3201,8 +3218,6 @@ SWITCH_STANDARD_APP(callcenter_function)
|
|||
switch_channel_set_variable(member_channel, "cc_exit_key", buf);
|
||||
h->member_cancel_reason = CC_MEMBER_CANCEL_REASON_EXIT_WITH_KEY;
|
||||
break;
|
||||
} else if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch_status_t status = switch_ivr_collect_digits_callback(member_session, &args, 0, 0);
|
||||
|
@ -3230,12 +3245,18 @@ SWITCH_STANDARD_APP(callcenter_function)
|
|||
h->running = 0;
|
||||
}
|
||||
|
||||
/* Stop uuid_broadcasts */
|
||||
switch_core_session_flush_private_events(member_session);
|
||||
switch_channel_stop_broadcast(member_channel);
|
||||
switch_channel_set_flag_value(member_channel, CF_BREAK, 2);
|
||||
|
||||
/* Check if we were removed because FS Core(BREAK) asked us to */
|
||||
if (h->member_cancel_reason == CC_MEMBER_CANCEL_REASON_NONE && !agent_found) {
|
||||
h->member_cancel_reason = CC_MEMBER_CANCEL_REASON_BREAK_OUT;
|
||||
}
|
||||
|
||||
switch_channel_set_variable(member_channel, "cc_agent_found", NULL);
|
||||
|
||||
/* Canceled for some reason */
|
||||
if (!switch_channel_up(member_channel) || h->member_cancel_reason != CC_MEMBER_CANCEL_REASON_NONE) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_DEBUG, "Member %s <%s> abandoned waiting in queue %s\n", switch_str_nil(switch_channel_get_variable(member_channel, "caller_id_name")), switch_str_nil(switch_channel_get_variable(member_channel, "caller_id_number")), queue_name);
|
||||
|
@ -3282,12 +3303,6 @@ SWITCH_STANDARD_APP(callcenter_function)
|
|||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_DEBUG, "Member %s <%s> is answered by an agent in queue %s\n", switch_str_nil(switch_channel_get_variable(member_channel, "caller_id_name")), switch_str_nil(switch_channel_get_variable(member_channel, "caller_id_number")), queue_name);
|
||||
|
||||
/* Update member state */
|
||||
sql = switch_mprintf("UPDATE members SET state = '%q', bridge_epoch = '%" SWITCH_TIME_T_FMT "' WHERE uuid = '%q' AND instance_id = '%q'",
|
||||
cc_member_state2str(CC_MEMBER_STATE_ANSWERED), local_epoch_time_now(NULL), member_uuid, globals.cc_instance_id);
|
||||
cc_execute_sql(NULL, sql, NULL);
|
||||
switch_safe_free(sql);
|
||||
|
||||
/* Update some channel variables for xml_cdr needs */
|
||||
switch_channel_set_variable_printf(member_channel, "cc_cause", "%s", "answered");
|
||||
if ((queue = get_queue(queue_name))) {
|
||||
|
|
|
@ -845,6 +845,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cidlookup_load)
|
|||
Macro expands to: switch_status_t mod_cidlookup_shutdown() */
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cidlookup_shutdown)
|
||||
{
|
||||
switch_xml_config_cleanup(instructions);
|
||||
switch_event_unbind(&reload_xml_event);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -2417,7 +2417,7 @@ SWITCH_STANDARD_API(uptime_function)
|
|||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#define CTL_SYNTAX "[recover|send_sighup|hupall|pause [inbound|outbound]|resume [inbound|outbound]|shutdown [cancel|elegant|asap|now|restart]|sps|sps_peak_reset|sync_clock|sync_clock_when_idle|reclaim_mem|max_sessions|min_dtmf_duration [num]|max_dtmf_duration [num]|default_dtmf_duration [num]|min_idle_cpu|loglevel [level]|debug_level [level]|mdns_resolve [enable|disable]]"
|
||||
#define CTL_SYNTAX "[api_expansion [on|off]|recover|send_sighup|hupall|pause [inbound|outbound]|resume [inbound|outbound]|shutdown [cancel|elegant|asap|now|restart]|sps|sps_peak_reset|sync_clock|sync_clock_when_idle|reclaim_mem|max_sessions|min_dtmf_duration [num]|max_dtmf_duration [num]|default_dtmf_duration [num]|min_idle_cpu|loglevel [level]|debug_level [level]|mdns_resolve [enable|disable]]"
|
||||
SWITCH_STANDARD_API(ctl_function)
|
||||
{
|
||||
int argc;
|
||||
|
@ -5653,22 +5653,26 @@ SWITCH_STANDARD_API(alias_function)
|
|||
#define COALESCE_SYNTAX "[^^<delim>]<value1>,<value2>,..."
|
||||
SWITCH_STANDARD_API(coalesce_function)
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
char *data = (char *) cmd;
|
||||
char *mydata = NULL, *argv[256] = { 0 };
|
||||
char *arg = (char *) cmd;
|
||||
int argc = -1;
|
||||
char delim = ',';
|
||||
|
||||
if (data && *data && (mydata = strdup(data))) {
|
||||
argc = switch_separate_string(mydata, ',', argv,
|
||||
if (!zstr(arg) && *arg == '^' && *(arg+1) == '^') {
|
||||
arg += 2;
|
||||
delim = *arg++;
|
||||
}
|
||||
|
||||
if (!zstr(arg) && (mydata = strdup(arg))) {
|
||||
argc = switch_separate_string(mydata, delim, argv,
|
||||
(sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argc > 0) {
|
||||
int i;
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (argv[i] && *argv[i]) {
|
||||
if (!zstr(argv[i])) {
|
||||
stream->write_function(stream, argv[i]);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -5676,7 +5680,9 @@ SWITCH_STANDARD_API(coalesce_function)
|
|||
stream->write_function(stream, "-USAGE: %s\n", COALESCE_SYNTAX);
|
||||
}
|
||||
|
||||
return status;
|
||||
switch_safe_free(mydata);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#define SHOW_SYNTAX "codec|endpoint|application|api|dialplan|file|timer|calls [count]|channels [count|like <match string>]|calls|detailed_calls|bridged_calls|detailed_bridged_calls|aliases|complete|chat|management|modules|nat_map|say|interfaces|interface_types|tasks|limits|status"
|
||||
|
@ -7745,6 +7751,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
|
|||
switch_console_set_complete("add complete add");
|
||||
switch_console_set_complete("add complete del");
|
||||
switch_console_set_complete("add db_cache status");
|
||||
switch_console_set_complete("add fsctl api_expansion on");
|
||||
switch_console_set_complete("add fsctl api_expansion off");
|
||||
switch_console_set_complete("add fsctl debug_level");
|
||||
switch_console_set_complete("add fsctl debug_pool");
|
||||
switch_console_set_complete("add fsctl debug_sql");
|
||||
|
@ -7793,6 +7801,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
|
|||
switch_console_set_complete("add fsctl shutdown restart elegant");
|
||||
switch_console_set_complete("add fsctl sps");
|
||||
switch_console_set_complete("add fsctl sync_clock");
|
||||
switch_console_set_complete("add fsctl sync_clock_when_idle");
|
||||
switch_console_set_complete("add fsctl flush_db_handles");
|
||||
switch_console_set_complete("add fsctl min_idle_cpu");
|
||||
switch_console_set_complete("add fsctl send_sighup");
|
||||
|
|
|
@ -3803,6 +3803,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
|||
switch_image_t *use_img = NULL;
|
||||
|
||||
if (!omember->session || !switch_channel_test_flag(omember->channel, CF_VIDEO_READY) ||
|
||||
(conference_utils_test_flag(omember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) && !conference_utils_member_test_flag(omember, MFLAG_CAN_BE_SEEN)) ||
|
||||
switch_core_session_media_flow(omember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(omember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -854,7 +854,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi
|
|||
}
|
||||
|
||||
if (context->rawImage && (context->debug || !context->overlay_count)) {
|
||||
switch_img_from_raw(frame->img, (uint8_t *)context->rawImage->imageData, SWITCH_IMG_FMT_RGB24, context->rawImage->width, context->rawImage->height);
|
||||
switch_img_from_raw(&frame->img, (uint8_t *)context->rawImage->imageData, SWITCH_IMG_FMT_RGB24, context->rawImage->width, context->rawImage->height);
|
||||
}
|
||||
|
||||
int abs = 0;
|
||||
|
|
|
@ -497,6 +497,7 @@ switch_status_t ldns_lookup(const char *number, const char *root, char *server_n
|
|||
/* create a new resolver from /etc/resolv.conf */
|
||||
if (res) {
|
||||
ldns_resolver_free(res);
|
||||
res = NULL;
|
||||
}
|
||||
s = ldns_resolver_new_frm_file(&res, NULL);
|
||||
}
|
||||
|
|
|
@ -370,6 +370,11 @@ static switch_bool_t ladspa_callback(switch_media_bug_t *bug, void *user_data, s
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pvt->ldesc->activate) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "ACTIVATE\n");
|
||||
pvt->ldesc->activate(pvt->handle);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -382,6 +387,10 @@ static switch_bool_t ladspa_callback(switch_media_bug_t *bug, void *user_data, s
|
|||
}
|
||||
|
||||
if (pvt->handle && pvt->ldesc) {
|
||||
if (pvt->ldesc->deactivate) {
|
||||
pvt->ldesc->deactivate(pvt->handle);
|
||||
}
|
||||
|
||||
pvt->ldesc->cleanup(pvt->handle);
|
||||
}
|
||||
|
||||
|
|
|
@ -645,7 +645,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi
|
|||
}
|
||||
|
||||
|
||||
switch_img_from_raw(frame->img, patch_data, SWITCH_IMG_FMT_ARGB, frame->img->d_w, frame->img->d_h);
|
||||
switch_img_from_raw(&frame->img, patch_data, SWITCH_IMG_FMT_ARGB, frame->img->d_w, frame->img->d_h);
|
||||
|
||||
switch_img_free(&img);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ extern int switch_amr_array_lshift(uint8_t lshift, uint8_t *buf, int a_len)
|
|||
if (!buf || !a_len)
|
||||
return (-1);
|
||||
|
||||
if ((lshift < 0) || (lshift > 8))
|
||||
if (lshift > 8)
|
||||
return (-1);
|
||||
|
||||
first_byte = 0xFF >> lshift;
|
||||
|
|
|
@ -817,6 +817,7 @@ static switch_status_t switch_opus_decode(switch_codec_t *codec,
|
|||
int fec = 0, plc = 0;
|
||||
int32_t frame_size = 0, last_frame_size = 0;
|
||||
uint32_t frame_samples;
|
||||
uint8_t buf[SWITCH_RTP_MAX_BUF_LEN];
|
||||
|
||||
if (!context) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
@ -842,7 +843,6 @@ static switch_status_t switch_opus_decode(switch_codec_t *codec,
|
|||
}
|
||||
if (codec->cur_frame && (jb = switch_core_session_get_jb(session, SWITCH_MEDIA_TYPE_AUDIO))) {
|
||||
switch_frame_t frame = { 0 };
|
||||
uint8_t buf[SWITCH_RTP_MAX_BUF_LEN];
|
||||
uint32_t ts = 0;
|
||||
uint16_t seq = 0;
|
||||
|
||||
|
@ -1105,7 +1105,7 @@ static switch_status_t switch_opus_keep_fec_enabled(switch_codec_t *codec)
|
|||
uint32_t LBRR_threshold_bitrate,LBRR_rate_thres_bps,real_target_bitrate ;
|
||||
opus_int32 a32,b32;
|
||||
uint32_t fs = context->enc_frame_size * 1000 / (codec->implementation->microseconds_per_packet / 1000);
|
||||
float frame_rate =(float)(1000 / (codec->implementation->microseconds_per_packet / 1000));
|
||||
float frame_rate =(float)(1000 / (float)(codec->implementation->microseconds_per_packet / 1000));
|
||||
uint32_t step = (codec->implementation->microseconds_per_packet / 1000) != 60 ? 8000 / (codec->implementation->microseconds_per_packet / 1000 ) : 134 ;
|
||||
|
||||
opus_encoder_ctl(context->encoder_object, OPUS_GET_BITRATE(¤t_bitrate));
|
||||
|
|
|
@ -629,6 +629,8 @@ done:
|
|||
|
||||
error:
|
||||
|
||||
pgsql_free_result(&result);
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -142,6 +142,7 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
|
||||
if (!caller_profile || zstr(caller_profile->destination_number)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Obtaining Profile!\n");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -150,6 +151,7 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
if (!switch_config_open_file(&cfg, cf)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf);
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -226,12 +228,14 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
}
|
||||
} else {
|
||||
if (pattern && strcasecmp(pattern, field_data)) {
|
||||
switch_safe_free(field_expanded);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (cid) {
|
||||
if (strcasecmp(cid, caller_profile->caller_id_number)) {
|
||||
switch_safe_free(field_expanded);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -266,15 +270,19 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
switch_perform_substitution(re, proceed, argument, field_data, substituted, sizeof(substituted), ovector);
|
||||
argument = substituted;
|
||||
}
|
||||
|
||||
switch_regex_safe_free(re);
|
||||
|
||||
if (!extension) {
|
||||
if (zstr(field_data)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "No extension!\n");
|
||||
switch_safe_free(field_expanded);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((extension = switch_caller_extension_new(session, field_data, field_data)) == 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
|
||||
switch_safe_free(field_expanded);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ if HAVE_STIRSHAKEN
|
|||
test_test_sofia_funcs_CFLAGS += -DHAVE_STIRSHAKEN
|
||||
endif
|
||||
test_test_sofia_funcs_LDFLAGS = $(AM_LDFLAGS) -avoid-version -no-undefined $(freeswitch_LDFLAGS) $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) $(STIRSHAKEN_LIBS)
|
||||
test_test_sofia_funcs_LDADD = libsofiamod.la $(SOFIA_SIP_LIBS)
|
||||
test_test_sofia_funcs_LDADD = libsofiamod.la $(SOFIA_SIP_LIBS) $(STIRSHAKEN_LIBS)
|
||||
|
||||
test_test_nuafail_SOURCES = test/test_nuafail.c
|
||||
test_test_nuafail_CFLAGS = $(AM_CFLAGS) $(SOFIA_SIP_CFLAGS) $(STIRSHAKEN_CFLAGS) -DSWITCH_TEST_BASE_DIR_FOR_CONF=\"${abs_builddir}/test\" -DSWITCH_TEST_BASE_DIR_OVERRIDE=\"${abs_builddir}/test\"
|
||||
|
|
|
@ -2065,7 +2065,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
|
||||
nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
|
||||
TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), SIPTAG_PAYLOAD_STR(message), TAG_END());
|
||||
} else if (update_allowed && ua && (switch_stristr("polycom", ua) ||
|
||||
} else if (update_allowed && ua && (switch_channel_var_true(tech_pvt->channel, "update_ignore_ua") ||
|
||||
switch_stristr("polycom", ua) ||
|
||||
(switch_stristr("aastra", ua) && !switch_stristr("Intelligate", ua)) ||
|
||||
(switch_stristr("cisco/spa50", ua) ||
|
||||
switch_stristr("cisco/spa525", ua)) ||
|
||||
|
@ -4667,7 +4668,7 @@ static switch_status_t sofia_manage(char *relative_oid, switch_management_action
|
|||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static int protect_dest_uri(switch_caller_profile_t *cp)
|
||||
int protect_dest_uri(switch_caller_profile_t *cp)
|
||||
{
|
||||
char *p = cp->destination_number, *o = p;
|
||||
char *q = NULL, *e = NULL, *qenc = NULL;
|
||||
|
|
|
@ -2949,6 +2949,9 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
|||
|
||||
sofia_set_pflag_locked(profile, PFLAG_WORKER_RUNNING);
|
||||
|
||||
/* Seed PRNG for functions within worker thread */
|
||||
srand((unsigned)((intptr_t) switch_thread_self() + switch_micro_time_now()));
|
||||
|
||||
while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING))) {
|
||||
|
||||
if (tick) {
|
||||
|
@ -10299,6 +10302,7 @@ void sofia_handle_sip_i_reinvite(switch_core_session_t *session,
|
|||
}
|
||||
}
|
||||
|
||||
sofia_glue_set_extra_headers(session, sip, SOFIA_SIP_HEADER_PREFIX);
|
||||
switch_channel_execute_on(channel, "execute_on_sip_reinvite");
|
||||
}
|
||||
|
||||
|
@ -11483,6 +11487,16 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
|
|||
}
|
||||
}
|
||||
|
||||
if (sip->sip_identity) {
|
||||
sip_identity_t *id;
|
||||
|
||||
for (id = sip->sip_identity; id; id = id->id_next) {
|
||||
if (!zstr(id->id_value)) {
|
||||
switch_channel_add_variable_var_check(channel, "sip_identity", id->id_value, SWITCH_FALSE, SWITCH_STACK_PUSH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sip->sip_identity && sip->sip_identity->id_value) {
|
||||
switch_channel_set_variable(channel, "sip_h_identity", sip->sip_identity->id_value);
|
||||
}
|
||||
|
|
|
@ -446,14 +446,16 @@ void sofia_glue_store_session_id(switch_core_session_t *session, sofia_profile_t
|
|||
|
||||
a_id = switch_strip_whitespace(duped);
|
||||
|
||||
if (zstr(a_id)) return;
|
||||
if (zstr(a_id)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
p = strchr(a_id, ';');
|
||||
if (p) *p = '\0';
|
||||
|
||||
if (!sofia_glue_is_valid_session_uuid(a_id)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Session-ID: Ignoring \"%s\" parsed as \"%s\"\n", header, a_id);
|
||||
return;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* RFC7329 compatibility */
|
||||
|
@ -483,7 +485,7 @@ void sofia_glue_store_session_id(switch_core_session_t *session, sofia_profile_t
|
|||
if (!p) {
|
||||
switch_channel_set_flag(channel, CF_RFC7329_COMPAT);
|
||||
switch_channel_set_flag_partner(channel, CF_RFC7329_COMPAT);
|
||||
return;
|
||||
goto end;
|
||||
}
|
||||
p++;
|
||||
remote_param = strstr(p, "remote=");
|
||||
|
@ -491,7 +493,7 @@ void sofia_glue_store_session_id(switch_core_session_t *session, sofia_profile_t
|
|||
switch_channel_set_flag(channel, CF_RFC7329_COMPAT);
|
||||
switch_channel_set_flag_partner(channel, CF_RFC7329_COMPAT);
|
||||
sofia_glue_check_filter_generic_params(session, profile, p);
|
||||
return;
|
||||
goto end;
|
||||
}
|
||||
b_id = remote_param + 7;
|
||||
if (!zstr(b_id) && strlen(b_id) == RFC7989_SESSION_UUID_LEN /*32*/) {
|
||||
|
@ -503,6 +505,9 @@ void sofia_glue_store_session_id(switch_core_session_t *session, sofia_profile_t
|
|||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Session-ID: invalid uuid, ignored.\n");
|
||||
}
|
||||
|
||||
end:
|
||||
switch_safe_free(a_id);
|
||||
}
|
||||
|
||||
/* add "Session-ID:" header */
|
||||
|
|
|
@ -399,6 +399,7 @@ switch_status_t sofia_presence_chat_send(switch_event_t *message_event)
|
|||
switch_safe_free(route_uri);
|
||||
switch_safe_free(ffrom);
|
||||
switch_safe_free(dup);
|
||||
switch_safe_free(extra_headers);
|
||||
|
||||
if (profile) {
|
||||
switch_thread_rwlock_unlock(profile->rwlock);
|
||||
|
@ -3755,7 +3756,6 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
|||
|
||||
if ((sub_max_deviation_var = profile->sip_subscription_max_deviation)) {
|
||||
int sub_deviation;
|
||||
srand( (unsigned) ( (unsigned)(intptr_t)switch_thread_self() + switch_micro_time_now() ) );
|
||||
/* random negative number between 0 and negative sub_max_deviation_var: */
|
||||
sub_deviation = ( rand() % sub_max_deviation_var ) - sub_max_deviation_var;
|
||||
if ( (exp_delta + sub_deviation) > 45 ) {
|
||||
|
|
|
@ -884,7 +884,6 @@ long sofia_reg_uniform_distribution(int max)
|
|||
int result;
|
||||
int range = max + 1;
|
||||
|
||||
srand((unsigned)((intptr_t) switch_thread_self() + switch_micro_time_now()));
|
||||
result = (int)((double)rand() / (((double)RAND_MAX + (double)1) / range));
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, "Generated random %ld, max is %d\n", (long) result, max);
|
||||
|
@ -894,8 +893,7 @@ long sofia_reg_uniform_distribution(int max)
|
|||
void sofia_reg_check_ping_expire(sofia_profile_t *profile, time_t now, int interval)
|
||||
{
|
||||
char *sql;
|
||||
int mean = interval / 2;
|
||||
long next, irand;
|
||||
long next;
|
||||
char buf[32] = "";
|
||||
int count;
|
||||
|
||||
|
@ -952,8 +950,7 @@ void sofia_reg_check_ping_expire(sofia_profile_t *profile, time_t now, int inter
|
|||
/* only update if needed */
|
||||
if (count) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, "Updating ping expires for profile %s\n", profile->name);
|
||||
irand = mean + sofia_reg_uniform_distribution(interval);
|
||||
next = (long) now + irand;
|
||||
next = (long) now + interval;
|
||||
|
||||
sql = switch_mprintf("update sip_registrations set ping_expires = %ld where hostname='%q' and profile_name='%q' and ping_expires <= %ld ",
|
||||
next, mod_sofia_globals.hostname, profile->name, (long) now);
|
||||
|
@ -1765,7 +1762,6 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu
|
|||
(( exp_max_deviation_var = profile->sip_expires_max_deviation )) ) {
|
||||
if (exp_max_deviation_var > 0) {
|
||||
int exp_deviation;
|
||||
srand( (unsigned) ( (unsigned)(intptr_t)switch_thread_self() + switch_micro_time_now() ) );
|
||||
/* random number between negative exp_max_deviation_var and positive exp_max_deviation_var: */
|
||||
exp_deviation = ( rand() % ( exp_max_deviation_var * 2 ) ) - exp_max_deviation_var;
|
||||
exptime += exp_deviation;
|
||||
|
@ -2013,23 +2009,26 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu
|
|||
sql = switch_mprintf("insert into sip_registrations "
|
||||
"(call_id,sip_user,sip_host,presence_hosts,contact,status,rpid,expires,"
|
||||
"user_agent,server_user,server_host,profile_name,hostname,network_ip,network_port,sip_username,sip_realm,"
|
||||
"mwi_user,mwi_host, orig_server_host, orig_hostname, sub_host, ping_status, ping_count, force_ping) "
|
||||
"values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q','%q','%q','%q', '%q', %d, %d)",
|
||||
"mwi_user,mwi_host, orig_server_host, orig_hostname, sub_host, ping_status, ping_count, ping_expires, force_ping) "
|
||||
"values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q','%q','%q','%q', '%q', %d, %ld, %d)",
|
||||
call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : "",
|
||||
contact_str, reg_desc, rpid, (long) reg_time + (long) exptime + profile->sip_expires_late_margin,
|
||||
agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname, network_ip, network_port_c, username, realm,
|
||||
mwi_user, mwi_host, guess_ip4, mod_sofia_globals.hostname, sub_host, "Reachable", 0, force_ping);
|
||||
mwi_user, mwi_host, guess_ip4, mod_sofia_globals.hostname, sub_host, "Reachable", 0,
|
||||
(long) switch_epoch_time_now(NULL) + sofia_reg_uniform_distribution(profile->iping_seconds), force_ping);
|
||||
} else {
|
||||
sql = switch_mprintf("update sip_registrations set call_id='%q',"
|
||||
"sub_host='%q', network_ip='%q',network_port='%q',"
|
||||
"presence_hosts='%q', server_host='%q', orig_server_host='%q',"
|
||||
"hostname='%q', orig_hostname='%q',"
|
||||
"expires = %ld, force_ping=%d where sip_user='%q' and sip_username='%q' and sip_host='%q' and contact='%q'",
|
||||
"expires = %ld, ping_expires=%ld, force_ping=%d "
|
||||
"where sip_user='%q' and sip_username='%q' and sip_host='%q' and contact='%q'",
|
||||
call_id, sub_host, network_ip, network_port_c,
|
||||
profile->presence_hosts ? profile->presence_hosts : "", guess_ip4, guess_ip4,
|
||||
mod_sofia_globals.hostname, mod_sofia_globals.hostname,
|
||||
(long) reg_time + (long) exptime + profile->sip_expires_late_margin, force_ping,
|
||||
to_user, username, reg_host, contact_str);
|
||||
(long) reg_time + (long) exptime + profile->sip_expires_late_margin,
|
||||
(long) switch_epoch_time_now(NULL) + sofia_reg_uniform_distribution(profile->iping_seconds),
|
||||
force_ping, to_user, username, reg_host, contact_str);
|
||||
}
|
||||
|
||||
if (sql) {
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
|
||||
#include <switch.h>
|
||||
#include <test/switch_test.h>
|
||||
#include "../mod_sofia.c"
|
||||
|
||||
int protect_dest_uri(switch_caller_profile_t *cp);
|
||||
|
||||
static int timeout_sec = 10;
|
||||
static switch_interval_time_t delay_start_ms = 5000;
|
||||
|
|
|
@ -86,6 +86,7 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
|
|||
|
||||
if ( setsockopt(handle->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(one)) != 0 ) {
|
||||
mcast_socket_close(handle);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -103,11 +104,13 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
|
|||
|
||||
if (setsockopt(handle->sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&mreq, sizeof(mreq)) < 0) {
|
||||
mcast_socket_close(handle);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (bind(handle->sock, (struct sockaddr *) &handle->recv_addr, sizeof(handle->recv_addr)) < 0) {
|
||||
mcast_socket_close(handle);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -124,7 +127,11 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
|
|||
addr_criteria.ai_flags |= AI_NUMERICHOST;
|
||||
|
||||
snprintf(service, sizeof(service), "%d", port);
|
||||
getaddrinfo(host, service, &addr_criteria, &mcast_addr);
|
||||
if (getaddrinfo(host, service, &addr_criteria, &mcast_addr) != 0) {
|
||||
mcast_socket_close(handle);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
memset(&handle->recv_addr6, 0, sizeof(handle->recv_addr6));
|
||||
|
@ -134,11 +141,14 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
|
|||
|
||||
memcpy(&mreq.ipv6mr_multiaddr, &((struct sockaddr_in6 *)mcast_addr->ai_addr)->sin6_addr, sizeof(struct in6_addr));
|
||||
|
||||
freeaddrinfo(mcast_addr);
|
||||
|
||||
mreq.ipv6mr_interface = 0;
|
||||
setsockopt(handle->sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, (const char *)&mreq, sizeof(mreq));
|
||||
|
||||
if (bind(handle->sock, (struct sockaddr *) &handle->recv_addr6, sizeof(handle->recv_addr6)) < 0) {
|
||||
mcast_socket_close(handle);
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -771,10 +771,6 @@ static void jsock_send_event(cJSON *event)
|
|||
}
|
||||
switch_thread_rwlock_unlock(verto_globals.event_channel_rwlock);
|
||||
|
||||
if (use_jsock) {
|
||||
switch_thread_rwlock_unlock(use_jsock->rwlock);
|
||||
use_jsock = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static jrpc_func_t jrpc_get_func(jsock_t *jsock, const char *method)
|
||||
|
@ -1069,7 +1065,7 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
|
|||
const char *use_passwd = NULL, *verto_context = NULL, *verto_dialplan = NULL;
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Login sucessful for user: %s domain: %s\n", id, domain ? domain : "N/A");
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Login sucessful for user: %s domain: %s\n", id, domain);
|
||||
|
||||
jsock->logintime = now;
|
||||
jsock->id = switch_core_strdup(jsock->pool, id);
|
||||
|
@ -1970,6 +1966,7 @@ static void client_run(jsock_t *jsock)
|
|||
{
|
||||
int flags = KWS_BLOCK;
|
||||
int idle = 0;
|
||||
ks_json_t *params = NULL;
|
||||
|
||||
if (jsock->profile->vhosts) {
|
||||
flags |= KWS_STAY_OPEN;
|
||||
|
@ -1977,7 +1974,14 @@ static void client_run(jsock_t *jsock)
|
|||
}
|
||||
|
||||
ks_pool_open(&jsock->kpool);
|
||||
|
||||
#if defined(KS_VERSION_NUM) && KS_VERSION_NUM >= 20000
|
||||
params = ks_json_create_object();
|
||||
ks_json_add_number_to_object(params, "payload_size_max", 1000000);
|
||||
if (kws_init_ex(&jsock->ws, jsock->client_socket, (jsock->ptype & PTYPE_CLIENT_SSL) ? jsock->profile->ssl_ctx : NULL, 0, flags, jsock->kpool, params) != KS_STATUS_SUCCESS) {
|
||||
#else
|
||||
if (kws_init(&jsock->ws, jsock->client_socket, (jsock->ptype & PTYPE_CLIENT_SSL) ? jsock->profile->ssl_ctx : NULL, 0, flags, jsock->kpool) != KS_STATUS_SUCCESS) {
|
||||
#endif
|
||||
log_and_exit(SWITCH_LOG_NOTICE, "%s WS SETUP FAILED\n", jsock->name);
|
||||
}
|
||||
|
||||
|
@ -2123,6 +2127,8 @@ static void client_run(jsock_t *jsock)
|
|||
detach_jsock(jsock);
|
||||
kws_destroy(&jsock->ws);
|
||||
ks_pool_close(&jsock->kpool);
|
||||
ks_json_delete(¶ms);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -6769,6 +6775,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_verto_load)
|
|||
ks_ssl_init_skip(KS_TRUE);
|
||||
ks_init();
|
||||
|
||||
#if defined(KS_VERSION_NUM) && KS_VERSION_NUM < 20000
|
||||
kws_set_global_payload_size_max(1000000);
|
||||
#endif
|
||||
|
||||
if (switch_event_reserve_subclass(MY_EVENT_LOGIN) != SWITCH_STATUS_SUCCESS) {
|
||||
ks_shutdown();
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_LOGIN);
|
||||
|
|
|
@ -70,6 +70,11 @@
|
|||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>AMQP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
|
|
@ -87,6 +87,11 @@ typedef struct mod_amqp_keypart_s {
|
|||
int size;
|
||||
} mod_amqp_keypart_t;
|
||||
|
||||
typedef struct {
|
||||
switch_event_types_t id;
|
||||
char* subclass;
|
||||
} mod_amqp_events_t;
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
|
||||
|
@ -103,7 +108,7 @@ typedef struct {
|
|||
/* Array to store the possible event subscriptions */
|
||||
int event_subscriptions;
|
||||
switch_event_node_t *event_nodes[SWITCH_EVENT_ALL];
|
||||
switch_event_types_t event_ids[SWITCH_EVENT_ALL];
|
||||
mod_amqp_events_t events[SWITCH_EVENT_ALL];
|
||||
switch_event_node_t *eventNode;
|
||||
|
||||
|
||||
|
|
|
@ -203,7 +203,11 @@ switch_status_t mod_amqp_connection_create(mod_amqp_connection_t **conn, switch_
|
|||
amqp_boolean_t ssl_verify_peer = 1;
|
||||
|
||||
if (zstr(name)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Connection missing name attribute\n%s\n", switch_xml_toxml(cfg, 1));
|
||||
char *str_tmp = switch_xml_toxml(cfg, 1);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Connection missing name attribute\n%s\n", str_tmp);
|
||||
switch_safe_free(str_tmp);
|
||||
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
|
@ -260,6 +264,7 @@ switch_status_t mod_amqp_connection_create(mod_amqp_connection_t **conn, switch_
|
|||
new_con->ssl_verify_peer = ssl_verify_peer;
|
||||
|
||||
*conn = new_con;
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -186,7 +186,8 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg)
|
|||
profile->name = switch_core_strdup(profile->pool, name);
|
||||
profile->running = 1;
|
||||
memset(profile->format_fields, 0, (MAX_ROUTING_KEY_FORMAT_FIELDS + 1) * sizeof(mod_amqp_keypart_t));
|
||||
profile->event_ids[0] = SWITCH_EVENT_ALL;
|
||||
profile->events[0].id = SWITCH_EVENT_ALL;
|
||||
profile->events[0].subclass = SWITCH_EVENT_SUBCLASS_ANY;
|
||||
profile->event_subscriptions = 1;
|
||||
profile->conn_root = NULL;
|
||||
profile->conn_active = NULL;
|
||||
|
@ -269,7 +270,14 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg)
|
|||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Found %d subscriptions\n", profile->event_subscriptions);
|
||||
|
||||
for (arg = 0; arg < profile->event_subscriptions; arg++) {
|
||||
if (switch_name_event(argv[arg], &(profile->event_ids[arg])) != SWITCH_STATUS_SUCCESS) {
|
||||
char *subclass = SWITCH_EVENT_SUBCLASS_ANY;
|
||||
if ((subclass = strchr(argv[arg], '^'))) {
|
||||
*subclass++ = '\0';
|
||||
}
|
||||
|
||||
if (switch_name_event(argv[arg], &(profile->events[arg].id)) == SWITCH_STATUS_SUCCESS) {
|
||||
profile->events[arg].subclass = subclass;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "The switch event %s was not recognised.\n", argv[arg]);
|
||||
}
|
||||
}
|
||||
|
@ -344,13 +352,13 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg)
|
|||
/* Subscribe events */
|
||||
for (i = 0; i < profile->event_subscriptions; i++) {
|
||||
if (switch_event_bind_removable("AMQP",
|
||||
profile->event_ids[i],
|
||||
SWITCH_EVENT_SUBCLASS_ANY,
|
||||
profile->events[i].id,
|
||||
profile->events[i].subclass,
|
||||
mod_amqp_producer_event_handler,
|
||||
profile,
|
||||
&(profile->event_nodes[i])) != SWITCH_STATUS_SUCCESS) {
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot bind to event handler %d!\n",(int)profile->event_ids[i]);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot bind to event handler %d!\n",(int)profile->events[i].id);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,16 +153,18 @@ static switch_status_t load_config(switch_xml_t input_cfg)
|
|||
}
|
||||
|
||||
if ((settings = switch_xml_child(cfg, "settings"))) {
|
||||
|
||||
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
|
||||
char *var = (char *) switch_xml_attr_soft(param, "name");
|
||||
char *val = (char *) switch_xml_attr_soft(param, "value");
|
||||
char *val_no_whitespace = switch_strip_whitespace(val);
|
||||
|
||||
if (!strcasecmp(var, "address")) {
|
||||
set_global_dst_addrs(switch_strip_whitespace(val));
|
||||
set_global_dst_addrs(val_no_whitespace);
|
||||
} else if (!strcasecmp(var, "source_address")) {
|
||||
set_global_src_addr(switch_strip_whitespace(val));
|
||||
set_global_src_addr(val_no_whitespace);
|
||||
} else if (!strcasecmp(var, "source_address_ipv6")) {
|
||||
set_global_src_addr6(switch_strip_whitespace(val));
|
||||
set_global_src_addr6(val_no_whitespace);
|
||||
} else if (!strcasecmp(var, "bindings")) {
|
||||
set_global_bindings(val);
|
||||
} else if (!strcasecmp(var, "port")) {
|
||||
|
@ -183,6 +185,8 @@ static switch_status_t load_config(switch_xml_t input_cfg)
|
|||
} else if (!strcasecmp(var, "loopback")) {
|
||||
globals.loopback = switch_true(val);
|
||||
}
|
||||
|
||||
switch_safe_free(val_no_whitespace);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,6 +194,7 @@ static switch_status_t load_config(switch_xml_t input_cfg)
|
|||
|
||||
|
||||
if (globals.bindings) {
|
||||
|
||||
for (cur = globals.bindings; cur; count++) {
|
||||
switch_event_types_t type;
|
||||
|
||||
|
@ -293,13 +298,13 @@ static switch_status_t initialize_sockets(switch_xml_t input_cfg)
|
|||
char *host_string;
|
||||
char ipv6_first_octet[3];
|
||||
|
||||
memset(&globals.dst_sockaddrs[globals.num_dst_addrs].sockaddr, 0, sizeof(dst_sockaddr_t));
|
||||
|
||||
if (globals.num_dst_addrs > MAX_DST_HOSTS) {
|
||||
if (globals.num_dst_addrs >= MAX_DST_HOSTS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot add destination address: %s, exceeded maximum of %d\n", dst_hosts[i], MAX_DST_HOSTS);
|
||||
continue;
|
||||
}
|
||||
|
||||
memset(&globals.dst_sockaddrs[globals.num_dst_addrs], 0, sizeof(dst_sockaddr_t));
|
||||
|
||||
if (switch_sockaddr_info_get(&globals.dst_sockaddrs[globals.num_dst_addrs].sockaddr, dst_hosts[i], SWITCH_UNSPEC, globals.port, 0, module_pool) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find address: %s\n", dst_hosts[i]);
|
||||
switch_goto_status(SWITCH_STATUS_TERM, fail);
|
||||
|
@ -627,8 +632,8 @@ static void event_handler(switch_event_t *event)
|
|||
len = strlen(packet) + strlen((char *) MAGIC);
|
||||
#endif
|
||||
buf = malloc(len + 1);
|
||||
memset(buf, 0, len + 1);
|
||||
switch_assert(buf);
|
||||
memset(buf, 0, len + 1);
|
||||
|
||||
#ifdef HAVE_OPENSSL
|
||||
if (globals.psk) {
|
||||
|
@ -777,7 +782,11 @@ static switch_status_t process_packet(char* packet, size_t len)
|
|||
switch_url_decode(val);
|
||||
switch_snprintf(tmpname, sizeof(tmpname), "Orig-%s", var);
|
||||
switch_event_add_header_string(local_event, SWITCH_STACK_BOTTOM, tmpname, val);
|
||||
var = term + 1;
|
||||
if (term) {
|
||||
var = term + 1;
|
||||
} else {
|
||||
var = NULL;
|
||||
}
|
||||
} else {
|
||||
/* This should be our magic packet, done processing incoming headers */
|
||||
break;
|
||||
|
|
|
@ -384,10 +384,11 @@ static switch_status_t read_page(pdf_file_context_t *context)
|
|||
if (ret == MagickFalse && context->exception->severity != UndefinedException) {
|
||||
CatchException(context->exception);
|
||||
free(storage);
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
switch_img_from_raw(context->img, storage, SWITCH_IMG_FMT_BGR24, w, h);
|
||||
switch_img_from_raw(&context->img, storage, SWITCH_IMG_FMT_BGR24, w, h);
|
||||
free(storage);
|
||||
} else {
|
||||
switch_image_t *img = switch_img_alloc(NULL, SWITCH_IMG_FMT_ARGB, image->columns, image->rows, 0);
|
||||
|
@ -397,6 +398,8 @@ static switch_status_t read_page(pdf_file_context_t *context)
|
|||
|
||||
if (ret == MagickFalse && context->exception->severity != UndefinedException) {
|
||||
CatchException(context->exception);
|
||||
switch_img_free(&img);
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -295,6 +295,7 @@ static switch_status_t switch_opusfile_open(switch_file_handle_t *handle, const
|
|||
context->of = op_open_file(path, &ret);
|
||||
if (!context->of) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "[OGG/OPUS File] Error opening %s\n", path);
|
||||
switch_thread_rwlock_unlock(context->rwlock);
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
|
|
|
@ -294,64 +294,57 @@ static switch_status_t load_config(JavaVMOption **javaOptions, int *optionCount,
|
|||
|
||||
static switch_status_t create_java_vm(JavaVMOption *options, int optionCount, vm_control_t * vmControl)
|
||||
{
|
||||
jint (JNICALL *pJNI_CreateJavaVM)(JavaVM**,void**,void*);
|
||||
switch_status_t status;
|
||||
jint (JNICALL *pJNI_CreateJavaVM)(JavaVM**,void**,void*);
|
||||
switch_status_t status;
|
||||
char *derr = NULL;
|
||||
|
||||
pJNI_CreateJavaVM = (jint (*)(JavaVM **, void **, void *))switch_dso_func_sym(javaVMHandle, "JNI_CreateJavaVM", &derr);
|
||||
|
||||
if (!derr)
|
||||
{
|
||||
JNIEnv *env;
|
||||
JavaVMInitArgs initArgs;
|
||||
jint res;
|
||||
if (!derr) {
|
||||
JNIEnv *env;
|
||||
JavaVMInitArgs initArgs;
|
||||
jint res;
|
||||
|
||||
memset(&initArgs, 0, sizeof(initArgs));
|
||||
initArgs.version = JNI_VERSION_1_4;
|
||||
initArgs.nOptions = optionCount;
|
||||
initArgs.options = options;
|
||||
initArgs.ignoreUnrecognized = JNI_TRUE;
|
||||
memset(&initArgs, 0, sizeof(initArgs));
|
||||
initArgs.version = JNI_VERSION_1_4;
|
||||
initArgs.nOptions = optionCount;
|
||||
initArgs.options = options;
|
||||
initArgs.ignoreUnrecognized = JNI_TRUE;
|
||||
|
||||
res = pJNI_CreateJavaVM(&javaVM, (void*) &env, &initArgs);
|
||||
if (res == JNI_OK)
|
||||
{
|
||||
// call FindClass here already so that the Java VM executes the static
|
||||
// initializer (@see org.freeswitch.Launcher) which loads the jni library
|
||||
// so we can use jni functions right away (for example in the startup method)
|
||||
launcherClass = (*env)->FindClass(env, "org/freeswitch/Launcher");
|
||||
if ( launcherClass == NULL )
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to find 'org.freeswitch.Launcher' class!\n");
|
||||
(*env)->ExceptionDescribe(env);
|
||||
}
|
||||
res = pJNI_CreateJavaVM(&javaVM, (void*) &env, &initArgs);
|
||||
if (res == JNI_OK) {
|
||||
/* call FindClass here already so that the Java VM executes the static
|
||||
initializer (@see org.freeswitch.Launcher) which loads the jni library
|
||||
so we can use jni functions right away (for example in the startup method) */
|
||||
|
||||
// store a global reference for use in the launch_java() function
|
||||
launcherClass = (*env)->NewGlobalRef(env, launcherClass);
|
||||
if ( launcherClass == NULL )
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Out of memory!\n");
|
||||
(*env)->ExceptionDescribe(env);
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
launcherClass = (*env)->FindClass(env, "org/freeswitch/Launcher");
|
||||
if ( launcherClass == NULL ) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to find 'org.freeswitch.Launcher' class!\n");
|
||||
(*env)->ExceptionDescribe(env);
|
||||
}
|
||||
|
||||
(*javaVM)->DetachCurrentThread(javaVM);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error creating Java VM!\n");
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Specified Java VM doesn't have JNI_CreateJavaVM\n");
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
return status;
|
||||
/* store a global reference for use in the launch_java() function */
|
||||
launcherClass = (*env)->NewGlobalRef(env, launcherClass);
|
||||
if ( launcherClass == NULL ) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Out of memory!\n");
|
||||
(*env)->ExceptionDescribe(env);
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
} else {
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
(*javaVM)->DetachCurrentThread(javaVM);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error creating Java VM!\n");
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Specified Java VM doesn't have JNI_CreateJavaVM\n");
|
||||
switch_safe_free(derr);
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_java_load)
|
||||
|
|
|
@ -39405,6 +39405,24 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_event_add_header_stri
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_event_add_header_string_nodup___(void * jarg1, int jarg2, char * jarg3, char * jarg4) {
|
||||
int jresult ;
|
||||
switch_event_t *arg1 = (switch_event_t *) 0 ;
|
||||
switch_stack_t arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (switch_event_t *)jarg1;
|
||||
arg2 = (switch_stack_t)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
result = (switch_status_t)switch_event_add_header_string_nodup(arg1,arg2,(char const *)arg3,(char const *)arg4);
|
||||
jresult = (int)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_event_del_header_val___(void * jarg1, char * jarg2, char * jarg3) {
|
||||
int jresult ;
|
||||
switch_event_t *arg1 = (switch_event_t *) 0 ;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -167,9 +167,15 @@ void Session::do_hangup_hook()
|
|||
arglist = Py_BuildValue("(Os)", Self, what);
|
||||
}
|
||||
|
||||
#if PY_VERSION_HEX <= 0x03080000
|
||||
if (!PyEval_CallObject(hangup_func, arglist)) {
|
||||
PyErr_Print();
|
||||
}
|
||||
#else
|
||||
if (!PyObject_CallObject(hangup_func, arglist)) {
|
||||
PyErr_Print();
|
||||
}
|
||||
#endif
|
||||
|
||||
Py_XDECREF(arglist);
|
||||
Py_XDECREF(hangup_func_arg);
|
||||
|
@ -287,7 +293,7 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp
|
|||
|
||||
PyObject *pyresult, *arglist, *io = NULL;
|
||||
int ts = 0;
|
||||
char *str = NULL, *what = "";
|
||||
char *str = NULL, *what = (char*)"";
|
||||
|
||||
if (TS) {
|
||||
ts++;
|
||||
|
@ -302,9 +308,9 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp
|
|||
if (itype == SWITCH_INPUT_TYPE_DTMF) {
|
||||
switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
|
||||
io = mod_python_conjure_DTMF(dtmf->digit, dtmf->duration);
|
||||
what = "dtmf";
|
||||
what = (char*)"dtmf";
|
||||
} else if (itype == SWITCH_INPUT_TYPE_EVENT){
|
||||
what = "event";
|
||||
what = (char*)"event";
|
||||
io = mod_python_conjure_event((switch_event_t *) input);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unsupported type!\n");
|
||||
|
@ -320,8 +326,12 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp
|
|||
} else {
|
||||
arglist = Py_BuildValue("(OsO)", Self, what, io);
|
||||
}
|
||||
|
||||
if ((pyresult = PyEval_CallObject(cb_function, arglist))) {
|
||||
#if PY_VERSION_HEX <= 0x03080000
|
||||
pyresult = PyEval_CallObject(cb_function, arglist);
|
||||
#else
|
||||
pyresult = PyObject_CallObject(cb_function, arglist);
|
||||
#endif
|
||||
if (pyresult) {
|
||||
str = (char *) PyString_AsString(pyresult);
|
||||
} else {
|
||||
PyErr_Print();
|
||||
|
|
|
@ -354,12 +354,24 @@ static switch_xml_t python_fetch(const char *section,
|
|||
|
||||
switch_xml_t xml = NULL;
|
||||
char *str = NULL;
|
||||
switch_event_t *my_params = NULL;
|
||||
|
||||
if (!zstr(globals.xml_handler)) {
|
||||
char *mycmd = strdup(globals.xml_handler);
|
||||
|
||||
switch_assert(mycmd);
|
||||
|
||||
if (!params) {
|
||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(params);
|
||||
my_params = params;
|
||||
}
|
||||
|
||||
switch_event_add_header_string(params, SWITCH_STACK_TOP, "section", switch_str_nil(section));
|
||||
switch_event_add_header_string(params, SWITCH_STACK_TOP, "tag_name", switch_str_nil(tag_name));
|
||||
switch_event_add_header_string(params, SWITCH_STACK_TOP, "key_name", switch_str_nil(key_name));
|
||||
switch_event_add_header_string(params, SWITCH_STACK_TOP, "key_value", switch_str_nil(key_value));
|
||||
|
||||
eval_some_python("xml_fetch", mycmd, NULL, NULL, params, &str, NULL);
|
||||
|
||||
if (str) {
|
||||
|
@ -372,6 +384,10 @@ static switch_xml_t python_fetch(const char *section,
|
|||
}
|
||||
|
||||
free(mycmd);
|
||||
|
||||
if (my_params) {
|
||||
switch_event_destroy(&my_params);
|
||||
}
|
||||
}
|
||||
|
||||
return xml;
|
||||
|
|
|
@ -196,7 +196,7 @@ static switch_status_t en_say_general_count(switch_say_file_handle_t *sh, char *
|
|||
|
||||
static switch_status_t en_say_time(switch_say_file_handle_t *sh, char *tosay, switch_say_args_t *say_args)
|
||||
{
|
||||
int32_t t = 0;
|
||||
int64_t t = 0;
|
||||
switch_time_t target = 0, target_now = 0;
|
||||
switch_time_exp_t tm, tm_now;
|
||||
uint8_t say_date = 0, say_time = 0, say_year = 0, say_month = 0, say_dow = 0, say_day = 0, say_yesterday = 0, say_today = 0;
|
||||
|
@ -287,7 +287,7 @@ static switch_status_t en_say_time(switch_say_file_handle_t *sh, char *tosay, sw
|
|||
|
||||
if (strchr(tosay, ':')) {
|
||||
switch_time_t tme = switch_str_time(tosay);
|
||||
t = (int32_t) ((tme) / (int64_t) (1000000));
|
||||
t = (int64_t) ((tme) / (int64_t) (1000000));
|
||||
|
||||
target = switch_time_make(t, 0);
|
||||
target_now = switch_micro_time_now();
|
||||
|
|
|
@ -141,6 +141,7 @@ static size_t file_callback(void *ptr, size_t size, size_t nmemb, void *data)
|
|||
static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params,
|
||||
void *user_data)
|
||||
{
|
||||
switch_event_t *my_params = NULL;
|
||||
char filename[512] = "";
|
||||
switch_CURL *curl_handle = NULL;
|
||||
switch_CURLcode cc;
|
||||
|
@ -185,6 +186,7 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
|
|||
if (!params) {
|
||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(params);
|
||||
my_params = params;
|
||||
}
|
||||
|
||||
switch_event_add_header_string(params, SWITCH_STACK_TOP, "hostname", hostname);
|
||||
|
@ -208,13 +210,6 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
|
|||
switch_uuid_format(uuid_str, &uuid);
|
||||
|
||||
switch_snprintf(filename, sizeof(filename), "%s%s%s.tmp.xml", SWITCH_GLOBAL_dirs.temp_dir, SWITCH_PATH_SEPARATOR, uuid_str);
|
||||
curl_handle = switch_curl_easy_init();
|
||||
headers = switch_curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
|
||||
|
||||
if (!strncasecmp(binding->url, "https", 5)) {
|
||||
switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
}
|
||||
|
||||
memset(&config_data, 0, sizeof(config_data));
|
||||
|
||||
|
@ -222,6 +217,14 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
|
|||
config_data.max_bytes = binding->curl_max_bytes;
|
||||
|
||||
if ((config_data.fd = open(filename, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR)) > -1) {
|
||||
curl_handle = switch_curl_easy_init();
|
||||
headers = switch_curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
|
||||
|
||||
if (!strncasecmp(binding->url, "https", 5)) {
|
||||
switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
}
|
||||
|
||||
if (!zstr(binding->cred)) {
|
||||
switch_curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, binding->auth_scheme);
|
||||
switch_curl_easy_setopt(curl_handle, CURLOPT_USERPWD, binding->cred);
|
||||
|
@ -333,6 +336,11 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
|
|||
switch_safe_free(uri);
|
||||
if (binding->use_dynamic_url && dynamic_url != binding->url)
|
||||
switch_safe_free(dynamic_url);
|
||||
|
||||
if (my_params) {
|
||||
switch_event_destroy(&my_params);
|
||||
}
|
||||
|
||||
return xml;
|
||||
}
|
||||
|
||||
|
|
|
@ -614,7 +614,7 @@ abyss_bool websocket_hook(TSession *r)
|
|||
|
||||
if (ret != 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "handshake error %d\n", ret);
|
||||
return FALSE;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (switch_event_bind_removable("websocket", SWITCH_EVENT_CUSTOM, "websocket::stophook", stop_hook_event_handler, wsh, &nodes[node_count++]) != SWITCH_STATUS_SUCCESS) {
|
||||
|
@ -696,8 +696,11 @@ abyss_bool websocket_hook(TSession *r)
|
|||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "wsh->down = %d, node_count = %d\n", wsh->down, node_count);
|
||||
|
||||
switch_yield(2000);
|
||||
|
||||
while (--node_count >= 0) switch_event_unbind(&nodes[node_count]);
|
||||
|
||||
err:
|
||||
ws_destroy(wsh);
|
||||
switch_safe_free(wsh);
|
||||
|
||||
return FALSE;
|
||||
|
|
|
@ -176,6 +176,10 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
|
|||
if (bytes > XML_SCGI_MAX_BYTES) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Data too big!\n");
|
||||
len = -1;
|
||||
if (expanded != (char*)buf) {
|
||||
free(expanded);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -837,7 +837,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
|
|||
}
|
||||
}
|
||||
|
||||
for (x = 0; x < argc && x < 11; x++) {
|
||||
for (x = 0; x < argc; x++) {
|
||||
if (h.words + 1 > argc) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
stream.write_function(&stream, "(a%d like '::%%' or a%d = '' or a%d = '%q')%q",
|
||||
|
|
|
@ -3009,7 +3009,7 @@ SWITCH_DECLARE(switch_bool_t) switch_core_ready_outbound(void)
|
|||
return (switch_test_flag((&runtime), SCF_SHUTTING_DOWN) || switch_test_flag((&runtime), SCF_NO_NEW_OUTBOUND_SESSIONS)) ? SWITCH_FALSE : SWITCH_TRUE;
|
||||
}
|
||||
|
||||
void switch_core_sqldb_destroy()
|
||||
void switch_core_sqldb_destroy(void)
|
||||
{
|
||||
if (switch_test_flag((&runtime), SCF_USE_SQL)) {
|
||||
switch_core_sqldb_stop();
|
||||
|
|
|
@ -3057,7 +3057,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
uint32_t codec_ms = (int) (engine->read_frame.timestamp -
|
||||
engine->last_ts) / (engine->read_impl.samples_per_second / 1000);
|
||||
if (engine->last_seq && (int) (engine->read_frame.seq - engine->last_seq) > 1) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[%s]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s). \n", is_vbr?"VBR":"CBR", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[CBR]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s). \n", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
|
||||
codec_ms = codec_ms / (int) (engine->read_frame.seq - engine->last_seq);
|
||||
}
|
||||
|
||||
|
@ -3080,9 +3080,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
|
||||
if (codec_ms > 120) { /* yeah right */
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
|
||||
"[%s]: Your phone is trying to send timestamps that suggest an increment of %dms per packet\n"
|
||||
"[CBR]: Your phone is trying to send timestamps that suggest an increment of %dms per packet\n"
|
||||
"That seems hard to believe so I am going to go on ahead and um ignore that, mmkay?\n",
|
||||
is_vbr?"VBR":"CBR",
|
||||
(int) codec_ms);
|
||||
engine->check_frames = MAX_CODEC_CHECK_FRAMES;
|
||||
goto skip;
|
||||
|
@ -3092,8 +3091,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
|
||||
if (codec_ms != engine->cur_payload_map->codec_ms) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
|
||||
"[%s]: Asynchronous PTIME not supported, changing our end from %d to %d\n",
|
||||
is_vbr?"VBR":"CBR",
|
||||
"[CBR]: Asynchronous PTIME not supported, changing our end from %d to %d\n",
|
||||
(int) engine->cur_payload_map->codec_ms,
|
||||
(int) codec_ms
|
||||
);
|
||||
|
@ -3123,7 +3121,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
engine->last_ts) / (engine->read_impl.samples_per_second / 1000);
|
||||
|
||||
if (engine->last_seq && (int) (engine->read_frame.seq - engine->last_seq) > 1) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[%s]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s)\n", is_vbr?"VBR":"CBR", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[VBR]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s)\n", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
|
||||
codec_ms = codec_ms / (int) (engine->read_frame.seq - engine->last_seq);
|
||||
}
|
||||
|
||||
|
@ -3142,8 +3140,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
if (codec_ms > 120) {
|
||||
/*will show too many times with packet loss*/
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG3,
|
||||
"[%s]: Remote party is trying to send timestamps that suggest an increment of [%d] ms per packet, which is too high. Ignoring.\n",
|
||||
is_vbr?"VBR":"CBR",
|
||||
"[VBR]: Remote party is trying to send timestamps that suggest an increment of [%d] ms per packet, which is too high. Ignoring.\n",
|
||||
(int) codec_ms);
|
||||
engine->last_ts = engine->read_frame.timestamp;
|
||||
engine->last_seq = engine->read_frame.seq;
|
||||
|
@ -3152,8 +3149,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
|
||||
if (codec_ms != engine->cur_payload_map->codec_ms) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
|
||||
"[%s]: Packet size change detected. Remote PTIME changed from [%d] to [%d]\n",
|
||||
is_vbr?"VBR":"CBR",
|
||||
"[VBR]: Packet size change detected. Remote PTIME changed from [%d] to [%d]\n",
|
||||
(int) engine->cur_payload_map->codec_ms,
|
||||
(int) codec_ms
|
||||
);
|
||||
|
@ -6676,10 +6672,6 @@ SWITCH_DECLARE(void) switch_core_session_write_blank_video(switch_core_session_t
|
|||
if (!height) height = 288;
|
||||
if (!fps) fps = 15;
|
||||
|
||||
if (!(width && height && fps)) {
|
||||
return;
|
||||
}
|
||||
|
||||
fr.packet = buf;
|
||||
fr.packetlen = buflen;
|
||||
fr.data = buf + 12;
|
||||
|
@ -12443,7 +12435,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_media_params(switch_core_sessi
|
|||
*val++ = '\0';
|
||||
}
|
||||
|
||||
if (name && val) {
|
||||
if (val) {
|
||||
if (!strcmp(name, "aspect")) {
|
||||
aspect = val;
|
||||
vid++;
|
||||
|
@ -15864,7 +15856,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
|
|||
|
||||
if (!(switch_core_codec_ready(session->write_codec) && switch_core_codec_ready(frame->codec))) goto error;
|
||||
|
||||
if ((session->write_codec && frame->codec && session->write_codec->implementation != frame->codec->implementation)) {
|
||||
if (frame->codec && session->write_codec->implementation != frame->codec->implementation) {
|
||||
if (session->write_impl.codec_id == frame->codec->implementation->codec_id ||
|
||||
session->write_impl.microseconds_per_packet != frame->codec->implementation->microseconds_per_packet) {
|
||||
ptime_mismatch = TRUE;
|
||||
|
|
|
@ -2380,11 +2380,6 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_
|
|||
int32_t sps = 0;
|
||||
|
||||
|
||||
if (use_uuid && switch_core_hash_find(session_manager.session_table, use_uuid)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Duplicate UUID!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (direction == SWITCH_CALL_DIRECTION_INBOUND && !switch_core_ready_inbound()) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "The system cannot create any inbound sessions at this time.\n");
|
||||
return NULL;
|
||||
|
@ -2406,6 +2401,15 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_
|
|||
|
||||
PROTECT_INTERFACE(endpoint_interface);
|
||||
|
||||
switch_mutex_lock(runtime.session_hash_mutex);
|
||||
if (use_uuid && switch_core_hash_find(session_manager.session_table, use_uuid)) {
|
||||
switch_mutex_unlock(runtime.session_hash_mutex);
|
||||
UNPROTECT_INTERFACE(endpoint_interface);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Duplicate UUID!\n");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(originate_flags & SOF_NO_LIMITS)) {
|
||||
switch_mutex_lock(runtime.throttle_mutex);
|
||||
count = session_manager.session_count;
|
||||
|
@ -2413,12 +2417,14 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_
|
|||
switch_mutex_unlock(runtime.throttle_mutex);
|
||||
|
||||
if (sps <= 0) {
|
||||
switch_mutex_unlock(runtime.session_hash_mutex);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Throttle Error! %d\n", session_manager.session_count);
|
||||
UNPROTECT_INTERFACE(endpoint_interface);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((count + 1) > session_manager.session_limit) {
|
||||
switch_mutex_unlock(runtime.session_hash_mutex);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Over Session Limit! %d\n", session_manager.session_limit);
|
||||
UNPROTECT_INTERFACE(endpoint_interface);
|
||||
return NULL;
|
||||
|
@ -2490,7 +2496,6 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_
|
|||
switch_queue_create(&session->private_event_queue, SWITCH_EVENT_QUEUE_LEN, session->pool);
|
||||
switch_queue_create(&session->private_event_queue_pri, SWITCH_EVENT_QUEUE_LEN, session->pool);
|
||||
|
||||
switch_mutex_lock(runtime.session_hash_mutex);
|
||||
switch_core_hash_insert(session_manager.session_table, session->uuid_str, session);
|
||||
session->id = session_manager.session_id++;
|
||||
session_manager.session_count++;
|
||||
|
@ -3000,7 +3005,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
|
|||
{
|
||||
char *dp[25];
|
||||
char *dpstr;
|
||||
int argc, x, count = 0;
|
||||
int argc, x;
|
||||
uint32_t stack_count = 0;
|
||||
switch_caller_profile_t *profile, *new_profile, *pp = NULL;
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
|
@ -3054,8 +3059,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
|
|||
continue;
|
||||
}
|
||||
|
||||
count++;
|
||||
|
||||
extension = dialplan_interface->hunt_function(session, dparg, new_profile);
|
||||
UNPROTECT_INTERFACE(dialplan_interface);
|
||||
|
||||
|
|
|
@ -3181,6 +3181,8 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName
|
|||
|
||||
if (!(ep = switch_loadable_module_get_endpoint_interface(argv[0]))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "EP ERROR\n");
|
||||
switch_xml_free(xml);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -3521,11 +3521,18 @@ SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *des
|
|||
#endif
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_img_from_raw(switch_image_t *dest, void *src, switch_img_fmt_t fmt, int width, int height)
|
||||
SWITCH_DECLARE(switch_status_t) switch_img_from_raw(switch_image_t **destP, void *src, switch_img_fmt_t fmt, int width, int height)
|
||||
{
|
||||
#ifdef SWITCH_HAVE_YUV
|
||||
uint32_t fourcc;
|
||||
int ret = -1;
|
||||
switch_image_t *dest = NULL;
|
||||
|
||||
if (!destP) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
dest = *destP;
|
||||
|
||||
fourcc = switch_img_fmt2fourcc(fmt);
|
||||
|
||||
|
@ -3574,6 +3581,8 @@ SWITCH_DECLARE(switch_status_t) switch_img_from_raw(switch_image_t *dest, void *
|
|||
0, fourcc);
|
||||
}
|
||||
|
||||
*destP = dest;
|
||||
|
||||
return ret == 0 ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
|
||||
#else
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
@ -3586,10 +3595,12 @@ SWITCH_DECLARE(switch_status_t) switch_img_scale(switch_image_t *src, switch_ima
|
|||
switch_image_t *dest = NULL;
|
||||
int ret = 0;
|
||||
|
||||
if (destP) {
|
||||
dest = *destP;
|
||||
if (!destP) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
dest = *destP;
|
||||
|
||||
switch_assert(width > 0);
|
||||
switch_assert(height > 0);
|
||||
|
||||
|
@ -3615,15 +3626,13 @@ SWITCH_DECLARE(switch_status_t) switch_img_scale(switch_image_t *src, switch_ima
|
|||
kFilterBox);
|
||||
}
|
||||
|
||||
*destP = dest;
|
||||
|
||||
if (ret != 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Scaling Error: ret: %d\n", ret);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (destP) {
|
||||
*destP = dest;
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
#else
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
@ -3637,10 +3646,12 @@ SWITCH_DECLARE(switch_status_t) switch_img_mirror(switch_image_t *src, switch_im
|
|||
switch_image_t *dest = NULL;
|
||||
int ret = 0;
|
||||
|
||||
if (destP) {
|
||||
dest = *destP;
|
||||
if (!destP) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
dest = *destP;
|
||||
|
||||
if (dest && src->fmt != dest->fmt) switch_img_free(&dest);
|
||||
|
||||
if (!dest) dest = switch_img_alloc(NULL, src->fmt, src->d_w, src->d_h, 1);
|
||||
|
@ -3660,15 +3671,13 @@ SWITCH_DECLARE(switch_status_t) switch_img_mirror(switch_image_t *src, switch_im
|
|||
|
||||
}
|
||||
|
||||
*destP = dest;
|
||||
|
||||
if (ret != 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Mirror Error: ret: %d\n", ret);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (destP) {
|
||||
*destP = dest;
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
#else
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
|
|
@ -1909,6 +1909,8 @@ SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, const ch
|
|||
data = (char *) malloc(2048);
|
||||
if (!data) {
|
||||
va_end(ap);
|
||||
switch_xml_free(xml);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
ret = vsnprintf(data, 2048, fmt, ap);
|
||||
|
@ -1918,6 +1920,8 @@ SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, const ch
|
|||
#ifndef HAVE_VASPRINTF
|
||||
free(data);
|
||||
#endif
|
||||
switch_xml_free(xml);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -546,6 +546,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
|||
}
|
||||
|
||||
if (dmachine->pinging) {
|
||||
switch_mutex_unlock(dmachine->mutex);
|
||||
return SWITCH_STATUS_BREAK;
|
||||
}
|
||||
|
||||
|
@ -2129,7 +2130,7 @@ static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data
|
|||
break;
|
||||
}
|
||||
|
||||
if (ep->eavesdropper && switch_core_session_read_lock(ep->eavesdropper) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_session_read_lock(ep->eavesdropper) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_session_write_video_frame(ep->eavesdropper, bug->video_ping_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error writing video to %s\n", switch_core_session_get_name(ep->eavesdropper));
|
||||
ep->errs++;
|
||||
|
@ -2177,10 +2178,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_pop_eavesdropper(switch_cor
|
|||
struct eavesdrop_pvt *ep = (struct eavesdrop_pvt *) switch_core_media_bug_get_user_data(bug);
|
||||
|
||||
if (ep && ep->eavesdropper && ep->eavesdropper != session) {
|
||||
switch_core_session_read_lock(ep->eavesdropper);
|
||||
*sessionp = ep->eavesdropper;
|
||||
switch_core_media_bug_set_flag(bug, SMBF_PRUNE);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
if (switch_core_session_read_lock(ep->eavesdropper) == SWITCH_STATUS_SUCCESS) {
|
||||
*sessionp = ep->eavesdropper;
|
||||
switch_core_media_bug_set_flag(bug, SMBF_PRUNE);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (switch_channel_media_up(b_channel)) {
|
||||
if (read_frame && switch_channel_media_up(b_channel)) {
|
||||
if (switch_core_session_write_video_frame(vh->session_b, read_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_cond_next();
|
||||
continue;
|
||||
|
|
|
@ -909,6 +909,9 @@ static int teletone_handler(teletone_generation_session_t *ts, teletone_tone_map
|
|||
return -1;
|
||||
}
|
||||
wrote = teletone_mux_tones(ts, map);
|
||||
if (wrote <= 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tto->channels != 1) {
|
||||
if (tto->mux_buflen < wrote * 2 * tto->channels) {
|
||||
|
@ -1465,6 +1468,7 @@ typedef struct {
|
|||
int done;
|
||||
switch_thread_t *thread;
|
||||
switch_mutex_t *mutex;
|
||||
switch_mutex_t *fence_mutex;
|
||||
switch_dial_handle_t *dh;
|
||||
} enterprise_originate_handle_t;
|
||||
|
||||
|
@ -1479,9 +1483,13 @@ struct ent_originate_ringback {
|
|||
static void *SWITCH_THREAD_FUNC enterprise_originate_thread(switch_thread_t *thread, void *obj)
|
||||
{
|
||||
enterprise_originate_handle_t *handle = (enterprise_originate_handle_t *) obj;
|
||||
switch_status_t status;
|
||||
|
||||
switch_mutex_lock(handle->fence_mutex);
|
||||
handle->done = 0;
|
||||
handle->status = switch_ivr_originate(NULL, &handle->bleg, &handle->cause,
|
||||
switch_mutex_unlock(handle->fence_mutex);
|
||||
|
||||
status = switch_ivr_originate(NULL, &handle->bleg, &handle->cause,
|
||||
handle->bridgeto, handle->timelimit_sec,
|
||||
handle->table,
|
||||
handle->cid_name_override,
|
||||
|
@ -1492,8 +1500,11 @@ static void *SWITCH_THREAD_FUNC enterprise_originate_thread(switch_thread_t *thr
|
|||
&handle->cancel_cause,
|
||||
handle->dh);
|
||||
|
||||
|
||||
switch_mutex_lock(handle->fence_mutex);
|
||||
handle->status = status;
|
||||
handle->done = 1;
|
||||
switch_mutex_unlock(handle->fence_mutex);
|
||||
|
||||
switch_mutex_lock(handle->mutex);
|
||||
switch_mutex_unlock(handle->mutex);
|
||||
|
||||
|
@ -1697,6 +1708,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
|
|||
switch_dial_handle_dup(&handles[i].dh, hl->handles[i]);
|
||||
}
|
||||
switch_mutex_init(&handles[i].mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_mutex_init(&handles[i].fence_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_mutex_lock(handles[i].mutex);
|
||||
switch_thread_create(&handles[i].thread, thd_attr, enterprise_originate_thread, &handles[i], pool);
|
||||
}
|
||||
|
@ -1738,13 +1750,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
|
|||
|
||||
for (i = 0; i < x_argc; i++) {
|
||||
|
||||
|
||||
switch_mutex_lock(handles[i].fence_mutex);
|
||||
if (handles[i].done == 0) {
|
||||
running++;
|
||||
} else if (handles[i].done == 1) {
|
||||
if (handles[i].status == SWITCH_STATUS_SUCCESS) {
|
||||
handles[i].done = 2;
|
||||
hp = &handles[i];
|
||||
switch_mutex_unlock(handles[i].fence_mutex);
|
||||
goto done;
|
||||
} else {
|
||||
handles[i].done = -1;
|
||||
|
@ -1753,6 +1766,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
|
|||
over++;
|
||||
}
|
||||
|
||||
switch_mutex_unlock(handles[i].fence_mutex);
|
||||
|
||||
switch_yield(10000);
|
||||
}
|
||||
|
||||
|
@ -3203,6 +3218,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||
l_session = NULL;
|
||||
}
|
||||
|
||||
switch_channel_set_variable(oglobals.originate_status[i].peer_channel, "originate_endpoint", chan_type);
|
||||
switch_channel_execute_on(oglobals.originate_status[i].peer_channel, SWITCH_CHANNEL_EXECUTE_ON_ORIGINATE_VARIABLE);
|
||||
switch_channel_api_on(oglobals.originate_status[i].peer_channel, SWITCH_CHANNEL_API_ON_ORIGINATE_VARIABLE);
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ struct switch_loadable_module_container {
|
|||
switch_hash_t *database_hash;
|
||||
switch_hash_t *secondary_recover_hash;
|
||||
switch_mutex_t *mutex;
|
||||
switch_thread_rwlock_t *chat_rwlock;
|
||||
switch_memory_pool_t *pool;
|
||||
};
|
||||
|
||||
|
@ -634,7 +635,9 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
|
|||
|
||||
added++;
|
||||
}
|
||||
switch_thread_rwlock_wrlock(loadable_modules.chat_rwlock);
|
||||
switch_core_hash_insert(loadable_modules.chat_hash, ptr->interface_name, (const void *) ptr);
|
||||
switch_thread_rwlock_unlock(loadable_modules.chat_rwlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -822,7 +825,7 @@ static switch_status_t do_chat_send(switch_event_t *message_event)
|
|||
replying = switch_event_get_header(message_event, "replying");
|
||||
|
||||
if (!switch_true(replying) && !switch_stristr("global", proto) && !switch_true(switch_event_get_header(message_event, "skip_global_process"))) {
|
||||
switch_mutex_lock(loadable_modules.mutex);
|
||||
switch_thread_rwlock_rdlock(loadable_modules.chat_rwlock);
|
||||
for (hi = switch_core_hash_first(loadable_modules.chat_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
|
||||
|
@ -852,7 +855,7 @@ static switch_status_t do_chat_send(switch_event_t *message_event)
|
|||
}
|
||||
}
|
||||
switch_safe_free(hi);
|
||||
switch_mutex_unlock(loadable_modules.mutex);
|
||||
switch_thread_rwlock_unlock(loadable_modules.chat_rwlock);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1548,7 +1551,9 @@ static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t
|
|||
switch_event_fire(&event);
|
||||
removed++;
|
||||
}
|
||||
switch_thread_rwlock_wrlock(loadable_modules.chat_rwlock);
|
||||
switch_core_hash_delete(loadable_modules.chat_hash, ptr->interface_name);
|
||||
switch_thread_rwlock_unlock(loadable_modules.chat_rwlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2131,7 +2136,8 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init(switch_bool_t autolo
|
|||
switch_core_hash_init_nocase(&loadable_modules.dialplan_hash);
|
||||
switch_core_hash_init(&loadable_modules.secondary_recover_hash);
|
||||
switch_mutex_init(&loadable_modules.mutex, SWITCH_MUTEX_NESTED, loadable_modules.pool);
|
||||
|
||||
switch_thread_rwlock_create(&loadable_modules.chat_rwlock, loadable_modules.pool);
|
||||
|
||||
if (!autoload) return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
/*
|
||||
|
|
|
@ -680,8 +680,8 @@ static int vxprintf(void (*func) (void *, const char *, int), /* Consumer of tex
|
|||
case etSQLESCAPE2:
|
||||
case etSQLESCAPE4:
|
||||
case etSQLESCAPE3:{
|
||||
int i, j, n, ch, isnull;
|
||||
int needQuote;
|
||||
size_t i, j, n, ch;
|
||||
int needQuote, isnull;
|
||||
char *escarg = va_arg(ap, char *);
|
||||
isnull = escarg == 0;
|
||||
if (isnull)
|
||||
|
|
|
@ -506,7 +506,7 @@ static switch_status_t switch_nat_add_mapping_upnp(switch_port_t port, switch_na
|
|||
|
||||
if (r == UPNPCOMMAND_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mapped public port %s protocol %s to localport %s\n", port_str,
|
||||
(proto == SWITCH_NAT_TCP) ? "TCP" : (proto == SWITCH_NAT_UDP ? "UDP" : "UNKNOWN"), port_str);
|
||||
(proto == SWITCH_NAT_TCP) ? "TCP" : "UDP", port_str);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -566,7 +566,7 @@ static switch_status_t switch_nat_del_mapping_upnp(switch_port_t port, switch_na
|
|||
|
||||
if (r == UPNPCOMMAND_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "unmapped public port %s protocol %s to localport %s\n", port_str,
|
||||
(proto == SWITCH_NAT_TCP) ? "TCP" : (proto == SWITCH_NAT_UDP ? "UDP" : "UNKNOWN"), port_str);
|
||||
(proto == SWITCH_NAT_TCP) ? "TCP" : "UDP", port_str);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
return status;
|
||||
|
|
|
@ -1277,7 +1277,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
|
|||
}
|
||||
|
||||
|
||||
if (ice->ice_params && ice->ice_params->cands[ice->ice_params->chosen[ice->proto]][ice->proto].cand_type &&
|
||||
if (ice->ice_params->cands[ice->ice_params->chosen[ice->proto]][ice->proto].cand_type &&
|
||||
!strcasecmp(ice->ice_params->cands[ice->ice_params->chosen[ice->proto]][ice->proto].cand_type, "relay")) {
|
||||
do_adj++;
|
||||
}
|
||||
|
@ -3010,7 +3010,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_remote_address(switch_rtp_t *rtp_
|
|||
rtp_session->dtls->sock_output = rtp_session->sock_output;
|
||||
|
||||
if (rtp_session->flags[SWITCH_RTP_FLAG_RTCP_MUX]) {
|
||||
switch_sockaddr_info_get(&rtp_session->dtls->remote_addr, host, SWITCH_UNSPEC, port, 0, rtp_session->pool);
|
||||
status = switch_sockaddr_info_get(&rtp_session->dtls->remote_addr, host, SWITCH_UNSPEC, port, 0, rtp_session->pool);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3529,9 +3529,13 @@ SWITCH_DECLARE(dtls_state_t) switch_rtp_dtls_state(switch_rtp_t *rtp_session, dt
|
|||
{
|
||||
dtls_state_t s = DS_OFF;
|
||||
|
||||
if (!rtp_session) {
|
||||
return s;
|
||||
}
|
||||
|
||||
switch_mutex_lock(rtp_session->ice_mutex);
|
||||
|
||||
if (!rtp_session || (!rtp_session->dtls && !rtp_session->rtcp_dtls)) {
|
||||
if (!rtp_session->dtls && !rtp_session->rtcp_dtls) {
|
||||
s = DS_OFF;
|
||||
goto done;
|
||||
}
|
||||
|
@ -3556,9 +3560,13 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_del_dtls(switch_rtp_t *rtp_session, d
|
|||
{
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
if (!rtp_session) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
switch_mutex_lock(rtp_session->ice_mutex);
|
||||
|
||||
if (!rtp_session || (!rtp_session->dtls && !rtp_session->rtcp_dtls)) {
|
||||
if (!rtp_session->dtls && !rtp_session->rtcp_dtls) {
|
||||
switch_goto_status(SWITCH_STATUS_FALSE, done);
|
||||
}
|
||||
|
||||
|
@ -4764,11 +4772,12 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_ice(switch_rtp_t *rtp_sessio
|
|||
if ((type & ICE_VANILLA)) {
|
||||
switch_snprintf(ice_user, sizeof(ice_user), "%s:%s", login, rlogin);
|
||||
switch_snprintf(user_ice, sizeof(user_ice), "%s:%s", rlogin, login);
|
||||
switch_snprintf(luser_ice, sizeof(user_ice), "%s%s", rlogin, login);
|
||||
switch_snprintf(luser_ice, sizeof(luser_ice), "%s%s", rlogin, login);
|
||||
ice->ready = ice->rready = 0;
|
||||
} else {
|
||||
switch_snprintf(ice_user, sizeof(ice_user), "%s%s", login, rlogin);
|
||||
switch_snprintf(user_ice, sizeof(user_ice), "%s%s", rlogin, login);
|
||||
switch_snprintf(luser_ice, sizeof(luser_ice), "");
|
||||
ice->ready = ice->rready = 1;
|
||||
}
|
||||
|
||||
|
@ -6966,13 +6975,10 @@ static void check_timeout(switch_rtp_t *rtp_session)
|
|||
elapsed, rtp_session->media_timeout);
|
||||
|
||||
if (elapsed > rtp_session->media_timeout) {
|
||||
|
||||
if (rtp_session->session) {
|
||||
switch_channel_t *channel = switch_core_session_get_channel(rtp_session->session);
|
||||
|
||||
switch_channel_execute_on(channel, "execute_on_media_timeout");
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1243,15 +1243,17 @@ SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime)
|
|||
if (runtime.sps <= 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Over Session Rate of %d!\n", runtime.sps_total);
|
||||
}
|
||||
|
||||
/* These two mutexes must be held in exact order: session_hash_mutex and then throttle_mutex. See switch_core_session_request_uuid() */
|
||||
switch_mutex_lock(runtime.session_hash_mutex);
|
||||
switch_mutex_lock(runtime.throttle_mutex);
|
||||
runtime.sps_last = runtime.sps_total - runtime.sps;
|
||||
|
||||
if (sps_interval_ticks >= 300) {
|
||||
runtime.sps_peak_fivemin = 0;
|
||||
sps_interval_ticks = 0;
|
||||
switch_mutex_lock(runtime.session_hash_mutex);
|
||||
/* This line is protected by runtime.session_hash_mutex */
|
||||
runtime.sessions_peak_fivemin = session_manager.session_count;
|
||||
switch_mutex_unlock(runtime.session_hash_mutex);
|
||||
}
|
||||
|
||||
sps_interval_ticks++;
|
||||
|
@ -1265,6 +1267,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime)
|
|||
}
|
||||
runtime.sps = runtime.sps_total;
|
||||
switch_mutex_unlock(runtime.throttle_mutex);
|
||||
switch_mutex_unlock(runtime.session_hash_mutex);
|
||||
tick = 0;
|
||||
}
|
||||
#ifndef DISABLE_1MS_COND
|
||||
|
|
|
@ -1638,11 +1638,25 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file_simple(const char *file)
|
|||
|
||||
if ((fd = open(file, O_RDONLY, 0)) > -1) {
|
||||
fstat(fd, &st);
|
||||
if (!st.st_size) goto error;
|
||||
if (!st.st_size) {
|
||||
close(fd);
|
||||
goto error;
|
||||
}
|
||||
|
||||
m = switch_must_malloc(st.st_size);
|
||||
|
||||
if (!(0<(l = read(fd, m, st.st_size)))) goto error;
|
||||
if (!(root = (switch_xml_root_t) switch_xml_parse_str((char *) m, l))) goto error;
|
||||
if (!(0 < (l = read(fd, m, st.st_size)))) {
|
||||
free(m);
|
||||
close(fd);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!(root = (switch_xml_root_t)switch_xml_parse_str((char*)m, l))) {
|
||||
free(m);
|
||||
close(fd);
|
||||
goto error;
|
||||
}
|
||||
|
||||
root->dynamic = 1;
|
||||
close(fd);
|
||||
return &root->xml;
|
||||
|
|
|
@ -457,7 +457,7 @@ SWITCH_DECLARE(void) switch_xml_config_cleanup(switch_xml_config_item_t *instruc
|
|||
char **ptr = (char **) item->ptr;
|
||||
switch_xml_config_string_options_t *string_options = (switch_xml_config_string_options_t *) item->data;
|
||||
/* if (using_strdup) */
|
||||
if (string_options && !string_options->pool && !string_options->length) {
|
||||
if (!string_options || (!string_options->pool && !string_options->length)) {
|
||||
switch_safe_free(*ptr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#include <openssl/ssl.h>
|
||||
#endif
|
||||
|
||||
#define ENABLE_SNPRINTFV_TESTS 0 /* Do not turn on for CI as this requires a lot of RAM */
|
||||
|
||||
FST_CORE_BEGIN("./conf")
|
||||
{
|
||||
FST_SUITE_BEGIN(switch_core)
|
||||
|
@ -51,6 +53,61 @@ FST_CORE_BEGIN("./conf")
|
|||
}
|
||||
FST_TEARDOWN_END()
|
||||
|
||||
#if ENABLE_SNPRINTFV_TESTS
|
||||
FST_TEST_BEGIN(test_snprintfv_1)
|
||||
{
|
||||
size_t src_buf_size = 0x100000001;
|
||||
char* src = calloc(1, src_buf_size);
|
||||
|
||||
if (!src) {
|
||||
printf("bad allocation\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
src[0] = '\xc0';
|
||||
memset(src + 1, '\x80', 0xffffffff);
|
||||
|
||||
char dst[256];
|
||||
switch_snprintfv(dst, 256, "'%!q'", src);
|
||||
free(src);
|
||||
}
|
||||
FST_TEST_END()
|
||||
|
||||
FST_TEST_BEGIN(test_snprintfv_2)
|
||||
{
|
||||
#define STR_LEN ((0x100000001 - 3) / 2)
|
||||
|
||||
char* src = calloc(1, STR_LEN + 1); /* Account for NULL byte. */
|
||||
|
||||
if (!src) { return -1; }
|
||||
|
||||
memset(src, 'a', STR_LEN);
|
||||
|
||||
char* dst = calloc(1, STR_LEN + 3); /* Account for extra quotes and NULL byte */
|
||||
if (!dst) { return -1; }
|
||||
|
||||
switch_snprintfv(dst, 2 * STR_LEN + 3, "'%q'", src);
|
||||
|
||||
free(src);
|
||||
free(dst);
|
||||
}
|
||||
FST_TEST_END()
|
||||
#endif
|
||||
|
||||
FST_TEST_BEGIN(test_md5)
|
||||
{
|
||||
char digest[SWITCH_MD5_DIGEST_STRING_SIZE] = { 0 };
|
||||
char test_string[] = "test";
|
||||
switch_status_t status;
|
||||
|
||||
status = switch_md5_string(digest, (void *)test_string, strlen(test_string));
|
||||
|
||||
fst_check_int_equals(status, SWITCH_STATUS_SUCCESS);
|
||||
fst_check_string_equals(digest, "098f6bcd4621d373cade4e832627b4f6");
|
||||
}
|
||||
FST_TEST_END()
|
||||
|
||||
FST_TEST_BEGIN(test_switch_event_add_header_leak)
|
||||
{
|
||||
switch_event_t* event;
|
||||
|
|
|
@ -128,7 +128,7 @@ if not exist "$(OutDir)fonts" xcopy "$(SolutionDir)fonts\*.*" "$(OutDir)fonts\"
|
|||
<BuildLog />
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -178,7 +178,7 @@ if not exist "$(OutDir)fonts" xcopy "$(SolutionDir)fonts\*.*" "$(OutDir)fonts\"
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -219,7 +219,7 @@ if not exist "$(OutDir)fonts" xcopy "$(SolutionDir)fonts\*.*" "$(OutDir)fonts\"
|
|||
<BuildLog />
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
|
@ -257,7 +257,7 @@ if not exist "$(OutDir)fonts" xcopy "$(SolutionDir)fonts\*.*" "$(OutDir)fonts\"
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<curlVersion>7.78.0</curlVersion>
|
||||
<curlVersion>7.88.0</curlVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<curlVersionImported>true</curlVersionImported>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
</ImportGroup>
|
||||
<PropertyGroup>
|
||||
<downloadsqlitePropsImported>true</downloadsqlitePropsImported>
|
||||
<sqliteVersion>3400000</sqliteVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
|
@ -29,11 +30,12 @@
|
|||
|
||||
<Target Name="sqliteDownloadTarget" BeforeTargets="CustomBuild;PreBuildEvent;" DependsOnTargets="7za">
|
||||
<DownloadPackageTask
|
||||
package="http://files.freeswitch.org/downloads/libs/sqlite-amalgamation-3080401.zip"
|
||||
expectfileordirectory="$(BaseDir)libs\sqlite-amalgamation-3080401\sqlite3.c"
|
||||
package="http://files.freeswitch.org/downloads/libs/sqlite-amalgamation-$(sqliteVersion).zip"
|
||||
expectfileordirectory="$(BaseDir)libs\sqlite\sqlite3.c"
|
||||
outputfolder=""
|
||||
outputfilename=""
|
||||
extractto="$(BaseDir)libs\"
|
||||
moveafter="sqlite-amalgamation-$(sqliteVersion)|sqlite"
|
||||
/>
|
||||
</Target>
|
||||
|
||||
|
|
|
@ -100,7 +100,14 @@ using System.Diagnostics;
|
|||
Uri uri = new Uri(package);
|
||||
string urifilename = Path.GetFileName(uri.LocalPath);
|
||||
string output = Path.Combine(outputfolder ?? librarypath, (outputfilename ?? urifilename));
|
||||
string cachedir = Environment.GetEnvironmentVariable("FreeSWITCHBuildCachePath") ?? "";
|
||||
string cached_file = cachedir != "" ? Path.Combine(cachedir, (outputfilename ?? urifilename)) : "";
|
||||
|
||||
if (cached_file != "" && File.Exists(cached_file)) {
|
||||
Log.LogMessage(MessageImportance.High,
|
||||
"Found package in cache \"" + cached_file + "\".");
|
||||
File.Copy(cached_file, output);
|
||||
} else
|
||||
//if (!File.Exists(output)) // Uncomment to skip download if exists
|
||||
{
|
||||
var syncObject = new State
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
<Import Project="basedir.props" Condition=" '$(BaseDirImported)' == ''"/>
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<libksVersion>1.8.0</libksVersion>
|
||||
<libksVersion>1.8.2</libksVersion>
|
||||
<libksBuildNumber>1</libksBuildNumber>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<libksVersionImported>true</libksVersionImported>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
<Target Name="libksBinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
|
||||
<DownloadPackageTask
|
||||
package="http://files.freeswitch.org/windows/packages/libks/$(libksVersion)/libks-$(libksVersion)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
|
||||
package="http://files.freeswitch.org/windows/packages/libks/$(libksVersion)_$(libksBuildNumber)/libks-$(libksVersion)_$(libksBuildNumber)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
|
||||
expectfileordirectory="$(libksDir)\binaries\$(Platform)\$(Configuration)\ks.dll"
|
||||
outputfolder=""
|
||||
outputfilename=""
|
||||
|
@ -45,7 +45,7 @@
|
|||
</Target>
|
||||
<Target Name="libksHeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
|
||||
<DownloadPackageTask
|
||||
package="http://files.freeswitch.org/windows/packages/libks/$(libksVersion)/libks-$(libksVersion)-headers.zip"
|
||||
package="http://files.freeswitch.org/windows/packages/libks/$(libksVersion)_$(libksBuildNumber)/libks-$(libksVersion)_$(libksBuildNumber)-headers.zip"
|
||||
expectfileordirectory="$(libksDir)\src\include\libks\ks.h"
|
||||
outputfolder=""
|
||||
outputfilename=""
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<Import Project="basedir.props" Condition=" '$(BaseDirImported)' == ''"/>
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<libpqVersion>10.18</libpqVersion>
|
||||
<libpqVersion>10.23</libpqVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<libpqVersionImported>true</libpqVersionImported>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<Import Project="basedir.props" Condition=" '$(BaseDirImported)' == ''"/>
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<OpenSSLVersion>1.1.1l</OpenSSLVersion>
|
||||
<OpenSSLVersion>1.1.1t</OpenSSLVersion>
|
||||
<OpenSSLLibDir>$(BaseDir)libs\openssl-$(OpenSSLVersion)</OpenSSLLibDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<AdditionalIncludeDirectories>$(OpenSSLLibDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Platform)'=='Win32'">$(OpenSSLLibDir)\include_x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Platform)'=='x64'">$(OpenSSLLibDir)\include_x64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>OPENSSL;HAVE_OPENSSL;HAVE_OPENSSL_DTLS_SRTP;HAVE_OPENSSL_DTLS;HAVE_OPENSSL_DTLSv1_2_method;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>HAVE_LIBCRYPTO;OPENSSL;HAVE_OPENSSL;HAVE_OPENSSL_DTLS_SRTP;HAVE_OPENSSL_DTLS;HAVE_OPENSSL_DTLSv1_2_method;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories>$(OpenSSLLibDir)\binaries\$(Platform)\$(LibraryConfiguration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<Import Project="basedir.props" Condition=" '$(BaseDirImported)' == ''"/>
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<rabbitmq_cVersion>0.11.0</rabbitmq_cVersion>
|
||||
<rabbitmq_cVersion>0.13.0</rabbitmq_cVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<rabbitmq_cVersionImported>true</rabbitmq_cVersionImported>
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
<Import Project="basedir.props" Condition=" '$(BaseDirImported)' == ''"/>
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<signalwire-client-cVersion>1.3.0</signalwire-client-cVersion>
|
||||
<signalwire-client-cVersion>1.3.2</signalwire-client-cVersion>
|
||||
<signalwire-client-cBuildNumber>1</signalwire-client-cBuildNumber>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<signalwire-client-cVersionImported>true</signalwire-client-cVersionImported>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
<Target Name="signalwire-client-cBinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
|
||||
<DownloadPackageTask
|
||||
package="http://files.freeswitch.org/windows/packages/signalwire-client-c/$(signalwire-client-cVersion)/signalwire-client-c-$(signalwire-client-cVersion)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
|
||||
package="http://files.freeswitch.org/windows/packages/signalwire-client-c/$(signalwire-client-cVersion)_$(signalwire-client-cBuildNumber)/signalwire-client-c-$(signalwire-client-cVersion)_$(signalwire-client-cBuildNumber)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
|
||||
expectfileordirectory="$(signalwire-client-cDir)\binaries\$(Platform)\$(Configuration)\signalwire_client.dll"
|
||||
outputfolder=""
|
||||
outputfilename=""
|
||||
|
@ -43,7 +43,7 @@
|
|||
</Target>
|
||||
<Target Name="signalwire-client-cHeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
|
||||
<DownloadPackageTask
|
||||
package="http://files.freeswitch.org/windows/packages/signalwire-client-c/$(signalwire-client-cVersion)/signalwire-client-c-$(signalwire-client-cVersion)-headers.zip"
|
||||
package="http://files.freeswitch.org/windows/packages/signalwire-client-c/$(signalwire-client-cVersion)_$(signalwire-client-cBuildNumber)/signalwire-client-c-$(signalwire-client-cVersion)_$(signalwire-client-cBuildNumber)-headers.zip"
|
||||
expectfileordirectory="$(signalwire-client-cDir)\include\signalwire-client-c\client.h"
|
||||
outputfolder=""
|
||||
outputfilename=""
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
</ImportGroup>
|
||||
<PropertyGroup>
|
||||
<YasmPropsImported>true</YasmPropsImported>
|
||||
<Is64yasm Condition="$([System.Environment]::Is64BitProcess)">true</Is64yasm>
|
||||
<PackageToDownload Condition="'$(Is64yasm)' == 'true'">http://files.freeswitch.org/downloads/win64/yasm.exe</PackageToDownload>
|
||||
<PackageToDownload Condition="'$(Is64yasm)' != 'true'">http://files.freeswitch.org/downloads/win32/yasm.exe</PackageToDownload>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
|
@ -28,8 +31,9 @@
|
|||
-->
|
||||
|
||||
<Target Name="YasmDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="">
|
||||
<Message Text="System is 64 bit." Condition="'$(Is64yasm)' == 'true'" Importance="High" />
|
||||
<DownloadPackageTask
|
||||
package="http://files.freeswitch.org/downloads/win32/yasm.exe"
|
||||
package="$(PackageToDownload)"
|
||||
expectfileordirectory="$(ProjectDir)\yasm.exe"
|
||||
outputfolder="$(ProjectDir)\"
|
||||
outputfilename=""
|
||||
|
|
Loading…
Reference in New Issue