From 074b07f5458d8584c153a5810bfa2e4011def20c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Zaprza=C5=82a?= Date: Tue, 28 Apr 2015 17:49:09 +0200 Subject: [PATCH 001/136] FS-7486: Fix handling of queued requests in Sofia-SIP --- libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c index e15d6787de..8efaa31d4c 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c @@ -1593,10 +1593,6 @@ int nua_client_next_request(nua_client_request_t *cr, int invite) for (; cr; cr = cr->cr_next) { if (cr->cr_method == sip_method_cancel) continue; - - if (invite - ? cr->cr_method == sip_method_invite - : cr->cr_method != sip_method_invite) break; } From 2d14aa93895a065b5861a0b7234771613d5f6f56 Mon Sep 17 00:00:00 2001 From: Joao Mesquita Date: Thu, 20 Aug 2015 18:50:45 -0300 Subject: [PATCH 002/136] FS-7997 #resolve We need to have a designer look at the html partial and come up with a CSS to make this better looking. --- html5/verto/verto_communicator/partials/chat.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html5/verto/verto_communicator/partials/chat.html b/html5/verto/verto_communicator/partials/chat.html index 928b690fbe..6c96b2161d 100644 --- a/html5/verto/verto_communicator/partials/chat.html +++ b/html5/verto/verto_communicator/partials/chat.html @@ -21,7 +21,7 @@ -

{{ member.name }}

+

{{ member.name }} ({{ member.number }})

