Permalink
Browse files

merge fixes

  • Loading branch information...
2 parents 89e163a + f6baeb2 commit 71184fc1046f6f4d1b93d8ee94f50fb7d413b662 @swk swk committed Nov 21, 2012
Showing with 1,427 additions and 481 deletions.
  1. +1 −1 build/sounds_version.txt
  2. +12 −0 conf/vanilla/dialplan/default.xml
  3. +1 −1 configure.in
  4. +0 −1 debian/bootstrap.sh
  5. +1 −1 debian/rules
  6. +8 −0 docs/ChangeLog
  7. +1 −1 libs/apr/.update
  8. +1 −1 libs/apr/configure.in
  9. +11 −4 libs/apr/threadproc/unix/thread.c
  10. +4 −1 libs/esl/src/esl.c
  11. +40 −11 libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c
  12. +1 −0 libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.h
  13. +4 −0 libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c
  14. +66 −12 libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c
  15. +19 −1 libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.h
  16. +1 −1 libs/libedit/src/unvis.c
  17. +2 −2 libs/libedit/src/vi.c
  18. +1 −1 libs/libedit/src/vis.c
  19. +1 −1 libs/sofia-sip/.update
  20. +1 −1 libs/sofia-sip/configure.ac
  21. +1 −1 libs/sofia-sip/libsofia-sip-ua/nta/nta.c
  22. +7 −1 libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
  23. +11 −2 libs/sofia-sip/libsofia-sip-ua/su/su.c
  24. +6 −2 libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c
  25. +3 −0 libs/spandsp/src/spandsp/private/t30.h
  26. +10 −0 libs/spandsp/src/spandsp/telephony.h
  27. +114 −53 libs/spandsp/src/t30.c
  28. +16 −21 libs/spandsp/src/t4_tx.c
  29. +11 −5 libs/spandsp/tests/fax_decode.c
  30. +3 −3 libs/spandsp/tests/line_model_monitor.cpp
  31. +7 −2 libs/tiff-4.0.2/tools/tiffgt.c
  32. +4 −2 scripts/ci/common.sh
  33. +1 −0 src/include/private/switch_core_pvt.h
  34. +2 −0 src/include/switch_channel.h
  35. +1 −0 src/include/switch_core.h
  36. +14 −3 src/include/switch_pgsql.h
  37. +1 −0 src/include/switch_types.h
  38. +0 −5 src/mod/applications/mod_callcenter/mod_callcenter.c
  39. +15 −0 src/mod/applications/mod_cidlookup/mod_cidlookup.c
  40. +3 −1 src/mod/applications/mod_commands/mod_commands.c
  41. +1 −1 src/mod/applications/mod_db/mod_db.c
  42. +16 −17 src/mod/applications/mod_dptools/mod_dptools.c
  43. +4 −4 src/mod/applications/mod_lcr/mod_lcr.c
  44. +18 −3 src/mod/applications/mod_sms/mod_sms.c
  45. +49 −7 src/mod/endpoints/mod_dingaling/mod_dingaling.c
  46. +9 −0 src/mod/endpoints/mod_gsmopen/FREEBSD_README.txt
  47. +171 −0 src/mod/endpoints/mod_gsmopen/FREEBSD_patch.diff
  48. +2 −2 src/mod/endpoints/mod_gsmopen/gsmopen.h
  49. +5 −3 src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp
  50. +3 −0 src/mod/endpoints/mod_gsmopen/mod_gsmopen.2010.vcxproj
  51. +20 −6 src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp
  52. +29 −4 src/mod/endpoints/mod_loopback/mod_loopback.c
  53. +23 −3 src/mod/endpoints/mod_skypopen/mod_skypopen.c
  54. +57 −0 src/mod/endpoints/mod_skypopen/skypopen_protocol.c
  55. +30 −24 src/mod/endpoints/mod_sofia/mod_sofia.c
  56. +5 −0 src/mod/endpoints/mod_sofia/mod_sofia.h
  57. +15 −40 src/mod/endpoints/mod_sofia/sofia.c
  58. +38 −1 src/mod/endpoints/mod_sofia/sofia_glue.c
  59. +66 −31 src/mod/endpoints/mod_sofia/sofia_presence.c
  60. +12 −4 src/mod/endpoints/mod_sofia/sofia_reg.c
  61. +2 −2 src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c
  62. +0 −10 src/mod/event_handlers/mod_event_socket/mod_event_socket.c
  63. +6 −2 src/mod/formats/mod_shout/mod_shout.c
  64. +7 −0 src/mod/languages/mod_lua/freeswitch_lua.cpp
  65. +41 −3 src/switch_channel.c
  66. +38 −5 src/switch_core_session.c
  67. +83 −7 src/switch_core_sqldb.c
  68. +2 −0 src/switch_core_state_machine.c
  69. +24 −12 src/switch_event.c
  70. +1 −1 src/switch_ivr.c
  71. +20 −1 src/switch_ivr_bridge.c
  72. +28 −12 src/switch_loadable_module.c
  73. +192 −130 src/switch_pgsql.c
  74. +2 −2 src/switch_rtp.c
  75. +1 −1 src/switch_utils.c
  76. +1 −1 src/switch_xml.c
