From 029d68ce47c5990d809716b88c65e924259e1f68 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 14 Jan 2011 17:42:31 -0600 Subject: [PATCH 01/18] disable media timeout when encountering a recvonly stream --- src/mod/endpoints/mod_sofia/sofia_glue.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index bf7c1aa7a1..cabc366620 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -70,7 +70,7 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t * port = tech_pvt->proxy_sdp_audio_port; } } - + if (!port) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "%s NO PORT!\n", switch_channel_get_name(tech_pvt->channel)); return; @@ -4108,6 +4108,15 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s if (!strcasecmp(attr->a_name, "sendonly") || !strcasecmp(attr->a_name, "inactive")) { sendonly = 1; + } else if (!strcasecmp(attr->a_name, "recvonly")) { + if (switch_rtp_ready(tech_pvt->rtp_session)) { + switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, 0); + tech_pvt->max_missed_hold_packets = 0; + tech_pvt->max_missed_packets = 0; + } else { + switch_channel_set_variable(tech_pvt->channel, "rtp_timeout_sec", "0"); + switch_channel_set_variable(tech_pvt->channel, "rtp_hold_timeout_sec", "0"); + } } else if (sendonly < 2 && !strcasecmp(attr->a_name, "sendrecv")) { sendonly = 0; } else if (!strcasecmp(attr->a_name, "ptime")) { From e6a25e85783cf7bfc21f45c8fb6802bd2dd40546 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 14 Jan 2011 18:42:38 -0600 Subject: [PATCH 02/18] FS-2984 --- src/mod/endpoints/mod_sofia/sofia_glue.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index cabc366620..8a8af67ae6 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -4040,7 +4040,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s sdp_attribute_t *attr; int first = 0, last = 0; int ptime = 0, dptime = 0, maxptime = 0, dmaxptime = 0; - int sendonly = 0; + int sendonly = 0, recvonly = 0; int greedy = 0, x = 0, skip = 0, mine = 0; switch_channel_t *channel = switch_core_session_get_channel(session); const char *val; @@ -4108,7 +4108,11 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s if (!strcasecmp(attr->a_name, "sendonly") || !strcasecmp(attr->a_name, "inactive")) { sendonly = 1; + switch_channel_set_variable(tech_pvt->channel, "media_audio_mode", "recvonly"); } else if (!strcasecmp(attr->a_name, "recvonly")) { + switch_channel_set_variable(tech_pvt->channel, "media_audio_mode", "sendonly"); + recvonly = 1; + if (switch_rtp_ready(tech_pvt->rtp_session)) { switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, 0); tech_pvt->max_missed_hold_packets = 0; @@ -4126,6 +4130,11 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s } } + if (sendonly != 1 && recvonly != 1) { + switch_channel_set_variable(tech_pvt->channel, "media_audio_mode", NULL); + } + + if (sofia_test_pflag(tech_pvt->profile, PFLAG_DISABLE_HOLD) || ((val = switch_channel_get_variable(tech_pvt->channel, "sip_disable_hold")) && switch_true(val))) { sendonly = 0; From 68bf642c1134c63e89c204bd953c30381de8488d Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Sun, 16 Jan 2011 22:27:56 +0000 Subject: [PATCH 03/18] fix sofia flush_inbound_reg to work when @domain is given Prior to this change, calling flush_inbound_reg with @domain will reboot all matching devices (if reboot is specified), but will not actually flush the matching registrations. --- src/mod/endpoints/mod_sofia/sofia_reg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 344e51774d..f644ff772b 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -606,16 +606,16 @@ void sofia_reg_expire_call_id(sofia_profile_t *profile, const char *call_id, int sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,rpid,expires" ",user_agent,server_user,server_host,profile_name,network_ip" ",%d from sip_registrations where call_id='%q' %s", reboot, call_id, sqlextra); - switch_safe_free(sqlextra); switch_mutex_lock(profile->ireg_mutex); sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_del_callback, profile); switch_mutex_unlock(profile->ireg_mutex); switch_safe_free(sql); - sql = switch_mprintf("delete from sip_registrations where call_id='%q' or (sip_user='%q' and sip_host='%q')", call_id, user, host); + sql = switch_mprintf("delete from sip_registrations where call_id='%q' %s", call_id, sqlextra); sofia_glue_execute_sql_now(profile, &sql, SWITCH_FALSE); + switch_safe_free(sqlextra); switch_safe_free(sql); switch_safe_free(dup); From 7eceff48a2b8fc9590816748c63f9563e7929488 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Sun, 16 Jan 2011 22:33:15 +0000 Subject: [PATCH 04/18] update sofia usage string for flush_inbound_reg --- src/mod/endpoints/mod_sofia/mod_sofia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 8f01290407..eb5e2ad1ae 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -3627,7 +3627,7 @@ SWITCH_STANDARD_API(sofia_function) "--------------------------------------------------------------------------------\n" "sofia help\n" "sofia profile [[start|stop|restart|rescan]|" - "flush_inbound_reg [] [reboot]|" + "flush_inbound_reg [|<[user]@domain>] [reboot]|" "[register|unregister] [|all]|" "killgw |" "[stun-auto-disable|stun-enabled] [true|false]]|" From cc06fdb5fae26a01914cbbeb8ae306bd17ab01b2 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 17 Jan 2011 10:41:01 -0600 Subject: [PATCH 05/18] FS-2992 --- src/switch_ivr_originate.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index d17105a465..d156c700fd 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -1705,6 +1705,16 @@ static void *SWITCH_THREAD_FUNC early_thread_run(switch_thread_t *thread, void * switch_channel_get_state(_peer) == CS_RESET || \ !switch_channel_test_flag(_peer, CF_ORIGINATING))) +static void wait_for_cause(switch_channel_t *channel) +{ + int sanity = 5; + + while (--sanity > 0 && peer_eligible(channel) && switch_channel_get_cause(channel) == SWITCH_CAUSE_NONE) { + switch_yield(10000); + } +} + + SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session, switch_core_session_t **bleg, @@ -3271,7 +3281,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess if (i != oglobals.idx) { holding = NULL; - + if (oglobals.idx == IDX_TIMEOUT || to) { reason = SWITCH_CAUSE_NO_ANSWER; } else { @@ -3280,6 +3290,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } else { if (and_argc > 1) { reason = SWITCH_CAUSE_LOSE_RACE; + } else if (!switch_channel_ready(originate_status[i].peer_channel)) { + wait_for_cause(originate_status[i].peer_channel); + if (switch_channel_down(originate_status[i].peer_channel)) { + reason = switch_channel_get_cause(originate_status[i].peer_channel); + } } else { reason = SWITCH_CAUSE_NO_ANSWER; } @@ -3385,6 +3400,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } if (peer_channel) { + wait_for_cause(peer_channel); *cause = switch_channel_get_cause(peer_channel); } else { for (i = 0; i < and_argc; i++) { @@ -3435,6 +3451,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess *cause = switch_channel_get_cause(caller_channel); } else { *cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + for (i = 0; i < and_argc; i++) { + if (!peer_eligible(originate_status[i].peer_channel)) { + continue; + } + + wait_for_cause(originate_status[i].peer_channel); + + if (switch_channel_down(originate_status[i].peer_channel)) { + *cause = switch_channel_get_cause(originate_status[i].peer_channel); + break; + } + + } } } @@ -3529,7 +3558,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess continue; } pchannel = switch_core_session_get_channel(originate_status[i].peer_session); - + wait_for_cause(pchannel); if (switch_channel_down(pchannel)) { cause_str = switch_channel_cause2str(switch_channel_get_cause(pchannel)); if (switch_stristr(cause_str, fail_on_single_reject_var)) { From 018a3800b4cec46e0cebb6707497bac8045d654b Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 17 Jan 2011 13:10:53 -0600 Subject: [PATCH 06/18] fix session timer failure when freeswitch is generating the sdp and there are enough dynamic codecs enabled to conflict with the 2833 pt (4 by default) --- src/mod/endpoints/mod_sofia/sofia_glue.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 8a8af67ae6..dfd6a76974 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -377,6 +377,13 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32 sofia_glue_check_dtmf_type(tech_pvt); + if (sofia_test_pflag(tech_pvt->profile, PFLAG_SUPPRESS_CNG) || + ((val = switch_channel_get_variable(tech_pvt->channel, "supress_cng")) && switch_true(val)) || + ((val = switch_channel_get_variable(tech_pvt->channel, "suppress_cng")) && switch_true(val))) { + use_cng = 0; + tech_pvt->cng_pt = 0; + } + if (!tech_pvt->payload_space) { int i; @@ -388,6 +395,13 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32 tech_pvt->ianacodes[i] = imp->ianacode; if (tech_pvt->ianacodes[i] > 64) { + if (tech_pvt->dtmf_type == DTMF_2833 && tech_pvt->te > 95 && tech_pvt->te == tech_pvt->payload_space) { + tech_pvt->payload_space++; + } + if (!sofia_test_pflag(tech_pvt->profile, PFLAG_SUPPRESS_CNG) && + tech_pvt->cng_pt && use_cng && tech_pvt->cng_pt == tech_pvt->payload_space) { + tech_pvt->payload_space++; + } tech_pvt->ianacodes[i] = tech_pvt->payload_space++; } } @@ -401,13 +415,6 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32 verbose_sdp = 1; } - if (sofia_test_pflag(tech_pvt->profile, PFLAG_SUPPRESS_CNG) || - ((val = switch_channel_get_variable(tech_pvt->channel, "supress_cng")) && switch_true(val)) || - ((val = switch_channel_get_variable(tech_pvt->channel, "suppress_cng")) && switch_true(val))) { - use_cng = 0; - tech_pvt->cng_pt = 0; - } - if (!force && !ip && !sr && (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) || switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MEDIA))) { return; From 585cb68ad4ecf011380d35199bd4609a36b503cd Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Mon, 17 Jan 2011 17:21:24 -0500 Subject: [PATCH 07/18] freetdm: support parameters: outbound-bc-user-layer1 and outbound-bc-transfer-cap --- .../src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c index 100631f345..aad68e15d1 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c @@ -326,9 +326,11 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_ ftdm_set_ton(val, &span->default_caller_data.rdnis.type); } else if (!strcasecmp(var, "outbound-rdnis-npi")) { ftdm_set_npi(val, &span->default_caller_data.rdnis.plan); - } else if (!strcasecmp(var, "outbound-bearer_cap")) { + } else if (!strcasecmp(var, "outbound-bearer_cap") || + !strcasecmp(var, "outbound-bc-transfer-cap")) { ftdm_set_bearer_capability(val, (uint8_t*)&span->default_caller_data.bearer_capability); - } else if (!strcasecmp(var, "outbound-bearer_layer1")) { + } else if (!strcasecmp(var, "outbound-bearer_layer1") || + !strcasecmp(var, "outbound-bc-user-layer1")) { ftdm_set_bearer_layer1(val, (uint8_t*)&span->default_caller_data.bearer_layer1); } else if (!strcasecmp(var, "channel-restart-on-link-up")) { parse_yesno(var, val, &signal_data->restart_opt); From f3082c7d75926e77062bc83c0318979e89ad0857 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Mon, 17 Jan 2011 19:15:02 -0500 Subject: [PATCH 08/18] freetdm: enable ec only upon SIGEVENT_PROGRESS_MEDIA --- libs/freetdm/src/ftdm_io.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index 6bfa37576c..c13fe76447 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -2417,8 +2417,6 @@ static ftdm_status_t _ftdm_channel_call_place_nl(const char *file, const char *f ftdm_assert_return(ftdmchan != NULL, FTDM_FAIL, "null channel"); ftdm_assert_return(ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND), FTDM_FAIL, "Call place, but outbound flag not set\n"); - ftdm_set_echocancel_call_begin(ftdmchan); - if (!ftdmchan->span->outgoing_call) { ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "outgoing_call method not implemented in this span!\n"); status = FTDM_ENOSYS; @@ -5548,6 +5546,13 @@ FT_DECLARE(ftdm_status_t) ftdm_span_send_signal(ftdm_span_t *span, ftdm_sigmsg_t } break; + case FTDM_SIGEVENT_PROGRESS_MEDIA: + { + ftdm_log_chan_msg(sigmsg->channel, FTDM_LOG_DEBUG, "Enabling echo cancellation on progress media\n"); + ftdm_set_echocancel_call_begin(sigmsg->channel); + } + break; + case FTDM_SIGEVENT_STOP: if (!ftdm_test_flag(sigmsg->channel, FTDM_CHANNEL_CALL_STARTED)) { /* this happens for FXS devices which blindly send SIGEVENT_STOP, we should fix it there ... */ From de49305ad501b4bba758679be7b5e80b68eba1cf Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 18 Jan 2011 04:23:45 +0000 Subject: [PATCH 09/18] let vmain-key and operator-key be set empty The defaults for these keys are empty. This change allows them to be set empty in the XML config without error. --- src/mod/applications/mod_voicemail/mod_voicemail.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 1799e5c7dc..76870f75b9 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -311,6 +311,7 @@ static void destroy_profile(const char *profile_name, switch_bool_t block) /* Static buffer, 2 bytes */ static switch_xml_config_string_options_t config_dtmf = { NULL, 2, "[0-9#\\*]" }; +static switch_xml_config_string_options_t config_dtmf_optional = { NULL, 2, "[0-9#\\*]?" }; static switch_xml_config_string_options_t config_login_keys = { NULL, 16, "[0-9#\\*]*" }; static switch_xml_config_string_options_t config_file_ext = { NULL, 10, NULL }; static switch_xml_config_int_options_t config_int_0_10000 = { SWITCH_TRUE, 0, SWITCH_TRUE, 10000 }; @@ -520,8 +521,8 @@ vm_profile_t *profile_set_config(vm_profile_t *profile) SWITCH_CONFIG_SET_ITEM(profile->config[i++], "urgent-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, &profile->urgent_key, "*", &config_dtmf, NULL, NULL); SWITCH_CONFIG_SET_ITEM(profile->config[i++], "operator-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, - &profile->operator_key, "", &config_dtmf, NULL, NULL); - SWITCH_CONFIG_SET_ITEM(profile->config[i++], "vmain-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, &profile->vmain_key, "", &config_dtmf, NULL, NULL); + &profile->operator_key, "", &config_dtmf_optional, NULL, NULL); + SWITCH_CONFIG_SET_ITEM(profile->config[i++], "vmain-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, &profile->vmain_key, "", &config_dtmf_optional, NULL, NULL); SWITCH_CONFIG_SET_ITEM(profile->config[i++], "vmain-extension", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, &profile->vmain_ext, "", &profile->config_str_pool, NULL, NULL); SWITCH_CONFIG_SET_ITEM(profile->config[i++], "forward-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, From 7438e24d1ab38317d73ace94150573fb84778f59 Mon Sep 17 00:00:00 2001 From: cypromis Date: Tue, 18 Jan 2011 10:32:45 +0100 Subject: [PATCH 10/18] fix a fedora dep and fix python path to be variable in sopec file --- freeswitch.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/freeswitch.spec b/freeswitch.spec index 66db65c698..cb83ffbeb1 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -53,7 +53,7 @@ Vendor: http://www.freeswitch.org/ # Source files and where to get them # ###################################################################################################################### -Source0: http://files.freeswitch.org/%{name}-%{version}.tar.bz2 +Source0: http://files.freeswitch.org/%{name}-%{version}.tar.bz2 Source1: http://files.freeswitch.org/downloads/libs/celt-0.7.1.tar.gz Source2: http://files.freeswitch.org/downloads/libs/flite-1.3.99-latest.tar.gz Source3: http://files.freeswitch.org/downloads/libs/lame-3.97.tar.gz @@ -89,6 +89,9 @@ BuildRequires: libtool >= 1.5.17 BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: perl +%if %{_vendor} == redhat && 0%{?fedora} <= 8 +BuildRequires: perl-ExtUtils-Embed +%endif BuildRequires: pkgconfig BuildRequires: termcap BuildRequires: unixODBC-devel @@ -893,7 +896,7 @@ fi %files python %defattr(-,freeswitch,daemon) %{prefix}/mod/mod_python*.so* -%attr(0644, root, bin) /usr/lib/python2.4/site-packages/freeswitch.py* +%attr(0644, root, bin) /usr/lib/python*/site-packages/freeswitch.py* %dir %attr(0750, freeswitch, daemon) %{prefix}/conf/autoload_configs %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/python.conf.xml From af0dc500ae8639d2b19c9a1a55937e7bb6f27db2 Mon Sep 17 00:00:00 2001 From: cypromis Date: Tue, 18 Jan 2011 11:20:12 +0100 Subject: [PATCH 11/18] more fedora fixes --- freeswitch.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freeswitch.spec b/freeswitch.spec index cb83ffbeb1..c434af6728 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -89,11 +89,13 @@ BuildRequires: libtool >= 1.5.17 BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: perl -%if %{_vendor} == redhat && 0%{?fedora} <= 8 +% 0%{?fedora_version} >= 8 BuildRequires: perl-ExtUtils-Embed %endif BuildRequires: pkgconfig +%if %{_vendor} == redhat && 0%{?fedora} <= 6 BuildRequires: termcap +%endif BuildRequires: unixODBC-devel BuildRequires: gdbm-devel BuildRequires: db4-devel @@ -954,6 +956,8 @@ fi # ###################################################################################################################### %changelog +* Tue Jan 18 2011 - michal.bielicki@seventhsignal.de +- Fedora adjustments * Fri Oct 15 2010 - michal.bielicki@seventhsignal.de - added mod_curl * Sat Oct 09 2010 - michal.bielicki@seventhsignal.de From 54879c381e287b6cf0344c08086bf9d8faf686de Mon Sep 17 00:00:00 2001 From: cypromis Date: Tue, 18 Jan 2011 11:21:35 +0100 Subject: [PATCH 12/18] added rpm building for callie soundfiles --- build/buildsounds-callie.sh | 15 ++ freeswitch-sounds-en-us-callie.spec | 319 ++++++++++++++++++++++++++++ 2 files changed, 334 insertions(+) create mode 100755 build/buildsounds-callie.sh create mode 100644 freeswitch-sounds-en-us-callie.spec diff --git a/build/buildsounds-callie.sh b/build/buildsounds-callie.sh new file mode 100755 index 0000000000..06099e6c5e --- /dev/null +++ b/build/buildsounds-callie.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +sounds_location=$1 +for rate in 32000 16000 8000 +do + for i in ascii base256 conference currency digits ivr misc phonetic-ascii time voicemail zrtp + do + mkdir -p $sounds_location/$i/$rate + for f in `find $sounds_location/$i/48000 -name \*.wav` + do + echo "generating" $sounds_location/$i/$rate/`basename $f` + sox $f -r $rate $sounds_location/$i/$rate/`basename $f` + done + done +done diff --git a/freeswitch-sounds-en-us-callie.spec b/freeswitch-sounds-en-us-callie.spec new file mode 100644 index 0000000000..2dbb91a94e --- /dev/null +++ b/freeswitch-sounds-en-us-callie.spec @@ -0,0 +1,319 @@ +############################################################################## +# Copyright and license +############################################################################## +# +# Spec file for package freeswitch-sounds-en-us-callie (version 1.0.12-8) +# +# Copyright (c) 2009 Patrick Laimbock +# Some fixes and additions (c) 2011 Michal Bielicki +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# + +############################################################################## +# Determine distribution +############################################################################## + +%define is_rhel5 %(test -f /etc/redhat-release && egrep -q 'release 5' /etc/redhat-release && echo 1 || echo 0) + +############################################################################## +# Set variables +############################################################################## + +%define version 1.0.14 +%define release 1 + +%define fsname freeswitch +# you could add a version number to be more strict + +%define prefix /opt/freeswitch +%define _prefix %{prefix} + +############################################################################## +# General +############################################################################## + +Summary: FreeSWITCH en-us Callie prompts +Name: freeswitch-sounds-en-us-callie +Version: %{version} +Release: %{release}%{?dist} +License: MPL +Group: Applications/Communications +Packager: Patrick Laimbock +URL: http://www.freeswitch.org +Source0:http://files.freeswitch.org/%{name}-48000-%{version}.tar.gz +BuildArch: noarch +BuildRequires: sox +Requires: freeswitch +Requires: freeswitch-sounds-en-us-callie-48000 + +%if %{is_rhel5}0 +%BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +%endif + +%description +FreeSWITCH 48kHz en-us Callie prompts plus, during the installation, +it will also install locally generated 8KHz, 16KHz and 32KHz prompts + +%package -n freeswitch-sounds-en-us-callie-8000 +Summary: FreeSWITCH 8kHz en-us Callie prompts +Group: Applications/Communications +BuildArch: noarch +Requires: %{fsname} + +%description -n freeswitch-sounds-en-us-callie-8000 +FreeSWITCH 8kHz en-us Callie prompts + +%package -n freeswitch-sounds-en-us-callie-16000 +Summary: FreeSWITCH 16kHz en-us Callie prompts +Group: Applications/Communications +BuildArch: noarch +Requires: %{fsname} + +%description -n freeswitch-sounds-en-us-callie-16000 +FreeSWITCH 16kHz en-us Callie prompts + +%package -n freeswitch-sounds-en-us-callie-32000 +Summary: FreeSWITCH 32kHz en-us Callie prompts +Group: Applications/Communications +BuildArch: noarch +Requires: %{fsname} + +%description -n freeswitch-sounds-en-us-callie-32000 +FreeSWITCH 32kHz en-us Callie prompts + +%package -n freeswitch-sounds-en-us-callie-48000 +Summary: FreeSWITCH 48kHz en-us Callie prompts +Group: Applications/Communications +BuildArch: noarch +Requires: %{fsname} + +%description -n freeswitch-sounds-en-us-callie-48000 +FreeSWITCH 48kHz en-us Callie prompts + +%package -n freeswitch-sounds-en-us-callie-all +Summary: FreeSWITCH en-us Callie prompts +Group: Applications/Communications +BuildArch: noarch +Requires: %{fsname} +Requires: freeswitch-sounds-en-us-callie-8000 = %{version} +Requires: freeswitch-sounds-en-us-callie-16000 = %{version} +Requires: freeswitch-sounds-en-us-callie-32000 = %{version} +Requires: freeswitch-sounds-en-us-callie-48000 = %{version} + +%description -n freeswitch-sounds-en-us-callie-all +FreeSWITCH Callie prompts package that pulls in the 8KHz, 16KHz, +32KHz and 48KHz RPMs + +############################################################################## +# Prep +############################################################################## + +%prep +%setup -b0 -q -n en + +# copy buildsounds-callie.sh script to working dir +%{__install} -m 0750 build/buildsounds-callie.sh ./us/callie + +############################################################################## +# Build +############################################################################## + +%build +# nothing to do here + +############################################################################## +# Install +############################################################################## + +%install +[ "%{buildroot}" != '/' ] && rm -rf %{buildroot} + +# create the sounds directories +%{__install} -d -m 0750 %{buildroot}%{_prefix}/sounds/en/us/callie + +pushd us/callie +# first install the 48KHz sounds +%{__cp} -prv ./* %{buildroot}%{_prefix}/sounds/en/us/callie +# now resample the 48KHz ones to 8KHz, 16KHz and 32KHz +./buildsounds-callie.sh %{buildroot}%{_prefix}/sounds/en/us/callie +popd + +############################################################################## +# Clean +############################################################################## + +%clean +[ "%{buildroot}" != '/' ] && rm -rf %{buildroot} + +############################################################################## +# Post +############################################################################## + +%post +# generate the 8KHz, 16KHz and 32KHz prompts from the 48KHz ones +cd %{_prefix}/sounds/en/us/callie +./buildsounds-callie.sh %{_prefix}/sounds/en/us/callie + +############################################################################## +# Postun +############################################################################## + +%postun +# you could check if there are sound files in 8000/ or +# 16000/ or 32000/ and remove them *only* if the files +# do not belong to an rpm + +############################################################################## +# Files +############################################################################## + +%files +%defattr(-,root,root) +%attr(0750,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/buildsounds-callie.sh + +%files -n freeswitch-sounds-en-us-callie-8000 +%defattr(-,root,root,-) +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ascii/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/base256/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/conference/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/currency/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/digits/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ivr/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/misc/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/phonetic-ascii/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/time/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/voicemail/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/zrtp/8000 +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ascii/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/base256/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/conference/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/currency/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/digits/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ivr/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/misc/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/phonetic-ascii/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/time/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/voicemail/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/zrtp/8000/*.wav + +%files -n freeswitch-sounds-en-us-callie-16000 +%defattr(-,root,root,-) +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ascii/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/base256/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/conference/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/currency/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/digits/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ivr/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/misc/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/phonetic-ascii/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/time/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/voicemail/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/zrtp/16000 +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ascii/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/base256/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/conference/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/currency/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/digits/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ivr/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/misc/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/phonetic-ascii/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/time/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/voicemail/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/zrtp/16000/*.wav + +%files -n freeswitch-sounds-en-us-callie-32000 +%defattr(-,root,root,-) +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ascii/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/base256/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/conference/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/currency/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/digits/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ivr/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/misc/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/phonetic-ascii/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/time/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/voicemail/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/zrtp/32000 +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ascii/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/base256/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/conference/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/currency/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/digits/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ivr/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/misc/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/phonetic-ascii/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/time/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/voicemail/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/zrtp/32000/*.wav + +%files -n freeswitch-sounds-en-us-callie-48000 +%defattr(-,root,root,-) +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ascii/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/base256/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/conference/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/currency/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/digits/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ivr/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/misc/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/phonetic-ascii/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/time/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/voicemail/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/zrtp/48000 +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ascii/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/base256/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/conference/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/currency/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/digits/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ivr/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/misc/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/phonetic-ascii/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/time/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/voicemail/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/zrtp/48000/*.wav + +%files -n freeswitch-sounds-en-us-callie-all + +############################################################################## +# Changelog +############################################################################## + +%changelog +* Tue Jan 18 2011 Michal Bielicki - 1.0.14-1 +- bump up version +- include script into freeswitch core +- include specfile into freeswitch core +- runtime does not require sox, only building + +* Thu Dec 17 2009 Patrick Laimbock - 1.0.12-8 +- update perms and user/group to sync with the old situation + +* Wed Dec 16 2009 Patrick Laimbock - 1.0.12-7 +- make main package require freeswitch-sounds-en-us-callie-48000 and +- generate the 8KHz, 16KHz and 32KHz sounds from there +- add license to spec file + +* Wed Dec 16 2009 Patrick Laimbock - 1.0.12-5 +- put 48KHz in a separate package and let the main package Require 48KHz +- and then use the script to generate the 8KHz, 16KHz and 32KHz sounds + +* Wed Dec 16 2009 Patrick Laimbock - 1.0.12-4 +- add freeswitch-sounds-en-us-callie-all package that pulls in the 8KHz, +- 16KHz, 32KHz and 48KHz RPM packages + +* Tue Dec 15 2009 Patrick Laimbock - 1.0.12-3 +- override subpackage name with -n so it no longer builds an empty main RPM +- rework spec file +- add sox as a requirement +- run buildsounds-callie.sh in post to generate 8KHz, 16KHz and 32KHz prompts + +* Tue Dec 15 2009 Patrick Laimbock - 1.0.12-2 +- can't override Name in subpackage so put all versions in RPM subpackages +- with an empty main RPM package + +* Tue Dec 15 2009 Patrick Laimbock - 1.0.12-1 +- create spec file with the following requirement: +- source only contains the 48KHz sound prompts +- during build the 48KHz sound prompts are resampled to 8KHz, 16KHz and 32KHz +- the 8KHz, 16KHz, 32KHz and 48KHz sound prompts are packaged separately + From 10b38944f6e51f33e3d0092ea1dcf3e88538a5a7 Mon Sep 17 00:00:00 2001 From: cypromis Date: Tue, 18 Jan 2011 11:40:37 +0100 Subject: [PATCH 13/18] updated sounds version in version file --- build/sounds_version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/sounds_version.txt b/build/sounds_version.txt index cb0c481b13..20cb29cbd7 100644 --- a/build/sounds_version.txt +++ b/build/sounds_version.txt @@ -1,3 +1,3 @@ -en-us-callie 1.0.13 +en-us-callie 1.0.14 ru-RU-elena 1.0.12 From 90e87a481145242bf661de4a96a7ccda1476034e Mon Sep 17 00:00:00 2001 From: Michal Bielicki Date: Tue, 18 Jan 2011 15:27:57 +0300 Subject: [PATCH 14/18] this file is not needed anymore, included in spec file for sounds --- build/buildsounds-callie.sh | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100755 build/buildsounds-callie.sh diff --git a/build/buildsounds-callie.sh b/build/buildsounds-callie.sh deleted file mode 100755 index 06099e6c5e..0000000000 --- a/build/buildsounds-callie.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -sounds_location=$1 -for rate in 32000 16000 8000 -do - for i in ascii base256 conference currency digits ivr misc phonetic-ascii time voicemail zrtp - do - mkdir -p $sounds_location/$i/$rate - for f in `find $sounds_location/$i/48000 -name \*.wav` - do - echo "generating" $sounds_location/$i/$rate/`basename $f` - sox $f -r $rate $sounds_location/$i/$rate/`basename $f` - done - done -done From b683bb6585165c29ef883b41b97400d8ebc550df Mon Sep 17 00:00:00 2001 From: Michal Bielicki Date: Tue, 18 Jan 2011 17:58:36 +0300 Subject: [PATCH 15/18] final version I hope --- freeswitch-sounds-en-us-callie.spec | 32 +++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/freeswitch-sounds-en-us-callie.spec b/freeswitch-sounds-en-us-callie.spec index 2dbb91a94e..c4764570f5 100644 --- a/freeswitch-sounds-en-us-callie.spec +++ b/freeswitch-sounds-en-us-callie.spec @@ -46,10 +46,7 @@ BuildArch: noarch BuildRequires: sox Requires: freeswitch Requires: freeswitch-sounds-en-us-callie-48000 - -%if %{is_rhel5}0 -%BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -%endif +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description FreeSWITCH 48kHz en-us Callie prompts plus, during the installation, @@ -111,9 +108,24 @@ FreeSWITCH Callie prompts package that pulls in the 8KHz, 16KHz, %prep %setup -b0 -q -n en +mkdir -p ./usr/callie +# create buildsounds-callie.sh script in working dir +echo '#!/bin/bash -# copy buildsounds-callie.sh script to working dir -%{__install} -m 0750 build/buildsounds-callie.sh ./us/callie +sounds_location=$1 +for rate in 32000 16000 8000 +do + for i in ascii base256 conference currency digits directory ivr misc phonetic-ascii time voicemail zrtp + do + mkdir -p $sounds_location/$i/$rate + for f in `find $sounds_location/$i/48000 -name \*.wav` + do + echo "generating" $sounds_location/$i/$rate/`basename $f` + sox $f -r $rate $sounds_location/$i/$rate/`basename $f` + done + done +done' > ./us/callie/buildsounds-callie.sh +%{__chmod} 0750 ./us/callie/buildsounds-callie.sh ############################################################################## # Build @@ -179,6 +191,7 @@ cd %{_prefix}/sounds/en/us/callie %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/conference/8000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/currency/8000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/digits/8000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/directory/8000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ivr/8000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/misc/8000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/phonetic-ascii/8000 @@ -190,6 +203,7 @@ cd %{_prefix}/sounds/en/us/callie %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/conference/8000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/currency/8000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/digits/8000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/directory/8000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ivr/8000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/misc/8000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/phonetic-ascii/8000/*.wav @@ -204,6 +218,7 @@ cd %{_prefix}/sounds/en/us/callie %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/conference/16000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/currency/16000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/digits/16000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/directory/16000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ivr/16000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/misc/16000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/phonetic-ascii/16000 @@ -215,6 +230,7 @@ cd %{_prefix}/sounds/en/us/callie %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/conference/16000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/currency/16000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/digits/16000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/directory/16000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ivr/16000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/misc/16000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/phonetic-ascii/16000/*.wav @@ -229,6 +245,7 @@ cd %{_prefix}/sounds/en/us/callie %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/conference/32000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/currency/32000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/digits/32000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/directory/32000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ivr/32000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/misc/32000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/phonetic-ascii/32000 @@ -240,6 +257,7 @@ cd %{_prefix}/sounds/en/us/callie %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/conference/32000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/currency/32000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/digits/32000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/directory/32000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ivr/32000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/misc/32000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/phonetic-ascii/32000/*.wav @@ -254,6 +272,7 @@ cd %{_prefix}/sounds/en/us/callie %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/conference/48000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/currency/48000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/digits/48000 +%attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/directory/48000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/ivr/48000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/misc/48000 %attr(0750,freeswitch,daemon) %dir %{_prefix}/sounds/en/us/callie/phonetic-ascii/48000 @@ -265,6 +284,7 @@ cd %{_prefix}/sounds/en/us/callie %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/conference/48000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/currency/48000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/digits/48000/*.wav +%attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/directory/48000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/ivr/48000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/misc/48000/*.wav %attr(0640,freeswitch,daemon) %{_prefix}/sounds/en/us/callie/phonetic-ascii/48000/*.wav From 190bd61d8a74678135396f28940655114d9b6513 Mon Sep 17 00:00:00 2001 From: Michal Bielicki Date: Tue, 18 Jan 2011 17:58:53 +0300 Subject: [PATCH 16/18] typo in freeswitch.spec --- freeswitch.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freeswitch.spec b/freeswitch.spec index c434af6728..7fb9f80d8e 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -89,7 +89,7 @@ BuildRequires: libtool >= 1.5.17 BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: perl -% 0%{?fedora_version} >= 8 +%if 0%{?fedora_version} >= 8 BuildRequires: perl-ExtUtils-Embed %endif BuildRequires: pkgconfig From 1db40e60e4675ce363855ba429ceadd90e800f1c Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 18 Jan 2011 11:28:37 -0500 Subject: [PATCH 17/18] freetdm: improved logic to enable/disable EC on call start/stop - MFC-R2 requires tone signaling that gets screwed sometimes if the EC is enabled during call setup. - EC is now enabled only when switching to a state requiring media (UP and PROGRESS_MEDIA) - The logic is aware of EC persist option in Wanpipe - Improved logging in ftmod_wanpipe to print EC state on startup --- libs/freetdm/src/ftdm_io.c | 69 ++++++++++++------- libs/freetdm/src/ftdm_state.c | 10 +-- libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c | 3 - .../src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c | 9 ++- libs/freetdm/src/include/private/ftdm_core.h | 11 +++ libs/freetdm/src/include/private/ftdm_types.h | 9 +-- 6 files changed, 70 insertions(+), 41 deletions(-) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index c13fe76447..b5f9fab93d 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -404,39 +404,39 @@ static __inline__ void ftdm_std_free(void *pool, void *ptr) free(ptr); } -static void ftdm_set_echocancel_call_begin(ftdm_channel_t *chan) +FT_DECLARE(void) ftdm_set_echocancel_call_begin(ftdm_channel_t *chan) { ftdm_caller_data_t *caller_data = ftdm_channel_get_caller_data(chan); if (ftdm_channel_test_feature(chan, FTDM_CHANNEL_FEATURE_HWEC)) { if (ftdm_channel_test_feature(chan, FTDM_CHANNEL_FEATURE_HWEC_DISABLED_ON_IDLE)) { + /* If the ec is disabled on idle, we need to enable it unless is a digital call */ if (caller_data->bearer_capability != FTDM_BEARER_CAP_64K_UNRESTRICTED) { + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "Enabling ec for call in channel state %s\n", ftdm_channel_state2str(chan->state)); ftdm_channel_command(chan, FTDM_COMMAND_ENABLE_ECHOCANCEL, NULL); } } else { + /* If the ec is enabled on idle, we do nothing unless is a digital call that needs it disabled */ if (caller_data->bearer_capability == FTDM_BEARER_CAP_64K_UNRESTRICTED) { + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "Disabling ec for digital call in channel state %s\n", ftdm_channel_state2str(chan->state)); ftdm_channel_command(chan, FTDM_COMMAND_DISABLE_ECHOCANCEL, NULL); } } } } -static void ftdm_set_echocancel_call_end(ftdm_channel_t *chan) +FT_DECLARE(void) ftdm_set_echocancel_call_end(ftdm_channel_t *chan) { - ftdm_caller_data_t *caller_data = ftdm_channel_get_caller_data(chan); if (ftdm_channel_test_feature(chan, FTDM_CHANNEL_FEATURE_HWEC)) { if (ftdm_channel_test_feature(chan, FTDM_CHANNEL_FEATURE_HWEC_DISABLED_ON_IDLE)) { - if (caller_data->bearer_capability != FTDM_BEARER_CAP_64K_UNRESTRICTED) { - ftdm_channel_command(chan, FTDM_COMMAND_DISABLE_ECHOCANCEL, NULL); - } + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "Disabling ec on call end in channel state %s\n", ftdm_channel_state2str(chan->state)); + ftdm_channel_command(chan, FTDM_COMMAND_DISABLE_ECHOCANCEL, NULL); } else { - if (caller_data->bearer_capability == FTDM_BEARER_CAP_64K_UNRESTRICTED) { - ftdm_channel_command(chan, FTDM_COMMAND_ENABLE_ECHOCANCEL, NULL); - } + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "Enabling ec back on call end in channel state %s\n", ftdm_channel_state2str(chan->state)); + ftdm_channel_command(chan, FTDM_COMMAND_ENABLE_ECHOCANCEL, NULL); } } } - FT_DECLARE_DATA ftdm_memory_handler_t g_ftdm_mem_handler = { /*.pool =*/ NULL, @@ -5548,25 +5548,44 @@ FT_DECLARE(ftdm_status_t) ftdm_span_send_signal(ftdm_span_t *span, ftdm_sigmsg_t case FTDM_SIGEVENT_PROGRESS_MEDIA: { - ftdm_log_chan_msg(sigmsg->channel, FTDM_LOG_DEBUG, "Enabling echo cancellation on progress media\n"); - ftdm_set_echocancel_call_begin(sigmsg->channel); + /* test signaling module compliance */ + if (sigmsg->channel->state != FTDM_CHANNEL_STATE_PROGRESS_MEDIA) { + ftdm_log_chan(sigmsg->channel, FTDM_LOG_WARNING, "FTDM_SIGEVENT_PROGRESS_MEDIA sent in state %s\n", ftdm_channel_state2str(sigmsg->channel->state)); + } + } + break; + + case FTDM_SIGEVENT_UP: + { + /* test signaling module compliance */ + if (sigmsg->channel->state != FTDM_CHANNEL_STATE_UP) { + ftdm_log_chan(sigmsg->channel, FTDM_LOG_WARNING, "FTDM_SIGEVENT_UP sent in state %s\n", ftdm_channel_state2str(sigmsg->channel->state)); + } } break; case FTDM_SIGEVENT_STOP: - if (!ftdm_test_flag(sigmsg->channel, FTDM_CHANNEL_CALL_STARTED)) { - /* this happens for FXS devices which blindly send SIGEVENT_STOP, we should fix it there ... */ - ftdm_log_chan_msg(sigmsg->channel, FTDM_LOG_DEBUG, "Ignoring SIGEVENT_STOP since user never knew about a call in this channel\n"); - goto done; - } - if (ftdm_test_flag(sigmsg->channel, FTDM_CHANNEL_USER_HANGUP)) { - ftdm_log_chan_msg(sigmsg->channel, FTDM_LOG_DEBUG, "Ignoring SIGEVENT_STOP since user already requested hangup\n"); - goto done; - } - if (sigmsg->channel->state == FTDM_CHANNEL_STATE_TERMINATING) { - ftdm_log_chan_msg(sigmsg->channel, FTDM_LOG_DEBUG, "Scheduling safety hangup timer\n"); - /* if the user does not move us to hangup in 2 seconds, we will do it ourselves */ - ftdm_sched_timer(globals.timingsched, "safety-hangup", FORCE_HANGUP_TIMER, execute_safety_hangup, sigmsg->channel, &sigmsg->channel->hangup_timer); + { + /* TODO: we could test for compliance here and check the state is FTDM_CHANNEL_STATE_TERMINATING + * but several modules need to be updated first */ + + /* if the call was never started, do not send SIGEVENT_STOP + this happens for FXS devices in ftmod_analog which blindly send SIGEVENT_STOP, we should fix it there ... */ + if (!ftdm_test_flag(sigmsg->channel, FTDM_CHANNEL_CALL_STARTED)) { + ftdm_log_chan_msg(sigmsg->channel, FTDM_LOG_DEBUG, "Ignoring SIGEVENT_STOP since user never knew about a call in this channel\n"); + goto done; + } + + if (ftdm_test_flag(sigmsg->channel, FTDM_CHANNEL_USER_HANGUP)) { + ftdm_log_chan_msg(sigmsg->channel, FTDM_LOG_DEBUG, "Ignoring SIGEVENT_STOP since user already requested hangup\n"); + goto done; + } + + if (sigmsg->channel->state == FTDM_CHANNEL_STATE_TERMINATING) { + ftdm_log_chan_msg(sigmsg->channel, FTDM_LOG_DEBUG, "Scheduling safety hangup timer\n"); + /* if the user does not move us to hangup in 2 seconds, we will do it ourselves */ + ftdm_sched_timer(globals.timingsched, "safety-hangup", FORCE_HANGUP_TIMER, execute_safety_hangup, sigmsg->channel, &sigmsg->channel->hangup_timer); + } } break; diff --git a/libs/freetdm/src/ftdm_state.c b/libs/freetdm/src/ftdm_state.c index 574d85845b..de62c0f0e7 100644 --- a/libs/freetdm/src/ftdm_state.c +++ b/libs/freetdm/src/ftdm_state.c @@ -70,13 +70,13 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_complete_state(const char *file, const c if (state == FTDM_CHANNEL_STATE_PROGRESS) { ftdm_set_flag(fchan, FTDM_CHANNEL_PROGRESS); - } else if (state == FTDM_CHANNEL_STATE_UP) { - ftdm_set_flag(fchan, FTDM_CHANNEL_PROGRESS); - ftdm_set_flag(fchan, FTDM_CHANNEL_MEDIA); - ftdm_set_flag(fchan, FTDM_CHANNEL_ANSWERED); } else if (state == FTDM_CHANNEL_STATE_PROGRESS_MEDIA) { ftdm_set_flag(fchan, FTDM_CHANNEL_PROGRESS); - ftdm_set_flag(fchan, FTDM_CHANNEL_MEDIA); + ftdm_test_and_set_media(fchan); + } else if (state == FTDM_CHANNEL_STATE_UP) { + ftdm_set_flag(fchan, FTDM_CHANNEL_PROGRESS); + ftdm_set_flag(fchan, FTDM_CHANNEL_ANSWERED); + ftdm_test_and_set_media(fchan); } else if (state == FTDM_CHANNEL_STATE_DIALING) { ftdm_sigmsg_t msg; memset(&msg, 0, sizeof(msg)); diff --git a/libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c b/libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c index 434417726b..6e2b292ce7 100644 --- a/libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c +++ b/libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c @@ -647,9 +647,6 @@ static void ftdm_r2_on_call_init(openr2_chan_t *r2chan) return; } - /* mark the channel in use (so no outgoing calls can be placed here) */ - ftdm_channel_use(ftdmchan); - memset(ftdmchan->caller_data.dnis.digits, 0, sizeof(ftdmchan->caller_data.collected)); memset(ftdmchan->caller_data.ani.digits, 0, sizeof(ftdmchan->caller_data.collected)); diff --git a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c index 1f2ad84d72..7bcb69cd9e 100644 --- a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c +++ b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c @@ -230,6 +230,8 @@ static unsigned wp_open_range(ftdm_span_t *span, unsigned spanno, unsigned start ftdm_channel_t *chan; ftdm_socket_t sockfd = FTDM_INVALID_SOCKET; const char *dtmf = "none"; + const char *hwec_str = "none"; + const char *hwec_idle = "none"; if (!strncasecmp(span->name, "smg_prid_nfas", 8) && span->trunk_type == FTDM_TRUNK_T1 && x == 24) { #ifdef LIBSANGOMA_VERSION sockfd = __tdmv_api_open_span_chan(spanno, x); @@ -271,6 +273,8 @@ static unsigned wp_open_range(ftdm_span_t *span, unsigned spanno, unsigned start || type == FTDM_CHAN_TYPE_B) { int err; + hwec_str = "unavailable"; + hwec_idle = "enabled"; dtmf = "software"; err = sangoma_tdm_get_hw_coding(chan->sockfd, &tdm_api); @@ -289,6 +293,7 @@ static unsigned wp_open_range(ftdm_span_t *span, unsigned spanno, unsigned start err = sangoma_tdm_get_hw_ec(chan->sockfd, &tdm_api); if (err > 0) { + hwec_str = "available"; ftdm_channel_set_feature(chan, FTDM_CHANNEL_FEATURE_HWEC); } @@ -296,6 +301,7 @@ static unsigned wp_open_range(ftdm_span_t *span, unsigned spanno, unsigned start err = sangoma_tdm_get_hwec_persist_status(chan->sockfd, &tdm_api); if (err == 0) { ftdm_channel_set_feature(chan, FTDM_CHANNEL_FEATURE_HWEC_DISABLED_ON_IDLE); + hwec_idle = "disabled"; } #else if (span->trunk_type == FTDM_TRUNK_BRI || span->trunk_type == FTDM_TRUNK_BRI_PTMP) { @@ -365,7 +371,8 @@ static unsigned wp_open_range(ftdm_span_t *span, unsigned spanno, unsigned start ftdm_copy_string(chan->chan_number, number, sizeof(chan->chan_number)); } configured++; - ftdm_log_chan(chan, FTDM_LOG_INFO, "Configured wanpipe device fd:%d DTMF: %s\n", sockfd, dtmf); + ftdm_log_chan(chan, FTDM_LOG_INFO, "Configured wanpipe device FD: %d, DTMF: %s, HWEC: %s, HWEC_IDLE: %s\n", + sockfd, dtmf, hwec_str, hwec_idle); } else { ftdm_log(FTDM_LOG_ERROR, "ftdm_span_add_channel failed for wanpipe span %d channel %d\n", spanno, x); diff --git a/libs/freetdm/src/include/private/ftdm_core.h b/libs/freetdm/src/include/private/ftdm_core.h index 4fd8ec64ea..fbe42d33da 100644 --- a/libs/freetdm/src/include/private/ftdm_core.h +++ b/libs/freetdm/src/include/private/ftdm_core.h @@ -622,6 +622,9 @@ FT_DECLARE(ftdm_status_t) ftdm_span_trigger_signals(const ftdm_span_t *span); /*! \brief clear the tone detector state */ FT_DECLARE(void) ftdm_channel_clear_detected_tones(ftdm_channel_t *ftdmchan); +/* start/stop echo cancelling at the beginning/end of a call */ +FT_DECLARE(void) ftdm_set_echocancel_call_begin(ftdm_channel_t *chan); +FT_DECLARE(void) ftdm_set_echocancel_call_end(ftdm_channel_t *chan); /*! \brief Assert condition @@ -677,6 +680,14 @@ FT_DECLARE(void) ftdm_channel_clear_detected_tones(ftdm_channel_t *ftdmchan); #define ftdm_span_lock(span) ftdm_mutex_lock(span->mutex) #define ftdm_span_unlock(span) ftdm_mutex_unlock(span->mutex) +#define ftdm_test_and_set_media(fchan) \ + do { \ + if (!ftdm_test_flag((fchan), FTDM_CHANNEL_MEDIA)) { \ + ftdm_set_flag((fchan), FTDM_CHANNEL_MEDIA); \ + ftdm_set_echocancel_call_begin((fchan)); \ + } \ + } while (0); + FT_DECLARE_DATA extern const char *FTDM_LEVEL_NAMES[9]; static __inline__ void ftdm_abort(void) diff --git a/libs/freetdm/src/include/private/ftdm_types.h b/libs/freetdm/src/include/private/ftdm_types.h index 3bc986d7f6..9e8df1f5f2 100644 --- a/libs/freetdm/src/include/private/ftdm_types.h +++ b/libs/freetdm/src/include/private/ftdm_types.h @@ -227,16 +227,11 @@ typedef enum { #define FTDM_CHANNEL_OUTBOUND (1ULL << 18) #define FTDM_CHANNEL_SUSPENDED (1ULL << 19) #define FTDM_CHANNEL_3WAY (1ULL << 20) - -/* this 3 flags are really nonsense used by boost module only, as soon - * as we deprecate/delete boost module we can get rid of them - * ================== - * */ #define FTDM_CHANNEL_PROGRESS (1ULL << 21) +/*!< There is media on the channel already */ #define FTDM_CHANNEL_MEDIA (1ULL << 22) +/*!< The channel was answered */ #define FTDM_CHANNEL_ANSWERED (1ULL << 23) -/* ================== */ - #define FTDM_CHANNEL_MUTE (1ULL << 24) #define FTDM_CHANNEL_USE_RX_GAIN (1ULL << 25) #define FTDM_CHANNEL_USE_TX_GAIN (1ULL << 26) From 0a38d7761e1099b4e369da8948f22ac7c0c8d184 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 18 Jan 2011 12:44:41 -0500 Subject: [PATCH 18/18] freetdm: set explicit numbers for channel commands to aid debugging --- libs/freetdm/src/include/freetdm.h | 114 ++++++++++++++--------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/libs/freetdm/src/include/freetdm.h b/libs/freetdm/src/include/freetdm.h index 2666a26df2..142dff888a 100644 --- a/libs/freetdm/src/include/freetdm.h +++ b/libs/freetdm/src/include/freetdm.h @@ -574,84 +574,84 @@ typedef struct ftdm_iterator ftdm_iterator_t; /*! \brief Channel commands that can be executed through ftdm_channel_command() */ typedef enum { - FTDM_COMMAND_NOOP, - FTDM_COMMAND_SET_INTERVAL, - FTDM_COMMAND_GET_INTERVAL, - FTDM_COMMAND_SET_CODEC, - FTDM_COMMAND_GET_CODEC, - FTDM_COMMAND_SET_NATIVE_CODEC, - FTDM_COMMAND_GET_NATIVE_CODEC, - FTDM_COMMAND_ENABLE_DTMF_DETECT, - FTDM_COMMAND_DISABLE_DTMF_DETECT, - FTDM_COMMAND_SEND_DTMF, - FTDM_COMMAND_SET_DTMF_ON_PERIOD, - FTDM_COMMAND_GET_DTMF_ON_PERIOD, - FTDM_COMMAND_SET_DTMF_OFF_PERIOD, - FTDM_COMMAND_GET_DTMF_OFF_PERIOD, - FTDM_COMMAND_GENERATE_RING_ON, - FTDM_COMMAND_GENERATE_RING_OFF, - FTDM_COMMAND_OFFHOOK, - FTDM_COMMAND_ONHOOK, - FTDM_COMMAND_FLASH, - FTDM_COMMAND_WINK, - FTDM_COMMAND_ENABLE_PROGRESS_DETECT, - FTDM_COMMAND_DISABLE_PROGRESS_DETECT, + FTDM_COMMAND_NOOP = 0, + FTDM_COMMAND_SET_INTERVAL = 1, + FTDM_COMMAND_GET_INTERVAL = 2, + FTDM_COMMAND_SET_CODEC = 3, + FTDM_COMMAND_GET_CODEC = 4, + FTDM_COMMAND_SET_NATIVE_CODEC = 5, + FTDM_COMMAND_GET_NATIVE_CODEC = 6, + FTDM_COMMAND_ENABLE_DTMF_DETECT = 7, + FTDM_COMMAND_DISABLE_DTMF_DETECT = 8, + FTDM_COMMAND_SEND_DTMF = 9, + FTDM_COMMAND_SET_DTMF_ON_PERIOD = 10, + FTDM_COMMAND_GET_DTMF_ON_PERIOD = 11, + FTDM_COMMAND_SET_DTMF_OFF_PERIOD = 12, + FTDM_COMMAND_GET_DTMF_OFF_PERIOD = 13, + FTDM_COMMAND_GENERATE_RING_ON = 14, + FTDM_COMMAND_GENERATE_RING_OFF = 15, + FTDM_COMMAND_OFFHOOK = 16, + FTDM_COMMAND_ONHOOK = 17, + FTDM_COMMAND_FLASH = 18, + FTDM_COMMAND_WINK = 19, + FTDM_COMMAND_ENABLE_PROGRESS_DETECT = 20, + FTDM_COMMAND_DISABLE_PROGRESS_DETECT = 21, /*!< Start tracing input and output from channel to the given file */ - FTDM_COMMAND_TRACE_INPUT, - FTDM_COMMAND_TRACE_OUTPUT, + FTDM_COMMAND_TRACE_INPUT = 22, + FTDM_COMMAND_TRACE_OUTPUT = 23, /*!< Stop both Input and Output trace, closing the files */ - FTDM_COMMAND_TRACE_END_ALL, + FTDM_COMMAND_TRACE_END_ALL = 24, /*!< Enable DTMF debugging */ - FTDM_COMMAND_ENABLE_DEBUG_DTMF, + FTDM_COMMAND_ENABLE_DEBUG_DTMF = 25, /*!< Disable DTMF debugging (if not disabled explicitly, it is disabled automatically when calls hangup) */ - FTDM_COMMAND_DISABLE_DEBUG_DTMF, + FTDM_COMMAND_DISABLE_DEBUG_DTMF = 26, /*!< Start dumping all input to a circular buffer. The size of the circular buffer can be specified, default used otherwise */ - FTDM_COMMAND_ENABLE_INPUT_DUMP, + FTDM_COMMAND_ENABLE_INPUT_DUMP = 27, /*!< Stop dumping all input to a circular buffer. */ - FTDM_COMMAND_DISABLE_INPUT_DUMP, + FTDM_COMMAND_DISABLE_INPUT_DUMP = 28, /*!< Start dumping all output to a circular buffer. The size of the circular buffer can be specified, default used otherwise */ - FTDM_COMMAND_ENABLE_OUTPUT_DUMP, + FTDM_COMMAND_ENABLE_OUTPUT_DUMP = 29, /*!< Stop dumping all output to a circular buffer. */ - FTDM_COMMAND_DISABLE_OUTPUT_DUMP, + FTDM_COMMAND_DISABLE_OUTPUT_DUMP = 30, /*!< Dump the current input circular buffer to the specified FILE* structure */ - FTDM_COMMAND_DUMP_INPUT, + FTDM_COMMAND_DUMP_INPUT = 31, /*!< Dump the current output circular buffer to the specified FILE* structure */ - FTDM_COMMAND_DUMP_OUTPUT, + FTDM_COMMAND_DUMP_OUTPUT = 32, - FTDM_COMMAND_ENABLE_CALLERID_DETECT, - FTDM_COMMAND_DISABLE_CALLERID_DETECT, - FTDM_COMMAND_ENABLE_ECHOCANCEL, - FTDM_COMMAND_DISABLE_ECHOCANCEL, - FTDM_COMMAND_ENABLE_ECHOTRAIN, - FTDM_COMMAND_DISABLE_ECHOTRAIN, - FTDM_COMMAND_SET_CAS_BITS, - FTDM_COMMAND_GET_CAS_BITS, - FTDM_COMMAND_SET_RX_GAIN, - FTDM_COMMAND_GET_RX_GAIN, - FTDM_COMMAND_SET_TX_GAIN, - FTDM_COMMAND_GET_TX_GAIN, - FTDM_COMMAND_FLUSH_TX_BUFFERS, - FTDM_COMMAND_FLUSH_RX_BUFFERS, - FTDM_COMMAND_FLUSH_BUFFERS, - FTDM_COMMAND_FLUSH_IOSTATS, - FTDM_COMMAND_SET_PRE_BUFFER_SIZE, - FTDM_COMMAND_SET_LINK_STATUS, - FTDM_COMMAND_GET_LINK_STATUS, - FTDM_COMMAND_ENABLE_LOOP, - FTDM_COMMAND_DISABLE_LOOP, - FTDM_COMMAND_SET_RX_QUEUE_SIZE, - FTDM_COMMAND_SET_TX_QUEUE_SIZE, - FTDM_COMMAND_SET_POLARITY, + FTDM_COMMAND_ENABLE_CALLERID_DETECT = 33, + FTDM_COMMAND_DISABLE_CALLERID_DETECT = 34, + FTDM_COMMAND_ENABLE_ECHOCANCEL = 35, + FTDM_COMMAND_DISABLE_ECHOCANCEL = 36, + FTDM_COMMAND_ENABLE_ECHOTRAIN = 37, + FTDM_COMMAND_DISABLE_ECHOTRAIN = 38, + FTDM_COMMAND_SET_CAS_BITS = 39, + FTDM_COMMAND_GET_CAS_BITS = 40, + FTDM_COMMAND_SET_RX_GAIN = 41, + FTDM_COMMAND_GET_RX_GAIN = 42, + FTDM_COMMAND_SET_TX_GAIN = 43, + FTDM_COMMAND_GET_TX_GAIN = 44, + FTDM_COMMAND_FLUSH_TX_BUFFERS = 45, + FTDM_COMMAND_FLUSH_RX_BUFFERS = 46, + FTDM_COMMAND_FLUSH_BUFFERS = 47, + FTDM_COMMAND_FLUSH_IOSTATS = 48, + FTDM_COMMAND_SET_PRE_BUFFER_SIZE = 49, + FTDM_COMMAND_SET_LINK_STATUS = 50, + FTDM_COMMAND_GET_LINK_STATUS = 51, + FTDM_COMMAND_ENABLE_LOOP = 52, + FTDM_COMMAND_DISABLE_LOOP = 53, + FTDM_COMMAND_SET_RX_QUEUE_SIZE = 54, + FTDM_COMMAND_SET_TX_QUEUE_SIZE = 55, + FTDM_COMMAND_SET_POLARITY = 56, FTDM_COMMAND_COUNT, } ftdm_command_t;