+ +
+ +
+
+ + +
diff --git a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js index c12eee4d6b..5895ed2830 100644 --- a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js +++ b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js @@ -13,6 +13,7 @@ 'cgPrompt', '720kb.tooltips', 'ui.gravatar', + 'directive.g+signin', ]); vertoApp.config(['$routeProvider', 'gravatarServiceProvider', @@ -95,4 +96,4 @@ } ]); -})(); \ No newline at end of file +})(); diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js index 8cb88aa7f1..4277898618 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js @@ -3,7 +3,7 @@ angular .module('vertoControllers') - .controller('LoginController', ['$scope', '$http', '$location', 'verto', + .controller('LoginController', ['$scope', '$http', '$location', 'verto', function($scope, $http, $location, verto) { $scope.checkBrowser(); @@ -19,6 +19,11 @@ var name = verto.data.name; var email = verto.data.email; + console.debug("googlelogin: " + data.googlelogin); + if (data.googlelogin){ + $scope.googlelogin = data.googlelogin; + } + angular.extend(verto.data, data); /** diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js index f7e3d5bb91..afeb770bd1 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js @@ -88,6 +88,10 @@ var disconnectCallback = function(v, connected) { console.debug('Redirecting to login page.'); storage.reset(); + if (typeof gapi !== 'undefined'){ + console.debug(gapi); + gapi.auth.signOut(); + } $location.path('/login'); }; @@ -277,6 +281,40 @@ }); + $scope.$on('event:google-plus-signin-success', function (event,authResult) { + // Send login to server or save into cookie + console.log('Google+ Login Success'); + console.log(authResult); + gapi.client.load('plus', 'v1', gapiClientLoaded); + }); + + function gapiClientLoaded() { + gapi.client.plus.people.get({userId: 'me'}).execute(handleEmailResponse); + } + + function handleEmailResponse(resp){ + var primaryEmail; + for (var i=0; i < resp.emails.length; i++) { + if (resp.emails[i].type === 'account') primaryEmail = resp.emails[i].value; + } + console.debug("Primary Email: " + primaryEmail ); + console.debug("display name: " + resp.displayName); + console.debug("imageurl: " + resp.image.url); + console.debug(resp); + console.debug(verto.data); + verto.data.email = primaryEmail; + verto.data.name = resp.displayName; + storage.data.name = verto.data.name; + storage.data.email = verto.data.email; + + $scope.login(); + } + + $scope.$on('event:google-plus-signin-failure', function (event,authResult) { + // Auth failure or signout detected + console.log('Google+ Login Failure'); + }); + $rootScope.callActive = function(data) { verto.data.mutedMic = storage.data.mutedMic; verto.data.mutedVideo = storage.data.mutedVideo; From 34d72cba985247531c3745d649cc5b1947bc3f48 Mon Sep 17 00:00:00 2001 From: Ken Rice Date: Sun, 20 Sep 2015 00:28:29 -0500 Subject: [PATCH 110/136] remove unused code --- .../verto/verto_communicator/src/vertoApp/vertoApp.module.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js index 5895ed2830..2c7cffc381 100644 --- a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js +++ b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js @@ -34,11 +34,6 @@ templateUrl: 'partials/incall.html', controller: 'InCallController' }). - /*when('/contributors', { - title: 'Contributors', - templateUrl: 'partials/contributors.html', - controller: 'ContributorsController', - }).*/ when('/browser-upgrade', { title: '', templateUrl: 'partials/browser_upgrade.html', From f8b19b7485023ba94755bd606a384c80e80cc54b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 21 Sep 2015 18:00:14 -0500 Subject: [PATCH 111/136] FS-8190 #resolve [When using nixevent, freeswitch stops sending us certain custom event that were NOT part of the nixevent command] --- src/include/switch_event.h | 2 + src/mod/applications/mod_avmd/mod_avmd.c | 9 ++ src/mod/applications/mod_bert/mod_bert.c | 22 ++++ .../mod_callcenter/mod_callcenter.c | 9 ++ src/mod/applications/mod_curl/mod_curl.c | 9 ++ src/mod/applications/mod_cv/mod_cv.cpp | 10 +- .../applications/mod_dptools/mod_dptools.c | 20 +++ src/mod/applications/mod_sms/mod_sms.c | 6 + src/mod/applications/mod_sonar/mod_sonar.c | 8 ++ .../applications/mod_spandsp/mod_spandsp.c | 45 ++++++- .../applications/mod_spandsp/mod_spandsp.h | 11 ++ .../mod_spandsp/mod_spandsp_fax.c | 10 -- src/mod/applications/mod_vmd/mod_vmd.c | 8 ++ src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c | 20 +++ src/mod/endpoints/mod_loopback/mod_loopback.c | 9 ++ src/mod/endpoints/mod_rtmp/mod_rtmp.c | 49 ++++++++ src/mod/endpoints/mod_sofia/mod_sofia.c | 116 ++++++++++++++++++ src/mod/endpoints/mod_verto/mod_verto.c | 21 ++++ .../mod_event_socket/mod_event_socket.c | 38 +++++- src/mod/event_handlers/mod_rayo/mod_rayo.c | 9 ++ src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c | 8 ++ src/switch_event.c | 16 +++ 22 files changed, 442 insertions(+), 13 deletions(-) diff --git a/src/include/switch_event.h b/src/include/switch_event.h index 12f18a9b94..d13af7d471 100644 --- a/src/include/switch_event.h +++ b/src/include/switch_event.h @@ -254,6 +254,8 @@ SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, c SWITCH_DECLARE(switch_status_t) switch_event_bind(const char *id, switch_event_types_t event, const char *subclass_name, switch_event_callback_t callback, void *user_data); +SWITCH_DECLARE(switch_status_t) switch_event_get_custom_events(switch_console_callback_match_t **matches); + /*! \brief Bind an event callback to a specific event \param id an identifier token of the binder diff --git a/src/mod/applications/mod_avmd/mod_avmd.c b/src/mod/applications/mod_avmd/mod_avmd.c index 3722365397..a4a1c07815 100644 --- a/src/mod/applications/mod_avmd/mod_avmd.c +++ b/src/mod/applications/mod_avmd/mod_avmd.c @@ -216,6 +216,13 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_avmd_load) /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); + + if (switch_event_reserve_subclass(AVMD_EVENT_BEEP) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", AVMD_EVENT_BEEP); + return SWITCH_STATUS_TERM; + } + + switch_log_printf( SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, @@ -322,6 +329,8 @@ SWITCH_STANDARD_APP(avmd_start_function) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_avmd_shutdown) { + switch_event_free_subclass(AVMD_EVENT_BEEP); + #ifdef FASTMATH destroy_fast_acosf(); #endif diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index 35f7b87ab8..70badc1354 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -377,6 +377,24 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load) { switch_application_interface_t *app_interface = NULL; + if (switch_event_reserve_subclass(BERT_EVENT_TIMEOUT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", BERT_EVENT_TIMEOUT); + return SWITCH_STATUS_TERM; + } + + + if (switch_event_reserve_subclass(BERT_EVENT_LOST_SYNC) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", BERT_EVENT_LOST_SYNC); + return SWITCH_STATUS_TERM; + } + + + if (switch_event_reserve_subclass(BERT_EVENT_IN_SYNC) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", BERT_EVENT_IN_SYNC); + return SWITCH_STATUS_TERM; + } + + *module_interface = switch_loadable_module_create_module_interface(pool, modname); SWITCH_ADD_APP(app_interface, "bert_test", "Start BERT Test", "Start BERT Test", bert_test_function, "", SAF_NONE); @@ -385,6 +403,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_bert_shutdown) { + switch_event_free_subclass(BERT_EVENT_TIMEOUT); + switch_event_free_subclass(BERT_EVENT_LOST_SYNC); + switch_event_free_subclass(BERT_EVENT_IN_SYNC); + return SWITCH_STATUS_UNLOAD; } diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 594908dd4d..2b0e28a5e7 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -3421,6 +3421,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load) switch_api_interface_t *api_interface; switch_status_t status; + + if (switch_event_reserve_subclass(CALLCENTER_EVENT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", CALLCENTER_EVENT); + return SWITCH_STATUS_TERM; + } + memset(&globals, 0, sizeof(globals)); globals.pool = pool; @@ -3495,6 +3501,9 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_callcenter_shutdown) switch_ssize_t keylen; int sanity = 0; + + switch_event_free_subclass(CALLCENTER_EVENT); + switch_mutex_lock(globals.mutex); if (globals.running == 1) { globals.running = 0; diff --git a/src/mod/applications/mod_curl/mod_curl.c b/src/mod/applications/mod_curl/mod_curl.c index 9b9c7cc12b..4499fe4cea 100644 --- a/src/mod/applications/mod_curl/mod_curl.c +++ b/src/mod/applications/mod_curl/mod_curl.c @@ -1014,6 +1014,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_curl_load) { switch_api_interface_t *api_interface; switch_application_interface_t *app_interface; + + if (switch_event_reserve_subclass(HTTP_SENDFILE_ACK_EVENT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", HTTP_SENDFILE_ACK_EVENT); + return SWITCH_STATUS_TERM; + } + /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); @@ -1037,6 +1043,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_curl_load) Macro expands to: switch_status_t mod_cidlookup_shutdown() */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_curl_shutdown) { + + switch_event_free_subclass(HTTP_SENDFILE_ACK_EVENT); + /* Cleanup dynamically allocated config settings */ return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/applications/mod_cv/mod_cv.cpp b/src/mod/applications/mod_cv/mod_cv.cpp index 50dd5862b4..9f5d95dac0 100644 --- a/src/mod/applications/mod_cv/mod_cv.cpp +++ b/src/mod/applications/mod_cv/mod_cv.cpp @@ -1334,6 +1334,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cv_load) switch_application_interface_t *app_interface; switch_api_interface_t *api_interface; + if (switch_event_reserve_subclass(MY_EVENT_VIDEO_DETECT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_VIDEO_DETECT); + return SWITCH_STATUS_TERM; + } + *module_interface = switch_loadable_module_create_module_interface(pool, modname); MODULE_INTERFACE = *module_interface; @@ -1354,7 +1359,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cv_load) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cv_shutdown) { - return SWITCH_STATUS_UNLOAD; + + switch_event_free_subclass(MY_EVENT_VIDEO_DETECT); + + return SWITCH_STATUS_UNLOAD; } diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 8cc2947343..310aa302e4 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -5909,6 +5909,11 @@ SWITCH_STANDARD_APP(deduplicate_dtmf_app_function) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dptools_shutdown) { + + switch_event_free_subclass(FILE_STRING_CLOSE); + switch_event_free_subclass(FILE_STRING_FAIL); + switch_event_free_subclass(FILE_STRING_OPEN); + switch_event_unbind_callback(pickup_pres_event_handler); switch_mutex_destroy(globals.pickup_mutex); switch_core_hash_destroy(&globals.pickup_hash); @@ -5926,6 +5931,21 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) switch_chat_interface_t *chat_interface; switch_file_interface_t *file_interface; + if (switch_event_reserve_subclass(FILE_STRING_CLOSE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", FILE_STRING_CLOSE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(FILE_STRING_FAIL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", FILE_STRING_FAIL); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(FILE_STRING_OPEN) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", FILE_STRING_OPEN); + return SWITCH_STATUS_TERM; + } + globals.pool = pool; switch_core_hash_init(&globals.pickup_hash); switch_mutex_init(&globals.pickup_mutex, SWITCH_MUTEX_NESTED, globals.pool); diff --git a/src/mod/applications/mod_sms/mod_sms.c b/src/mod/applications/mod_sms/mod_sms.c index 4529244b0d..9f10ef98a5 100644 --- a/src/mod/applications/mod_sms/mod_sms.c +++ b/src/mod/applications/mod_sms/mod_sms.c @@ -609,6 +609,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sms_load) switch_chat_interface_t *chat_interface; switch_chat_application_interface_t *chat_app_interface; + if (switch_event_reserve_subclass(MY_EVENT_DELIVERY_REPORT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_DELIVERY_REPORT); + return SWITCH_STATUS_TERM; + } if (switch_event_bind(modname, SWITCH_EVENT_CUSTOM, MY_EVENT_SEND_MESSAGE, event_handler, NULL) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n"); @@ -640,6 +644,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sms_shutdown) { switch_event_unbind_callback(event_handler); + switch_event_free_subclass(MY_EVENT_DELIVERY_REPORT); + return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/applications/mod_sonar/mod_sonar.c b/src/mod/applications/mod_sonar/mod_sonar.c index 2457703b55..ebf641a351 100644 --- a/src/mod/applications/mod_sonar/mod_sonar.c +++ b/src/mod/applications/mod_sonar/mod_sonar.c @@ -218,6 +218,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sonar_load) { switch_application_interface_t *app_interface; + if (switch_event_reserve_subclass("sonar::ping") != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", "sonar::ping"); + return SWITCH_STATUS_TERM; + } + + /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); @@ -233,6 +239,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sonar_load) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sonar_shutdown) { + switch_event_free_subclass("sonar::ping"); + return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c index 6f15ed79a3..fdbb44c5a6 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp.c @@ -772,6 +772,42 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spandsp_init) switch_application_interface_t *app_interface; switch_api_interface_t *api_interface; + + if (switch_event_reserve_subclass(MY_EVENT_TDD_RECV_MESSAGE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_TDD_RECV_MESSAGE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(SPANDSP_EVENT_TXFAXNEGOCIATERESULT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", SPANDSP_EVENT_TXFAXNEGOCIATERESULT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(SPANDSP_EVENT_RXFAXNEGOCIATERESULT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", SPANDSP_EVENT_RXFAXNEGOCIATERESULT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(SPANDSP_EVENT_TXFAXPAGERESULT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", SPANDSP_EVENT_TXFAXPAGERESULT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(SPANDSP_EVENT_RXFAXPAGERESULT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", SPANDSP_EVENT_RXFAXPAGERESULT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(SPANDSP_EVENT_TXFAXRESULT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", SPANDSP_EVENT_TXFAXRESULT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(SPANDSP_EVENT_RXFAXRESULT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", SPANDSP_EVENT_RXFAXRESULT); + return SWITCH_STATUS_TERM; + } + memset(&spandsp_globals, 0, sizeof(spandsp_globals)); spandsp_globals.pool = pool; @@ -855,7 +891,14 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spandsp_shutdown) switch_event_unbind_callback(event_handler); switch_event_unbind_callback(tdd_event_handler); - + switch_event_free_subclass(MY_EVENT_TDD_RECV_MESSAGE); + switch_event_free_subclass(SPANDSP_EVENT_TXFAXNEGOCIATERESULT); + switch_event_free_subclass(SPANDSP_EVENT_RXFAXNEGOCIATERESULT); + switch_event_free_subclass(SPANDSP_EVENT_TXFAXPAGERESULT); + switch_event_free_subclass(SPANDSP_EVENT_RXFAXPAGERESULT); + switch_event_free_subclass(SPANDSP_EVENT_TXFAXRESULT); + switch_event_free_subclass(SPANDSP_EVENT_RXFAXRESULT); + mod_spandsp_fax_shutdown(); mod_spandsp_dsp_shutdown(); #if defined(MODEM_SUPPORT) diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.h b/src/mod/applications/mod_spandsp/mod_spandsp.h index 183426e7eb..4e8f1d2427 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.h +++ b/src/mod/applications/mod_spandsp/mod_spandsp.h @@ -49,6 +49,17 @@ typedef int zap_socket_t; #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include +#define SPANDSP_EVENT_TXFAXRESULT "spandsp::txfaxresult" +#define SPANDSP_EVENT_RXFAXRESULT "spandsp::rxfaxresult" + +#define SPANDSP_EVENT_TXFAXPAGERESULT "spandsp::txfaxpageresult" +#define SPANDSP_EVENT_RXFAXPAGERESULT "spandsp::rxfaxpageresult" + +#define SPANDSP_EVENT_TXFAXNEGOCIATERESULT "spandsp::txfaxnegociateresult" +#define SPANDSP_EVENT_RXFAXNEGOCIATERESULT "spandsp::rxfaxnegociateresult" + + + /* The global stuff */ struct spandsp_globals { switch_memory_pool_t *pool; diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c index 31bb3a74d7..3d175a18e5 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c @@ -42,16 +42,6 @@ #define DEFAULT_FEC_ENTRIES 3 #define DEFAULT_FEC_SPAN 3 -#define SPANDSP_EVENT_TXFAXRESULT "spandsp::txfaxresult" -#define SPANDSP_EVENT_RXFAXRESULT "spandsp::rxfaxresult" - -#define SPANDSP_EVENT_TXFAXPAGERESULT "spandsp::txfaxpageresult" -#define SPANDSP_EVENT_RXFAXPAGERESULT "spandsp::rxfaxpageresult" - -#define SPANDSP_EVENT_TXFAXNEGOCIATERESULT "spandsp::txfaxnegociateresult" -#define SPANDSP_EVENT_RXFAXNEGOCIATERESULT "spandsp::rxfaxnegociateresult" - - /***************************************************************************** OUR DEFINES AND STRUCTS *****************************************************************************/ diff --git a/src/mod/applications/mod_vmd/mod_vmd.c b/src/mod/applications/mod_vmd/mod_vmd.c index 89dcc76ab9..e1932cc0d1 100644 --- a/src/mod/applications/mod_vmd/mod_vmd.c +++ b/src/mod/applications/mod_vmd/mod_vmd.c @@ -508,6 +508,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_vmd_load) { switch_application_interface_t *app_interface; switch_api_interface_t *api_interface; + + if (switch_event_reserve_subclass(VMD_EVENT_BEEP) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", VMD_EVENT_BEEP); + return SWITCH_STATUS_TERM; + } + /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); @@ -599,6 +605,8 @@ SWITCH_STANDARD_APP(vmd_start_function) */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_vmd_shutdown) { + + switch_event_free_subclass(VMD_EVENT_BEEP); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Voicemail detection disabled\n"); return SWITCH_STATUS_SUCCESS; diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c index e349ddfaa9..ea563869fb 100644 --- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c +++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c @@ -4393,6 +4393,21 @@ static mrcp_client_t *mod_unimrcp_client_create(switch_memory_pool_t *mod_pool) */ SWITCH_MODULE_LOAD_FUNCTION(mod_unimrcp_load) { + if (switch_event_reserve_subclass(MY_EVENT_PROFILE_CREATE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_PROFILE_CREATE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_PROFILE_CLOSE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_PROFILE_CLOSE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_PROFILE_OPEN) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_PROFILE_OPEN); + return SWITCH_STATUS_TERM; + } + /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); @@ -4449,6 +4464,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_unimrcp_load) */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_unimrcp_shutdown) { + + switch_event_free_subclass(MY_EVENT_PROFILE_CREATE); + switch_event_free_subclass(MY_EVENT_PROFILE_CLOSE); + switch_event_free_subclass(MY_EVENT_PROFILE_OPEN); + synth_shutdown(); recog_shutdown(); diff --git a/src/mod/endpoints/mod_loopback/mod_loopback.c b/src/mod/endpoints/mod_loopback/mod_loopback.c index 4bcd0c7d3e..99e83add97 100644 --- a/src/mod/endpoints/mod_loopback/mod_loopback.c +++ b/src/mod/endpoints/mod_loopback/mod_loopback.c @@ -1206,6 +1206,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_loopback_load) { switch_application_interface_t *app_interface; + if (switch_event_reserve_subclass("loopback::bowout") != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", "loopback::bowout"); + return SWITCH_STATUS_TERM; + } + + memset(&globals, 0, sizeof(globals)); /* connect my internal structure to the blank pointer passed to me */ @@ -1223,6 +1229,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_loopback_load) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_loopback_shutdown) { + + switch_event_free_subclass("loopback::bowout"); + return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/endpoints/mod_rtmp/mod_rtmp.c b/src/mod/endpoints/mod_rtmp/mod_rtmp.c index d4e0c218c9..9066148566 100644 --- a/src/mod/endpoints/mod_rtmp/mod_rtmp.c +++ b/src/mod/endpoints/mod_rtmp/mod_rtmp.c @@ -1979,6 +1979,46 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rtmp_load) switch_api_interface_t *api_interface; rtmp_globals.pool = pool; + if (switch_event_reserve_subclass(RTMP_EVENT_CONNECT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", RTMP_EVENT_CONNECT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(RTMP_EVENT_DISCONNECT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", RTMP_EVENT_DISCONNECT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(RTMP_EVENT_REGISTER) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", RTMP_EVENT_REGISTER); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(RTMP_EVENT_UNREGISTER) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", RTMP_EVENT_UNREGISTER); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(RTMP_EVENT_LOGIN) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", RTMP_EVENT_LOGIN); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(RTMP_EVENT_LOGOUT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", RTMP_EVENT_LOGOUT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(RTMP_EVENT_DETACH) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", RTMP_EVENT_DETACH); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(RTMP_EVENT_ATTACH) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", RTMP_EVENT_ATTACH); + return SWITCH_STATUS_TERM; + } + memset(&rtmp_globals, 0, sizeof(rtmp_globals)); switch_mutex_init(&rtmp_globals.mutex, SWITCH_MUTEX_NESTED, pool); @@ -2070,6 +2110,15 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_rtmp_shutdown) { switch_hash_index_t *hi = NULL; + switch_event_free_subclass(RTMP_EVENT_CONNECT); + switch_event_free_subclass(RTMP_EVENT_DISCONNECT); + switch_event_free_subclass(RTMP_EVENT_REGISTER); + switch_event_free_subclass(RTMP_EVENT_UNREGISTER); + switch_event_free_subclass(RTMP_EVENT_LOGIN); + switch_event_free_subclass(RTMP_EVENT_LOGOUT); + switch_event_free_subclass(RTMP_EVENT_DETACH); + switch_event_free_subclass(RTMP_EVENT_ATTACH); + switch_mutex_lock(rtmp_globals.mutex); while ((hi = switch_core_hash_first_iter(rtmp_globals.profile_hash, hi))) { void *val; diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 8c663622e8..8b141ef2eb 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -5749,6 +5749,102 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load) switch_application_interface_t *app_interface; struct in_addr in; + + if (switch_event_reserve_subclass(MY_EVENT_NOTIFY_REFER) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_NOTIFY_REFER); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_NOTIFY_WATCHED_HEADER) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_NOTIFY_WATCHED_HEADER); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_UNREGISTER) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_UNREGISTER); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_PROFILE_START) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_PROFILE_START); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_REINVITE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_REINVITE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_REPLACED) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_REPLACED); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_TRANSFEROR) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_TRANSFEROR); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_TRANSFEREE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_TRANSFEREE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_ERROR) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_ERROR); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_INTERCEPTED) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_INTERCEPTED); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_GATEWAY_STATE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_GATEWAY_STATE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_SIP_USER_STATE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_SIP_USER_STATE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_GATEWAY_DEL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_GATEWAY_DEL); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_EXPIRE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_EXPIRE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_REGISTER_ATTEMPT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_REGISTER_ATTEMPT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_REGISTER_FAILURE) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_REGISTER_FAILURE); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_PRE_REGISTER) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_PRE_REGISTER); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_REGISTER) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_REGISTER); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_GATEWAY_ADD) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_GATEWAY_ADD); + return SWITCH_STATUS_TERM; + } + memset(&mod_sofia_globals, 0, sizeof(mod_sofia_globals)); mod_sofia_globals.destroy_private.destroy_nh = 1; mod_sofia_globals.destroy_private.is_static = 1; @@ -5957,6 +6053,26 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown) int i; switch_status_t st; + switch_event_free_subclass(MY_EVENT_NOTIFY_REFER); + switch_event_free_subclass(MY_EVENT_NOTIFY_WATCHED_HEADER); + switch_event_free_subclass(MY_EVENT_UNREGISTER); + switch_event_free_subclass(MY_EVENT_PROFILE_START); + switch_event_free_subclass(MY_EVENT_REINVITE); + switch_event_free_subclass(MY_EVENT_REPLACED); + switch_event_free_subclass(MY_EVENT_TRANSFEROR); + switch_event_free_subclass(MY_EVENT_TRANSFEREE); + switch_event_free_subclass(MY_EVENT_ERROR); + switch_event_free_subclass(MY_EVENT_INTERCEPTED); + switch_event_free_subclass(MY_EVENT_GATEWAY_STATE); + switch_event_free_subclass(MY_EVENT_SIP_USER_STATE); + switch_event_free_subclass(MY_EVENT_GATEWAY_DEL); + switch_event_free_subclass(MY_EVENT_EXPIRE); + switch_event_free_subclass(MY_EVENT_REGISTER_ATTEMPT); + switch_event_free_subclass(MY_EVENT_REGISTER_FAILURE); + switch_event_free_subclass(MY_EVENT_PRE_REGISTER); + switch_event_free_subclass(MY_EVENT_REGISTER); + switch_event_free_subclass(MY_EVENT_GATEWAY_ADD); + switch_console_del_complete_func("::sofia::list_profiles"); switch_console_set_complete("del sofia"); diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index eea514822d..a2aaed5a64 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -5605,6 +5605,22 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_verto_load) switch_cache_db_handle_t *dbh; //switch_application_interface_t *app_interface = NULL; + + if (switch_event_reserve_subclass(MY_EVENT_LOGIN) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_LOGIN); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_CLIENT_DISCONNECT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_CLIENT_DISCONNECT); + return SWITCH_STATUS_TERM; + } + + if (switch_event_reserve_subclass(MY_EVENT_CLIENT_CONNECT) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", MY_EVENT_CLIENT_CONNECT); + return SWITCH_STATUS_TERM; + } + memset(&globals, 0, sizeof(globals)); globals.pool = pool; #ifndef WIN32 @@ -5695,6 +5711,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_verto_load) Macro expands to: switch_status_t mod_verto_shutdown() */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_verto_shutdown) { + + switch_event_free_subclass(MY_EVENT_LOGIN); + switch_event_free_subclass(MY_EVENT_CLIENT_DISCONNECT); + switch_event_free_subclass(MY_EVENT_CLIENT_CONNECT); + json_cleanup(); switch_core_hash_destroy(&json_GLOBALS.store_hash); diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 8d1b1d5567..2bce7703f1 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -1650,6 +1650,35 @@ static switch_bool_t auth_api_command(listener_t *listener, const char *api_cmd, } +static void set_all_custom(listener_t *listener) +{ + switch_console_callback_match_t *events = NULL; + switch_console_callback_match_node_t *m; + + if (switch_event_get_custom_events(&events) == SWITCH_STATUS_SUCCESS) { + for (m = events->head; m; m = m->next) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "ADDING CUSTOM EVENT: %s\n", m->val); + switch_core_hash_insert(listener->event_hash, m->val, MARKER); + } + + switch_console_free_matches(&events); + } +} + +static void set_allowed_custom(listener_t *listener) +{ + switch_hash_index_t *hi = NULL; + const void *var; + void *val; + + switch_assert(listener->allowed_event_hash); + + for (hi = switch_core_hash_first(listener->allowed_event_hash); hi; hi = switch_core_hash_next(&hi)) { + switch_core_hash_this(hi, &var, NULL, &val); + switch_core_hash_insert(listener->event_hash, (char *)var, MARKER); + } +} + static switch_status_t parse_command(listener_t *listener, switch_event_t **event, char *reply, uint32_t reply_len) { switch_status_t status = SWITCH_STATUS_SUCCESS; @@ -2450,6 +2479,13 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even for (x = 0; x < SWITCH_EVENT_ALL; x++) { listener->event_list[x] = 1; } + + if (!listener->allowed_event_hash) { + set_all_custom(listener); + } else { + set_allowed_custom(listener); + } + } if (type <= SWITCH_EVENT_ALL) { listener->event_list[type] = 1; @@ -2481,7 +2517,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even uint8_t custom = 0; strip_cr(cmd); - cur = cmd + 5; + cur = cmd + 8; if (cur && (cur = strchr(cur, ' '))) { for (cur++; cur; count++) { diff --git a/src/mod/event_handlers/mod_rayo/mod_rayo.c b/src/mod/event_handlers/mod_rayo/mod_rayo.c index 4a008e9b84..60224cd9db 100644 --- a/src/mod/event_handlers/mod_rayo/mod_rayo.c +++ b/src/mod/event_handlers/mod_rayo/mod_rayo.c @@ -5158,6 +5158,13 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load) switch_api_interface_t *api_interface; switch_application_interface_t *app_interface; + + if (switch_event_reserve_subclass("rayo::cpa") != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", "rayo::cpa"); + return SWITCH_STATUS_TERM; + } + + *module_interface = switch_loadable_module_create_module_interface(pool, modname); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loading module\n"); @@ -5267,6 +5274,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load) */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_rayo_shutdown) { + switch_event_free_subclass("rayo::cpa"); + switch_status_t result = do_shutdown(); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Module shutdown\n"); return result; diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c index 3871993078..a71726c357 100644 --- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c +++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c @@ -160,6 +160,12 @@ static switch_status_t do_config(void) SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load) { + + if (switch_event_reserve_subclass("websocket::stophook") != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", "websocket::stophook"); + return SWITCH_STATUS_TERM; + } + /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); @@ -1268,6 +1274,8 @@ void stop_all_websockets() SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown) { + switch_event_free_subclass("websocket::stophook"); + /* Cann't find a way to stop the websockets, use this for a workaround before finding the real one that works */ stop_all_websockets(); diff --git a/src/switch_event.c b/src/switch_event.c index ae73436306..89f1b74cf2 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -1993,6 +1993,22 @@ SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, con return SWITCH_STATUS_SUCCESS; } +SWITCH_DECLARE(switch_status_t) switch_event_get_custom_events(switch_console_callback_match_t **matches) +{ + switch_hash_index_t *hi = NULL; + const void *var; + void *val; + int x = 0; + + for (hi = switch_core_hash_first(CUSTOM_HASH); hi; hi = switch_core_hash_next(&hi)) { + switch_core_hash_this(hi, &var, NULL, &val); + switch_console_push_match(matches, (const char *) var); + x++; + } + + return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; +} + SWITCH_DECLARE(switch_status_t) switch_event_bind_removable(const char *id, switch_event_types_t event, const char *subclass_name, switch_event_callback_t callback, void *user_data, switch_event_node_t **node) { From 3aa051e1a14dfc40a77757247b6849dbd2c9c69d Mon Sep 17 00:00:00 2001 From: Saumar Hajjar Date: Mon, 21 Sep 2015 23:36:42 -0300 Subject: [PATCH 112/136] FS-7673: ODBC NULL value incorrectly evaluated in mod_v8 --- src/mod/languages/mod_v8/src/fsodbc.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mod/languages/mod_v8/src/fsodbc.cpp b/src/mod/languages/mod_v8/src/fsodbc.cpp index 79cf57a906..80bc90ebd7 100644 --- a/src/mod/languages/mod_v8/src/fsodbc.cpp +++ b/src/mod/languages/mod_v8/src/fsodbc.cpp @@ -315,12 +315,17 @@ JS_ODBC_FUNCTION_IMPL(GetData) SQLULEN ColumnSize; SQLCHAR name[1024] = ""; SQLCHAR *data = _colbuf; - + SQLLEN pcbValue; + SQLDescribeCol(_stmt, x, name, sizeof(name), &NameLength, &DataType, &ColumnSize, &DecimalDigits, &Nullable); - SQLGetData(_stmt, x, SQL_C_CHAR, _colbuf, _cblen, NULL); + SQLGetData(_stmt, x, SQL_C_CHAR, _colbuf, _cblen, &pcbValue); if (name) { - arg->Set(String::NewFromUtf8(GetIsolate(), (const char *)name), String::NewFromUtf8(GetIsolate(), data ? (const char *)data : "")); + if (SQL_NULL_DATA == pcbValue) { + arg->Set(String::NewFromUtf8(GetIsolate(), (const char *)name), Null(info.GetIsolate())); + } else { + arg->Set(String::NewFromUtf8(GetIsolate(), (const char *)name), String::NewFromUtf8(GetIsolate(), data ? (const char *)data : "")); + } } } From 12e90ce989a44888c1e5f8726a83c8d764dfb881 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 22 Sep 2015 04:23:20 +0000 Subject: [PATCH 113/136] Use systemd RuntimeDirectory for /run/freeswitch This changes how we create the temporary directory /run/freeswitch when starting FS with systemd. The /run directory starts empty after a system reboot, so we need to ensure this directory is present. Originally for the FS systemd unit we created /run/freeswitch using ExecStartPre and mkdir. With commit adb5f0d this was changed to use the tmpfiles.d(5) mechanism (but the ExecStartPre/mkdir code was not removed). As part of systemd.exec(5), systemd provides a mechanism to automatically manage these directories under /run and to bind their lifetime to the lifetime of the process. This is actually what we want here as compared to the more general tmpfiles.d(5) mechanism. This commit moves to using the RuntimeDirectory= mechanism and removes the obsolete ExecStartPre/mkdir code. References-commit: adb5f0d278bae7ccda1d1807f094876a4671f94d --- debian/freeswitch-systemd.freeswitch.conf | 1 - debian/freeswitch-systemd.freeswitch.service | 4 ++-- debian/freeswitch-systemd.install | 1 - debian/rules | 4 ---- 4 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 debian/freeswitch-systemd.freeswitch.conf diff --git a/debian/freeswitch-systemd.freeswitch.conf b/debian/freeswitch-systemd.freeswitch.conf deleted file mode 100644 index 77dfd6908c..0000000000 --- a/debian/freeswitch-systemd.freeswitch.conf +++ /dev/null @@ -1 +0,0 @@ -d /run/freeswitch 0755 freeswitch freeswitch - diff --git a/debian/freeswitch-systemd.freeswitch.service b/debian/freeswitch-systemd.freeswitch.service index 3ddae52112..ac24c49a3e 100644 --- a/debian/freeswitch-systemd.freeswitch.service +++ b/debian/freeswitch-systemd.freeswitch.service @@ -9,13 +9,13 @@ After=syslog.target network.target local-fs.target Type=forking PIDFile=/run/freeswitch/freeswitch.pid PermissionsStartOnly=true -ExecStartPre=/bin/mkdir -p /run/freeswitch -ExecStartPre=/bin/chown freeswitch:freeswitch /run/freeswitch ExecStartPre=/bin/chown freeswitch:freeswitch /etc/freeswitch/tls ExecStart=/usr/bin/freeswitch -ncwait -nonat TimeoutSec=45s Restart=always ; exec +RuntimeDirectory=freeswitch +RuntimeDirectoryMode=0755 WorkingDirectory=/var/log/freeswitch User=freeswitch Group=freeswitch diff --git a/debian/freeswitch-systemd.install b/debian/freeswitch-systemd.install index b554d1b2bd..d647282ecd 100644 --- a/debian/freeswitch-systemd.install +++ b/debian/freeswitch-systemd.install @@ -1,2 +1 @@ /lib/systemd/system/freeswitch.service -/usr/lib/tmpfiles.d/freeswitch.conf diff --git a/debian/rules b/debian/rules index 07437f271a..b2e43d68d0 100755 --- a/debian/rules +++ b/debian/rules @@ -100,10 +100,6 @@ override_dh_auto_install: dh_auto_install -- -C libs/esl pymod-install mkdir -p debian/tmp/lib/systemd/system install -m0644 debian/freeswitch-systemd.freeswitch.service debian/tmp/lib/systemd/system/freeswitch.service - - mkdir -p debian/tmp/usr/lib/tmpfiles.d - install -m0644 debian/freeswitch-systemd.freeswitch.conf debian/tmp/usr/lib/tmpfiles.d/freeswitch.conf - rm -f debian/tmp/usr/share/freeswitch/grammar/model/communicator/COPYING override_dh_installinit: From 16d0538fb577ecac6c28a2503415cf6e698c161d Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 22 Sep 2015 04:53:23 +0000 Subject: [PATCH 114/136] Move chown of /etc/freeswitch/tls to postinst Doing a chown of something in /etc/ as part of a systemd service file is totally broken. It's far too large a sledgehammer to point at /etc here. Someone may legitimately not be using /etc/freeswitch/tls in his configuration, in which case this chown would fail and cause FS to fail to start. Or someone may legitimately need /etc/freeswitch/tls to have different ownership, in which case we would clobber it here. The right thing to do is to create this directory in the postinst (which we already are, assuming there is not an existing configuration) and then perform the chown of it at the same time. FS-7697 --- debian/freeswitch-systemd.freeswitch.service | 2 -- debian/freeswitch.postinst | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/freeswitch-systemd.freeswitch.service b/debian/freeswitch-systemd.freeswitch.service index ac24c49a3e..8713ce2531 100644 --- a/debian/freeswitch-systemd.freeswitch.service +++ b/debian/freeswitch-systemd.freeswitch.service @@ -8,8 +8,6 @@ After=syslog.target network.target local-fs.target ; service Type=forking PIDFile=/run/freeswitch/freeswitch.pid -PermissionsStartOnly=true -ExecStartPre=/bin/chown freeswitch:freeswitch /etc/freeswitch/tls ExecStart=/usr/bin/freeswitch -ncwait -nonat TimeoutSec=45s Restart=always diff --git a/debian/freeswitch.postinst b/debian/freeswitch.postinst index 38f33b1797..b19277fe8b 100644 --- a/debian/freeswitch.postinst +++ b/debian/freeswitch.postinst @@ -31,6 +31,7 @@ case "$1" in done if [ ! -d "/etc/freeswitch" ]; then mkdir -p /etc/freeswitch/tls/ + chown freeswitch:freeswitch /etc/freeswitch/tls cp -a /usr/share/freeswitch/conf/vanilla/* /etc/freeswitch/ fi ;; From 2184af8ea629982c5dbd1a3979e714740d7e9a4c Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 22 Sep 2015 05:21:27 +0000 Subject: [PATCH 115/136] Remove explicit set of WorkingDirectory In the systemd unit for FS/debian, if the WorkingDirectory is not set then it defaults to '/'. This is fine for FS, and is a common and expected chdir choice for daemons. We had previously set this to /run/freeswitch. Due to Debian having systemd-coredump(8) disabled, this was causing core files to be written to /run/freeswitch, which is a bad place for them as it's mounted on tmpfs. So in commit cd68e0f we changed this to the log directory /var/log/freeswitch. That choice is a bit usual as well on Debian. It's better to leave FS as running on '/'. This will prevent core files from being written unless the user adjusts `sysctl kernel.core_pattern`, which is a reasonable thing to expect if the user wants these files. Core files can be huge, and even having them go to /var/log unexpectedly can be a problem. When Debian adds the systemd-coredumps support this will all work nicely and automatically. ref: http://www.freedesktop.org/software/systemd/man/coredump.conf.html ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744964 References-commit: cd68e0fe1b4ae347c6a9a4108c6690db82baee3c FS-7909 --- debian/freeswitch-systemd.freeswitch.service | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/freeswitch-systemd.freeswitch.service b/debian/freeswitch-systemd.freeswitch.service index 8713ce2531..5a46d8731c 100644 --- a/debian/freeswitch-systemd.freeswitch.service +++ b/debian/freeswitch-systemd.freeswitch.service @@ -14,7 +14,6 @@ Restart=always ; exec RuntimeDirectory=freeswitch RuntimeDirectoryMode=0755 -WorkingDirectory=/var/log/freeswitch User=freeswitch Group=freeswitch LimitCORE=infinity From f7ba4c440279fbefda1e61052a4960909ed3ff74 Mon Sep 17 00:00:00 2001 From: Stefan Yohansson Date: Tue, 22 Sep 2015 10:23:41 -0300 Subject: [PATCH 116/136] FS-8089 [verto_communicator] Opening members list when start conference --- .../controllers/InCallController.js | 10 +++++++++- .../controllers/MainController.js | 18 ++++++++---------- .../src/vertoService/services/vertoService.js | 1 + 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js index c093be086f..47eb987a28 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js @@ -20,6 +20,14 @@ if (storage.data.videoCall) { $scope.callTemplate = 'partials/video_call.html'; } + + $rootScope.$on('call.conference', function(event, data) { + $timeout(function() { + if($scope.chatStatus) { + $scope.openChat(); + } + }); + }); $rootScope.$on('call.video', function(event, data) { $timeout(function() { @@ -78,4 +86,4 @@ } ]); -})(); \ No newline at end of file +})(); diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js index f7e3d5bb91..bd2f2562c1 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js @@ -12,7 +12,7 @@ $scope.verto = verto; $scope.storage = storage; $scope.call_history = angular.element("#call_history").hasClass('active'); - $scope.chatStatus = angular.element('#wrapper').hasClass('toggled'); + $rootScope.chatStatus = angular.element('#wrapper').hasClass('toggled'); /** * (explanation) scope in another controller extends rootScope (singleton) @@ -202,20 +202,20 @@ }; $scope.toggleChat = function() { - if ($scope.chatStatus && $rootScope.activePane === 'chat') { + if ($rootScope.chatStatus && $rootScope.activePane === 'chat') { $rootScope.chat_counter = 0; } angular.element('#wrapper').toggleClass('toggled'); - $scope.chatStatus = angular.element('#wrapper').hasClass('toggled'); + $rootScope.chatStatus = angular.element('#wrapper').hasClass('toggled'); }; - $scope.openChat = function() { - $scope.chatStatus = false; + $rootScope.openChat = function() { + $rootScope.chatStatus = false; angular.element('#wrapper').removeClass('toggled'); }; $scope.closeChat = function() { - $scope.chatStatus = true; + $rootScope.chatStatus = true; angular.element('#wrapper').addClass('toggled'); }; @@ -240,11 +240,9 @@ Fullscreen.cancel(); } - - console.log($scope.chatStatus); - if (!$scope.chatStatus) { + if (!$rootScope.chatStatus) { angular.element('#wrapper').toggleClass('toggled'); - $scope.chatStatus = angular.element('#wrapper').hasClass('toggled'); + $rootScope.chatStatus = angular.element('#wrapper').hasClass('toggled'); } $rootScope.dialpadNumber = ''; diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js index cb30f897a4..940ae1059d 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -335,6 +335,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora function startConference(v, dialog, pvtData) { $rootScope.$emit('call.video', 'video'); + $rootScope.$emit('call.conference', 'conference'); data.chattingWith = pvtData.chatID; data.confRole = pvtData.role; From 64a2e6820140de6b080b6bc033eec9897c2c151b Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Tue, 22 Sep 2015 10:49:41 -0300 Subject: [PATCH 117/136] FS-8095 [verto_communicator] Moving factory reset button to bottom left with red color and confirmation. Reloading page upon reset. --- html5/verto/verto_communicator/src/css/verto.css | 6 ++++++ .../src/partials/modal_settings.html | 2 +- .../vertoControllers/controllers/MainController.js | 2 +- .../controllers/ModalSettingsController.js | 11 ++++++++--- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/html5/verto/verto_communicator/src/css/verto.css b/html5/verto/verto_communicator/src/css/verto.css index 160ede11df..6fbb90f448 100644 --- a/html5/verto/verto_communicator/src/css/verto.css +++ b/html5/verto/verto_communicator/src/css/verto.css @@ -36,6 +36,12 @@ body { height: 100%; } +.modal-content .modal-footer button.btn-pull-left { + padding-left: 16px; + padding-right: 16px; + margin-left: 5px; +} + /* This is an technique to align the block centered vertically and horizontally in a page. */ .centered-block-frame { diff --git a/html5/verto/verto_communicator/src/partials/modal_settings.html b/html5/verto/verto_communicator/src/partials/modal_settings.html index dc08dbb9cc..0f258c2802 100644 --- a/html5/verto/verto_communicator/src/partials/modal_settings.html +++ b/html5/verto/verto_communicator/src/partials/modal_settings.html @@ -24,7 +24,6 @@ Refresh device list - Factory reset
@@ -113,6 +112,7 @@
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js index f7e3d5bb91..f189b8c667 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js @@ -83,7 +83,7 @@ * Logout the user from verto server and * redirects him to login page. */ - $scope.logout = function() { + $rootScope.logout = function() { var disconnect = function() { var disconnectCallback = function(v, connected) { console.debug('Redirecting to login page.'); diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js index 9324fa2f37..b144d3026e 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js @@ -24,11 +24,16 @@ $scope.refreshDeviceList = function() { return verto.refreshDevices(); - } + }; $scope.resetSettings = function() { - storage.factoryReset(); - } + if (confirm('Factory Reset Settings?')) { + storage.factoryReset(); + $scope.logout(); + $scope.ok(); + window.location.reload(); + }; + }; } ]); From 6a9f936f72e1a022d421112839e408baae717283 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 22 Sep 2015 11:21:15 -0500 Subject: [PATCH 118/136] FS-8202 #resolve [Stop peer when ending screen share] --- html5/verto/js/src/jquery.FSRTC.js | 7 +++++++ html5/verto/js/src/jquery.verto.js | 6 ++++-- html5/verto/video_demo/js/verto-min.js | 7 ++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index 1bdeeed80f..d1ea75ed90 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -287,6 +287,13 @@ onSuccess, onError); }; + $.FSRTC.prototype.stopPeer = function() { + if (self.peer) { + console.log("stopping peer"); + self.peer.stop(); + } + } + $.FSRTC.prototype.stop = function() { var self = this; diff --git a/html5/verto/js/src/jquery.verto.js b/html5/verto/js/src/jquery.verto.js index 0db4bb64fd..ee88a8f507 100644 --- a/html5/verto/js/src/jquery.verto.js +++ b/html5/verto/js/src/jquery.verto.js @@ -1962,7 +1962,7 @@ dialog.rtc = new $.FSRTC({ callbacks: RTCcallbacks, - localVideo: dialog.localVideo, + localVideo: dialog.screenShare ? null : dialog.localVideo, useVideo: dialog.params.useVideo ? dialog.videoStream : null, useAudio: dialog.audioStream, useStereo: dialog.params.useStereo, @@ -2093,7 +2093,9 @@ break; case $.verto.enum.state.destroy: delete dialog.verto.dialogs[dialog.callID]; - if (!dialog.params.screenShare) { + if (dialog.params.screenShare) { + dialog.rtc.stopPeer(); + } else { dialog.rtc.stop(); } break; diff --git a/html5/verto/video_demo/js/verto-min.js b/html5/verto/video_demo/js/verto-min.js index 2ea234eb45..758c3d6f9a 100644 --- a/html5/verto/video_demo/js/verto-min.js +++ b/html5/verto/video_demo/js/verto-min.js @@ -27,7 +27,8 @@ function onRemoteStream(self,stream){if(self.options.useVideo){self.options.useV var element=self.options.useAudio;console.log("REMOTE STREAM",stream,element);if(typeof element.srcObject!=='undefined'){element.srcObject=stream;}else if(typeof element.mozSrcObject!=='undefined'){element.mozSrcObject=stream;}else if(typeof element.src!=='undefined'){element.src=URL.createObjectURL(stream);}else{console.error('Error attaching stream to element.');} self.options.useAudio.play();self.remoteStream=stream;} function onOfferSDP(self,sdp){self.mediaData.SDP=self.stereoHack(sdp.sdp);console.log("Offer SDP");doCallback(self,"onOfferSDP");} -$.FSRTC.prototype.answer=function(sdp,onSuccess,onError){this.peer.addAnswerSDP({type:"answer",sdp:sdp},onSuccess,onError);};$.FSRTC.prototype.stop=function(){var self=this;if(self.options.useVideo){self.options.useVideo.style.display='none';if(moz){self.options.useVideo['mozSrcObject']=null;}else{self.options.useVideo['src']='';}} +$.FSRTC.prototype.answer=function(sdp,onSuccess,onError){this.peer.addAnswerSDP({type:"answer",sdp:sdp},onSuccess,onError);};$.FSRTC.prototype.stopPeer=function(){if(self.peer){console.log("stopping peer");self.peer.stop();}} +$.FSRTC.prototype.stop=function(){var self=this;if(self.options.useVideo){self.options.useVideo.style.display='none';if(moz){self.options.useVideo['mozSrcObject']=null;}else{self.options.useVideo['src']='';}} if(self.localStream){self.localStream.stop();self.localStream=null;} if(self.options.localVideo){self.options.localVideo.style.display='none';if(moz){self.options.localVideo['mozSrcObject']=null;}else{self.options.localVideo['src']='';}} if(self.options.localVideoStream){self.options.localVideoStream.stop();} @@ -238,7 +239,7 @@ if(!dialog.params.remote_caller_id_name){dialog.params.remote_caller_id_name="No if(!dialog.params.remote_caller_id_number){dialog.params.remote_caller_id_number="UNKNOWN";} RTCcallbacks.onMessage=function(rtc,msg){console.debug(msg);};RTCcallbacks.onAnswerSDP=function(rtc,sdp){console.error("answer sdp",sdp);};}else{dialog.params.remote_caller_id_name="Outbound Call";dialog.params.remote_caller_id_number=dialog.params.destination_number;} RTCcallbacks.onICESDP=function(rtc){console.log("RECV "+rtc.type+" SDP",rtc.mediaData.SDP);if(dialog.state==$.verto.enum.state.requesting||dialog.state==$.verto.enum.state.answering||dialog.state==$.verto.enum.state.active){location.reload();return;} -if(rtc.type=="offer"){if(dialog.state==$.verto.enum.state.active){dialog.setState($.verto.enum.state.requesting);dialog.sendMethod("verto.attach",{sdp:rtc.mediaData.SDP});}else{dialog.setState($.verto.enum.state.requesting);dialog.sendMethod("verto.invite",{sdp:rtc.mediaData.SDP});}}else{dialog.setState($.verto.enum.state.answering);dialog.sendMethod(dialog.attach?"verto.attach":"verto.answer",{sdp:dialog.rtc.mediaData.SDP});}};RTCcallbacks.onICE=function(rtc){if(rtc.type=="offer"){console.log("offer",rtc.mediaData.candidate);return;}};RTCcallbacks.onStream=function(rtc,stream){console.log("stream started");};RTCcallbacks.onError=function(e){console.error("ERROR:",e);dialog.hangup({cause:"Device or Permission Error"});};dialog.rtc=new $.FSRTC({callbacks:RTCcallbacks,localVideo:dialog.localVideo,useVideo:dialog.params.useVideo?dialog.videoStream:null,useAudio:dialog.audioStream,useStereo:dialog.params.useStereo,videoParams:dialog.params.videoParams,audioParams:verto.options.audioParams,iceServers:verto.options.iceServers,screenShare:dialog.screenShare,useCamera:dialog.useCamera,useMic:dialog.useMic,useSpeak:dialog.useSpeak});dialog.rtc.verto=dialog.verto;if(dialog.direction==$.verto.enum.direction.inbound){if(dialog.attach){dialog.answer();}else{dialog.ring();}}};$.verto.dialog.prototype.invite=function(){var dialog=this;dialog.rtc.call();};$.verto.dialog.prototype.sendMethod=function(method,obj){var dialog=this;obj.dialogParams={};for(var i in dialog.params){if(i=="sdp"&&method!="verto.invite"&&method!="verto.attach"){continue;} +if(rtc.type=="offer"){if(dialog.state==$.verto.enum.state.active){dialog.setState($.verto.enum.state.requesting);dialog.sendMethod("verto.attach",{sdp:rtc.mediaData.SDP});}else{dialog.setState($.verto.enum.state.requesting);dialog.sendMethod("verto.invite",{sdp:rtc.mediaData.SDP});}}else{dialog.setState($.verto.enum.state.answering);dialog.sendMethod(dialog.attach?"verto.attach":"verto.answer",{sdp:dialog.rtc.mediaData.SDP});}};RTCcallbacks.onICE=function(rtc){if(rtc.type=="offer"){console.log("offer",rtc.mediaData.candidate);return;}};RTCcallbacks.onStream=function(rtc,stream){console.log("stream started");};RTCcallbacks.onError=function(e){console.error("ERROR:",e);dialog.hangup({cause:"Device or Permission Error"});};dialog.rtc=new $.FSRTC({callbacks:RTCcallbacks,localVideo:dialog.screenShare?null:dialog.localVideo,useVideo:dialog.params.useVideo?dialog.videoStream:null,useAudio:dialog.audioStream,useStereo:dialog.params.useStereo,videoParams:dialog.params.videoParams,audioParams:verto.options.audioParams,iceServers:verto.options.iceServers,screenShare:dialog.screenShare,useCamera:dialog.useCamera,useMic:dialog.useMic,useSpeak:dialog.useSpeak});dialog.rtc.verto=dialog.verto;if(dialog.direction==$.verto.enum.direction.inbound){if(dialog.attach){dialog.answer();}else{dialog.ring();}}};$.verto.dialog.prototype.invite=function(){var dialog=this;dialog.rtc.call();};$.verto.dialog.prototype.sendMethod=function(method,obj){var dialog=this;obj.dialogParams={};for(var i in dialog.params){if(i=="sdp"&&method!="verto.invite"&&method!="verto.attach"){continue;} obj.dialogParams[i]=dialog.params[i];} dialog.verto.rpcClient.call(method,obj,function(e){dialog.processReply(method,true,e);},function(e){dialog.processReply(method,false,e);});};function checkStateChange(oldS,newS){if(newS==$.verto.enum.state.purge||$.verto.enum.states[oldS.name][newS.name]){return true;} return false;} @@ -249,7 +250,7 @@ if(!dialog.cause){dialog.cause="NORMAL CLEARING";} if(dialog.callbacks.onDialogState){dialog.callbacks.onDialogState(this);} switch(dialog.state){case $.verto.enum.state.early:case $.verto.enum.state.active:var speaker=dialog.useSpeak;console.info("Using Speaker: ",speaker);if(speaker&&speaker!=="any"){var videoElement=dialog.audioStream;setTimeout(function(){console.info("Setting speaker:",videoElement,speaker);attachSinkId(videoElement,speaker);},500);} break;case $.verto.enum.state.trying:setTimeout(function(){if(dialog.state==$.verto.enum.state.trying){dialog.setState($.verto.enum.state.hangup);}},30000);break;case $.verto.enum.state.purge:dialog.setState($.verto.enum.state.destroy);break;case $.verto.enum.state.hangup:if(dialog.lastState.val>$.verto.enum.state.requesting.val&&dialog.lastState.val<$.verto.enum.state.hangup.val){dialog.sendMethod("verto.bye",{});} -dialog.setState($.verto.enum.state.destroy);break;case $.verto.enum.state.destroy:delete dialog.verto.dialogs[dialog.callID];if(!dialog.params.screenShare){dialog.rtc.stop();} +dialog.setState($.verto.enum.state.destroy);break;case $.verto.enum.state.destroy:delete dialog.verto.dialogs[dialog.callID];if(dialog.params.screenShare){dialog.rtc.stopPeer();}else{dialog.rtc.stop();} break;} return true;};$.verto.dialog.prototype.processReply=function(method,success,e){var dialog=this;switch(method){case"verto.answer":case"verto.attach":if(success){dialog.setState($.verto.enum.state.active);}else{dialog.hangup();} break;case"verto.invite":if(success){dialog.setState($.verto.enum.state.trying);}else{dialog.setState($.verto.enum.state.destroy);} From 18b5b4cae0d2a1ab9d906cb6643c2a3b8c2d27d2 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 22 Sep 2015 13:03:02 -0500 Subject: [PATCH 119/136] FS-8031 firefox gives up very fast, autoadj on any valid packet when dtls is not up --- src/switch_rtp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index c7b85f2049..0ddce9648e 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1185,9 +1185,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d rtp_session->wrong_addrs = 0; } else { if ((rtp_session->dtls->state != DS_READY || !ice->ready || !ice->rready)) { - if (elapsed > 500 || rtp_session->wrong_addrs > 1) { - do_adj = 1; - } + do_adj = 1; } else if (rtp_session->wrong_addrs > 5 || elapsed >= 3000) { do_adj++; } From 145ae8a0fbfead007c178f315dc1716925336fd8 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 22 Sep 2015 13:52:50 -0500 Subject: [PATCH 120/136] FS-8031 firefox was giving up because we replied to their stun --- src/switch_rtp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 0ddce9648e..5c4e48aaf7 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1185,7 +1185,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d rtp_session->wrong_addrs = 0; } else { if ((rtp_session->dtls->state != DS_READY || !ice->ready || !ice->rready)) { - do_adj = 1; + do_adj++; } else if (rtp_session->wrong_addrs > 5 || elapsed >= 3000) { do_adj++; } @@ -1229,8 +1229,9 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d ice->last_ok = now; rtp_session->wrong_addrs = 0; } - - switch_socket_sendto(sock_output, from_addr, 0, (void *) rpacket, &bytes); + if (cmp) { + switch_socket_sendto(sock_output, from_addr, 0, (void *) rpacket, &bytes); + } } } else if (packet->header.type == SWITCH_STUN_BINDING_ERROR_RESPONSE) { From 5587a0d614b929b069b8d601fa3731a36f4abbdd Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 22 Sep 2015 15:10:29 -0500 Subject: [PATCH 121/136] FS-8204 #resolve [Add stereo audio support for opus on FireFox] --- html5/verto/js/src/jquery.FSRTC.js | 18 ++++++++++++------ html5/verto/video_demo/js/verto-min.js | 5 +++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index d1ea75ed90..282d6e2e33 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -168,18 +168,24 @@ var sdpLines = sdp.split('\r\n'); // Find opus payload. - var opusIndex = findLine(sdpLines, 'a=rtpmap', 'opus/48000'), - opusPayload; - if (opusIndex) { + var opusIndex = findLine(sdpLines, 'a=rtpmap', 'opus/48000'), opusPayload; + + if (!opusIndex) { + return sdp; + } else { opusPayload = getCodecPayloadType(sdpLines[opusIndex]); } // Find the payload in fmtp line. var fmtpLineIndex = findLine(sdpLines, 'a=fmtp:' + opusPayload.toString()); - if (fmtpLineIndex === null) return sdp; - // Append stereo=1 to fmtp line. - sdpLines[fmtpLineIndex] = sdpLines[fmtpLineIndex].concat('; stereo=1'); + if (fmtpLineIndex === null) { + // create an fmtp line + sdpLines[opusIndex] = sdpLines[opusIndex] + '\r\na=fmtp:' + opusPayload.toString() + " stereo=1" + } else { + // Append stereo=1 to fmtp line. + sdpLines[fmtpLineIndex] = sdpLines[fmtpLineIndex].concat('; stereo=1'); + } sdp = sdpLines.join('\r\n'); return sdp; diff --git a/html5/verto/video_demo/js/verto-min.js b/html5/verto/video_demo/js/verto-min.js index 758c3d6f9a..372e833419 100644 --- a/html5/verto/video_demo/js/verto-min.js +++ b/html5/verto/video_demo/js/verto-min.js @@ -10,8 +10,9 @@ $.FSRTC=function(options){this.options=$.extend({useVideo:null,useStereo:false,u if(self.options.useVideo){self.options.useVideo.style.display='none';} setCompat();checkCompat();};$.FSRTC.validRes=[];$.FSRTC.prototype.useVideo=function(obj,local){var self=this;if(obj){self.options.useVideo=obj;self.options.localVideo=local;if(moz){self.constraints.offerToReceiveVideo=true;}else{self.constraints.mandatory.OfferToReceiveVideo=true;}}else{self.options.useVideo=null;self.options.localVideo=null;if(moz){self.constraints.offerToReceiveVideo=false;}else{self.constraints.mandatory.OfferToReceiveVideo=false;}} if(self.options.useVideo){self.options.useVideo.style.display='none';}};$.FSRTC.prototype.useStereo=function(on){var self=this;self.options.useStereo=on;};$.FSRTC.prototype.stereoHack=function(sdp){var self=this;if(!self.options.useStereo){return sdp;} -var sdpLines=sdp.split('\r\n');var opusIndex=findLine(sdpLines,'a=rtpmap','opus/48000'),opusPayload;if(opusIndex){opusPayload=getCodecPayloadType(sdpLines[opusIndex]);} -var fmtpLineIndex=findLine(sdpLines,'a=fmtp:'+opusPayload.toString());if(fmtpLineIndex===null)return sdp;sdpLines[fmtpLineIndex]=sdpLines[fmtpLineIndex].concat('; stereo=1');sdp=sdpLines.join('\r\n');return sdp;};function setCompat(){$.FSRTC.moz=!!navigator.mozGetUserMedia;if(!navigator.getUserMedia){navigator.getUserMedia=navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia;}} +var sdpLines=sdp.split('\r\n');var opusIndex=findLine(sdpLines,'a=rtpmap','opus/48000'),opusPayload;if(!opusIndex){return sdp;}else{opusPayload=getCodecPayloadType(sdpLines[opusIndex]);} +var fmtpLineIndex=findLine(sdpLines,'a=fmtp:'+opusPayload.toString());if(fmtpLineIndex===null){sdpLines[opusIndex]=sdpLines[opusIndex]+'\r\na=fmtp:'+opusPayload.toString()+" stereo=1"}else{sdpLines[fmtpLineIndex]=sdpLines[fmtpLineIndex].concat('; stereo=1');} +sdp=sdpLines.join('\r\n');return sdp;};function setCompat(){$.FSRTC.moz=!!navigator.mozGetUserMedia;if(!navigator.getUserMedia){navigator.getUserMedia=navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia;}} function checkCompat(){if(!navigator.getUserMedia){alert('This application cannot function in this browser.');return false;} return true;} function onStreamError(self,e){console.log('There has been a problem retrieving the streams - did you allow access? Check Device Resolution',e);doCallback(self,"onError",e);} From 86805cece39a131f7c7a4db8b1498d73868b7385 Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Tue, 22 Sep 2015 17:15:04 -0300 Subject: [PATCH 122/136] FS-7980 [verto_communicator] Fixing video padding-top. --- html5/verto/verto_communicator/src/css/verto.css | 1 + 1 file changed, 1 insertion(+) diff --git a/html5/verto/verto_communicator/src/css/verto.css b/html5/verto/verto_communicator/src/css/verto.css index 6fbb90f448..e679fd4eb7 100644 --- a/html5/verto/verto_communicator/src/css/verto.css +++ b/html5/verto/verto_communicator/src/css/verto.css @@ -489,6 +489,7 @@ body .modal-body .btn-group .btn.active { #incall .panel { background: #333; + padding-top: 5px; } #incall .hangup-button { From 7ea9b684a70aad5433c9a717a766f50a44e4bfee Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 22 Sep 2015 15:31:09 -0500 Subject: [PATCH 123/136] FS-8204 add sprop-stereo also --- html5/verto/js/src/jquery.FSRTC.js | 4 ++-- html5/verto/video_demo/js/verto-min.js | 2 +- src/mod/codecs/mod_opus/mod_opus.c | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index 282d6e2e33..c6296f36a8 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -181,10 +181,10 @@ if (fmtpLineIndex === null) { // create an fmtp line - sdpLines[opusIndex] = sdpLines[opusIndex] + '\r\na=fmtp:' + opusPayload.toString() + " stereo=1" + sdpLines[opusIndex] = sdpLines[opusIndex] + '\r\na=fmtp:' + opusPayload.toString() + " stereo=1; sprop-stereo=1" } else { // Append stereo=1 to fmtp line. - sdpLines[fmtpLineIndex] = sdpLines[fmtpLineIndex].concat('; stereo=1'); + sdpLines[fmtpLineIndex] = sdpLines[fmtpLineIndex].concat('; stereo=1; sprop-stereo=1'); } sdp = sdpLines.join('\r\n'); diff --git a/html5/verto/video_demo/js/verto-min.js b/html5/verto/video_demo/js/verto-min.js index 372e833419..622cfa10a4 100644 --- a/html5/verto/video_demo/js/verto-min.js +++ b/html5/verto/video_demo/js/verto-min.js @@ -11,7 +11,7 @@ if(self.options.useVideo){self.options.useVideo.style.display='none';} setCompat();checkCompat();};$.FSRTC.validRes=[];$.FSRTC.prototype.useVideo=function(obj,local){var self=this;if(obj){self.options.useVideo=obj;self.options.localVideo=local;if(moz){self.constraints.offerToReceiveVideo=true;}else{self.constraints.mandatory.OfferToReceiveVideo=true;}}else{self.options.useVideo=null;self.options.localVideo=null;if(moz){self.constraints.offerToReceiveVideo=false;}else{self.constraints.mandatory.OfferToReceiveVideo=false;}} if(self.options.useVideo){self.options.useVideo.style.display='none';}};$.FSRTC.prototype.useStereo=function(on){var self=this;self.options.useStereo=on;};$.FSRTC.prototype.stereoHack=function(sdp){var self=this;if(!self.options.useStereo){return sdp;} var sdpLines=sdp.split('\r\n');var opusIndex=findLine(sdpLines,'a=rtpmap','opus/48000'),opusPayload;if(!opusIndex){return sdp;}else{opusPayload=getCodecPayloadType(sdpLines[opusIndex]);} -var fmtpLineIndex=findLine(sdpLines,'a=fmtp:'+opusPayload.toString());if(fmtpLineIndex===null){sdpLines[opusIndex]=sdpLines[opusIndex]+'\r\na=fmtp:'+opusPayload.toString()+" stereo=1"}else{sdpLines[fmtpLineIndex]=sdpLines[fmtpLineIndex].concat('; stereo=1');} +var fmtpLineIndex=findLine(sdpLines,'a=fmtp:'+opusPayload.toString());if(fmtpLineIndex===null){sdpLines[opusIndex]=sdpLines[opusIndex]+'\r\na=fmtp:'+opusPayload.toString()+" stereo=1; sprop-stereo=1"}else{sdpLines[fmtpLineIndex]=sdpLines[fmtpLineIndex].concat('; stereo=1; sprop-stereo=1');} sdp=sdpLines.join('\r\n');return sdp;};function setCompat(){$.FSRTC.moz=!!navigator.mozGetUserMedia;if(!navigator.getUserMedia){navigator.getUserMedia=navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia;}} function checkCompat(){if(!navigator.getUserMedia){alert('This application cannot function in this browser.');return false;} return true;} diff --git a/src/mod/codecs/mod_opus/mod_opus.c b/src/mod/codecs/mod_opus/mod_opus.c index 6f56727667..159a50c22b 100644 --- a/src/mod/codecs/mod_opus/mod_opus.c +++ b/src/mod/codecs/mod_opus/mod_opus.c @@ -253,6 +253,7 @@ static char *gen_fmtp(opus_codec_settings_t *settings, switch_memory_pool_t *poo } if (settings->stereo) { + settings->sprop_stereo = settings->stereo; snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "stereo=%d; ", settings->stereo); } From e677044dfa1c8ef5d0e5b7a425a36586168d834d Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Tue, 22 Sep 2015 18:21:53 -0300 Subject: [PATCH 124/136] FS-8200 [verto_communicator] Ending screenshare if user hangup call. Screenshare now is for all instead of only mods. --- html5/verto/verto_communicator/src/partials/video_call.html | 6 +++--- .../src/vertoControllers/controllers/MainController.js | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/html5/verto/verto_communicator/src/partials/video_call.html b/html5/verto/verto_communicator/src/partials/video_call.html index 8c5ec45e7f..da339e4878 100644 --- a/html5/verto/verto_communicator/src/partials/video_call.html +++ b/html5/verto/verto_communicator/src/partials/video_call.html @@ -17,9 +17,6 @@ -
+ diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js index 10de084ee0..0363d91f27 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js @@ -391,7 +391,9 @@ //}; // //verto.hangup(hangupCallback); - + if (verto.data.shareCall) { + verto.screenshareHangup(); + } verto.hangup(); }; From 5bcff7777c34a9dc3317675035e5391b1474c80f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 22 Sep 2015 16:35:00 -0500 Subject: [PATCH 125/136] FS-8130 add jb_video_low_bitrate for a bit rate to ask for when the jb is taxed --- src/switch_jitterbuffer.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/switch_jitterbuffer.c b/src/switch_jitterbuffer.c index 36c3c45e00..cf6bf6dd69 100644 --- a/src/switch_jitterbuffer.c +++ b/src/switch_jitterbuffer.c @@ -82,6 +82,7 @@ struct switch_jb_s { uint32_t samples_per_frame; uint32_t samples_per_second; uint32_t bitrate_control; + uint32_t video_low_bitrate; uint8_t write_init; uint8_t read_init; uint8_t debug_level; @@ -740,8 +741,19 @@ SWITCH_DECLARE(void) switch_jb_ts_mode(switch_jb_t *jb, uint32_t samples_per_fra SWITCH_DECLARE(void) switch_jb_set_session(switch_jb_t *jb, switch_core_session_t *session) { + const char *var; + jb->session = session; jb->channel = switch_core_session_get_channel(session); + + if (jb->type == SJB_VIDEO && (var = switch_channel_get_variable_dup(jb->channel, "jb_video_low_bitrate", SWITCH_FALSE, -1))) { + int tmp = atoi(var); + + if (tmp > 128 && tmp < 10240) { + jb->video_low_bitrate = (uint32_t)tmp; + } + } + } SWITCH_DECLARE(void) switch_jb_set_flag(switch_jb_t *jb, switch_jb_flag_t flag) @@ -1140,7 +1152,7 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp jb->consec_miss_count = 0; jb->consec_good_count = 0; - if (jb->type == SJB_VIDEO && jb->channel) { + if (jb->type == SJB_VIDEO && jb->channel && jb->video_low_bitrate) { //switch_time_t now = switch_time_now(); //int ok = (now - jb->last_bitrate_change) > 10000; @@ -1151,10 +1163,10 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp if (jb->session) { switch_core_session_request_video_refresh(jb->session); } - } else if (!switch_channel_test_flag(jb->channel, CF_VIDEO_BITRATE_UNMANAGABLE) && jb->frame_len > jb->min_frame_len + 1) { + } else if (!switch_channel_test_flag(jb->channel, CF_VIDEO_BITRATE_UNMANAGABLE) && jb->frame_len > jb->min_frame_len * 2) { switch_core_session_message_t msg = { 0 }; - jb->bitrate_control = 512; + jb->bitrate_control = jb->video_low_bitrate; msg.message_id = SWITCH_MESSAGE_INDICATE_BITRATE_REQ; msg.numeric_arg = jb->bitrate_control * 1024; From e1f93e4079268b435f2143005028f93960288e1d Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 22 Sep 2015 19:17:45 -0500 Subject: [PATCH 126/136] FS-8183 tweak the CSS to look better --- html5/verto/verto_communicator/src/css/verto.css | 4 ++++ html5/verto/verto_communicator/src/partials/login.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/html5/verto/verto_communicator/src/css/verto.css b/html5/verto/verto_communicator/src/css/verto.css index e679fd4eb7..df7efea2f7 100644 --- a/html5/verto/verto_communicator/src/css/verto.css +++ b/html5/verto/verto_communicator/src/css/verto.css @@ -78,6 +78,10 @@ button.btn i { z-index:1001; } +.googlelogin { + margin: 5px 0px; +} + .navbar .navbar-nav > li.navbar-item-icon > a { padding: 18px; height: 60px; diff --git a/html5/verto/verto_communicator/src/partials/login.html b/html5/verto/verto_communicator/src/partials/login.html index 42a1edbe55..58ac2e9f9c 100644 --- a/html5/verto/verto_communicator/src/partials/login.html +++ b/html5/verto/verto_communicator/src/partials/login.html @@ -50,7 +50,7 @@
-
+
From 819a2c13a95de1b0a333ca5eecd8438d786339de Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 23 Sep 2015 10:35:45 -0500 Subject: [PATCH 127/136] FS-8210 #resolve [mod_verto can be unloaded while it is in use] --- src/mod/endpoints/mod_verto/mod_verto.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index a2aaed5a64..69ef7ac767 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -2036,6 +2036,13 @@ static void untrack_pvt(verto_pvt_t *tech_pvt) switch_thread_rwlock_unlock(globals.tech_rwlock); } +switch_endpoint_interface_t *verto_endpoint_interface = NULL; + +static switch_status_t verto_on_destroy(switch_core_session_t *session) +{ + UNPROTECT_INTERFACE(verto_endpoint_interface); + return SWITCH_STATUS_SUCCESS; +} static switch_status_t verto_on_hangup(switch_core_session_t *session) { @@ -2244,7 +2251,7 @@ static switch_state_handler_table_t verto_state_handlers = { /*.on_reset */ NULL, /*.on_park */ NULL, /*.on_reporting */ NULL, - /*.on_destroy */ NULL, + /*.on_destroy */ verto_on_destroy, SSH_FLAG_STICKY }; @@ -2478,11 +2485,13 @@ static int verto_recover_callback(switch_core_session_t *session) const char *profile_name = NULL, *jsock_uuid_str = NULL; switch_channel_t *channel = switch_core_session_get_channel(session); + PROTECT_INTERFACE(verto_endpoint_interface); profile_name = switch_channel_get_variable(channel, "verto_profile_name"); jsock_uuid_str = switch_channel_get_variable(channel, "jsock_uuid_str"); if (!(profile_name && jsock_uuid_str && (profile = find_profile(profile_name)))) { + UNPROTECT_INTERFACE(verto_endpoint_interface); return 0; } @@ -3297,6 +3306,8 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock } switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_uuid", call_id); + + PROTECT_INTERFACE(verto_endpoint_interface); if ((reason = switch_core_session_outgoing_channel(NULL, var_event, "rtc", NULL, &session, NULL, SOF_NONE, &cancel_cause)) != SWITCH_CAUSE_SUCCESS) { cJSON_AddItemToObject(obj, "message", cJSON_CreateString("Cannot create channel")); @@ -3456,6 +3467,8 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock return SWITCH_TRUE; } + UNPROTECT_INTERFACE(verto_endpoint_interface); + if (session) { switch_core_session_destroy(&session); } @@ -4848,7 +4861,7 @@ static void run_profiles(void) //// ENDPOINT -switch_endpoint_interface_t *verto_endpoint_interface; + static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event, switch_caller_profile_t *outbound_profile, @@ -4935,6 +4948,8 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session switch_call_cause_t cause = SWITCH_CAUSE_CHANNEL_UNACCEPTABLE; char *dest = NULL; + PROTECT_INTERFACE(verto_endpoint_interface); + if (!zstr(outbound_profile->destination_number)) { dest = strdup(outbound_profile->destination_number); } @@ -5041,6 +5056,10 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session end: + if (cause != SWITCH_CAUSE_SUCCESS) { + UNPROTECT_INTERFACE(verto_endpoint_interface); + } + switch_safe_free(dest); return cause; From 43ef01fbbe10d790c42c9ac631a3aab2f0f09376 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 23 Sep 2015 11:58:57 -0500 Subject: [PATCH 128/136] correct version of proposed patch --- src/include/switch_core_media.h | 3 +++ src/mod/endpoints/mod_sofia/mod_sofia.c | 24 ++++++----------- src/mod/endpoints/mod_sofia/sofia.c | 35 ++++++++++++++++++++++--- src/switch_channel.c | 8 +++--- 4 files changed, 46 insertions(+), 24 deletions(-) diff --git a/src/include/switch_core_media.h b/src/include/switch_core_media.h index 5c7c993238..9a60b7a5d1 100644 --- a/src/include/switch_core_media.h +++ b/src/include/switch_core_media.h @@ -1,3 +1,4 @@ + /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application * Copyright (C) 2005-2014, Anthony Minessale II @@ -107,6 +108,8 @@ typedef struct switch_core_media_params_s { char *local_sdp_str; char *last_sdp_str; char *last_sdp_response; + char *prev_sdp_str; + char *prev_sdp_response; char *stun_ip; switch_port_t stun_port; diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 8b141ef2eb..5cb2ff744b 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -1541,7 +1541,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi break; case SWITCH_MESSAGE_INDICATE_MESSAGE: { - char *ct = "text/plain"; + char ct[256] = "text/plain"; int ok = 0; if (!zstr(msg->string_array_arg[3]) && !strcmp(msg->string_array_arg[3], tech_pvt->caller_profile->uuid)) { @@ -1550,7 +1550,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } if (!zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) { - ct = switch_core_session_sprintf(session, "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]); + switch_snprintf(ct, sizeof(ct), "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]); ok = 1; } @@ -1582,26 +1582,14 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi break; case SWITCH_MESSAGE_INDICATE_INFO: { - char *ct = "freeswitch/data"; + char ct[256] = "freeswitch/data"; int ok = 0; - if (!zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) { - ct = switch_core_session_sprintf(session, "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]); - ok = 1; - } - if (switch_stristr("send_info", tech_pvt->x_freeswitch_support_remote)) { ok = 1; } - /* TODO: 1.4 remove this stanza */ - if (switch_true(switch_channel_get_variable(channel, "fs_send_unspported_info"))) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, - "fs_send_unspported_info is deprecated in favor of correctly spelled fs_send_unsupported_info\n"); - ok = 1; - } - - if (switch_true(switch_channel_get_variable(channel, "fs_send_unsupported_info"))) { + if (switch_true(switch_channel_get_variable_dup(channel, "fs_send_unsupported_info", SWITCH_FALSE, -1))) { ok = 1; } @@ -1609,6 +1597,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi char *headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_INFO_HEADER_PREFIX); const char *pl = NULL; + if (!zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) { + switch_snprintf(ct, sizeof(ct), "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]); + } + if (!zstr(msg->string_array_arg[2])) { pl = msg->string_array_arg[2]; } diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 4b6662ce03..e979618a8a 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -5977,14 +5977,24 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status switch_channel_set_variable_printf(channel, "sip_network_ip", "%s", network_ip); switch_channel_set_variable_printf(channel, "sip_network_port", "%d", network_port); - if ((caller_profile = switch_channel_get_caller_profile(channel))) { + if ((caller_profile = switch_channel_get_caller_profile(channel)) && !zstr(network_ip) && + (zstr(caller_profile->network_addr) || strcmp(caller_profile->network_addr, network_ip))) { caller_profile->network_addr = switch_core_strdup(caller_profile->pool, network_ip); } + if (tech_pvt->mparams.last_sdp_response) { + tech_pvt->mparams.prev_sdp_response = tech_pvt->mparams.last_sdp_response; + } tech_pvt->mparams.last_sdp_response = NULL; + if (sip->sip_payload && sip->sip_payload->pl_data) { switch_core_media_set_sdp_codec_string(session, sip->sip_payload->pl_data, SDP_TYPE_RESPONSE); - tech_pvt->mparams.last_sdp_response = switch_core_session_strdup(session, sip->sip_payload->pl_data); + + if (!zstr(tech_pvt->mparams.prev_sdp_response) && !strcmp(tech_pvt->mparams.prev_sdp_response, sip->sip_payload->pl_data)) { + tech_pvt->mparams.last_sdp_response = tech_pvt->mparams.prev_sdp_response; + } else { + tech_pvt->mparams.last_sdp_response = switch_core_session_strdup(session, sip->sip_payload->pl_data); + } } if (status > 299 && switch_channel_test_app_flag_key("T38", tech_pvt->channel, CF_APP_T38_REQ)) { @@ -6662,6 +6672,15 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } } } + + if (tech_pvt->mparams.last_sdp_str) { + tech_pvt->mparams.prev_sdp_str = tech_pvt->mparams.last_sdp_str; + } + + if (tech_pvt->mparams.last_sdp_response) { + tech_pvt->mparams.prev_sdp_response = tech_pvt->mparams.last_sdp_response; + } + tech_pvt->mparams.last_sdp_str = NULL; tech_pvt->mparams.last_sdp_response = NULL; @@ -9095,10 +9114,18 @@ void sofia_handle_sip_i_reinvite(switch_core_session_t *session, } if (channel) { + if (tech_pvt->mparams.last_sdp_str) { + tech_pvt->mparams.prev_sdp_str = tech_pvt->mparams.last_sdp_str; + } tech_pvt->mparams.last_sdp_str = NULL; + if (sip->sip_payload && sip->sip_payload->pl_data) { - switch_channel_set_variable(channel, "sip_reinvite_sdp", sip->sip_payload->pl_data); - tech_pvt->mparams.last_sdp_str = switch_core_session_strdup(session, sip->sip_payload->pl_data); + if (!zstr(tech_pvt->mparams.prev_sdp_str) && strcmp(tech_pvt->mparams.prev_sdp_str, sip->sip_payload->pl_data)) { + switch_channel_set_variable(channel, "sip_reinvite_sdp", sip->sip_payload->pl_data); + tech_pvt->mparams.last_sdp_str = switch_core_session_strdup(session, sip->sip_payload->pl_data); + } else { + tech_pvt->mparams.last_sdp_str = tech_pvt->mparams.prev_sdp_str; + } } switch_channel_execute_on(channel, "execute_on_sip_reinvite"); } diff --git a/src/switch_channel.c b/src/switch_channel.c index dfc23213f6..f528f84a9d 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -2523,21 +2523,21 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann switch_channel_test_flag(channel, CF_DIALPLAN) ? "true" : "false"); - if ((v = switch_channel_get_variable(channel, "presence_id"))) { + if ((v = switch_channel_get_variable_dup(channel, "presence_id", SWITCH_FALSE, -1))) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Presence-ID", v); } - if ((v = switch_channel_get_variable(channel, "presence_data"))) { + if ((v = switch_channel_get_variable_dup(channel, "presence_data", SWITCH_FALSE, -1))) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Presence-Data", v); } - if ((v = switch_channel_get_variable(channel, "presence_data_cols"))) { + if ((v = switch_channel_get_variable_dup(channel, "presence_data_cols", SWITCH_FALSE, -1))) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Presence-Data-Cols", v); switch_event_add_presence_data_cols(channel, event, "PD-"); } - if ((v = switch_channel_get_variable(channel, "call_uuid"))) { + if ((v = switch_channel_get_variable_dup(channel, "call_uuid", SWITCH_FALSE, -1))) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Call-UUID", v); } else { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Call-UUID", switch_core_session_get_uuid(channel->session)); From dd6da6e06aa2e9703b74b1b4e0489c6209f1f1e0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 23 Sep 2015 13:24:14 -0500 Subject: [PATCH 129/136] FS-8211 #resolve [Conference video recordings of layouts with overlap have flickering video] --- src/mod/applications/mod_conference/conference_video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 4e42afc3af..e78aa25700 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1915,7 +1915,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr canvas->video_timer_reset = 1; packet = switch_core_alloc(conference->pool, SWITCH_RTP_MAX_BUF_LEN); - + while (conference_globals.running && !conference_utils_test_flag(conference, CFLAG_DESTRUCT) && conference_utils_test_flag(conference, CFLAG_VIDEO_MUXING)) { switch_bool_t need_refresh = SWITCH_FALSE, send_keyframe = SWITCH_FALSE, need_reset = SWITCH_FALSE; switch_time_t now; @@ -2562,12 +2562,12 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr write_frame.img = write_img; + wait_for_canvas(canvas); + if (canvas->recording) { conference_video_check_recording(conference, canvas, &write_frame); } - wait_for_canvas(canvas); - if (conference->canvas_count > 1) { switch_image_t *img_copy = NULL; From 8b7465425d0a89c89784e4bbacf84cfe9051ec64 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 23 Sep 2015 14:46:47 -0500 Subject: [PATCH 130/136] FS-8130 regression in bridged channels with jitterbuffers --- src/switch_core_media.c | 3 ++- src/switch_rtp.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 0ffe6a6878..c0163f07e6 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -9075,7 +9075,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se const char *val; int ok = 0; - if (!(val = switch_channel_get_variable(session->channel, "rtp_jitter_buffer_during_bridge")) || switch_false(val)) { + if (!switch_channel_test_flag(session->channel, CF_VIDEO) && + (!(val = switch_channel_get_variable(session->channel, "rtp_jitter_buffer_during_bridge")) || switch_false(val))) { if (switch_channel_test_flag(session->channel, CF_JITTERBUFFER) && switch_channel_test_cap_partner(session->channel, CC_FS_RTP)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s PAUSE Jitterbuffer\n", switch_channel_get_name(session->channel)); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 5c4e48aaf7..bc3ca09fc9 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -5416,7 +5416,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t } } - if (rtp_session->jb && jb_valid(rtp_session)) { + if (rtp_session->jb && !rtp_session->pause_jb && jb_valid(rtp_session)) { uint32_t read_ssrc = ntohl(rtp_session->last_rtp_hdr.ssrc); if (rtp_session->recv_msg.header.m && rtp_session->recv_msg.header.pt != rtp_session->recv_te && From c167eb7d5dfe581188b9b3bb79da29af27b6b363 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 23 Sep 2015 16:40:13 -0500 Subject: [PATCH 131/136] FS-8190: fix build regression from original FS-8190 commit --- src/mod/event_handlers/mod_rayo/mod_rayo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mod/event_handlers/mod_rayo/mod_rayo.c b/src/mod/event_handlers/mod_rayo/mod_rayo.c index 60224cd9db..11828ce328 100644 --- a/src/mod/event_handlers/mod_rayo/mod_rayo.c +++ b/src/mod/event_handlers/mod_rayo/mod_rayo.c @@ -5273,10 +5273,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load) * Shutdown module. Notifies threads to stop. */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_rayo_shutdown) -{ +{ + switch_status_t result; + switch_event_free_subclass("rayo::cpa"); - - switch_status_t result = do_shutdown(); + result = do_shutdown(); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Module shutdown\n"); return result; } From 2ae48e9c173247a8aaf5641424734aef6d721b34 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 23 Sep 2015 18:00:38 -0500 Subject: [PATCH 132/136] FS-8215 #resolve [MacOSX nanosleep is not super accurate] --- src/switch_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_time.c b/src/switch_time.c index b539d9be10..01e6dfab15 100644 --- a/src/switch_time.c +++ b/src/switch_time.c @@ -175,7 +175,7 @@ static void do_sleep(switch_interval_time_t t) #elif defined(DARWIN) t -= OFFSET; ts.tv_sec = t / APR_USEC_PER_SEC; - ts.tv_nsec = (t % APR_USEC_PER_SEC) * 1000; + ts.tv_nsec = (t % APR_USEC_PER_SEC) * 850; nanosleep(&ts, NULL); #else apr_sleep(t); From 44014fdd1712508e2afff7578586d31678c8221d Mon Sep 17 00:00:00 2001 From: Ken Rice Date: Thu, 24 Sep 2015 00:05:45 -0500 Subject: [PATCH 133/136] FS-8183 Move google ClientID to config file where it belongs --- html5/verto/verto_communicator/src/partials/login.html | 2 +- .../src/vertoControllers/controllers/LoginController.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/html5/verto/verto_communicator/src/partials/login.html b/html5/verto/verto_communicator/src/partials/login.html index 58ac2e9f9c..5a0c03c7dd 100644 --- a/html5/verto/verto_communicator/src/partials/login.html +++ b/html5/verto/verto_communicator/src/partials/login.html @@ -51,7 +51,7 @@
- +
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js index 4277898618..bae60ac31e 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js @@ -22,6 +22,7 @@ console.debug("googlelogin: " + data.googlelogin); if (data.googlelogin){ $scope.googlelogin = data.googlelogin; + $scope.googleclientid = data.googleclientid; } angular.extend(verto.data, data); From 037031fc80ed55a6fb456ce74e2738266b294a55 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 24 Sep 2015 13:55:21 -0500 Subject: [PATCH 134/136] FS-8216 #resolve [Occasional lip sync problems when recording with mod_av ] --- src/mod/applications/mod_av/avformat.c | 150 ++++++++++++++++--------- 1 file changed, 97 insertions(+), 53 deletions(-) diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 02420c2899..e3f4ed6cd2 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -139,9 +139,11 @@ typedef struct record_helper_s { AVFormatContext *fc; MediaStream *video_st; switch_timer_t *timer; + switch_timer_t *other_timer; int in_callback; switch_queue_t *video_queue; switch_thread_t *video_thread; + switch_mm_t *mm; } record_helper_t; static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt) @@ -242,7 +244,8 @@ static switch_status_t add_stream(MediaStream *mst, AVFormatContext *fc, AVCodec } mst->st->id = fc->nb_streams - 1; c = mst->st->codec; - // switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "id:%d den:%d num:%d\n", mst->st->id, mst->st->time_base.den, mst->st->time_base.num); + + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "id:%d den:%d num:%d\n", mst->st->id, mst->st->time_base.den, mst->st->time_base.num); if (threads > 4) { threads = 4; @@ -256,6 +259,11 @@ static switch_status_t add_stream(MediaStream *mst, AVFormatContext *fc, AVCodec c->channels = mst->channels; c->channel_layout = av_get_default_channel_layout(c->channels); + mst->st->time_base.den = 1000; + mst->st->time_base.num = 1; + c->time_base.den = 1000; + c->time_base.num = 1; + if (mm) { if (mm->ab) { c->bit_rate = mm->ab * 1024; @@ -273,8 +281,12 @@ static switch_status_t add_stream(MediaStream *mst, AVFormatContext *fc, AVCodec if (mm->vbuf) { buffer_bytes = mm->vbuf; } - fps = mm->fps; - + if (mm->fps) { + fps = mm->fps; + } else { + mm->fps = fps; + } + if (mm->vw && mm->vh) { mst->width = mm->vw; mst->height = mm->vh; @@ -469,49 +481,62 @@ static switch_status_t open_audio(AVFormatContext *fc, AVCodec *codec, MediaStre return SWITCH_STATUS_SUCCESS; } - - static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void *obj) { record_helper_t *eh = (record_helper_t *) obj; void *pop; switch_image_t *img, *last_img = NULL, *tmp_img = NULL; + switch_size_t size; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "video thread start\n"); - + for(;;) { AVPacket pkt = { 0 }; int got_packet; - int ret = -1; + int ret = -1, popped = 0; - img = NULL; - - if (switch_queue_pop_timeout(eh->video_queue, &pop, 66000) == SWITCH_STATUS_SUCCESS) { - if (!pop) break; - img = (switch_image_t *) pop; - - if (last_img && (last_img->d_w != img->d_w || last_img->d_h != img->d_h)) { - /* scale to match established stream */ - switch_img_scale(img, &tmp_img, last_img->d_w, last_img->d_h); - switch_img_free(&img); - img = tmp_img; - tmp_img = NULL; - } - - switch_img_free(&last_img); - last_img = img; - } else { - if (last_img) { - img = last_img; + do { + switch_status_t status; + img = NULL; + + if (!popped) { + status = switch_queue_pop(eh->video_queue, &pop); + popped++; } else { - continue; + status = switch_queue_trypop(eh->video_queue, &pop); } - } + + if (status == SWITCH_STATUS_SUCCESS) { + switch_img_free(&img); + + if (!pop) { + goto endfor; + } + img = (switch_image_t *)pop; + } else { + if (img) { + break; + } else { + popped = 0; + continue; + } + } + + size = switch_queue_size(eh->video_queue); + } while(img && size > 1); - if (!img) { - continue; - } + if (last_img && (last_img->d_w != img->d_w || last_img->d_h != img->d_h)) { + /* scale to match established stream */ + switch_img_scale(img, &tmp_img, last_img->d_w, last_img->d_h); + switch_img_free(&img); + img = tmp_img; + tmp_img = NULL; + } + + switch_img_free(&last_img); + last_img = img; + //switch_mutex_lock(eh->mutex); eh->in_callback = 1; @@ -526,6 +551,14 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * fill_avframe(eh->video_st->frame, img); switch_core_timer_sync(eh->timer); + + if (eh->other_timer) { + if (eh->timer->samplecount > eh->other_timer->samplecount) { + int sleepfor = (eh->timer->samplecount - eh->other_timer->samplecount) * 1000; + switch_yield(sleepfor); + switch_core_timer_sync(eh->timer); + } + } if (eh->video_st->frame->pts == eh->timer->samplecount) { // never use the same pts, or the encoder coughs @@ -555,6 +588,8 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * //switch_mutex_unlock(eh->mutex); } + endfor: + switch_img_free(&last_img); while(switch_queue_trypop(eh->video_queue, &pop) == SWITCH_STATUS_SUCCESS) { @@ -1041,7 +1076,8 @@ struct av_file_context { switch_mutex_t *mutex; switch_buffer_t *buf; switch_buffer_t *audio_buffer; - switch_timer_t timer; + switch_timer_t video_timer; + switch_timer_t audio_timer; int offset; int audio_start; int vid_ready; @@ -1398,9 +1434,6 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa } switch_mutex_init(&context->mutex, SWITCH_MUTEX_NESTED, handle->memory_pool); - switch_core_timer_init(&context->timer, "soft", 1, 1000, context->pool); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "init timer\n"); - switch_buffer_create_dynamic(&context->audio_buffer, 512, 512, 0); if (!context->audio_buffer) { @@ -1529,6 +1562,10 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa handle->speed = 0; handle->pos = 0; + + switch_core_timer_init(&context->audio_timer, "soft", 1, 1, /*handle->samplerate / 1000,*/ context->pool); + switch_core_timer_init(&context->video_timer, "soft", 1, 1, context->pool); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Opening File [%s] %dhz %s\n", file, handle->samplerate, switch_test_flag(handle, SWITCH_FILE_FLAG_VIDEO) ? " with VIDEO" : ""); @@ -1540,8 +1577,12 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa mod_avformat_destroy_output_context(context); } - if (context->timer.interval) { - switch_core_timer_destroy(&context->timer); + if (context->video_timer.interval) { + switch_core_timer_destroy(&context->video_timer); + } + + if (context->audio_timer.interval) { + switch_core_timer_destroy(&context->audio_timer); } if (context->audio_buffer) { @@ -1599,8 +1640,12 @@ static switch_status_t av_file_close(switch_file_handle_t *handle) mod_avformat_destroy_output_context(context); } - if (context->timer.interval) { - switch_core_timer_destroy(&context->timer); + if (context->video_timer.interval) { + switch_core_timer_destroy(&context->video_timer); + } + + if (context->audio_timer.interval) { + switch_core_timer_destroy(&context->audio_timer); } switch_img_free(&context->last_img); @@ -1684,15 +1729,13 @@ static switch_status_t av_file_write(switch_file_handle_t *handle, void *data, s context->offset = 0; } - - switch_buffer_write(context->audio_buffer, data, datalen); bytes = context->audio_st.frame->nb_samples * 2 * context->audio_st.st->codec->channels; //inuse = switch_buffer_inuse(context->audio_buffer); //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "inuse: %d samples: %d bytes: %d\n", inuse, context->audio_st.frame->nb_samples, bytes); - while ((inuse = switch_buffer_inuse(context->audio_buffer)) >= bytes * 5) { + while ((inuse = switch_buffer_inuse(context->audio_buffer)) >= bytes) { AVPacket pkt = { 0 }; int got_packet = 0; int ret; @@ -1707,9 +1750,9 @@ static switch_status_t av_file_write(switch_file_handle_t *handle, void *data, s switch_buffer_read(context->audio_buffer, context->audio_st.frame->data[0], bytes); /* convert to destination format */ ret = avresample_convert(context->audio_st.resample_ctx, - (uint8_t **)context->audio_st.frame->data, 0, out_samples, - context->audio_st.tmp_frame->data, 0, context->audio_st.frame->nb_samples); - + (uint8_t **)context->audio_st.frame->data, 0, out_samples, + context->audio_st.tmp_frame->data, 0, context->audio_st.frame->nb_samples); + if (ret < 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error while converting %d samples, error text: %s\n", context->audio_st.frame->nb_samples, get_error_text(ret)); @@ -1718,13 +1761,15 @@ static switch_status_t av_file_write(switch_file_handle_t *handle, void *data, s context->audio_st.tmp_frame->pts = context->audio_st.next_pts; context->audio_st.next_pts += context->audio_st.frame->nb_samples; - ret = avcodec_encode_audio2(context->audio_st.st->codec, &pkt, context->audio_st.tmp_frame, &got_packet); } else { av_frame_make_writable(context->audio_st.frame); switch_buffer_read(context->audio_buffer, context->audio_st.frame->data[0], bytes); - context->audio_st.frame->pts = context->audio_st.next_pts; - context->audio_st.next_pts += context->audio_st.frame->nb_samples; + + switch_core_timer_sync(&context->audio_timer); + context->audio_st.frame->pts = context->audio_timer.samplecount; + //context->audio_st.frame->pts = context->audio_st.next_pts; + //context->audio_st.next_pts += context->audio_st.frame->nb_samples; ret = avcodec_encode_audio2(context->audio_st.st->codec, &pkt, context->audio_st.frame, &got_packet); } @@ -1744,6 +1789,7 @@ static switch_status_t av_file_write(switch_file_handle_t *handle, void *data, s } } + break; } @@ -1917,11 +1963,9 @@ static switch_status_t av_file_write_video(switch_file_handle_t *handle, switch_ context->eh.mutex = context->mutex; context->eh.video_st = &context->video_st; context->eh.fc = context->fc; - if (switch_core_timer_init(&context->timer, "soft", 1, 1, handle->memory_pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer Activation Fail\n"); - switch_goto_status(SWITCH_STATUS_FALSE, end); - } - context->eh.timer = &context->timer; + context->eh.mm = &handle->mm; + context->eh.timer = &context->video_timer; + context->eh.other_timer = &context->audio_timer; switch_queue_create(&context->eh.video_queue, SWITCH_CORE_QUEUE_LEN, handle->memory_pool); switch_threadattr_create(&thd_attr, handle->memory_pool); From e5f31310db598c6f842cc007f158ae29d8477cae Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 23 Sep 2015 11:58:57 -0500 Subject: [PATCH 135/136] FS-7911 #resolve --- src/mod/endpoints/mod_sofia/mod_sofia.c | 9 ++++----- src/mod/endpoints/mod_sofia/sofia_glue.c | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 5cb2ff744b..d74688c70c 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -1549,11 +1549,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi break; } - if (!zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) { - switch_snprintf(ct, sizeof(ct), "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]); - ok = 1; - } - if (switch_stristr("send_message", tech_pvt->x_freeswitch_support_remote)) { ok = 1; } @@ -1565,6 +1560,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi if (ok) { const char *pl = NULL; + if (!zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) { + switch_snprintf(ct, sizeof(ct), "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]); + } + if (!zstr(msg->string_array_arg[2])) { pl = msg->string_array_arg[2]; } diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index eff9ae7485..7dcdfcda79 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -636,7 +636,7 @@ void sofia_glue_set_extra_headers(switch_core_session_t *session, sip_t const *s sip_unknown_t *un; char name[512] = ""; switch_channel_t *channel = switch_core_session_get_channel(session); - char *pstr; + char pstr[32]; if (!sip || !channel) { @@ -652,7 +652,7 @@ void sofia_glue_set_extra_headers(switch_core_session_t *session, sip_t const *s } } - pstr = switch_core_session_sprintf(session, "execute_on_%sprefix", prefix); + switch_snprintf(pstr, sizeof(pstr), "execute_on_%sprefix", prefix); switch_channel_execute_on(channel, pstr); switch_channel_api_on(channel, pstr); From 5d2ef7dac4446be65d1d14a83a254a6403126b38 Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Fri, 25 Sep 2015 10:30:35 -0300 Subject: [PATCH 136/136] FSRTC - calling localStream.stop when it's available or localStream.active = false to make it work on newer chrome canary --- html5/verto/js/src/jquery.FSRTC.js | 36 ++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index c6296f36a8..b06951e312 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -313,7 +313,11 @@ } if (self.localStream) { - self.localStream.stop(); + if(typeof self.localStream.stop == 'function') { + self.localStream.stop(); + } else { + self.localStream.active = false; + } self.localStream = null; } @@ -327,7 +331,11 @@ } if (self.options.localVideoStream) { - self.options.localVideoStream.stop(); + if(typeof self.options.localVideoStream.stop == 'function') { + self.options.localVideoStream.stop(); + } else { + self.options.localVideoStream.active = false; + } } if (self.peer) { @@ -951,7 +959,11 @@ stop: function() { peer.close(); if (options.attachStream) { + if(typeof options.attachStream.stop == 'function') { options.attachStream.stop(); + } else { + options.attachStream.active = false; + } } } @@ -1073,7 +1085,13 @@ audio: ttl++ == 0, video: video }, - onsuccess: function(e) {e.stop(); console.info(w + "x" + h + " supported."); $.FSRTC.validRes.push([w, h]); checkRes(cam, func);}, + onsuccess: function(e) { + if(typeof e.stop == 'function') { + e.stop(); + } else { + e.active = false; + } + console.info(w + "x" + h + " supported."); $.FSRTC.validRes.push([w, h]); checkRes(cam, func);}, onerror: function(e) {console.error( w + "x" + h + " not supported."); checkRes(cam, func);} }); } @@ -1108,7 +1126,17 @@ audio: check_audio, video: check_video, }, - onsuccess: function(e) {e.stop(); console.info("media perm init complete"); if (runtime) {setTimeout(runtime, 100, true)}}, + onsuccess: function(e) { + if(typeof e.stop == 'function') { + e.stop(); + } else { + e.active = false; + } + console.info("media perm init complete"); + if (runtime) { + setTimeout(runtime, 100, true); + } + }, onerror: function(e) { if (check_video && check_audio) { console.error("error, retesting with audio params only");