mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-31 14:18:17 +00:00
Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch
This commit is contained in:
commit
49a5d71b68
@ -113,7 +113,7 @@
|
|||||||
|
|
||||||
<!-- Say -->
|
<!-- Say -->
|
||||||
<load module="mod_say_en"/>
|
<load module="mod_say_en"/>
|
||||||
<load module="mod_say_ru"/>
|
<!-- <load module="mod_say_ru"/> -->
|
||||||
<!-- <load module="mod_say_zh"/> -->
|
<!-- <load module="mod_say_zh"/> -->
|
||||||
|
|
||||||
<!-- Third party modules -->
|
<!-- Third party modules -->
|
||||||
|
@ -268,7 +268,9 @@
|
|||||||
<prompt phrase="...has left the conference." filename="conf-has_left.wav"/>
|
<prompt phrase="...has left the conference." filename="conf-has_left.wav"/>
|
||||||
<prompt phrase="You are already muted." filename="conf-you_are_already_muted.wav"/>
|
<prompt phrase="You are already muted." filename="conf-you_are_already_muted.wav"/>
|
||||||
<prompt phrase="You are now bi-directionally muted." filename="conf-you_are_now_bidirectionally_muted.wav"/>
|
<prompt phrase="You are now bi-directionally muted." filename="conf-you_are_now_bidirectionally_muted.wav"/>
|
||||||
</conference>
|
<prompt phrase="Enter the number of listeners at this location, then press pound." filename="conf-number_of_listeners.wav"/>
|
||||||
|
<prompt phrase="...listeners in this conference." filename="conf-listeners_in_conference.wav"/>
|
||||||
|
<prompt phrase="...members in this conference." filename="conf-members_in_conference.wav"/> </conference>
|
||||||
<ivr>
|
<ivr>
|
||||||
<prompt phrase="Account number" filename="ivr-account_number.wav"/>
|
<prompt phrase="Account number" filename="ivr-account_number.wav"/>
|
||||||
<prompt phrase="Connect to caller" filename="ivr-connect_to_caller.wav"/>
|
<prompt phrase="Connect to caller" filename="ivr-connect_to_caller.wav"/>
|
||||||
@ -425,16 +427,17 @@
|
|||||||
<prompt phrase="Barracuda Networks" filename="ivr-barracuda_networks.wav"/>
|
<prompt phrase="Barracuda Networks" filename="ivr-barracuda_networks.wav"/>
|
||||||
<prompt phrase="CudaTel Communication Server" filename="ivr-cudatel_communication_server.wav"/>
|
<prompt phrase="CudaTel Communication Server" filename="ivr-cudatel_communication_server.wav"/>
|
||||||
<prompt phrase="There are no calls waiting in this queue." filename="ivr-no_calls_waiting_in_queue.wav"/>
|
<prompt phrase="There are no calls waiting in this queue." filename="ivr-no_calls_waiting_in_queue.wav"/>
|
||||||
|
|
||||||
<!-- The following phrases still need to be recorded -->
|
|
||||||
<prompt phrase="You are caller number one. Of course, *every* caller is number one in our book so you may be waiting a while." filename="ivr-youre_number_one.wav"/>
|
<prompt phrase="You are caller number one. Of course, *every* caller is number one in our book so you may be waiting a while." filename="ivr-youre_number_one.wav"/>
|
||||||
<prompt phrase="...has called emergency services" filename="ivr-has_called_emergency_services.wav"/>
|
<prompt phrase="...has called emergency services" filename="ivr-has_called_emergency_services.wav"/>
|
||||||
<prompt phrase="There are..." filename="ivr-there_are.wav"/>
|
<prompt phrase="There are..." filename="ivr-there_are.wav"/>
|
||||||
<prompt phrase="Enter the number of listeners at this location, then press pound." filename="conf-number_of_listeners.wav"/>
|
|
||||||
<prompt phrase="...listeners in this conference." filename="conf-listeners_in_conference.wav"/>
|
|
||||||
<prompt phrase="...members in this conference." filename="conf-members_in_conference.wav"/>
|
|
||||||
<prompt phrase="Please enter the source telephone number, then press pound." filename="ivr-enter_source_telephone_number.wav"/>
|
<prompt phrase="Please enter the source telephone number, then press pound." filename="ivr-enter_source_telephone_number.wav"/>
|
||||||
<prompt phrase="Please enter the destination telephone number, then press pound." filename="ivr-enter_destination_telephone_number.wav"/>
|
<prompt phrase="Please enter the destination telephone number, then press pound." filename="ivr-enter_destination_telephone_number.wav"/>
|
||||||
|
|
||||||
|
<!-- The following phrases still need to be recorded -->
|
||||||
|
<prompt phrase="Recording started." filename="ivr-recording_started.wav"/>
|
||||||
|
<prompt phrase="Recording stopped." filename="ivr-recording_stopped.wav"/>
|
||||||
|
<prompt phrase="Recording deleted." filename="ivr-recording_deleted.wav"/>
|
||||||
|
|
||||||
</ivr>
|
</ivr>
|
||||||
<misc>
|
<misc>
|
||||||
<prompt phrase="This call has been secured" filename="call_secured.wav"/>
|
<prompt phrase="This call has been secured" filename="call_secured.wav"/>
|
||||||
|
@ -316,6 +316,7 @@
|
|||||||
<currency>
|
<currency>
|
||||||
<prompt phrase="и" filename="and.wav"/>
|
<prompt phrase="и" filename="and.wav"/>
|
||||||
<prompt phrase="Цент" filename="cent.wav"/>
|
<prompt phrase="Цент" filename="cent.wav"/>
|
||||||
|
<prompt phrase="Цента" filename="centa.wav"/>
|
||||||
<prompt phrase="центральный" filename="central.wav"/>
|
<prompt phrase="центральный" filename="central.wav"/>
|
||||||
<prompt phrase="Центов в минуту" filename="cents-per-minute.wav"/>
|
<prompt phrase="Центов в минуту" filename="cents-per-minute.wav"/>
|
||||||
<prompt phrase="Центов" filename="centov.wav"/>
|
<prompt phrase="Центов" filename="centov.wav"/>
|
||||||
@ -326,9 +327,9 @@
|
|||||||
<prompt phrase="Доллары" filename="dollari.wav"/>
|
<prompt phrase="Доллары" filename="dollari.wav"/>
|
||||||
<prompt phrase="Минус" filename="minus.wav"/>
|
<prompt phrase="Минус" filename="minus.wav"/>
|
||||||
<prompt phrase="Отрицательный" filename="negative.wav"/>
|
<prompt phrase="Отрицательный" filename="negative.wav"/>
|
||||||
<prompt phrase="Копеек" filename="kopeck-i.wav"/>
|
<prompt phrase="Копейки" filename="kopeck-i.wav"/>
|
||||||
<prompt phrase="Копейка" filename="kopeck.wav"/>
|
<prompt phrase="Копейка" filename="kopeck.wav"/>
|
||||||
<prompt phrase="Копейки" filename="kopecks.wav"/>
|
<prompt phrase="Копеек" filename="kopecks.wav"/>
|
||||||
<prompt phrase="Рубль" filename="ruble.wav"/>
|
<prompt phrase="Рубль" filename="ruble.wav"/>
|
||||||
<prompt phrase="Рубля" filename="ruble-a.wav"/>
|
<prompt phrase="Рубля" filename="ruble-a.wav"/>
|
||||||
<prompt phrase="Рублей" filename="rubles.wav"/>
|
<prompt phrase="Рублей" filename="rubles.wav"/>
|
||||||
|
@ -73,13 +73,13 @@ sub setVar($;) {
|
|||||||
|
|
||||||
sub playAndGetDigits($;) {
|
sub playAndGetDigits($;) {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($min, $max, $tries, $to, $term, $file, $invalid_file, $var, $regex) = @_;
|
my ($min, $max, $tries, $to, $term, $file, $invalid_file, $var, $regex, $digit_timeout) = @_;
|
||||||
|
|
||||||
if (!$self->{_esl}->connected()) {
|
if (!$self->{_esl}->connected()) {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->execute("play_and_get_digits", "$min $max $tries $to $term $file $invalid_file $var $regex");
|
$self->execute("play_and_get_digits", "$min $max $tries $to $term $file $invalid_file $var $regex $digit_timeout");
|
||||||
|
|
||||||
return $self->getVar($var);
|
return $self->getVar($var);
|
||||||
|
|
||||||
|
@ -979,7 +979,6 @@ static L3INT ftdm_isdn_931_34(void *pvt, struct Q931_Call *call, Q931mes_Generic
|
|||||||
{
|
{
|
||||||
Q931ie_CallingNum *callingnum = Q931GetIEPtr(gen->CallingNum, gen->buf);
|
Q931ie_CallingNum *callingnum = Q931GetIEPtr(gen->CallingNum, gen->buf);
|
||||||
Q931ie_CalledNum *callednum = Q931GetIEPtr(gen->CalledNum, gen->buf);
|
Q931ie_CalledNum *callednum = Q931GetIEPtr(gen->CalledNum, gen->buf);
|
||||||
uint32_t cplen = mlen;
|
|
||||||
int overlap_dial = 0;
|
int overlap_dial = 0;
|
||||||
int fail_cause = 0;
|
int fail_cause = 0;
|
||||||
int fail = 1;
|
int fail = 1;
|
||||||
@ -2128,7 +2127,7 @@ static int ftdm_isdn_q921_log(void *pvt, Q921LogLevel_t level, char *msg, L2INT
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static L3INT ftdm_isdn_q931_log(void *pvt, Q931LogLevel_t level, char *msg, L3INT size)
|
static L3INT ftdm_isdn_q931_log(void *pvt, Q931LogLevel_t level, const char *msg, L3INT size)
|
||||||
{
|
{
|
||||||
ftdm_span_t *span = (ftdm_span_t *) pvt;
|
ftdm_span_t *span = (ftdm_span_t *) pvt;
|
||||||
|
|
||||||
|
@ -2205,6 +2205,7 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand
|
|||||||
SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute(switch_cache_db_handle_t *dbh, const char *sql, uint32_t retries);
|
SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute(switch_cache_db_handle_t *dbh, const char *sql, uint32_t retries);
|
||||||
SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_cache_db_handle_t *dbh, char *sql, uint32_t retries);
|
SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_cache_db_handle_t *dbh, char *sql, uint32_t retries);
|
||||||
|
|
||||||
|
SWITCH_DECLARE(void) switch_core_set_signal_handlers(void);
|
||||||
SWITCH_DECLARE(uint32_t) switch_core_debug_level(void);
|
SWITCH_DECLARE(uint32_t) switch_core_debug_level(void);
|
||||||
SWITCH_DECLARE(void) switch_cache_db_flush_handles(void);
|
SWITCH_DECLARE(void) switch_cache_db_flush_handles(void);
|
||||||
SWITCH_DECLARE(const char *) switch_core_banner(void);
|
SWITCH_DECLARE(const char *) switch_core_banner(void);
|
||||||
|
@ -136,6 +136,7 @@ SWITCH_BEGIN_EXTERN_C
|
|||||||
#define SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE "execute_on_media"
|
#define SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE "execute_on_media"
|
||||||
#define SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE "api_on_answer"
|
#define SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE "api_on_answer"
|
||||||
#define SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE "execute_on_ring"
|
#define SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE "execute_on_ring"
|
||||||
|
#define SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE "execute_on_tone_detect"
|
||||||
#define SWITCH_CALL_TIMEOUT_VARIABLE "call_timeout"
|
#define SWITCH_CALL_TIMEOUT_VARIABLE "call_timeout"
|
||||||
#define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid"
|
#define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid"
|
||||||
#define SWITCH_SOFT_HOLDING_UUID_VARIABLE "soft_holding_uuid"
|
#define SWITCH_SOFT_HOLDING_UUID_VARIABLE "soft_holding_uuid"
|
||||||
|
@ -156,7 +156,9 @@ typedef enum {
|
|||||||
CFLAG_VID_FLOOR = (1 << 8),
|
CFLAG_VID_FLOOR = (1 << 8),
|
||||||
CFLAG_WASTE_BANDWIDTH = (1 << 9),
|
CFLAG_WASTE_BANDWIDTH = (1 << 9),
|
||||||
CFLAG_OUTCALL = (1 << 10),
|
CFLAG_OUTCALL = (1 << 10),
|
||||||
CFLAG_INHASH = (1 << 11)
|
CFLAG_INHASH = (1 << 11),
|
||||||
|
CFLAG_EXIT_SOUND = (1 << 12),
|
||||||
|
CFLAG_ENTER_SOUND = (1 << 13)
|
||||||
} conf_flag_t;
|
} conf_flag_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -717,12 +719,14 @@ static switch_status_t conference_add_member(conference_obj_t *conference, confe
|
|||||||
|
|
||||||
if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ) && !zstr(conference->enter_sound)) {
|
if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ) && !zstr(conference->enter_sound)) {
|
||||||
const char * enter_sound = switch_channel_get_variable(channel, "conference_enter_sound");
|
const char * enter_sound = switch_channel_get_variable(channel, "conference_enter_sound");
|
||||||
if (!zstr(enter_sound)) {
|
if (switch_test_flag(conference, CFLAG_ENTER_SOUND)) {
|
||||||
conference_play_file(conference, (char *)enter_sound, CONF_DEFAULT_LEADIN,
|
if (!zstr(enter_sound)) {
|
||||||
switch_core_session_get_channel(member->session), !switch_test_flag(conference, CFLAG_WAIT_MOD) ? 0 : 1);
|
conference_play_file(conference, (char *)enter_sound, CONF_DEFAULT_LEADIN,
|
||||||
} else {
|
switch_core_session_get_channel(member->session), !switch_test_flag(conference, CFLAG_WAIT_MOD) ? 0 : 1);
|
||||||
conference_play_file(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session),
|
} else {
|
||||||
!switch_test_flag(conference, CFLAG_WAIT_MOD) ? 0 : 1);
|
conference_play_file(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session),
|
||||||
|
!switch_test_flag(conference, CFLAG_WAIT_MOD) ? 0 : 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -906,7 +910,7 @@ static switch_status_t conference_del_member(conference_obj_t *conference, confe
|
|||||||
|| (switch_test_flag(conference, CFLAG_DYNAMIC) && conference->count == 0)) {
|
|| (switch_test_flag(conference, CFLAG_DYNAMIC) && conference->count == 0)) {
|
||||||
switch_set_flag(conference, CFLAG_DESTRUCT);
|
switch_set_flag(conference, CFLAG_DESTRUCT);
|
||||||
} else {
|
} else {
|
||||||
if (conference->exit_sound) {
|
if (conference->exit_sound && switch_test_flag(conference, CFLAG_EXIT_SOUND)) {
|
||||||
conference_play_file(conference, conference->exit_sound, 0, switch_core_session_get_channel(member->session), 0);
|
conference_play_file(conference, conference->exit_sound, 0, switch_core_session_get_channel(member->session), 0);
|
||||||
}
|
}
|
||||||
if (conference->count == 1 && conference->alone_sound && !switch_test_flag(conference, CFLAG_WAIT_MOD)) {
|
if (conference->count == 1 && conference->alone_sound && !switch_test_flag(conference, CFLAG_WAIT_MOD)) {
|
||||||
@ -1992,22 +1996,20 @@ static void conference_loop_fn_exec_app(conference_member_t *member, caller_cont
|
|||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mydata = switch_core_session_strdup(member->session, action->expanded_data))) {
|
mydata = strdup(action->expanded_data);
|
||||||
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
|
switch_assert(mydata);
|
||||||
if (argc > 0) {
|
|
||||||
app = argv[0];
|
|
||||||
}
|
|
||||||
if (argc > 1) {
|
|
||||||
arg = argv[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_ERROR, "Empty execute app string [%s]\n",
|
if (argc > 0) {
|
||||||
(char *) action->expanded_data);
|
app = argv[0];
|
||||||
goto done;
|
|
||||||
}
|
}
|
||||||
|
if (argc > 1) {
|
||||||
|
arg = argv[1];
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_ERROR, "Unable to allocate memory to duplicate execute_app data.\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_ERROR, "Empty execute app string [%s]\n",
|
||||||
|
(char *) action->expanded_data);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2025,8 +2027,11 @@ static void conference_loop_fn_exec_app(conference_member_t *member, caller_cont
|
|||||||
switch_core_session_execute_application(member->session, app, arg);
|
switch_core_session_execute_application(member->session, app, arg);
|
||||||
switch_core_session_set_read_codec(member->session, &member->read_codec);
|
switch_core_session_set_read_codec(member->session, &member->read_codec);
|
||||||
switch_channel_clear_app_flag(channel, CF_APP_TAGGED);
|
switch_channel_clear_app_flag(channel, CF_APP_TAGGED);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
|
switch_safe_free(mydata);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4023,7 +4028,7 @@ static void conference_xlist(conference_obj_t *conference, switch_xml_t x_confer
|
|||||||
switch_snprintf(i, sizeof(i), "%u", conference->rate);
|
switch_snprintf(i, sizeof(i), "%u", conference->rate);
|
||||||
switch_xml_set_attr_d(x_conference, "rate", ival);
|
switch_xml_set_attr_d(x_conference, "rate", ival);
|
||||||
switch_xml_set_attr_d(x_conference, "uuid", conference->uuid_str);
|
switch_xml_set_attr_d(x_conference, "uuid", conference->uuid_str);
|
||||||
|
|
||||||
if (switch_test_flag(conference, CFLAG_LOCKED)) {
|
if (switch_test_flag(conference, CFLAG_LOCKED)) {
|
||||||
switch_xml_set_attr_d(x_conference, "locked", "true");
|
switch_xml_set_attr_d(x_conference, "locked", "true");
|
||||||
}
|
}
|
||||||
@ -4056,6 +4061,14 @@ static void conference_xlist(conference_obj_t *conference, switch_xml_t x_confer
|
|||||||
switch_xml_set_attr_d(x_conference, "dynamic", "true");
|
switch_xml_set_attr_d(x_conference, "dynamic", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (switch_test_flag(conference, CFLAG_EXIT_SOUND)) {
|
||||||
|
switch_xml_set_attr_d(x_conference, "exit_sound", "true");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (switch_test_flag(conference, CFLAG_ENTER_SOUND)) {
|
||||||
|
switch_xml_set_attr_d(x_conference, "enter_sound", "true");
|
||||||
|
}
|
||||||
|
|
||||||
if (conference->record_count > 0) {
|
if (conference->record_count > 0) {
|
||||||
switch_xml_set_attr_d(x_conference, "recording", "true");
|
switch_xml_set_attr_d(x_conference, "recording", "true");
|
||||||
}
|
}
|
||||||
@ -4516,6 +4529,107 @@ static switch_status_t conf_api_sub_unlock(conference_obj_t *conference, switch_
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static switch_status_t conf_api_sub_exit_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
|
||||||
|
{
|
||||||
|
switch_event_t *event;
|
||||||
|
|
||||||
|
switch_assert(conference != NULL);
|
||||||
|
switch_assert(stream != NULL);
|
||||||
|
|
||||||
|
if (argc <= 2) {
|
||||||
|
stream->write_function(stream, "Not enough args\n");
|
||||||
|
return SWITCH_STATUS_GENERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !strcasecmp(argv[2], "on") ) {
|
||||||
|
switch_set_flag_locked(conference, CFLAG_EXIT_SOUND);
|
||||||
|
stream->write_function(stream, "OK %s exit sounds on (%s)\n", argv[0], conference->exit_sound);
|
||||||
|
if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
conference_add_event_data(conference, event);
|
||||||
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "exit-sounds-on");
|
||||||
|
switch_event_fire(&event);
|
||||||
|
}
|
||||||
|
} else if ( !strcasecmp(argv[2], "off") || !strcasecmp(argv[2], "none") ) {
|
||||||
|
switch_clear_flag_locked(conference, CFLAG_EXIT_SOUND);
|
||||||
|
stream->write_function(stream, "OK %s exit sounds off (%s)\n", argv[0], conference->exit_sound);
|
||||||
|
if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
conference_add_event_data(conference, event);
|
||||||
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "exit-sounds-off");
|
||||||
|
switch_event_fire(&event);
|
||||||
|
}
|
||||||
|
} else if ( !strcasecmp(argv[2], "file") ) {
|
||||||
|
if (! argv[3]) {
|
||||||
|
stream->write_function(stream, "No filename specified\n");
|
||||||
|
} else {
|
||||||
|
/* TODO: if possible, verify file exists before setting it */
|
||||||
|
stream->write_function(stream,"Old exit sound: [%s]\n", conference->exit_sound);
|
||||||
|
conference->exit_sound = switch_core_strdup(conference->pool, argv[3]);
|
||||||
|
stream->write_function(stream, "OK %s exit sound file set to %s\n", argv[0], conference->exit_sound);
|
||||||
|
if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
conference_add_event_data(conference, event);
|
||||||
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "exit-sound-file-changed");
|
||||||
|
switch_event_fire(&event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stream->write_function(stream, "Bad args\n");
|
||||||
|
return SWITCH_STATUS_GENERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static switch_status_t conf_api_sub_enter_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
|
||||||
|
{
|
||||||
|
switch_event_t *event;
|
||||||
|
|
||||||
|
switch_assert(conference != NULL);
|
||||||
|
switch_assert(stream != NULL);
|
||||||
|
|
||||||
|
if (argc <= 2) {
|
||||||
|
stream->write_function(stream, "Not enough args\n");
|
||||||
|
return SWITCH_STATUS_GENERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !strcasecmp(argv[2], "on") ) {
|
||||||
|
switch_set_flag_locked(conference, CFLAG_ENTER_SOUND);
|
||||||
|
stream->write_function(stream, "OK %s enter sounds on (%s)\n", argv[0], conference->enter_sound);
|
||||||
|
if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
conference_add_event_data(conference, event);
|
||||||
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "enter-sounds-on");
|
||||||
|
switch_event_fire(&event);
|
||||||
|
}
|
||||||
|
} else if ( !strcasecmp(argv[2], "off") || !strcasecmp(argv[2], "none") ) {
|
||||||
|
switch_clear_flag_locked(conference, CFLAG_ENTER_SOUND);
|
||||||
|
stream->write_function(stream, "OK %s enter sounds off (%s)\n", argv[0], conference->enter_sound);
|
||||||
|
if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
conference_add_event_data(conference, event);
|
||||||
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "enter-sounds-off");
|
||||||
|
switch_event_fire(&event);
|
||||||
|
}
|
||||||
|
} else if ( !strcasecmp(argv[2], "file") ) {
|
||||||
|
if (! argv[3]) {
|
||||||
|
stream->write_function(stream, "No filename specified\n");
|
||||||
|
} else {
|
||||||
|
/* TODO: verify file exists before setting it */
|
||||||
|
conference->enter_sound = switch_core_strdup(conference->pool, argv[3]);
|
||||||
|
stream->write_function(stream, "OK %s enter sound file set to %s\n", argv[0], conference->enter_sound);
|
||||||
|
if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
conference_add_event_data(conference, event);
|
||||||
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "enter-sound-file-changed");
|
||||||
|
switch_event_fire(&event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stream->write_function(stream, "Bad args\n");
|
||||||
|
return SWITCH_STATUS_GENERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
|
static switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
|
||||||
{
|
{
|
||||||
switch_call_cause_t cause;
|
switch_call_cause_t cause;
|
||||||
@ -4720,7 +4834,9 @@ typedef enum {
|
|||||||
CONF_API_COMMAND_BGDIAL,
|
CONF_API_COMMAND_BGDIAL,
|
||||||
CONF_API_COMMAND_TRANSFER,
|
CONF_API_COMMAND_TRANSFER,
|
||||||
CONF_API_COMMAND_RECORD,
|
CONF_API_COMMAND_RECORD,
|
||||||
CONF_API_COMMAND_NORECORD
|
CONF_API_COMMAND_NORECORD,
|
||||||
|
CONF_API_COMMAND_EXIT_SOUND,
|
||||||
|
CONF_API_COMMAND_ENTER_SOUND,
|
||||||
} api_command_type_t;
|
} api_command_type_t;
|
||||||
|
|
||||||
/* API Interface Function sub-commands */
|
/* API Interface Function sub-commands */
|
||||||
@ -4750,6 +4866,8 @@ static api_command_t conf_api_sub_commands[] = {
|
|||||||
{"transfer", (void_fn_t) & conf_api_sub_transfer, CONF_API_SUB_ARGS_SPLIT, "transfer", "<conference_name> <member id> [...<member id>]"},
|
{"transfer", (void_fn_t) & conf_api_sub_transfer, CONF_API_SUB_ARGS_SPLIT, "transfer", "<conference_name> <member id> [...<member id>]"},
|
||||||
{"record", (void_fn_t) & conf_api_sub_record, CONF_API_SUB_ARGS_SPLIT, "record", "<filename>"},
|
{"record", (void_fn_t) & conf_api_sub_record, CONF_API_SUB_ARGS_SPLIT, "record", "<filename>"},
|
||||||
{"norecord", (void_fn_t) & conf_api_sub_norecord, CONF_API_SUB_ARGS_SPLIT, "norecord", "<[filename|all]>"},
|
{"norecord", (void_fn_t) & conf_api_sub_norecord, CONF_API_SUB_ARGS_SPLIT, "norecord", "<[filename|all]>"},
|
||||||
|
{"exit_sound", (void_fn_t) & conf_api_sub_exit_sound, CONF_API_SUB_ARGS_SPLIT, "exit_sound", "on|off|none|file <filename>"},
|
||||||
|
{"enter_sound", (void_fn_t) & conf_api_sub_enter_sound, CONF_API_SUB_ARGS_SPLIT, "enter_sound", "on|off|none|file <filename>"},
|
||||||
{"pin", (void_fn_t) & conf_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "pin", "<pin#>"},
|
{"pin", (void_fn_t) & conf_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "pin", "<pin#>"},
|
||||||
{"nopin", (void_fn_t) & conf_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "nopin", ""},
|
{"nopin", (void_fn_t) & conf_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "nopin", ""},
|
||||||
};
|
};
|
||||||
@ -5330,7 +5448,7 @@ static void set_cflags(const char *flags, uint32_t *f)
|
|||||||
} else if (!strcasecmp(argv[i], "waste-bandwidth")) {
|
} else if (!strcasecmp(argv[i], "waste-bandwidth")) {
|
||||||
*f |= CFLAG_WASTE_BANDWIDTH;
|
*f |= CFLAG_WASTE_BANDWIDTH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(dup);
|
free(dup);
|
||||||
}
|
}
|
||||||
@ -6620,7 +6738,10 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
|
|||||||
switch_uuid_format(uuid_str, &uuid);
|
switch_uuid_format(uuid_str, &uuid);
|
||||||
conference->uuid_str = switch_core_strdup(conference->pool, uuid_str);
|
conference->uuid_str = switch_core_strdup(conference->pool, uuid_str);
|
||||||
|
|
||||||
|
/* Set enter sound and exit sound flags so that default is on */
|
||||||
|
switch_set_flag(conference, CFLAG_ENTER_SOUND);
|
||||||
|
switch_set_flag(conference, CFLAG_EXIT_SOUND);
|
||||||
|
|
||||||
/* Activate the conference mutex for exclusivity */
|
/* Activate the conference mutex for exclusivity */
|
||||||
switch_mutex_init(&conference->mutex, SWITCH_MUTEX_NESTED, conference->pool);
|
switch_mutex_init(&conference->mutex, SWITCH_MUTEX_NESTED, conference->pool);
|
||||||
switch_mutex_init(&conference->flag_mutex, SWITCH_MUTEX_NESTED, conference->pool);
|
switch_mutex_init(&conference->flag_mutex, SWITCH_MUTEX_NESTED, conference->pool);
|
||||||
|
@ -1552,7 +1552,8 @@ SWITCH_STANDARD_APP(tone_detect_session_function)
|
|||||||
int argc;
|
int argc;
|
||||||
char *mydata = NULL;
|
char *mydata = NULL;
|
||||||
time_t to = 0;
|
time_t to = 0;
|
||||||
int hits = 1;
|
int hits = 0;
|
||||||
|
const char *hp = NULL;
|
||||||
|
|
||||||
if (zstr(data) || !(mydata = switch_core_session_strdup(session, data))) {
|
if (zstr(data) || !(mydata = switch_core_session_strdup(session, data))) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "INVALID ARGS!\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "INVALID ARGS!\n");
|
||||||
@ -1582,10 +1583,16 @@ SWITCH_STANDARD_APP(tone_detect_session_function)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argv[6]) {
|
if (argv[4] && argv[5]) {
|
||||||
hits = atoi(argv[6]);
|
hp = argv[6];
|
||||||
|
} else if (argv[4] && !argv[6]) {
|
||||||
|
hp = argv[4];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hp) {
|
||||||
|
hits = atoi(hp);
|
||||||
if (hits < 0) {
|
if (hits < 0) {
|
||||||
hits = 1;
|
hits = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3629,7 +3636,7 @@ static switch_status_t file_string_file_read(switch_file_handle_t *handle, void
|
|||||||
}
|
}
|
||||||
|
|
||||||
context->samples -= *len;
|
context->samples -= *len;
|
||||||
switch_generate_sln_silence((int16_t *) data, *len, 400);
|
memset(data, 255, *len *2);
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
status = switch_core_file_read(&context->fh, data, len);
|
status = switch_core_file_read(&context->fh, data, len);
|
||||||
|
@ -164,6 +164,7 @@ static switch_status_t load_config(void)
|
|||||||
if(buf[data_sz - 1] != 0) {
|
if(buf[data_sz - 1] != 0) {
|
||||||
buf[data_sz] = 0;
|
buf[data_sz] = 0;
|
||||||
}
|
}
|
||||||
|
switch_replace_char(buf, ' ', 0, SWITCH_FALSE); /* only use the first entry ex "192.168.1.1 192.168.1.2" */
|
||||||
globals.server = buf;
|
globals.server = buf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,7 @@ struct callback_obj {
|
|||||||
profile_t *profile;
|
profile_t *profile;
|
||||||
switch_core_session_t *session;
|
switch_core_session_t *session;
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
|
float sell_rate;
|
||||||
};
|
};
|
||||||
typedef struct callback_obj callback_t;
|
typedef struct callback_obj callback_t;
|
||||||
|
|
||||||
@ -666,8 +667,11 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
|
|||||||
r = 0; goto end;
|
r = 0; goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (current = cbt->head; current; current = current->next) {
|
for (current = cbt->head; current; current = current->next) {
|
||||||
|
if (cbt->sell_rate && cbt->sell_rate > current->rate) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
key = switch_core_sprintf(pool, "%s:%s", additional->gw_prefix, additional->gw_suffix);
|
key = switch_core_sprintf(pool, "%s:%s", additional->gw_prefix, additional->gw_suffix);
|
||||||
if (switch_core_hash_find(cbt->dedup_hash, key)) {
|
if (switch_core_hash_find(cbt->dedup_hash, key)) {
|
||||||
@ -760,10 +764,14 @@ static switch_status_t is_intrastatelata(callback_t *cb_struct)
|
|||||||
*/
|
*/
|
||||||
if (!cb_struct->lookup_number || strlen(cb_struct->lookup_number) != 11 || *cb_struct->lookup_number != '1' ||
|
if (!cb_struct->lookup_number || strlen(cb_struct->lookup_number) != 11 || *cb_struct->lookup_number != '1' ||
|
||||||
!switch_is_number(cb_struct->lookup_number)) {
|
!switch_is_number(cb_struct->lookup_number)) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(cb_struct->session), SWITCH_LOG_DEBUG,
|
||||||
|
"%s doesn't appear to be a NANP number\n", cb_struct->lookup_number);
|
||||||
/* dest doesn't appear to be NANP number */
|
/* dest doesn't appear to be NANP number */
|
||||||
return SWITCH_STATUS_GENERR;
|
return SWITCH_STATUS_GENERR;
|
||||||
}
|
}
|
||||||
if (!cb_struct->cid || strlen(cb_struct->cid) != 11 || *cb_struct->cid != '1' || !switch_is_number(cb_struct->cid)) {
|
if (!cb_struct->cid || strlen(cb_struct->cid) != 11 || *cb_struct->cid != '1' || !switch_is_number(cb_struct->cid)) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(cb_struct->session), SWITCH_LOG_DEBUG,
|
||||||
|
"%s doesn't appear to be a NANP number\n", cb_struct->cid);
|
||||||
/* cid not NANP */
|
/* cid not NANP */
|
||||||
return SWITCH_STATUS_GENERR;
|
return SWITCH_STATUS_GENERR;
|
||||||
}
|
}
|
||||||
@ -821,6 +829,7 @@ static switch_status_t lcr_do_lookup(callback_t *cb_struct)
|
|||||||
|
|
||||||
digits_expanded = expand_digits(cb_struct->pool, digits_copy, cb_struct->profile->quote_in_list);
|
digits_expanded = expand_digits(cb_struct->pool, digits_copy, cb_struct->profile->quote_in_list);
|
||||||
|
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(cb_struct->session), SWITCH_LOG_DEBUG, "Has NPA NXX: [%u == %u]\n", profile->profile_has_npanxx, SWITCH_TRUE);
|
||||||
if (profile->profile_has_npanxx == SWITCH_TRUE) {
|
if (profile->profile_has_npanxx == SWITCH_TRUE) {
|
||||||
is_intrastatelata(cb_struct);
|
is_intrastatelata(cb_struct);
|
||||||
}
|
}
|
||||||
@ -843,6 +852,10 @@ static switch_status_t lcr_do_lookup(callback_t *cb_struct)
|
|||||||
if (cb_struct->session) {
|
if (cb_struct->session) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(cb_struct->session), SWITCH_LOG_DEBUG, "we have a session\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(cb_struct->session), SWITCH_LOG_DEBUG, "we have a session\n");
|
||||||
if ((channel = switch_core_session_get_channel(cb_struct->session))) {
|
if ((channel = switch_core_session_get_channel(cb_struct->session))) {
|
||||||
|
const char *sell_rate = switch_channel_get_variable(channel, "sell_rate");
|
||||||
|
if (!zstr(sell_rate)) {
|
||||||
|
cb_struct->sell_rate = atof(sell_rate);
|
||||||
|
}
|
||||||
switch_channel_set_variable_var_check(channel, "lcr_rate_field", rate_field, SWITCH_FALSE);
|
switch_channel_set_variable_var_check(channel, "lcr_rate_field", rate_field, SWITCH_FALSE);
|
||||||
switch_channel_set_variable_var_check(channel, "lcr_user_rate_field", user_rate_field, SWITCH_FALSE);
|
switch_channel_set_variable_var_check(channel, "lcr_user_rate_field", user_rate_field, SWITCH_FALSE);
|
||||||
switch_channel_set_variable_var_check(channel, "lcr_query_digits", digits_copy, SWITCH_FALSE);
|
switch_channel_set_variable_var_check(channel, "lcr_query_digits", digits_copy, SWITCH_FALSE);
|
||||||
@ -1062,13 +1075,17 @@ static switch_status_t lcr_load_config()
|
|||||||
if (zstr(custom_sql)) {
|
if (zstr(custom_sql)) {
|
||||||
/* use default sql */
|
/* use default sql */
|
||||||
sql_stream.write_function(&sql_stream,
|
sql_stream.write_function(&sql_stream,
|
||||||
"SELECT l.digits AS lcr_digits, c.carrier_name AS lcr_carrier_name, l.${lcr_rate_field} AS lcr_rate_field, cg.prefix AS lcr_gw_prefix, cg.suffix AS lcr_gw_suffix, l.lead_strip AS lcr_lead_strip, l.trail_strip AS lcr_trail_strip, l.prefix AS lcr_prefix, l.suffix AS lcr_suffix "
|
"SELECT l.digits AS lcr_digits, c.carrier_name AS lcr_carrier_name, l.${lcr_rate_field} AS lcr_rate_field, \
|
||||||
|
cg.prefix AS lcr_gw_prefix, cg.suffix AS lcr_gw_suffix, l.lead_strip AS lcr_lead_strip, \
|
||||||
|
l.trail_strip AS lcr_trail_strip, l.prefix AS lcr_prefix, l.suffix AS lcr_suffix "
|
||||||
);
|
);
|
||||||
if (db_check("SELECT codec from carrier_gateway limit 1") == SWITCH_TRUE) {
|
if (db_check("SELECT codec from carrier_gateway limit 1") == SWITCH_TRUE) {
|
||||||
sql_stream.write_function(&sql_stream, ", cg.codec AS lcr_codec ");
|
sql_stream.write_function(&sql_stream, ", cg.codec AS lcr_codec ");
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "codec field defined.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "codec field defined.\n");
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "codec field not defined, please update your lcr carrier_gateway database schema.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
|
||||||
|
"codec field not defined, please update your lcr carrier_gateway database schema.\n"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (db_check("SELECT cid from lcr limit 1") == SWITCH_TRUE) {
|
if (db_check("SELECT cid from lcr limit 1") == SWITCH_TRUE) {
|
||||||
sql_stream.write_function(&sql_stream, ", l.cid AS lcr_cid ");
|
sql_stream.write_function(&sql_stream, ", l.cid AS lcr_cid ");
|
||||||
@ -1076,12 +1093,15 @@ static switch_status_t lcr_load_config()
|
|||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "cid field not defined, please update your lcr database schema.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "cid field not defined, please update your lcr database schema.\n");
|
||||||
}
|
}
|
||||||
sql_stream.write_function(&sql_stream, "FROM lcr l JOIN carriers c ON l.carrier_id=c.id JOIN carrier_gateway cg ON c.id=cg.carrier_id WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1' AND digits IN (");
|
sql_stream.write_function(&sql_stream, "FROM lcr l JOIN carriers c ON l.carrier_id=c.id \
|
||||||
|
JOIN carrier_gateway cg ON c.id=cg.carrier_id WHERE \
|
||||||
|
c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1' AND digits IN (");
|
||||||
sql_stream.write_function(&sql_stream, "${lcr_query_expanded_digits}");
|
sql_stream.write_function(&sql_stream, "${lcr_query_expanded_digits}");
|
||||||
sql_stream.write_function(&sql_stream, ") AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end ");
|
sql_stream.write_function(&sql_stream, ") AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end ");
|
||||||
if (profile->id > 0) {
|
if (profile->id > 0) {
|
||||||
sql_stream.write_function(&sql_stream, "AND lcr_profile=%d ", profile->id);
|
sql_stream.write_function(&sql_stream, "AND lcr_profile=%d ", profile->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
sql_stream.write_function(&sql_stream, "ORDER BY digits DESC%s",
|
sql_stream.write_function(&sql_stream, "ORDER BY digits DESC%s",
|
||||||
profile->order_by);
|
profile->order_by);
|
||||||
if (db_random) {
|
if (db_random) {
|
||||||
@ -1880,16 +1900,11 @@ SWITCH_STANDARD_API(dialplan_lcr_admin_function)
|
|||||||
stream->write_function(stream, " has intrastate:\t%s\n", profile->profile_has_intrastate ? "true" : "false");
|
stream->write_function(stream, " has intrastate:\t%s\n", profile->profile_has_intrastate ? "true" : "false");
|
||||||
stream->write_function(stream, " has intralata:\t%s\n", profile->profile_has_intralata ? "true" : "false");
|
stream->write_function(stream, " has intralata:\t%s\n", profile->profile_has_intralata ? "true" : "false");
|
||||||
stream->write_function(stream, " has npanxx:\t%s\n", profile->profile_has_npanxx ? "true" : "false");
|
stream->write_function(stream, " has npanxx:\t%s\n", profile->profile_has_npanxx ? "true" : "false");
|
||||||
stream->write_function(stream, " Reorder rate:\t%s\n",
|
stream->write_function(stream, " Reorder rate:\t%s\n", profile->reorder_by_rate ? "enabled" : "disabled");
|
||||||
profile->reorder_by_rate ? "enabled" : "disabled");
|
stream->write_function(stream, " Info in headers:\t%s\n", profile->info_in_headers ? "enabled" : "disabled");
|
||||||
stream->write_function(stream, " Info in headers:\t%s\n",
|
stream->write_function(stream, " Quote IN() List:\t%s\n", profile->quote_in_list ? "enabled" : "disabled");
|
||||||
profile->info_in_headers ? "enabled" : "disabled");
|
stream->write_function(stream, " Sip Redirection Mode:\t%s\n", profile->enable_sip_redir ? "enabled" : "disabled");
|
||||||
stream->write_function(stream, " Quote IN() List:\t%s\n",
|
stream->write_function(stream, " Import fields:\t%s\n", profile->export_fields_str ? profile->export_fields_str : "(null)");
|
||||||
profile->quote_in_list ? "enabled" : "disabled");
|
|
||||||
stream->write_function(stream, " Sip Redirection Mode:\t%s\n",
|
|
||||||
profile->enable_sip_redir ? "enabled" : "disabled");
|
|
||||||
stream->write_function(stream, " Import fields:\t%s\n",
|
|
||||||
profile->export_fields_str ? profile->export_fields_str : "(null)");
|
|
||||||
stream->write_function(stream, " Limit type:\t%s\n", profile->limit_type);
|
stream->write_function(stream, " Limit type:\t%s\n", profile->limit_type);
|
||||||
stream->write_function(stream, "\n");
|
stream->write_function(stream, "\n");
|
||||||
}
|
}
|
||||||
|
@ -2415,7 +2415,7 @@ SWITCH_STANDARD_API(pa_cmd)
|
|||||||
} else if (!strcmp(action, "call")) {
|
} else if (!strcmp(action, "call")) {
|
||||||
switch_snprintf(cmd_buf, sizeof(cmd_buf), "call %s", wcmd);
|
switch_snprintf(cmd_buf, sizeof(cmd_buf), "call %s", wcmd);
|
||||||
cmd = cmd_buf;
|
cmd = cmd_buf;
|
||||||
} else if (!strcmp(action, "hangup") || !strcmp(action, "list") || !strcmp(action, "answer")) {
|
} else if (!strcmp(action, "hangup") || !strcmp(action, "list") || !strcmp(action, "devlist") || !strcmp(action, "answer")) {
|
||||||
cmd = action;
|
cmd = action;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2543,6 +2543,7 @@ SWITCH_STANDARD_API(pa_cmd)
|
|||||||
"<input name=action type=submit value=\"unmute\"> "
|
"<input name=action type=submit value=\"unmute\"> "
|
||||||
"<input name=action type=submit value=\"indev\"> "
|
"<input name=action type=submit value=\"indev\"> "
|
||||||
"<input name=action type=submit value=\"outdev\"> "
|
"<input name=action type=submit value=\"outdev\"> "
|
||||||
|
"<input name=action type=submit value=\"devlist\"> <br> "
|
||||||
"<input name=action type=submit value=\"preparestream\"> "
|
"<input name=action type=submit value=\"preparestream\"> "
|
||||||
"<input name=action type=submit value=\"switchstream\"> "
|
"<input name=action type=submit value=\"switchstream\"> "
|
||||||
"<input name=action type=submit value=\"closestreams\"> "
|
"<input name=action type=submit value=\"closestreams\"> "
|
||||||
|
@ -2041,8 +2041,8 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re
|
|||||||
listener->device_name, listener->device_instance);
|
listener->device_name, listener->device_instance);
|
||||||
}
|
}
|
||||||
if(zstr(listener->device_name) && request->type != REGISTER_MESSAGE && request->type != ALARM_MESSAGE && request->type != XML_ALARM_MESSAGE) {
|
if(zstr(listener->device_name) && request->type != REGISTER_MESSAGE && request->type != ALARM_MESSAGE && request->type != XML_ALARM_MESSAGE) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
|
||||||
"Device should send a register message first.\n");
|
"Device should send a register message first. Received %s (type=%x,length=%d).\n", skinny_message_type2str(request->type), request->type, request->length);
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
switch(request->type) {
|
switch(request->type) {
|
||||||
@ -2110,7 +2110,7 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re
|
|||||||
return skinny_handle_xml_alarm(listener, request);
|
return skinny_handle_xml_alarm(listener, request);
|
||||||
default:
|
default:
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
|
||||||
"Unhandled request %s (type=%x,length=%d).\n", skinny_message_type2str(request->type), request->type, request->length);
|
"Unhandled %s (type=%x,length=%d).\n", skinny_message_type2str(request->type), request->type, request->length);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,219 +35,220 @@
|
|||||||
|
|
||||||
/* Translation tables */
|
/* Translation tables */
|
||||||
struct skinny_table SKINNY_MESSAGE_TYPES[] = {
|
struct skinny_table SKINNY_MESSAGE_TYPES[] = {
|
||||||
{"KeepAliveMessage", KEEP_ALIVE_MESSAGE},
|
{KEEP_ALIVE_MESSAGE, "KeepAliveMessage"},
|
||||||
{"RegisterMessage", REGISTER_MESSAGE},
|
{REGISTER_MESSAGE, "RegisterMessage"},
|
||||||
{"PortMessage", PORT_MESSAGE},
|
{PORT_MESSAGE, "PortMessage"},
|
||||||
{"KeypadButtonMessage", KEYPAD_BUTTON_MESSAGE},
|
{KEYPAD_BUTTON_MESSAGE, "KeypadButtonMessage"},
|
||||||
{"EnblocCallMessage", ENBLOC_CALL_MESSAGE},
|
{ENBLOC_CALL_MESSAGE, "EnblocCallMessage"},
|
||||||
{"StimulusMessage", STIMULUS_MESSAGE},
|
{STIMULUS_MESSAGE, "StimulusMessage"},
|
||||||
{"OffHookMessage", OFF_HOOK_MESSAGE},
|
{OFF_HOOK_MESSAGE, "OffHookMessage"},
|
||||||
{"OnHookMessage", ON_HOOK_MESSAGE},
|
{ON_HOOK_MESSAGE, "OnHookMessage"},
|
||||||
{"ForwardStatReqMessage", FORWARD_STAT_REQ_MESSAGE},
|
{ FORWARD_STAT_REQ_MESSAGE, "ForwardStatReqMessage"},
|
||||||
{"SpeedDialStatReqMessage", SPEED_DIAL_STAT_REQ_MESSAGE},
|
{SPEED_DIAL_STAT_REQ_MESSAGE, "SpeedDialStatReqMessage"},
|
||||||
{"LineStatReqMessage", LINE_STAT_REQ_MESSAGE},
|
{LINE_STAT_REQ_MESSAGE, "LineStatReqMessage"},
|
||||||
{"ConfigStatReqMessage", CONFIG_STAT_REQ_MESSAGE},
|
{CONFIG_STAT_REQ_MESSAGE, "ConfigStatReqMessage"},
|
||||||
{"TimeDateReqMessage", TIME_DATE_REQ_MESSAGE},
|
{TIME_DATE_REQ_MESSAGE, "TimeDateReqMessage"},
|
||||||
{"ButtonTemplateReqMessage", BUTTON_TEMPLATE_REQ_MESSAGE},
|
{BUTTON_TEMPLATE_REQ_MESSAGE, "ButtonTemplateReqMessage"},
|
||||||
{"VersionReqMessage", VERSION_REQ_MESSAGE},
|
{VERSION_REQ_MESSAGE, "VersionReqMessage"},
|
||||||
{"CapabilitiesReqMessage", CAPABILITIES_RES_MESSAGE},
|
{CAPABILITIES_RES_MESSAGE, "CapabilitiesReqMessage"},
|
||||||
{"AlarmMessage", ALARM_MESSAGE},
|
{ALARM_MESSAGE, "AlarmMessage"},
|
||||||
{"OpenReceiveChannelAckMessage", OPEN_RECEIVE_CHANNEL_ACK_MESSAGE},
|
{OPEN_RECEIVE_CHANNEL_ACK_MESSAGE, "OpenReceiveChannelAckMessage"},
|
||||||
{"SoftKeySetReqMessage", SOFT_KEY_SET_REQ_MESSAGE},
|
{SOFT_KEY_SET_REQ_MESSAGE, "SoftKeySetReqMessage"},
|
||||||
{"SoftKeyEventMessage", SOFT_KEY_EVENT_MESSAGE},
|
{SOFT_KEY_EVENT_MESSAGE, "SoftKeyEventMessage"},
|
||||||
{"UnregisterMessage", UNREGISTER_MESSAGE},
|
{UNREGISTER_MESSAGE, "UnregisterMessage"},
|
||||||
{"SoftKeyTemplateReqMessage", SOFT_KEY_TEMPLATE_REQ_MESSAGE},
|
{SOFT_KEY_TEMPLATE_REQ_MESSAGE, "SoftKeyTemplateReqMessage"},
|
||||||
{"HeadsetStatusMessage", HEADSET_STATUS_MESSAGE},
|
{HEADSET_STATUS_MESSAGE, "HeadsetStatusMessage"},
|
||||||
{"RegisterAvailableLinesMessage", REGISTER_AVAILABLE_LINES_MESSAGE},
|
{REGISTER_AVAILABLE_LINES_MESSAGE, "RegisterAvailableLinesMessage"},
|
||||||
{"DeviceToUserDataMessage", DEVICE_TO_USER_DATA_MESSAGE},
|
{DEVICE_TO_USER_DATA_MESSAGE, "DeviceToUserDataMessage"},
|
||||||
{"DeviceToUserDataResponseMessage", DEVICE_TO_USER_DATA_RESPONSE_MESSAGE},
|
{DEVICE_TO_USER_DATA_RESPONSE_MESSAGE, "DeviceToUserDataResponseMessage"},
|
||||||
{"ServiceUrlStatReqMessage", SERVICE_URL_STAT_REQ_MESSAGE},
|
{SERVICE_URL_STAT_REQ_MESSAGE, "ServiceUrlStatReqMessage"},
|
||||||
{"FeatureStatReqMessage", FEATURE_STAT_REQ_MESSAGE},
|
{FEATURE_STAT_REQ_MESSAGE, "FeatureStatReqMessage"},
|
||||||
{"DeviceToUserDataVersion1Message", DEVICE_TO_USER_DATA_VERSION1_MESSAGE},
|
{DEVICE_TO_USER_DATA_VERSION1_MESSAGE, "DeviceToUserDataVersion1Message"},
|
||||||
{"DeviceToUserDataResponseVersion1Message", DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE},
|
{DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE, "DeviceToUserDataResponseVersion1Message"},
|
||||||
{"RegisterAckMessage", REGISTER_ACK_MESSAGE},
|
{REGISTER_ACK_MESSAGE, "RegisterAckMessage"},
|
||||||
{"StartToneMessage", START_TONE_MESSAGE},
|
{START_TONE_MESSAGE, "StartToneMessage"},
|
||||||
{"StopToneMessage", STOP_TONE_MESSAGE},
|
{STOP_TONE_MESSAGE, "StopToneMessage"},
|
||||||
{"SetRingerMessage", SET_RINGER_MESSAGE},
|
{SET_RINGER_MESSAGE, "SetRingerMessage"},
|
||||||
{"SetLampMessage", SET_LAMP_MESSAGE},
|
{SET_LAMP_MESSAGE, "SetLampMessage"},
|
||||||
{"SetSpeakerModeMessage", SET_SPEAKER_MODE_MESSAGE},
|
{SET_SPEAKER_MODE_MESSAGE, "SetSpeakerModeMessage"},
|
||||||
{"StartMediaTransmissionMessage", START_MEDIA_TRANSMISSION_MESSAGE},
|
{START_MEDIA_TRANSMISSION_MESSAGE, "StartMediaTransmissionMessage"},
|
||||||
{"StopMediaTransmissionMessage", STOP_MEDIA_TRANSMISSION_MESSAGE},
|
{STOP_MEDIA_TRANSMISSION_MESSAGE, "StopMediaTransmissionMessage"},
|
||||||
{"CallInfoMessage", CALL_INFO_MESSAGE},
|
{CALL_INFO_MESSAGE, "CallInfoMessage"},
|
||||||
{"ForwardStatMessage", FORWARD_STAT_MESSAGE},
|
{FORWARD_STAT_MESSAGE, "ForwardStatMessage"},
|
||||||
{"SpeedDialStatResMessage", SPEED_DIAL_STAT_RES_MESSAGE},
|
{SPEED_DIAL_STAT_RES_MESSAGE, "SpeedDialStatResMessage"},
|
||||||
{"LineStatResMessage", LINE_STAT_RES_MESSAGE},
|
{LINE_STAT_RES_MESSAGE, "LineStatResMessage"},
|
||||||
{"ConfigStatResMessage", CONFIG_STAT_RES_MESSAGE},
|
{CONFIG_STAT_RES_MESSAGE, "ConfigStatResMessage"},
|
||||||
{"DefineTimeDateMessage", DEFINE_TIME_DATE_MESSAGE},
|
{DEFINE_TIME_DATE_MESSAGE, "DefineTimeDateMessage"},
|
||||||
{"ButtonTemplateResMessage", BUTTON_TEMPLATE_RES_MESSAGE},
|
{BUTTON_TEMPLATE_RES_MESSAGE, "ButtonTemplateResMessage"},
|
||||||
{"VersionMessage", VERSION_MESSAGE},
|
{VERSION_MESSAGE, "VersionMessage"},
|
||||||
{"CapabilitiesReqMessage", CAPABILITIES_REQ_MESSAGE},
|
{CAPABILITIES_REQ_MESSAGE, "CapabilitiesReqMessage"},
|
||||||
{"RegisterRejectMessage", REGISTER_REJECT_MESSAGE},
|
{REGISTER_REJECT_MESSAGE, "RegisterRejectMessage"},
|
||||||
{"ResetMessage", RESET_MESSAGE},
|
{RESET_MESSAGE, "ResetMessage"},
|
||||||
{"KeepAliveAckMessage", KEEP_ALIVE_ACK_MESSAGE},
|
{KEEP_ALIVE_ACK_MESSAGE, "KeepAliveAckMessage"},
|
||||||
{"OpenReceiveChannelMessage", OPEN_RECEIVE_CHANNEL_MESSAGE},
|
{OPEN_RECEIVE_CHANNEL_MESSAGE, "OpenReceiveChannelMessage"},
|
||||||
{"CloseReceiveChannelMessage", CLOSE_RECEIVE_CHANNEL_MESSAGE},
|
{CLOSE_RECEIVE_CHANNEL_MESSAGE, "CloseReceiveChannelMessage"},
|
||||||
{"SoftKeyTemplateResMessage", SOFT_KEY_TEMPLATE_RES_MESSAGE},
|
{SOFT_KEY_TEMPLATE_RES_MESSAGE, "SoftKeyTemplateResMessage"},
|
||||||
{"SoftKeySetResMessage", SOFT_KEY_SET_RES_MESSAGE},
|
{SOFT_KEY_SET_RES_MESSAGE, "SoftKeySetResMessage"},
|
||||||
{"SelectSoftKeysMessage", SELECT_SOFT_KEYS_MESSAGE},
|
{SELECT_SOFT_KEYS_MESSAGE, "SelectSoftKeysMessage"},
|
||||||
{"CallStateMessage", CALL_STATE_MESSAGE},
|
{CALL_STATE_MESSAGE, "CallStateMessage"},
|
||||||
{"DisplayPromptStatusMessage", DISPLAY_PROMPT_STATUS_MESSAGE},
|
{DISPLAY_PROMPT_STATUS_MESSAGE, "DisplayPromptStatusMessage"},
|
||||||
{"ClearPromptStatusMessage", CLEAR_PROMPT_STATUS_MESSAGE},
|
{CLEAR_PROMPT_STATUS_MESSAGE, "ClearPromptStatusMessage"},
|
||||||
{"ActivateCallPlaneMessage", ACTIVATE_CALL_PLANE_MESSAGE},
|
{ACTIVATE_CALL_PLANE_MESSAGE, "ActivateCallPlaneMessage"},
|
||||||
{"UnregisterAckMessage", UNREGISTER_ACK_MESSAGE},
|
{UNREGISTER_ACK_MESSAGE, "UnregisterAckMessage"},
|
||||||
{"BackSpaceReqMessage", BACK_SPACE_REQ_MESSAGE},
|
{BACK_SPACE_REQ_MESSAGE, "BackSpaceReqMessage"},
|
||||||
{"DialedNumberMessage", DIALED_NUMBER_MESSAGE},
|
{DIALED_NUMBER_MESSAGE, "DialedNumberMessage"},
|
||||||
{"UserToDeviceDataMessage", USER_TO_DEVICE_DATA_MESSAGE},
|
{USER_TO_DEVICE_DATA_MESSAGE, "UserToDeviceDataMessage"},
|
||||||
{"FeatureResMessage", FEATURE_STAT_RES_MESSAGE},
|
{FEATURE_STAT_RES_MESSAGE, "FeatureResMessage"},
|
||||||
{"DisplayPriNotifyMessage", DISPLAY_PRI_NOTIFY_MESSAGE},
|
{DISPLAY_PRI_NOTIFY_MESSAGE, "DisplayPriNotifyMessage"},
|
||||||
{"ServiceUrlStatMessage", SERVICE_URL_STAT_RES_MESSAGE},
|
{SERVICE_URL_STAT_RES_MESSAGE, "ServiceUrlStatMessage"},
|
||||||
{"UserToDeviceDataVersion1Message", USER_TO_DEVICE_DATA_VERSION1_MESSAGE},
|
{USER_TO_DEVICE_DATA_VERSION1_MESSAGE, "UserToDeviceDataVersion1Message"},
|
||||||
{"XMLAlarmMessage", XML_ALARM_MESSAGE},
|
{XML_ALARM_MESSAGE, "XMLAlarmMessage"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, "UnknownMessage")
|
SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, "UnknownMessage")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2message_type, SKINNY_MESSAGE_TYPES, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2message_type, SKINNY_MESSAGE_TYPES, -1)
|
||||||
|
|
||||||
struct skinny_table SKINNY_DEVICE_TYPES[] = {
|
struct skinny_table SKINNY_DEVICE_TYPES[] = {
|
||||||
{"Cisco 30 SP+", 1},
|
{1, "Cisco 30 SP+"},
|
||||||
{"Cisco 12 SP+", 2},
|
{2, "Cisco 12 SP+"},
|
||||||
{"Cisco 12 SP", 3},
|
{3, "Cisco 12 SP"},
|
||||||
{"Cisco 12", 4},
|
{4, "Cisco 12"},
|
||||||
{"Cisco 30 VIP", 5},
|
{5, "Cisco 30 VIP"},
|
||||||
{"Cisco IP Phone 7910", 6},
|
{6, "Cisco IP Phone 7910"},
|
||||||
{"Cisco IP Phone 7960", 7},
|
{7, "Cisco IP Phone 7960"},
|
||||||
{"Cisco IP Phone 7940", 8},
|
{8, "Cisco IP Phone 7940"},
|
||||||
{"Cisco IP Phone 7935", 9},
|
{9, "Cisco IP Phone 7935"},
|
||||||
{"Cisco ATA 186", 12},
|
{12, "Cisco ATA 186"},
|
||||||
{"Cisco IP Phone CP-7962G", 404},
|
{365, "Cisco IP Phone CP-7921G"},
|
||||||
{"Cisco IP Phone CP-7965G", 436},
|
{404, "Cisco IP Phone CP-7962G"},
|
||||||
{"Cisco IP Phone CP-7961G", 30018},
|
{436, "Cisco IP Phone CP-7965G"},
|
||||||
{"Cisco IP Phone 7936", 30019},
|
{30018, "Cisco IP Phone CP-7961G"},
|
||||||
{NULL, 0}
|
{30019, "Cisco IP Phone 7936"},
|
||||||
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_device_type2str, SKINNY_DEVICE_TYPES, "UnknownDeviceType")
|
SKINNY_DECLARE_ID2STR(skinny_device_type2str, SKINNY_DEVICE_TYPES, "UnknownDeviceType")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2device_type, SKINNY_DEVICE_TYPES, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2device_type, SKINNY_DEVICE_TYPES, -1)
|
||||||
|
|
||||||
struct skinny_table SKINNY_RING_TYPES[] = {
|
struct skinny_table SKINNY_RING_TYPES[] = {
|
||||||
{"RingOff", SKINNY_RING_OFF},
|
{SKINNY_RING_OFF, "RingOff"},
|
||||||
{"RingInside", SKINNY_RING_INSIDE},
|
{SKINNY_RING_INSIDE, "RingInside"},
|
||||||
{"RingOutside", SKINNY_RING_OUTSIDE},
|
{SKINNY_RING_OUTSIDE, "RingOutside"},
|
||||||
{"RingFeature", SKINNY_RING_FEATURE},
|
{SKINNY_RING_FEATURE, "RingFeature"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_ring_type2str, SKINNY_RING_TYPES, "RingTypeUnknown")
|
SKINNY_DECLARE_ID2STR(skinny_ring_type2str, SKINNY_RING_TYPES, "RingTypeUnknown")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2ring_type, SKINNY_RING_TYPES, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2ring_type, SKINNY_RING_TYPES, -1)
|
||||||
|
|
||||||
struct skinny_table SKINNY_RING_MODES[] = {
|
struct skinny_table SKINNY_RING_MODES[] = {
|
||||||
{"RingForever", SKINNY_RING_FOREVER},
|
{SKINNY_RING_FOREVER, "RingForever"},
|
||||||
{"RingOnce", SKINNY_RING_ONCE},
|
{SKINNY_RING_ONCE, "RingOnce"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_ring_mode2str, SKINNY_RING_MODES, "RingModeUnknown")
|
SKINNY_DECLARE_ID2STR(skinny_ring_mode2str, SKINNY_RING_MODES, "RingModeUnknown")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2ring_mode, SKINNY_RING_MODES, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2ring_mode, SKINNY_RING_MODES, -1)
|
||||||
|
|
||||||
struct skinny_table SKINNY_BUTTONS[] = {
|
struct skinny_table SKINNY_BUTTONS[] = {
|
||||||
{"Unknown", SKINNY_BUTTON_UNKNOWN},
|
{SKINNY_BUTTON_UNKNOWN, "Unknown"},
|
||||||
{"LastNumberRedial", SKINNY_BUTTON_LAST_NUMBER_REDIAL},
|
{SKINNY_BUTTON_LAST_NUMBER_REDIAL, "LastNumberRedial"},
|
||||||
{"SpeedDial", SKINNY_BUTTON_SPEED_DIAL},
|
{SKINNY_BUTTON_SPEED_DIAL, "SpeedDial"},
|
||||||
{"Hold", SKINNY_BUTTON_HOLD},
|
{SKINNY_BUTTON_HOLD, "Hold"},
|
||||||
{"Transfer", SKINNY_BUTTON_TRANSFER},
|
{SKINNY_BUTTON_TRANSFER, "Transfer"},
|
||||||
{"Line", SKINNY_BUTTON_LINE},
|
{SKINNY_BUTTON_LINE, "Line"},
|
||||||
{"Voicemail", SKINNY_BUTTON_VOICEMAIL},
|
{SKINNY_BUTTON_VOICEMAIL, "Voicemail"},
|
||||||
{"Privacy", SKINNY_BUTTON_PRIVACY},
|
{SKINNY_BUTTON_PRIVACY, "Privacy"},
|
||||||
{"ServiceUrl", SKINNY_BUTTON_SERVICE_URL},
|
{SKINNY_BUTTON_SERVICE_URL, "ServiceUrl"},
|
||||||
{"Undefined", SKINNY_BUTTON_UNDEFINED},
|
{SKINNY_BUTTON_UNDEFINED, "Undefined"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_button2str, SKINNY_BUTTONS, "Unknown")
|
SKINNY_DECLARE_ID2STR(skinny_button2str, SKINNY_BUTTONS, "Unknown")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2button, SKINNY_BUTTONS, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2button, SKINNY_BUTTONS, -1)
|
||||||
|
|
||||||
struct skinny_table SKINNY_SOFT_KEY_EVENTS[] = {
|
struct skinny_table SKINNY_SOFT_KEY_EVENTS[] = {
|
||||||
{"SoftkeyRedial", SOFTKEY_REDIAL},
|
{SOFTKEY_REDIAL, "SoftkeyRedial"},
|
||||||
{"SoftkeyNewcall", SOFTKEY_NEWCALL},
|
{SOFTKEY_NEWCALL, "SoftkeyNewcall"},
|
||||||
{"SoftkeyHold", SOFTKEY_HOLD},
|
{SOFTKEY_HOLD, "SoftkeyHold"},
|
||||||
{"SoftkeyTransfer", SOFTKEY_TRANSFER},
|
{SOFTKEY_TRANSFER, "SoftkeyTransfer"},
|
||||||
{"SoftkeyCfwdall", SOFTKEY_CFWDALL},
|
{SOFTKEY_CFWDALL, "SoftkeyCfwdall"},
|
||||||
{"SoftkeyCfwdbusy", SOFTKEY_CFWDBUSY},
|
{SOFTKEY_CFWDBUSY, "SoftkeyCfwdbusy"},
|
||||||
{"SoftkeyCfwdnoanswer", SOFTKEY_CFWDNOANSWER},
|
{SOFTKEY_CFWDNOANSWER, "SoftkeyCfwdnoanswer"},
|
||||||
{"SoftkeyBackspace", SOFTKEY_BACKSPACE},
|
{SOFTKEY_BACKSPACE, "SoftkeyBackspace"},
|
||||||
{"SoftkeyEndcall", SOFTKEY_ENDCALL},
|
{SOFTKEY_ENDCALL, "SoftkeyEndcall"},
|
||||||
{"SoftkeyResume", SOFTKEY_RESUME},
|
{SOFTKEY_RESUME, "SoftkeyResume"},
|
||||||
{"SoftkeyAnswer", SOFTKEY_ANSWER },
|
{SOFTKEY_ANSWER , "SoftkeyAnswer"},
|
||||||
{"SoftkeyInfo", SOFTKEY_INFO},
|
{SOFTKEY_INFO, "SoftkeyInfo"},
|
||||||
{"SoftkeyConfrm", SOFTKEY_CONFRM},
|
{SOFTKEY_CONFRM, "SoftkeyConfrm"},
|
||||||
{"SoftkeyPark", SOFTKEY_PARK},
|
{SOFTKEY_PARK, "SoftkeyPark"},
|
||||||
{"SoftkeyJoin", SOFTKEY_JOIN},
|
{SOFTKEY_JOIN, "SoftkeyJoin"},
|
||||||
{"SoftkeyMeetmeconfrm", SOFTKEY_MEETMECONFRM},
|
{SOFTKEY_MEETMECONFRM, "SoftkeyMeetmeconfrm"},
|
||||||
{"SoftkeyCallpickup", SOFTKEY_CALLPICKUP},
|
{SOFTKEY_CALLPICKUP, "SoftkeyCallpickup"},
|
||||||
{"SoftkeyGrpcallpickup", SOFTKEY_GRPCALLPICKUP},
|
{SOFTKEY_GRPCALLPICKUP, "SoftkeyGrpcallpickup"},
|
||||||
{"SoftkeyDnd", SOFTKEY_DND},
|
{SOFTKEY_DND, "SoftkeyDnd"},
|
||||||
{"SoftkeyIdivert", SOFTKEY_IDIVERT},
|
{SOFTKEY_IDIVERT, "SoftkeyIdivert"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_soft_key_event2str, SKINNY_SOFT_KEY_EVENTS, "SoftkeyUnknown")
|
SKINNY_DECLARE_ID2STR(skinny_soft_key_event2str, SKINNY_SOFT_KEY_EVENTS, "SoftkeyUnknown")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2soft_key_event, SKINNY_SOFT_KEY_EVENTS, 0)
|
SKINNY_DECLARE_STR2ID(skinny_str2soft_key_event, SKINNY_SOFT_KEY_EVENTS, 0)
|
||||||
|
|
||||||
struct skinny_table SKINNY_LAMP_MODES[] = {
|
struct skinny_table SKINNY_LAMP_MODES[] = {
|
||||||
{"Off", SKINNY_LAMP_OFF},
|
{SKINNY_LAMP_OFF, "Off"},
|
||||||
{"On", SKINNY_LAMP_ON},
|
{SKINNY_LAMP_ON, "On"},
|
||||||
{"Wink", SKINNY_LAMP_WINK},
|
{SKINNY_LAMP_WINK, "Wink"},
|
||||||
{"Flash", SKINNY_LAMP_FLASH},
|
{SKINNY_LAMP_FLASH, "Flash"},
|
||||||
{"Blink", SKINNY_LAMP_BLINK},
|
{SKINNY_LAMP_BLINK, "Blink"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_lamp_mode2str, SKINNY_LAMP_MODES, "Unknown")
|
SKINNY_DECLARE_ID2STR(skinny_lamp_mode2str, SKINNY_LAMP_MODES, "Unknown")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2lamp_mode, SKINNY_LAMP_MODES, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2lamp_mode, SKINNY_LAMP_MODES, -1)
|
||||||
|
|
||||||
struct skinny_table SKINNY_SPEAKER_MODES[] = {
|
struct skinny_table SKINNY_SPEAKER_MODES[] = {
|
||||||
{"SpeakerOn", SKINNY_SPEAKER_ON},
|
{SKINNY_SPEAKER_ON, "SpeakerOn"},
|
||||||
{"SpeakerOff", SKINNY_SPEAKER_OFF},
|
{SKINNY_SPEAKER_OFF, "SpeakerOff"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_speaker_mode2str, SKINNY_SPEAKER_MODES, "Unknown")
|
SKINNY_DECLARE_ID2STR(skinny_speaker_mode2str, SKINNY_SPEAKER_MODES, "Unknown")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2speaker_mode, SKINNY_SPEAKER_MODES, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2speaker_mode, SKINNY_SPEAKER_MODES, -1)
|
||||||
|
|
||||||
struct skinny_table SKINNY_KEY_SETS[] = {
|
struct skinny_table SKINNY_KEY_SETS[] = {
|
||||||
{"KeySetOnHook", SKINNY_KEY_SET_ON_HOOK},
|
{SKINNY_KEY_SET_ON_HOOK, "KeySetOnHook"},
|
||||||
{"KeySetConnected", SKINNY_KEY_SET_CONNECTED},
|
{SKINNY_KEY_SET_CONNECTED, "KeySetConnected"},
|
||||||
{"KeySetOnHold", SKINNY_KEY_SET_ON_HOLD},
|
{SKINNY_KEY_SET_ON_HOLD, "KeySetOnHold"},
|
||||||
{"KeySetRingIn", SKINNY_KEY_SET_RING_IN},
|
{SKINNY_KEY_SET_RING_IN, "KeySetRingIn"},
|
||||||
{"KeySetOffHook", SKINNY_KEY_SET_OFF_HOOK},
|
{SKINNY_KEY_SET_OFF_HOOK, "KeySetOffHook"},
|
||||||
{"KeySetConnectedWithTransfer", SKINNY_KEY_SET_CONNECTED_WITH_TRANSFER},
|
{SKINNY_KEY_SET_CONNECTED_WITH_TRANSFER, "KeySetConnectedWithTransfer"},
|
||||||
{"KeySetDigitsAfterDialingFirstDigit", SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT},
|
{SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT, "KeySetDigitsAfterDialingFirstDigit"},
|
||||||
{"KeySetConnectedWithConference", SKINNY_KEY_SET_CONNECTED_WITH_CONFERENCE},
|
{SKINNY_KEY_SET_CONNECTED_WITH_CONFERENCE, "KeySetConnectedWithConference"},
|
||||||
{"KeySetRingOut", SKINNY_KEY_SET_RING_OUT},
|
{SKINNY_KEY_SET_RING_OUT, "KeySetRingOut"},
|
||||||
{"KeySetOffHookWithFeatures", SKINNY_KEY_SET_OFF_HOOK_WITH_FEATURES},
|
{SKINNY_KEY_SET_OFF_HOOK_WITH_FEATURES, "KeySetOffHookWithFeatures"},
|
||||||
{"KeySetInUseHint", SKINNY_KEY_SET_IN_USE_HINT},
|
{SKINNY_KEY_SET_IN_USE_HINT, "KeySetInUseHint"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_soft_key_set2str, SKINNY_KEY_SETS, "UNKNOWN_SOFT_KEY_SET")
|
SKINNY_DECLARE_ID2STR(skinny_soft_key_set2str, SKINNY_KEY_SETS, "UNKNOWN_SOFT_KEY_SET")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2soft_key_set, SKINNY_KEY_SETS, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2soft_key_set, SKINNY_KEY_SETS, -1)
|
||||||
|
|
||||||
struct skinny_table SKINNY_CALL_STATES[] = {
|
struct skinny_table SKINNY_CALL_STATES[] = {
|
||||||
{"OffHook", SKINNY_OFF_HOOK},
|
{SKINNY_OFF_HOOK, "OffHook"},
|
||||||
{"OnHook", SKINNY_ON_HOOK},
|
{SKINNY_ON_HOOK, "OnHook"},
|
||||||
{"RingOut", SKINNY_RING_OUT},
|
{SKINNY_RING_OUT, "RingOut"},
|
||||||
{"RingIn", SKINNY_RING_IN},
|
{SKINNY_RING_IN, "RingIn"},
|
||||||
{"Connected", SKINNY_CONNECTED},
|
{SKINNY_CONNECTED, "Connected"},
|
||||||
{"Busy", SKINNY_BUSY},
|
{SKINNY_BUSY, "Busy"},
|
||||||
{"LineInUse", SKINNY_LINE_IN_USE},
|
{SKINNY_LINE_IN_USE, "LineInUse"},
|
||||||
{"Hold", SKINNY_HOLD},
|
{SKINNY_HOLD, "Hold"},
|
||||||
{"CallWaiting", SKINNY_CALL_WAITING},
|
{SKINNY_CALL_WAITING, "CallWaiting"},
|
||||||
{"CallTransfer", SKINNY_CALL_TRANSFER},
|
{SKINNY_CALL_TRANSFER, "CallTransfer"},
|
||||||
{"CallPark", SKINNY_CALL_PARK},
|
{SKINNY_CALL_PARK, "CallPark"},
|
||||||
{"Proceed", SKINNY_PROCEED},
|
{SKINNY_PROCEED, "Proceed"},
|
||||||
{"InUseRemotely", SKINNY_IN_USE_REMOTELY},
|
{SKINNY_IN_USE_REMOTELY, "InUseRemotely"},
|
||||||
{"InvalidNumber", SKINNY_INVALID_NUMBER},
|
{SKINNY_INVALID_NUMBER, "InvalidNumber"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_call_state2str, SKINNY_CALL_STATES, "CallStateUnknown")
|
SKINNY_DECLARE_ID2STR(skinny_call_state2str, SKINNY_CALL_STATES, "CallStateUnknown")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2call_state, SKINNY_CALL_STATES, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2call_state, SKINNY_CALL_STATES, -1)
|
||||||
|
|
||||||
struct skinny_table SKINNY_DEVICE_RESET_TYPES[] = {
|
struct skinny_table SKINNY_DEVICE_RESET_TYPES[] = {
|
||||||
{"DeviceReset", SKINNY_DEVICE_RESET},
|
{SKINNY_DEVICE_RESET, "DeviceReset"},
|
||||||
{"DeviceRestart", SKINNY_DEVICE_RESTART},
|
{SKINNY_DEVICE_RESTART, "DeviceRestart"},
|
||||||
{NULL, 0}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
SKINNY_DECLARE_ID2STR(skinny_device_reset_type2str, SKINNY_DEVICE_RESET_TYPES, "DeviceResetTypeUnknown")
|
SKINNY_DECLARE_ID2STR(skinny_device_reset_type2str, SKINNY_DEVICE_RESET_TYPES, "DeviceResetTypeUnknown")
|
||||||
SKINNY_DECLARE_STR2ID(skinny_str2device_reset_type, SKINNY_DEVICE_RESET_TYPES, -1)
|
SKINNY_DECLARE_STR2ID(skinny_str2device_reset_type, SKINNY_DEVICE_RESET_TYPES, -1)
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
/* SKINNY TABLES */
|
/* SKINNY TABLES */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
struct skinny_table {
|
struct skinny_table {
|
||||||
const char *name;
|
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
|
const char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SKINNY_DECLARE_ID2STR(func, TABLE, DEFAULT_STR) \
|
#define SKINNY_DECLARE_ID2STR(func, TABLE, DEFAULT_STR) \
|
||||||
@ -92,7 +92,7 @@ const char *skinny_message_type2str(uint32_t id);
|
|||||||
uint32_t skinny_str2message_type(const char *str);
|
uint32_t skinny_str2message_type(const char *str);
|
||||||
#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
|
#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
|
||||||
|
|
||||||
extern struct skinny_table SKINNY_DEVICE_TYPES[15];
|
extern struct skinny_table SKINNY_DEVICE_TYPES[16];
|
||||||
const char *skinny_device_type2str(uint32_t id);
|
const char *skinny_device_type2str(uint32_t id);
|
||||||
uint32_t skinny_str2device_type(const char *str);
|
uint32_t skinny_str2device_type(const char *str);
|
||||||
#define SKINNY_PUSH_DEVICE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_DEVICE_TYPES)
|
#define SKINNY_PUSH_DEVICE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_DEVICE_TYPES)
|
||||||
|
@ -1655,6 +1655,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||||||
const char *ip = NULL, *port = NULL;
|
const char *ip = NULL, *port = NULL;
|
||||||
|
|
||||||
switch_channel_set_flag(channel, CF_PROXY_MODE);
|
switch_channel_set_flag(channel, CF_PROXY_MODE);
|
||||||
|
if (tech_pvt->rm_encoding) {
|
||||||
|
tech_pvt->rm_encoding = NULL;
|
||||||
|
}
|
||||||
sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE);
|
sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE);
|
||||||
|
|
||||||
if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
|
if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
|
||||||
|
@ -76,14 +76,15 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status,
|
|||||||
char const *phrase,
|
char const *phrase,
|
||||||
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[])
|
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[])
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if (status >= 300 && sip && sip->sip_call_id) {
|
if (status >= 300 && sip && sip->sip_call_id) {
|
||||||
char *sql;
|
char *sql;
|
||||||
sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", sip->sip_call_id->i_id);
|
sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", sip->sip_call_id->i_id);
|
||||||
switch_assert(sql != NULL);
|
switch_assert(sql != NULL);
|
||||||
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
|
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
|
||||||
|
nua_handle_destroy(nh);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define url_set_chanvars(session, url, varprefix) _url_set_chanvars(session, url, #varprefix "_user", #varprefix "_host", #varprefix "_port", #varprefix "_uri", #varprefix "_params")
|
#define url_set_chanvars(session, url, varprefix) _url_set_chanvars(session, url, #varprefix "_user", #varprefix "_host", #varprefix "_port", #varprefix "_uri", #varprefix "_params")
|
||||||
@ -5710,6 +5711,11 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
|||||||
switch_core_event_hook_add_state_change(a_session, xfer_hanguphook);
|
switch_core_event_hook_add_state_change(a_session, xfer_hanguphook);
|
||||||
switch_channel_set_variable(a_channel, "att_xfer_kill_uuid", switch_core_session_get_uuid(b_session));
|
switch_channel_set_variable(a_channel, "att_xfer_kill_uuid", switch_core_session_get_uuid(b_session));
|
||||||
|
|
||||||
|
if (profile->media_options & MEDIA_OPT_BYPASS_AFTER_ATT_XFER) {
|
||||||
|
switch_channel_set_flag(a_channel, CF_BYPASS_MEDIA_AFTER_BRIDGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((tmp = switch_channel_get_hold_music(a_channel))) {
|
if ((tmp = switch_channel_get_hold_music(a_channel))) {
|
||||||
moh = tmp;
|
moh = tmp;
|
||||||
}
|
}
|
||||||
@ -5769,6 +5775,12 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
|||||||
switch_core_session_rwunlock(tmp);
|
switch_core_session_rwunlock(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((profile->media_options & MEDIA_OPT_BYPASS_AFTER_ATT_XFER) && (tmp = switch_core_session_locate(br_a))) {
|
||||||
|
switch_channel_t *tchannel = switch_core_session_get_channel(tmp);
|
||||||
|
switch_channel_set_flag(tchannel, CF_BYPASS_MEDIA_AFTER_BRIDGE);
|
||||||
|
switch_core_session_rwunlock(tmp);
|
||||||
|
}
|
||||||
|
|
||||||
switch_ivr_uuid_bridge(br_b, br_a);
|
switch_ivr_uuid_bridge(br_b, br_a);
|
||||||
switch_channel_set_variable(channel_b, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER");
|
switch_channel_set_variable(channel_b, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER");
|
||||||
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
|
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
|
||||||
|
@ -729,6 +729,8 @@ void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tech_pvt->payload_space = 0;
|
||||||
|
|
||||||
switch_assert(tech_pvt->session != NULL);
|
switch_assert(tech_pvt->session != NULL);
|
||||||
|
|
||||||
if ((abs = switch_channel_get_variable(tech_pvt->channel, "absolute_codec_string"))) {
|
if ((abs = switch_channel_get_variable(tech_pvt->channel, "absolute_codec_string"))) {
|
||||||
|
@ -1506,9 +1506,9 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
|||||||
stream.write_function(&stream,
|
stream.write_function(&stream,
|
||||||
"<?xml version=\"1.0\"?>\n"
|
"<?xml version=\"1.0\"?>\n"
|
||||||
"<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" "
|
"<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" "
|
||||||
"version=\"%s\" state=\"%s\" entity=\"%s\">\n",
|
"version=\"%s\" state=\"partial\" entity=\"%s\">\n", version, clean_id);
|
||||||
version,
|
|
||||||
zstr(uuid) ? "partial" : "full", clean_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (strcasecmp(event_status, "Registered")) {
|
//if (strcasecmp(event_status, "Registered")) {
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
* Portions created by the Initial Developer are Copyright (C)
|
* Portions created by the Initial Developer are Copyright (C)
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
* Portions created by Seventh Signal Ltd. & Co. KG and its employees are Copyright (C)
|
||||||
|
* Seventh Signal Ltd. & Co. KG, All Rights Reserverd.
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Michal Bielicki <michal.bielicki@halokwadrat.de>
|
* Michal Bielicki <michal.bielicki@halokwadrat.de>
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
* Portions created by the Initial Developer are Copyright (C)
|
* Portions created by the Initial Developer are Copyright (C)
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
* Portions created by Seventh Signal Ltd. & Co. KG and its employees are Copyright (C)
|
||||||
|
* Seventh Signal Ltd. & Co. KG, All Rights Reserverd.
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Daniel Swarbrick <daniel.swarbrick@seventhsignal.de>
|
* Daniel Swarbrick <daniel.swarbrick@seventhsignal.de>
|
||||||
|
@ -1,3 +1,34 @@
|
|||||||
|
|
||||||
|
-- FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||||
|
-- Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
|
||||||
|
--
|
||||||
|
-- Version: MPL 1.1
|
||||||
|
--
|
||||||
|
-- The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
-- 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
-- the License. You may obtain a copy of the License at
|
||||||
|
-- http://www.mozilla.org/MPL/
|
||||||
|
--
|
||||||
|
-- Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
-- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
-- for the specific language governing rights and limitations under the
|
||||||
|
-- License.
|
||||||
|
--
|
||||||
|
-- The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||||
|
--
|
||||||
|
-- The Initial Developer of the Original Code is
|
||||||
|
-- Anthony Minessale II <anthm@freeswitch.org>
|
||||||
|
-- Portions created by the Initial Developer are Copyright (C)
|
||||||
|
-- the Initial Developer. All Rights Reserved.
|
||||||
|
-- Portions created by Seventh Signal Ltd. & Co. KG and its employees are Copyright (C)
|
||||||
|
-- Seventh Signal Ltd. & Co. KG, All Rights Reserverd.
|
||||||
|
--
|
||||||
|
-- Contributor(s):
|
||||||
|
-- Daniel Swarbrick <daniel.swarbrick@seventhsignal.de>
|
||||||
|
-- Stefan Knoblich <s.knoblich@axsentis.de>
|
||||||
|
--
|
||||||
|
-- MIB Definition for mod_snmp
|
||||||
|
|
||||||
FREESWITCH-MIB DEFINITIONS ::= BEGIN
|
FREESWITCH-MIB DEFINITIONS ::= BEGIN
|
||||||
|
|
||||||
IMPORTS
|
IMPORTS
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
* Portions created by the Initial Developer are Copyright (C)
|
* Portions created by the Initial Developer are Copyright (C)
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
* Portions created by Seventh Signal Ltd. & Co. KG and its employees are Copyright (C)
|
||||||
|
* Seventh Signal Ltd. & Co. KG, All Rights Reserverd.
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Daniel Swarbrick <daniel.swarbrick@seventhsignal.de>
|
* Daniel Swarbrick <daniel.swarbrick@seventhsignal.de>
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
* Portions created by the Initial Developer are Copyright (C)
|
* Portions created by the Initial Developer are Copyright (C)
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
* Portions created by Seventh Signal Ltd. & Co. KG and its employees are Copyright (C)
|
||||||
|
* Seventh Signal Ltd. & Co. KG, All Rights Reserverd.
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Daniel Swarbrick <daniel.swarbrick@seventhsignal.de>
|
* Daniel Swarbrick <daniel.swarbrick@seventhsignal.de>
|
||||||
|
@ -1,3 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||||
|
* Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
|
||||||
|
*
|
||||||
|
* Version: MPL 1.1
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* License.
|
||||||
|
*
|
||||||
|
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is
|
||||||
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
|
* Portions created by the Initial Developer are Copyright (C)
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
* Portions created by Seventh Signal Ltd. & Co. KG and its employees are Copyright (C)
|
||||||
|
* Seventh Signal Ltd. & Co. KG, All Rights Reserverd.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* Daniel Swarbrick <daniel.swarbrick@seventhsignal.de>
|
||||||
|
* Stefan Knoblich <s.knoblich@axsentis.de>
|
||||||
|
*
|
||||||
|
* subagent.h -- SNMP Agent Definitions
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef subagent_H
|
#ifndef subagent_H
|
||||||
#define subagent_H
|
#define subagent_H
|
||||||
|
|
||||||
|
@ -58,6 +58,10 @@ struct say_t matrix[7][8] = { {m_00, m_01, m_02, m_03, m_04, m_05, m_06, m_07},
|
|||||||
{m_60, m_61, m_62, m_63, m_64, m_65, m_66, m_67}
|
{m_60, m_61, m_62, m_63, m_64, m_65, m_66, m_67}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct say_cur_t matrix_currency[3] = {c_0, c_1, c_2};
|
||||||
|
|
||||||
|
|
||||||
SWITCH_MODULE_LOAD_FUNCTION(mod_say_ru_load);
|
SWITCH_MODULE_LOAD_FUNCTION(mod_say_ru_load);
|
||||||
SWITCH_MODULE_DEFINITION(mod_say_ru, mod_say_ru_load, NULL, NULL);
|
SWITCH_MODULE_DEFINITION(mod_say_ru, mod_say_ru_load, NULL, NULL);
|
||||||
|
|
||||||
@ -253,8 +257,7 @@ static switch_status_t ru_say_money(switch_say_file_handle_t *sh, char *tosay, s
|
|||||||
int iruble = 0;
|
int iruble = 0;
|
||||||
int ikopecks = 0;
|
int ikopecks = 0;
|
||||||
int ikopeck = 0;
|
int ikopeck = 0;
|
||||||
|
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_money %s say_opt->currency=%d\n", tosay,say_opt->currency);
|
||||||
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_money %s\n", tosay);
|
|
||||||
|
|
||||||
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) {
|
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) {
|
||||||
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
||||||
@ -278,40 +281,48 @@ static switch_status_t ru_say_money(switch_say_file_handle_t *sh, char *tosay, s
|
|||||||
rubles++;
|
rubles++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ru_say_count(sh, rubles, male, nominativus);
|
|
||||||
|
ru_say_count(sh, rubles, matrix_currency[say_opt->currency].first_gender,matrix_currency[say_opt->currency].first_cases);
|
||||||
|
|
||||||
if (rubles) {
|
if (rubles) {
|
||||||
irubles = atoi(rubles) % 100;
|
irubles = atoi(rubles) % 100;
|
||||||
iruble = atoi(rubles) % 10;
|
iruble = atoi(rubles) % 10;
|
||||||
}
|
}
|
||||||
|
if (iruble<5) {
|
||||||
if (irubles == 1 || (irubles > 20 && iruble == 1)) { /* рубль */
|
if ((irubles>10)&&(irubles<15)) {
|
||||||
switch_say_file(sh, "currency/ruble");
|
switch_say_file(sh, "currency/%s",matrix_currency->first[5]);
|
||||||
} else if ((irubles > 1 && irubles < 5) || (irubles > 20 && iruble > 1 && iruble < 5)) { /*рубля */
|
}
|
||||||
switch_say_file(sh, "currency/ruble-a");
|
else {
|
||||||
} else { /*рублей */
|
switch_say_file(sh, "currency/%s",matrix_currency->first[iruble]);
|
||||||
switch_say_file(sh, "currency/rubles");
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
switch_say_file(sh, "currency/%s",matrix_currency->first[5]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Say kopecks */
|
/* Say kopecks */
|
||||||
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " %s\n", kopecks);
|
ru_say_count(sh, kopecks, matrix_currency[say_opt->currency].second_gender,matrix_currency[say_opt->currency].second_cases);
|
||||||
ru_say_count(sh, kopecks, female, nominativus);
|
|
||||||
|
|
||||||
if (kopecks) {
|
if (kopecks) {
|
||||||
ikopecks = atoi(kopecks) % 100;
|
ikopecks = atoi(kopecks) % 100;
|
||||||
ikopeck = atoi(kopecks) % 10;
|
ikopeck = atoi(kopecks) % 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ikopecks == 1 || (ikopecks > 20 && ikopeck == 1)) {
|
if (ikopeck<5) {
|
||||||
/* копейка */
|
if ((ikopecks>10)&&(ikopecks<15)) {
|
||||||
switch_say_file(sh, "currency/kopeck");
|
switch_say_file(sh, "currency/%s",matrix_currency->second[5]);
|
||||||
} else if ((ikopecks > 1 && ikopecks < 5) || (ikopecks > 20 && ikopeck > 1 && ikopeck < 5)) {
|
}
|
||||||
/* копейки */
|
else {
|
||||||
switch_say_file(sh, "currency/kopeck-i");
|
switch_say_file(sh, "currency/%s",matrix_currency->second[ikopeck]);
|
||||||
} else {
|
}
|
||||||
/* копеек */
|
|
||||||
switch_say_file(sh, "currency/kopecks");
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
switch_say_file(sh, "currency/%s",matrix_currency->second[5]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,6 +451,7 @@ static switch_status_t ru_say_time(switch_say_file_handle_t *sh, char *tosay, sw
|
|||||||
break;
|
break;
|
||||||
case SST_SHORT_DATE_TIME:
|
case SST_SHORT_DATE_TIME:
|
||||||
say_time = 1;
|
say_time = 1;
|
||||||
|
tm.tm_sec = 0; // В коротком варианте секунды не проговариваем
|
||||||
if (tm.tm_year != tm_now.tm_year) {
|
if (tm.tm_year != tm_now.tm_year) {
|
||||||
say_date = 1;
|
say_date = 1;
|
||||||
break;
|
break;
|
||||||
@ -593,7 +605,7 @@ static switch_new_say_callback_ru_t choose_callback(switch_say_args_t *say_args)
|
|||||||
case SST_CURRENT_TIME:
|
case SST_CURRENT_TIME:
|
||||||
say_cb = ru_say_time;
|
say_cb = ru_say_time;
|
||||||
break;
|
break;
|
||||||
|
case SST_SHORT_DATE_TIME:
|
||||||
case SST_CURRENT_DATE_TIME:
|
case SST_CURRENT_DATE_TIME:
|
||||||
say_cb = ru_say_time;
|
say_cb = ru_say_time;
|
||||||
break;
|
break;
|
||||||
@ -608,7 +620,7 @@ static switch_new_say_callback_ru_t choose_callback(switch_say_args_t *say_args)
|
|||||||
say_cb = ru_say_money;
|
say_cb = ru_say_money;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown Say type=[%d]\n", say_args->type);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown Say type=[%d]\n", say_args->type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -628,7 +640,9 @@ static switch_status_t run_callback(switch_new_say_callback_ru_t say_cb, char *t
|
|||||||
const char *gender=NULL;
|
const char *gender=NULL;
|
||||||
const char *currency=NULL;
|
const char *currency=NULL;
|
||||||
say_opt_t say_opt;
|
say_opt_t say_opt;
|
||||||
|
say_opt.cases=0;
|
||||||
|
say_opt.gender=0;
|
||||||
|
say_opt.currency=0;
|
||||||
if (session) {
|
if (session) {
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
switch_channel_get_variables(channel, &var_event);
|
switch_channel_get_variables(channel, &var_event);
|
||||||
@ -692,12 +706,15 @@ static switch_status_t run_callback(switch_new_say_callback_ru_t say_cb, char *t
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (currency) {
|
if (currency) {
|
||||||
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "ru_say!!! %s!\n", currency);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "ru_say!!! %s!\n", currency);
|
||||||
|
|
||||||
if (strcmp(currency,"rubl") || strcmp(currency,"рубль")) {
|
if ((strcmp(currency,"ruble")==0) || (strcmp(currency,"рубль")==0)) {
|
||||||
say_opt.currency=(currency_t)0;
|
say_opt.currency=(currency_t)0;
|
||||||
|
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "rul!!! \n");
|
||||||
|
|
||||||
}
|
}
|
||||||
if (strcmp(gender,"dollar") || strcmp(gender,"доллар")) {
|
if ((strcmp(currency,"dollar")==0) || (strcmp(currency,"доллар")==0)) {
|
||||||
|
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "dollar!!! !\n");
|
||||||
say_opt.currency=(currency_t)1;
|
say_opt.currency=(currency_t)1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,10 +49,12 @@ typedef enum {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ruble,
|
ruble,
|
||||||
dollar
|
dollar,
|
||||||
|
euro
|
||||||
} currency_t;
|
} currency_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
say_gender_t gender;
|
say_gender_t gender;
|
||||||
cases_t cases;
|
cases_t cases;
|
||||||
@ -66,6 +68,29 @@ struct say_t {
|
|||||||
char *million[14];
|
char *million[14];
|
||||||
int all;
|
int all;
|
||||||
};
|
};
|
||||||
|
struct say_cur_t {
|
||||||
|
char *first[6];
|
||||||
|
say_gender_t first_gender;
|
||||||
|
cases_t first_cases;
|
||||||
|
char *second[6];
|
||||||
|
say_gender_t second_gender;
|
||||||
|
cases_t second_cases;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// описываем как произносить валяюты от 0 до 5 дальше идёт номер рода и падежа (с нуля)
|
||||||
|
//рубли
|
||||||
|
#define c_0 {{"rubles","ruble","ruble-a","ruble-a","ruble-a","rubles"},male,nominativus,\
|
||||||
|
{"kopecks","kopeck","kopeck-i","kopeck-i","kopeck-i","kopecks"},female,nominativus}
|
||||||
|
|
||||||
|
#define c_1 {{"dollars","dollar","dollara","dollara","dollara","dollars"},male,nominativus,\
|
||||||
|
{"centov","cent","centa","centa","centa","centov"},male,nominativus}
|
||||||
|
|
||||||
|
#define c_2 {{"rubles","ruble","ruble-a","ruble-a","ruble-a","rubles"},male,nominativus,\
|
||||||
|
{"kopecks","kopeck","kopeck-i","kopeck-i","kopeck-i","kopecks"},female,nominativus}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef switch_status_t (*switch_new_say_callback_ru_t) (switch_say_file_handle_t *sh, char *tosay, switch_say_args_t *say_args,say_opt_t *say_opt);
|
typedef switch_status_t (*switch_new_say_callback_ru_t) (switch_say_file_handle_t *sh, char *tosay, switch_say_args_t *say_args,say_opt_t *say_opt);
|
||||||
|
|
||||||
|
@ -2661,11 +2661,10 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_
|
|||||||
switch_mutex_unlock(channel->profile_mutex);
|
switch_mutex_unlock(channel->profile_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_PRE_ANSWER_VARIABLE) != SWITCH_STATUS_SUCCESS) {
|
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_PRE_ANSWER_VARIABLE);
|
||||||
if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
|
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE);
|
||||||
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((var = switch_channel_get_variable(channel, SWITCH_PASSTHRU_PTIME_MISMATCH_VARIABLE))) {
|
if ((var = switch_channel_get_variable(channel, SWITCH_PASSTHRU_PTIME_MISMATCH_VARIABLE))) {
|
||||||
switch_channel_set_flag(channel, CF_PASSTHRU_PTIME_MISMATCH);
|
switch_channel_set_flag(channel, CF_PASSTHRU_PTIME_MISMATCH);
|
||||||
@ -2772,17 +2771,27 @@ SWITCH_DECLARE(switch_status_t) switch_channel_execute_on(switch_channel_t *chan
|
|||||||
|
|
||||||
if (!strncasecmp(var, variable_prefix, strlen(variable_prefix))) {
|
if (!strncasecmp(var, variable_prefix, strlen(variable_prefix))) {
|
||||||
char *arg = NULL;
|
char *arg = NULL;
|
||||||
|
char *p;
|
||||||
|
int bg = 0;
|
||||||
x++;
|
x++;
|
||||||
|
|
||||||
app = switch_core_session_strdup(channel->session, val);
|
app = switch_core_session_strdup(channel->session, val);
|
||||||
|
|
||||||
if (strstr(app, "::")) {
|
for(p = app; p && *p; p++) {
|
||||||
|
if (*p == ' ') {
|
||||||
|
*p++ = '\0';
|
||||||
|
arg = p;
|
||||||
|
break;
|
||||||
|
} else if (*p == ':' && (*(p+1) == ':')) {
|
||||||
|
bg++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (bg) {
|
||||||
switch_core_session_execute_application_async(channel->session, app, arg);
|
switch_core_session_execute_application_async(channel->session, app, arg);
|
||||||
} else {
|
} else {
|
||||||
if ((arg = strchr(app, ' '))) {
|
|
||||||
*arg++ = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
switch_core_session_execute_application(channel->session, app, arg);
|
switch_core_session_execute_application(channel->session, app, arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2861,10 +2870,10 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
|
|||||||
channel->name);
|
channel->name);
|
||||||
|
|
||||||
|
|
||||||
if (switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE) != SWITCH_STATUS_SUCCESS) {
|
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE);
|
||||||
if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
|
|
||||||
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE);
|
if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
|
||||||
}
|
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE)) && !zstr(var)) {
|
if ((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE)) && !zstr(var)) {
|
||||||
|
@ -480,9 +480,13 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
|
|||||||
DWORD dwBufSize = BUFSIZE;
|
DWORD dwBufSize = BUFSIZE;
|
||||||
char base_dir[1024];
|
char base_dir[1024];
|
||||||
char *lastbacklash;
|
char *lastbacklash;
|
||||||
|
|
||||||
GetModuleFileName(NULL, base_dir, BUFSIZE);
|
GetModuleFileName(NULL, base_dir, BUFSIZE);
|
||||||
lastbacklash = strrchr(base_dir, '\\');
|
lastbacklash = strrchr(base_dir, '\\');
|
||||||
base_dir[(lastbacklash - base_dir)] = '\0';
|
base_dir[(lastbacklash - base_dir)] = '\0';
|
||||||
|
/* set base_dir as cwd, to be able to use relative paths in scripting languages (e.g. mod_lua) when FS is running as a service or while debugging FS using visual studio */
|
||||||
|
SetCurrentDirectory(base_dir);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
char base_dir[1024] = SWITCH_PREFIX_DIR;
|
char base_dir[1024] = SWITCH_PREFIX_DIR;
|
||||||
#endif
|
#endif
|
||||||
@ -1440,7 +1444,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
|||||||
static void handle_SIGQUIT(int sig)
|
static void handle_SIGQUIT(int sig)
|
||||||
{
|
{
|
||||||
if (sig);
|
if (sig);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Sig Quit!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Sig Quit!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1449,7 +1453,7 @@ static void handle_SIGQUIT(int sig)
|
|||||||
static void handle_SIGPIPE(int sig)
|
static void handle_SIGPIPE(int sig)
|
||||||
{
|
{
|
||||||
if (sig);
|
if (sig);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Sig Pipe!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Sig Pipe!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1458,7 +1462,7 @@ static void handle_SIGPIPE(int sig)
|
|||||||
static void handle_SIGPOLL(int sig)
|
static void handle_SIGPOLL(int sig)
|
||||||
{
|
{
|
||||||
if (sig);
|
if (sig);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Sig Poll!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Sig Poll!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1467,7 +1471,7 @@ static void handle_SIGPOLL(int sig)
|
|||||||
static void handle_SIGIO(int sig)
|
static void handle_SIGIO(int sig)
|
||||||
{
|
{
|
||||||
if (sig);
|
if (sig);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Sig I/O!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Sig I/O!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1475,7 +1479,7 @@ static void handle_SIGIO(int sig)
|
|||||||
#ifdef TRAP_BUS
|
#ifdef TRAP_BUS
|
||||||
static void handle_SIGBUS(int sig)
|
static void handle_SIGBUS(int sig)
|
||||||
{
|
{
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Sig BUS!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Sig BUS!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1768,27 +1772,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
|
|||||||
|
|
||||||
runtime.runlevel++;
|
runtime.runlevel++;
|
||||||
|
|
||||||
/* set signal handlers */
|
switch_core_set_signal_handlers();
|
||||||
signal(SIGINT, SIG_IGN);
|
|
||||||
#ifdef SIGPIPE
|
|
||||||
signal(SIGPIPE, handle_SIGPIPE);
|
|
||||||
#endif
|
|
||||||
#ifdef SIGQUIT
|
|
||||||
signal(SIGQUIT, handle_SIGQUIT);
|
|
||||||
#endif
|
|
||||||
#ifdef SIGPOLL
|
|
||||||
signal(SIGPOLL, handle_SIGPOLL);
|
|
||||||
#endif
|
|
||||||
#ifdef SIGIO
|
|
||||||
signal(SIGIO, handle_SIGIO);
|
|
||||||
#endif
|
|
||||||
#ifdef TRAP_BUS
|
|
||||||
signal(SIGBUS, handle_SIGBUS);
|
|
||||||
#endif
|
|
||||||
#ifdef SIGUSR1
|
|
||||||
signal(SIGUSR1, handle_SIGHUP);
|
|
||||||
#endif
|
|
||||||
signal(SIGHUP, handle_SIGHUP);
|
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Bringing up environment.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Bringing up environment.\n");
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Loading Modules.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Loading Modules.\n");
|
||||||
@ -1802,6 +1786,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
|
|||||||
|
|
||||||
switch_load_core_config("post_load_switch.conf");
|
switch_load_core_config("post_load_switch.conf");
|
||||||
|
|
||||||
|
switch_core_set_signal_handlers();
|
||||||
|
|
||||||
if (switch_event_create(&event, SWITCH_EVENT_STARTUP) == SWITCH_STATUS_SUCCESS) {
|
if (switch_event_create(&event, SWITCH_EVENT_STARTUP) == SWITCH_STATUS_SUCCESS) {
|
||||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Info", "System Ready");
|
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Info", "System Ready");
|
||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
@ -1865,6 +1851,31 @@ static void win_shutdown(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
SWITCH_DECLARE(void) switch_core_set_signal_handlers(void)
|
||||||
|
{
|
||||||
|
/* set signal handlers */
|
||||||
|
signal(SIGINT, SIG_IGN);
|
||||||
|
#ifdef SIGPIPE
|
||||||
|
signal(SIGPIPE, handle_SIGPIPE);
|
||||||
|
#endif
|
||||||
|
#ifdef SIGQUIT
|
||||||
|
signal(SIGQUIT, handle_SIGQUIT);
|
||||||
|
#endif
|
||||||
|
#ifdef SIGPOLL
|
||||||
|
signal(SIGPOLL, handle_SIGPOLL);
|
||||||
|
#endif
|
||||||
|
#ifdef SIGIO
|
||||||
|
signal(SIGIO, handle_SIGIO);
|
||||||
|
#endif
|
||||||
|
#ifdef TRAP_BUS
|
||||||
|
signal(SIGBUS, handle_SIGBUS);
|
||||||
|
#endif
|
||||||
|
#ifdef SIGUSR1
|
||||||
|
signal(SIGUSR1, handle_SIGHUP);
|
||||||
|
#endif
|
||||||
|
signal(SIGHUP, handle_SIGHUP);
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(uint32_t) switch_core_debug_level(void)
|
SWITCH_DECLARE(uint32_t) switch_core_debug_level(void)
|
||||||
{
|
{
|
||||||
return runtime.debug_level;
|
return runtime.debug_level;
|
||||||
|
@ -2392,7 +2392,6 @@ static switch_status_t tone_on_dtmf(switch_core_session_t *session, const switch
|
|||||||
{
|
{
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
switch_tone_container_t *cont = switch_channel_get_private(channel, "_tone_detect_");
|
switch_tone_container_t *cont = switch_channel_get_private(channel, "_tone_detect_");
|
||||||
switch_event_t *event;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!cont || !cont->detect_fax || dtmf->digit != 'f') {
|
if (!cont || !cont->detect_fax || dtmf->digit != 'f') {
|
||||||
@ -2403,13 +2402,10 @@ static switch_status_t tone_on_dtmf(switch_core_session_t *session, const switch
|
|||||||
|
|
||||||
if (cont->list[i].callback) {
|
if (cont->list[i].callback) {
|
||||||
cont->list[i].callback(cont->session, cont->list[i].app, cont->list[i].data);
|
cont->list[i].callback(cont->session, cont->list[i].app, cont->list[i].data);
|
||||||
} else if (cont->list[i].app) {
|
} else {
|
||||||
if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
|
switch_channel_execute_on(switch_core_session_get_channel(cont->session), SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
|
if (cont->list[i].app) {
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", cont->list[i].app);
|
switch_core_session_execute_application_async(cont->session, cont->list[i].app, cont->list[i].data);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", cont->list[i].data);
|
|
||||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
|
|
||||||
switch_core_session_queue_private_event(cont->session, &event, SWITCH_FALSE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2491,13 +2487,10 @@ static switch_bool_t tone_detect_callback(switch_media_bug_t *bug, void *user_da
|
|||||||
cont->list[i].sleep = 0;
|
cont->list[i].sleep = 0;
|
||||||
cont->list[i].expires = 0;
|
cont->list[i].expires = 0;
|
||||||
}
|
}
|
||||||
} else if (cont->list[i].app) {
|
} else {
|
||||||
if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
|
switch_channel_execute_on(switch_core_session_get_channel(cont->session), SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
|
if (cont->list[i].app) {
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", cont->list[i].app);
|
switch_core_session_execute_application_async(cont->session, cont->list[i].app, cont->list[i].data);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", cont->list[i].data);
|
|
||||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
|
|
||||||
switch_core_session_queue_private_event(cont->session, &event, SWITCH_FALSE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2605,6 +2598,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_tone_detect_session(switch_core_sessi
|
|||||||
return SWITCH_STATUS_MEMERR;
|
return SWITCH_STATUS_MEMERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((var = switch_channel_get_variable(channel, "tone_detect_hits"))) {
|
||||||
|
int tmp = atoi(var);
|
||||||
|
if (tmp > 0) {
|
||||||
|
hits = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hits) hits = 1;
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Adding tone spec %s index %d hits %d\n", tone_spec, cont->index, hits);
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Adding tone spec %s index %d hits %d\n", tone_spec, cont->index, hits);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -357,11 +357,11 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((bypass_media_after_bridge || switch_channel_test_flag(chan_a, CF_BYPASS_MEDIA_AFTER_BRIDGE)) && switch_channel_test_flag(chan_a, CF_ANSWERED)
|
if ((bypass_media_after_bridge || switch_channel_test_flag(chan_b, CF_BYPASS_MEDIA_AFTER_BRIDGE)) && switch_channel_test_flag(chan_a, CF_ANSWERED)
|
||||||
&& switch_channel_test_flag(chan_b, CF_ANSWERED)) {
|
&& switch_channel_test_flag(chan_b, CF_ANSWERED)) {
|
||||||
switch_ivr_nomedia(switch_core_session_get_uuid(session_a), SMF_REBRIDGE);
|
switch_ivr_nomedia(switch_core_session_get_uuid(session_a), SMF_REBRIDGE);
|
||||||
bypass_media_after_bridge = 0;
|
bypass_media_after_bridge = 0;
|
||||||
switch_channel_clear_flag(chan_a, CF_BYPASS_MEDIA_AFTER_BRIDGE);
|
switch_channel_clear_flag(chan_b, CF_BYPASS_MEDIA_AFTER_BRIDGE);
|
||||||
goto end_of_bridge_loop;
|
goto end_of_bridge_loop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1367,6 +1367,8 @@ static void cleanup_proxy_mode_a(switch_core_session_t *session)
|
|||||||
const char *sbv = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
|
const char *sbv = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
|
||||||
if (!zstr(sbv) && (sbsession = switch_core_session_locate(sbv))) {
|
if (!zstr(sbv) && (sbsession = switch_core_session_locate(sbv))) {
|
||||||
switch_channel_t *sbchannel = switch_core_session_get_channel(sbsession);
|
switch_channel_t *sbchannel = switch_core_session_get_channel(sbsession);
|
||||||
|
/* Clear this now, otherwise will cause the one we're interested in to hang up too...*/
|
||||||
|
switch_channel_set_variable(sbchannel, SWITCH_SIGNAL_BRIDGE_VARIABLE, NULL);
|
||||||
switch_channel_hangup(sbchannel, SWITCH_CAUSE_ATTENDED_TRANSFER);
|
switch_channel_hangup(sbchannel, SWITCH_CAUSE_ATTENDED_TRANSFER);
|
||||||
switch_core_session_rwunlock(sbsession);
|
switch_core_session_rwunlock(sbsession);
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
|
|||||||
|
|
||||||
if (pattern) {
|
if (pattern) {
|
||||||
switch_regex_t *re = NULL;
|
switch_regex_t *re = NULL;
|
||||||
int proceed = 0, ovector[30];
|
int proceed = 0, ovector[100];
|
||||||
char *substituted = NULL;
|
char *substituted = NULL;
|
||||||
uint32_t len = 0;
|
uint32_t len = 0;
|
||||||
char *odata = NULL;
|
char *odata = NULL;
|
||||||
|
@ -945,6 +945,8 @@ static switch_status_t switch_loadable_module_load_file(char *path, char *filena
|
|||||||
*new_module = module;
|
*new_module = module;
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Successfully Loaded [%s]\n", module_interface->module_name);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Successfully Loaded [%s]\n", module_interface->module_name);
|
||||||
|
|
||||||
|
switch_core_set_signal_handlers();
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user