@@ -1,3 +1,3 @@
-en-us-callie 1.0.18
+en-us-callie 1.0.22
ru-RU-elena 1.0.13
@@ -141,6 +141,18 @@
<!-- <action application="export" data="sip_secure_media=true"/> -->
</condition>
+ <!--
+ Since we have inbound-late-negotation on by default now the
+ above behavior isn't the same so you have to do one extra step.
+ -->
+ <condition field="${endpoint_disposition}" expression="^(DELAYED NEGOTIATION)"/>
+ <condition field="${switch_r_sdp}" expression="(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)" break="never">
+ <action application="set" data="sip_secure_media=true"/>
+ <!-- Offer SRTP on outbound legs if we have it on inbound. -->
+ <!-- <action application="export" data="sip_secure_media=true"/> -->
+ </condition>
+
+
<condition>
<action application="hash" data="insert/${domain_name}-spymap/${caller_id_number}/${uuid}"/>
<action application="hash" data="insert/${domain_name}-last_dial/${caller_id_number}/${destination_number}"/>
View
@@ -577,7 +577,7 @@ AX_HAVE_CPU_SET
AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])])
AC_CHECK_LIB(rt, clock_getres, [AC_DEFINE(HAVE_CLOCK_GETRES, 1, [Define if you have clock_getres()])])
AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])])
-AC_CHECK_LIB(pthread, pthread_setschedprio, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPRIO, 1, [Define if you have pthread_setschedprio()])])
+AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
View
@@ -15,7 +15,6 @@ avoid_mods=(
applications/mod_rad_auth
applications/mod_skel
asr_tts/mod_cepstral
- asr_tts/mod_flite
codecs/mod_com_g729
codecs/mod_ilbc
codecs/mod_sangoma_codec
View
@@ -6,7 +6,7 @@
FS_CC?=gcc
FS_CXX?=g++
-FS_CFLAGS?=-ggdb3 -O2
+FS_CFLAGS?=-ggdb3 -O2 -fPIC
FS_CPPFLAGS?=
FS_CXXFLAGS?=$(FS_CFLAGS)
export PATH?=/usr/lib/ccache:/usr/sbin:/usr/bin:/sbin:/bin
View
@@ -1,3 +1,11 @@
+freeswitch (1.2.5)
+ mod_lua: Enable mod_lua to use native pgsql dbh support (r:2cea7f0f)
+ mod_sofia: Add att_xfer_destination_number variable to indicate the original destination number of the attended transfer leg on REFER for semi-attended transfer scenarios. (r:893cd7be)
+ sounds: Bump Callie sounds ver to 1.0.22 (r:41e00c78)
+freeswitch (1.2.4)
+ core: Add Postgres core db support (r:0c1180d5)
+ mod_cdr_mongodb: update MongoDB driver to v0.6 (r:10093b44)
+ mod_dingaling: do lookup in dingaling when an address is specified as host:foo.bar.com like sofia does (r:fbfe830a)
freeswitch (1.2.3)
core: add hold_events variable with start and stop times for each hold (r:9a193a9c)
core: update json lib in core and ESL and re-apply old patches (r:5a956890)
View
@@ -1 +1 @@
-Tue Oct 23 13:13:30 EDT 2012
+Wed Nov 7 10:37:54 CST 2012
@@ -1620,7 +1620,7 @@ APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h)
if test "$threads" = "1"; then
APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
- AC_CHECK_LIB(pthread, pthread_setschedprio, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPRIO, 1, [Define if you have pthread_setschedprio()])])
+ AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
# Some systems have setpshared and define PROCESS_SHARED, but don't
# really support PROCESS_SHARED locks. So, we must validate that we
@@ -146,6 +146,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
{
apr_status_t stat;
pthread_attr_t *temp;
+ pthread_t tt;
(*new) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t));
@@ -173,15 +174,21 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
return stat;
}
- if ((stat = pthread_create((*new)->td, temp, dummy_worker, (*new))) == 0) {
+ if ((stat = pthread_create(&tt, temp, dummy_worker, (*new))) == 0) {
-#ifdef HAVE_PTHREAD_SETSCHEDPRIO
+#ifdef HAVE_PTHREAD_SETSCHEDPARAM
if (attr && attr->priority) {
- pthread_t *thread = (*new)->td;
- pthread_setschedprio(*thread, attr->priority);
+ int policy;
+ struct sched_param param = { 0 };
+
+ pthread_getschedparam(tt, &policy, &param);
+ param.sched_priority = attr->priority;
+ pthread_setschedparam(tt, policy, &param);
}
#endif
+ *(*new)->td = tt;
+
return APR_SUCCESS;
}
else {
View
@@ -918,6 +918,7 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
struct addrinfo hints = { 0 }, *result;
struct sockaddr_in *sockaddr_in;
struct sockaddr_in6 *sockaddr_in6;
+ socklen_t socklen;
#ifndef WIN32
int fd_flags = 0;
#else
@@ -951,10 +952,12 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
case AF_INET:
sockaddr_in = (struct sockaddr_in*)&(handle->sockaddr);
sockaddr_in->sin_port = htons(port);
+ socklen = sizeof(struct sockaddr_in);
break;
case AF_INET6:
sockaddr_in6 = (struct sockaddr_in6*)&(handle->sockaddr);
sockaddr_in6->sin6_port = htons(port);
+ socklen = sizeof(struct sockaddr_in6);
break;
default:
strncpy(handle->err, "Host resolves to unsupported address family", sizeof(handle->err));
@@ -985,7 +988,7 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
#endif
}
- rval = connect(handle->sock, (struct sockaddr*)&handle->sockaddr, sizeof(handle->sockaddr));
+ rval = connect(handle->sock, (struct sockaddr*)&handle->sockaddr, socklen);
if (timeout) {
int r;
@@ -942,7 +942,7 @@ static ftdm_status_t state_advance(ftdm_channel_t *chan)
ftdm_channel_t *chtmp = chan;
if (call) {
- pri_destroycall(isdn_data->spri.pri, call);
+ /* pri call destroy is done by libpri itself (on release_ack) */
chan_priv->call = NULL;
}
@@ -953,6 +953,9 @@ static ftdm_status_t state_advance(ftdm_channel_t *chan)
lpwrap_stop_timer(&isdn_data->spri, &chan_priv->t316);
chan_priv->t316_timeout_cnt = 0;
+ /* Unset remote hangup */
+ chan_priv->peerhangup = 0;
+
if (ftdm_channel_close(&chtmp) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_WARNING, "-- Failed to close channel %d:%d\n",
ftdm_channel_get_span_id(chan),
@@ -1206,12 +1209,21 @@ static ftdm_status_t state_advance(ftdm_channel_t *chan)
{
if (call) {
ftdm_caller_data_t *caller_data = ftdm_channel_get_caller_data(chan);
-
pri_hangup(isdn_data->spri.pri, call, caller_data->hangup_cause);
-// pri_destroycall(isdn_data->spri.pri, call);
-// chan_priv->call = NULL;
+
+ if (chan_priv->peerhangup) {
+ /* Call is inbound and hangup has been initiated by peer */
+ if (!ftdm_test_flag(chan, FTDM_CHANNEL_OUTBOUND)) {
+ ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE);
+ } else if (caller_data->hangup_cause == PRI_CAUSE_NO_USER_RESPONSE) {
+ /* Can happen when we have a DL link expire or some timer expired */
+ ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE);
+ } else if (caller_data->hangup_cause == PRI_CAUSE_DESTINATION_OUT_OF_ORDER) {
+ /* Can happen when we have a DL link expire or some timer expired */
+ ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE);
+ }
+ }
}
- ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE);
}
break;
@@ -1368,6 +1380,7 @@ static int on_hangup(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_even
{
ftdm_span_t *span = spri->span;
ftdm_channel_t *chan = ftdm_span_get_channel(span, pevent->hangup.channel);
+ ftdm_libpri_b_chan_t *chan_priv = chan->call_data;
if (!chan) {
ftdm_log(FTDM_LOG_CRIT, "-- Hangup on channel %d:%d but it's not in use?\n", ftdm_span_get_id(spri->span), pevent->hangup.channel);
@@ -1386,8 +1399,6 @@ static int on_hangup(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_even
ftdm_log(FTDM_LOG_DEBUG, "-- Hangup REQ on channel %d:%d\n",
ftdm_span_get_id(spri->span), pevent->hangup.channel);
- pri_hangup(spri->pri, pevent->hangup.call, pevent->hangup.cause);
-
chan->caller_data.hangup_cause = pevent->hangup.cause;
switch (ftdm_channel_get_state(chan)) {
@@ -1400,19 +1411,27 @@ static int on_hangup(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_even
}
break;
- case LPWRAP_PRI_EVENT_HANGUP_ACK: /* */
+ case LPWRAP_PRI_EVENT_HANGUP_ACK: /* RELEASE_COMPLETE */
ftdm_log(FTDM_LOG_DEBUG, "-- Hangup ACK on channel %d:%d\n",
ftdm_span_get_id(spri->span), pevent->hangup.channel);
- pri_hangup(spri->pri, pevent->hangup.call, pevent->hangup.cause);
-
- ftdm_set_state(chan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE);
+ switch (ftdm_channel_get_state(chan)) {
+ case FTDM_CHANNEL_STATE_RESTART:
+ /* ACK caused by DL FAILURE in DISC REQ */
+ ftdm_set_state(chan, FTDM_CHANNEL_STATE_DOWN);
+ break;
+ default:
+ ftdm_set_state(chan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE);
+ break;
+ }
break;
case LPWRAP_PRI_EVENT_HANGUP: /* "RELEASE/RELEASE_COMPLETE/other" */
ftdm_log(FTDM_LOG_DEBUG, "-- Hangup on channel %d:%d\n",
ftdm_span_get_id(spri->span), pevent->hangup.channel);
+ chan_priv->peerhangup = 1;
+
switch (ftdm_channel_get_state(chan)) {
case FTDM_CHANNEL_STATE_DIALING:
case FTDM_CHANNEL_STATE_RINGING:
@@ -1424,9 +1443,19 @@ static int on_hangup(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_even
ftdm_set_state(chan, FTDM_CHANNEL_STATE_TERMINATING);
break;
case FTDM_CHANNEL_STATE_HANGUP:
+ /* this will send "RELEASE_COMPLETE", eventually */
+ pri_hangup(spri->pri, pevent->hangup.call, chan->caller_data.hangup_cause);
chan->caller_data.hangup_cause = pevent->hangup.cause;
ftdm_set_state(chan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE);
break;
+ case FTDM_CHANNEL_STATE_RESTART:
+ /*
+ * We got an hungup doing a restart, normally beacause link has been lost during
+ * a call and the T309 timer has expired. So destroy it :) (DL_RELEASE_IND)
+ */
+ pri_destroycall(spri->pri, pevent->hangup.call);
+ ftdm_set_state(chan, FTDM_CHANNEL_STATE_DOWN);
+ break;
// case FTDM_CHANNEL_STATE_TERMINATING:
// ftdm_set_state(chan, FTDM_CHANNEL_STATE_HANGUP);
// break;
@@ -131,6 +131,7 @@ struct ftdm_libpri_b_chan {
q931_call *call; /*!< libpri opaque call handle */
uint32_t flags; /*!< channel flags */
uint32_t t316_timeout_cnt; /*!< T316 timeout counter */
+ int peerhangup; /*!< hangup requested from libpri (RELEASE/RELEASE_ACK/DL_RELEASE/TIMERS EXPIRY) */
};
typedef struct ftdm_libpri_b_chan ftdm_libpri_b_chan_t;
@@ -169,6 +169,10 @@ int lpwrap_init_pri(struct lpwrap_pri *spri, ftdm_span_t *span, ftdm_channel_t *
if (spri->pri) {
pri_set_debug(spri->pri, debug);
+#ifdef HAVE_LIBPRI_BRI
+ /* "follow Q.931 Section 5.3.2 call hangup better" */
+ pri_hangup_fix_enable(spri->pri, 1);
+#endif
#ifdef HAVE_LIBPRI_AOC
pri_aoc_events_enable(spri->pri, 1);
#endif
Oops, something went wrong.

0 comments on commit 71184fc

Please sign in to comment.