[asterisk-commits] rmudgett: branch dvossel/generic_aoc r267092 - in /team/dvossel/generic_aoc: ...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jun 2 12:43:54 CDT 2010
Author: rmudgett
Date: Wed Jun 2 12:43:47 2010
New Revision: 267092
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=267092
Log:
Sync with parent branch.
Added:
team/dvossel/generic_aoc/tests/test_locale.c
- copied unchanged from r267072, team/rmudgett/aoc_event/tests/test_locale.c
Modified:
team/dvossel/generic_aoc/ (props changed)
team/dvossel/generic_aoc/CHANGES
team/dvossel/generic_aoc/UPGRADE.txt
team/dvossel/generic_aoc/apps/app_dial.c
team/dvossel/generic_aoc/apps/app_voicemail.c
team/dvossel/generic_aoc/channels/chan_dahdi.c
team/dvossel/generic_aoc/channels/chan_sip.c
team/dvossel/generic_aoc/channels/sig_pri.c
team/dvossel/generic_aoc/channels/sig_pri.h
team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample
team/dvossel/generic_aoc/configs/voicemail.conf.sample
team/dvossel/generic_aoc/configure
team/dvossel/generic_aoc/configure.ac
team/dvossel/generic_aoc/contrib/init.d/rc.debian.asterisk
team/dvossel/generic_aoc/funcs/func_env.c
team/dvossel/generic_aoc/include/asterisk/autoconfig.h.in
team/dvossel/generic_aoc/include/asterisk/localtime.h
team/dvossel/generic_aoc/main/asterisk.c
team/dvossel/generic_aoc/main/bridging.c
team/dvossel/generic_aoc/main/manager.c
team/dvossel/generic_aoc/main/stdtime/localtime.c
team/dvossel/generic_aoc/makeopts.in
team/dvossel/generic_aoc/pbx/pbx_realtime.c
team/dvossel/generic_aoc/res/res_calendar_caldav.c
team/dvossel/generic_aoc/res/res_calendar_exchange.c
team/dvossel/generic_aoc/res/res_calendar_icalendar.c
team/dvossel/generic_aoc/res/res_smdi.c
Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
--- aoc_event-integrated (original)
+++ aoc_event-integrated Wed Jun 2 12:43:47 2010
@@ -1,1 +1,1 @@
-/team/group/CCSS:1-266201
+/team/group/CCSS:1-267071
Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
automerge = *
Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
--- generic_aoc-integrated (original)
+++ generic_aoc-integrated Wed Jun 2 12:43:47 2010
@@ -1,1 +1,1 @@
-/team/rmudgett/aoc_event:1-266237
+/team/rmudgett/aoc_event:1-267077
Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jun 2 12:43:47 2010
@@ -1,1 +1,1 @@
-/trunk:1-266146
+/trunk:1-267012
Modified: team/dvossel/generic_aoc/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/CHANGES?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/CHANGES (original)
+++ team/dvossel/generic_aoc/CHANGES Wed Jun 2 12:43:47 2010
@@ -149,6 +149,7 @@
* Added custom device states to ConfBridge bridges. Use 'confbridge:<name>' to
retrieve state for a particular bridge, where <name> is the conference name
* app_directory now allows exiting at any time using the operator or pound key.
+ * Voicemail now supports setting a locale per-mailbox.
Dialplan Functions
------------------
@@ -331,6 +332,10 @@
dialing option. Dial(DAHDI/g1/[extension]/K(<keypad_digits>))
Access any received keypad digits in SETUP message by: ${CHANNEL(keypad_digits)}
(requires latest LibPRI)
+ * Added ability to send and receive ETSI Explicit Call Transfer (ECT) messages
+ to eliminate tromboned calls. A tromboned call goes out an interface and comes
+ back into the same interface. Tromboned calls happen because of call routing,
+ call deflection, call forwarding, and call transfer.
Asterisk Manager Interface
--------------------------
@@ -448,6 +453,8 @@
of dynamic parkinglots.
* chan_dahdi now supports reporting alarms over AMI either by channel or span via
the reportalarms config option.
+ * The Realtime dialplan switch now caches entries for 1 second. This provides a
+ significant increase in performance (about 3X) for installations using this switchtype.
CLI Changes
-----------
Modified: team/dvossel/generic_aoc/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/UPGRADE.txt?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/UPGRADE.txt (original)
+++ team/dvossel/generic_aoc/UPGRADE.txt Wed Jun 2 12:43:47 2010
@@ -81,6 +81,12 @@
* VoiceMailMain and VMAuthenticate, if a '*' is entered in the first position
of a Mailbox or Password, will, if it exists, jump to the 'a' extension in
the current dialplan context.
+
+* Environment variables that start with "AST_" are reserved to the system and
+ may no longer be set from the dialplan.
+
+* When a call is redirected inside of a Dial, the app and appdata fields of the
+ CDR will now be set to "AppDial" and "(Outgoing Line)" instead of being blank.
From 1.6.1 to 1.6.2:
Modified: team/dvossel/generic_aoc/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/apps/app_dial.c?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/apps/app_dial.c (original)
+++ team/dvossel/generic_aoc/apps/app_dial.c Wed Jun 2 12:43:47 2010
@@ -884,6 +884,8 @@
ast_string_field_set(c, accountcode, in->accountcode);
}
ast_party_connected_line_copy(&c->connected, &original->connected);
+ c->appl = "AppDial";
+ c->data = "(Outgoing Line)";
/*
* We must unlock c before calling ast_channel_redirecting_macro, because
* we put c into autoservice there. That is pretty much a guaranteed
Modified: team/dvossel/generic_aoc/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/apps/app_voicemail.c?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/apps/app_voicemail.c (original)
+++ team/dvossel/generic_aoc/apps/app_voicemail.c Wed Jun 2 12:43:47 2010
@@ -636,6 +636,7 @@
char mailcmd[160]; /*!< Configurable mail command */
char language[MAX_LANGUAGE]; /*!< Config: Language setting */
char zonetag[80]; /*!< Time zone */
+ char locale[20]; /*!< The locale (for presentation of date/time) */
char callback[80];
char dialout[80];
char uniqueid[80]; /*!< Unique integer identifier */
@@ -773,6 +774,7 @@
static AST_LIST_HEAD_STATIC(users, ast_vm_user);
static AST_LIST_HEAD_STATIC(zones, vm_zone);
static char zonetag[80];
+static char locale[20];
static int maxsilence;
static int maxmsg;
static int maxdeletedmsg;
@@ -994,6 +996,7 @@
ast_copy_string(vmu->dialout, dialcontext, sizeof(vmu->dialout));
ast_copy_string(vmu->exit, exitcontext, sizeof(vmu->exit));
ast_copy_string(vmu->zonetag, zonetag, sizeof(vmu->zonetag));
+ ast_copy_string(vmu->locale, locale, sizeof(vmu->locale));
if (vmminsecs) {
vmu->minsecs = vmminsecs;
}
@@ -1035,6 +1038,8 @@
ast_copy_string(vmu->language, value, sizeof(vmu->language));
} else if (!strcasecmp(var, "tz")) {
ast_copy_string(vmu->zonetag, value, sizeof(vmu->zonetag));
+ } else if (!strcasecmp(var, "locale")) {
+ ast_copy_string(vmu->locale, value, sizeof(vmu->locale));
#ifdef IMAP_STORAGE
} else if (!strcasecmp(var, "imapuser")) {
ast_copy_string(vmu->imapuser, value, sizeof(vmu->imapuser));
@@ -4206,7 +4211,7 @@
struct timeval tv = { inttime, };
struct ast_tm tm;
ast_localtime(&tv, &tm, NULL);
- ast_strftime(origdate, sizeof(origdate), emaildateformat, &tm);
+ ast_strftime_locale(origdate, sizeof(origdate), emaildateformat, &tm, S_OR(vmu->locale, NULL));
pbx_builtin_setvar_helper(ast, "ORIG_VM_DATE", origdate);
}
ast_config_destroy(msg_cfg);
@@ -4377,18 +4382,18 @@
} else {
snprintf(who, sizeof(who), "%s@%s", srcemail, host);
}
-
+
greeting_attachment = strrchr(ast_strdupa(attach), '/');
if (greeting_attachment) {
*greeting_attachment++ = '\0';
}
snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
- ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
+ ast_strftime_locale(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL));
fprintf(p, "Date: %s" ENDL, date);
/* Set date format for voicemail mail */
- ast_strftime(date, sizeof(date), emaildateformat, &tm);
+ ast_strftime_locale(date, sizeof(date), emaildateformat, &tm, S_OR(vmu->locale, NULL));
if (!ast_strlen_zero(fromstring)) {
struct ast_channel *ast;
@@ -4571,7 +4576,7 @@
struct timeval tv = { inttime, };
struct ast_tm tm;
ast_localtime(&tv, &tm, NULL);
- ast_strftime(origdate, sizeof(origdate), emaildateformat, &tm);
+ ast_strftime_locale(origdate, sizeof(origdate), emaildateformat, &tm, S_OR(vmu->locale, NULL));
}
fprintf(p, "Dear %s:" ENDL ENDL "\tJust wanted to let you know you were just forwarded"
" a %s long message (number %d)" ENDL "in mailbox %s from %s, on %s" ENDL
@@ -4733,11 +4738,11 @@
snprintf(who, sizeof(who), "%s@%s", srcemail, host);
}
snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
- ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
+ ast_strftime_locale(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL));
fprintf(p, "Date: %s\n", date);
/* Reformat for custom pager format */
- ast_strftime(date, sizeof(date), pagerdateformat, vmu_tm(vmu, &tm));
+ ast_strftime_locale(date, sizeof(date), pagerdateformat, vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL));
if (!ast_strlen_zero(pagerfromstring)) {
struct ast_channel *ast;
@@ -12005,6 +12010,9 @@
if ((val = ast_variable_retrieve(cfg, "general", "tz"))) {
ast_copy_string(zonetag, val, sizeof(zonetag));
}
+ if ((val = ast_variable_retrieve(cfg, "general", "locale"))) {
+ ast_copy_string(locale, val, sizeof(locale));
+ }
if ((val = ast_variable_retrieve(cfg, "general", "emailsubject"))) {
emailsubject = ast_strdup(val);
}
Modified: team/dvossel/generic_aoc/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/channels/chan_dahdi.c?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/channels/chan_dahdi.c (original)
+++ team/dvossel/generic_aoc/channels/chan_dahdi.c Wed Jun 2 12:43:47 2010
@@ -6904,7 +6904,7 @@
#ifdef PRI_2BCT
if (!triedtopribridge) {
triedtopribridge = 1;
- if (p0->pri && p0->pri == p1->pri && p0->transfer && p1->transfer) {
+ if (p0->pri && p0->pri == p1->pri && p0->pri->transfer) {
ast_mutex_lock(&p0->pri->lock);
switch (p0->sig) {
case SIG_PRI_LIB_HANDLE_CASES:
@@ -11777,6 +11777,7 @@
pris[span].pri.cc_qsig_signaling_link_rsp =
conf->pri.pri.cc_qsig_signaling_link_rsp;
#endif /* defined(HAVE_PRI_CCSS) */
+ pris[span].pri.transfer = conf->chan.transfer;
pris[span].pri.facilityenable = conf->pri.pri.facilityenable;
#if defined(HAVE_PRI_AOC_EVENTS)
pris[span].pri.aoc_passthrough_flag = conf->pri.pri.aoc_passthrough_flag;
Modified: team/dvossel/generic_aoc/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/channels/chan_sip.c?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/channels/chan_sip.c (original)
+++ team/dvossel/generic_aoc/channels/chan_sip.c Wed Jun 2 12:43:47 2010
@@ -4708,12 +4708,15 @@
dialog->capability = peer->capability;
dialog->prefs = peer->prefs;
if (ast_test_flag(&dialog->flags[1], SIP_PAGE2_T38SUPPORT)) {
- if (!dialog->udptl) {
- /* t38pt_udptl was enabled in the peer and not in [general] */
- dialog->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr);
- }
- dialog->t38_maxdatagram = peer->t38_maxdatagram;
- set_t38_capabilities(dialog);
+ /* t38pt_udptl was enabled in the peer and not in [general] */
+ if (dialog->udptl || (!dialog->udptl && (dialog->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr)))) {
+ dialog->t38_maxdatagram = peer->t38_maxdatagram;
+ set_t38_capabilities(dialog);
+ } else {
+ /* It is impossible to support T38 without udptl */
+ ast_debug(1, "UDPTL creation failed on dialog.\n");
+ ast_clear_flag(&dialog->flags[1], SIP_PAGE2_T38SUPPORT);
+ }
} else if (dialog->udptl) {
ast_udptl_destroy(dialog->udptl);
dialog->udptl = NULL;
@@ -6065,7 +6068,7 @@
{
int res = 0;
- if (!ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT)) {
+ if (!ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) || !p->udptl) {
return -1;
}
switch (parameters->request_response) {
@@ -6933,9 +6936,15 @@
p->allowed_methods = UINT_MAX;
if (sip_methods[intended_method].need_rtp) {
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && (p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr))) {
- ast_udptl_setqos(p->udptl, global_tos_audio, global_cos_audio);
- p->t38_maxdatagram = global_t38_maxdatagram;
+ if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT)) {
+ if ((p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr))) {
+ ast_udptl_setqos(p->udptl, global_tos_audio, global_cos_audio);
+ p->t38_maxdatagram = global_t38_maxdatagram;
+ } else {
+ /* udptl creation failed, T38 can not be supported on this dialog */
+ ast_log(LOG_ERROR, "UDPTL creation failed\n");
+ ast_clear_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT);
+ }
}
p->maxcallbitrate = default_maxcallbitrate;
p->autoframing = global_autoframing;
@@ -20611,9 +20620,15 @@
}
/* If T38 is needed but not present, then make it magically appear */
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && !p->udptl && (p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr))) {
- p->t38_maxdatagram = global_t38_maxdatagram;
- set_t38_capabilities(p);
+ if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && !p->udptl) {
+ if ((p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr))) {
+ p->t38_maxdatagram = global_t38_maxdatagram;
+ set_t38_capabilities(p);
+ } else {
+ /* udptl creation failed, T38 can not be supported on this dialog */
+ ast_debug(1, "UDPTL creation failed on dialog.\n");
+ ast_clear_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT);
+ }
}
/* We have a succesful authentication, process the SDP portion if there is one */
Modified: team/dvossel/generic_aoc/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/channels/sig_pri.c?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/channels/sig_pri.c (original)
+++ team/dvossel/generic_aoc/channels/sig_pri.c Wed Jun 2 12:43:47 2010
@@ -1581,6 +1581,106 @@
/* Did not match any pattern in the list. */
return 0;
}
+
+#if defined(HAVE_PRI_CALL_HOLD) || defined(HAVE_PRI_TRANSFER)
+/*!
+ * \internal
+ * \brief Attempt to transfer the two calls to each other.
+ * \since 1.8
+ *
+ * \param pri sig_pri PRI control structure.
+ * \param call_1 First call involved in the transfer.
+ * \param call_1_held TRUE if call_1 is on hold.
+ * \param call_2 Second call involved in the transfer.
+ * \param call_2_held TRUE if call_2 is on hold.
+ *
+ * \note Assumes the pri->lock is already obtained.
+ *
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+static int sig_pri_attempt_transfer(struct sig_pri_pri *pri, q931_call *call_1, int call_1_held, q931_call *call_2, int call_2_held)
+{
+ int retval;
+ int call_1_chanpos;
+ int call_2_chanpos;
+ struct ast_channel *call_1_ast;
+ struct ast_channel *call_2_ast;
+ struct ast_channel *bridged;
+
+ call_1_chanpos = pri_find_pri_call(pri, call_1);
+ call_2_chanpos = pri_find_pri_call(pri, call_2);
+ if (call_1_chanpos < 0 || call_2_chanpos < 0) {
+ return -1;
+ }
+
+ /* Deadlock avoidance is attempted. */
+ sig_pri_lock_private(pri->pvts[call_1_chanpos]);
+ sig_pri_lock_owner(pri, call_1_chanpos);
+ sig_pri_lock_private(pri->pvts[call_2_chanpos]);
+ sig_pri_lock_owner(pri, call_2_chanpos);
+
+ call_1_ast = pri->pvts[call_1_chanpos]->owner;
+ call_2_ast = pri->pvts[call_2_chanpos]->owner;
+ if (!call_1_ast || !call_2_ast) {
+ if (call_1_ast) {
+ ast_channel_unlock(call_1_ast);
+ }
+ if (call_2_ast) {
+ ast_channel_unlock(call_2_ast);
+ }
+ sig_pri_unlock_private(pri->pvts[call_1_chanpos]);
+ sig_pri_unlock_private(pri->pvts[call_2_chanpos]);
+ return -1;
+ }
+
+ bridged = ast_bridged_channel(call_2_ast);
+ if (bridged) {
+ if (call_1_held) {
+ ast_queue_control(call_1_ast, AST_CONTROL_UNHOLD);
+ }
+ if (call_2_held) {
+ ast_queue_control(call_2_ast, AST_CONTROL_UNHOLD);
+ }
+
+ ast_verb(3, "TRANSFERRING %s to %s\n", call_2_ast->name, call_1_ast->name);
+ retval = ast_channel_masquerade(call_1_ast, bridged);
+ } else {
+ /* Try masquerading the other way. */
+ bridged = ast_bridged_channel(call_1_ast);
+ if (bridged) {
+ if (call_1_held) {
+ ast_queue_control(call_1_ast, AST_CONTROL_UNHOLD);
+ }
+ if (call_2_held) {
+ ast_queue_control(call_2_ast, AST_CONTROL_UNHOLD);
+ }
+
+ ast_verb(3, "TRANSFERRING %s to %s\n", call_1_ast->name, call_2_ast->name);
+ retval = ast_channel_masquerade(call_2_ast, bridged);
+ } else {
+ /* Could not transfer. */
+ retval = -1;
+ }
+ }
+ if (bridged && retval) {
+ /* Restore HOLD on held calls because masquerade failed. */
+ if (call_1_held) {
+ ast_queue_control(call_1_ast, AST_CONTROL_HOLD);
+ }
+ if (call_2_held) {
+ ast_queue_control(call_2_ast, AST_CONTROL_HOLD);
+ }
+ }
+
+ ast_channel_unlock(call_1_ast);
+ ast_channel_unlock(call_2_ast);
+ sig_pri_unlock_private(pri->pvts[call_1_chanpos]);
+ sig_pri_unlock_private(pri->pvts[call_2_chanpos]);
+
+ return retval;
+}
+#endif /* defined(HAVE_PRI_CALL_HOLD) || defined(HAVE_PRI_TRANSFER) */
#if defined(HAVE_PRI_CCSS)
/*!
@@ -3396,6 +3496,24 @@
subcmd->u.cc_cancel.is_agent);
break;
#endif /* defined(HAVE_PRI_CCSS) */
+#if defined(HAVE_PRI_TRANSFER)
+ case PRI_SUBCMD_TRANSFER_CALL:
+ if (!call_rsp) {
+ /* Should never happen. */
+ ast_log(LOG_ERROR,
+ "Call transfer subcommand without call to send response!\n");
+ break;
+ }
+
+ sig_pri_unlock_private(pri->pvts[chanpos]);
+ pri_transfer_rsp(pri->pri, call_rsp, subcmd->u.transfer.invoke_id,
+ sig_pri_attempt_transfer(pri,
+ subcmd->u.transfer.call_1, subcmd->u.transfer.is_call_1_held,
+ subcmd->u.transfer.call_2, subcmd->u.transfer.is_call_2_held)
+ ? 0 : 1);
+ sig_pri_lock_private(pri->pvts[chanpos]);
+ break;
+#endif /* defined(HAVE_PRI_TRANSFER) */
#if defined(HAVE_PRI_AOC_EVENTS)
case PRI_SUBCMD_AOC_S:
sig_pri_lock_owner(pri, chanpos);
@@ -3461,78 +3579,6 @@
}
}
}
-
-#if defined(HAVE_PRI_CALL_HOLD)
-/*!
- * \internal
- * \brief Attempt to transfer the active call to the held call.
- * \since 1.8
- *
- * \param pri sig_pri PRI control structure.
- * \param active_call Active call to transfer.
- * \param held_call Held call to transfer.
- *
- * \note Assumes the pri->lock is already obtained.
- *
- * \retval 0 on success.
- * \retval -1 on error.
- */
-static int sig_pri_attempt_transfer(struct sig_pri_pri *pri, q931_call *active_call, q931_call *held_call)
-{
- int retval;
- int active_chanpos;
- int held_chanpos;
- struct ast_channel *active_ast;
- struct ast_channel *held_ast;
- struct ast_channel *bridged;
-
- active_chanpos = pri_find_pri_call(pri, active_call);
- held_chanpos = pri_find_pri_call(pri, held_call);
- if (active_chanpos < 0 || held_chanpos < 0) {
- return -1;
- }
-
- sig_pri_lock_private(pri->pvts[active_chanpos]);
- sig_pri_lock_private(pri->pvts[held_chanpos]);
- sig_pri_lock_owner(pri, active_chanpos);
- sig_pri_lock_owner(pri, held_chanpos);
-
- active_ast = pri->pvts[active_chanpos]->owner;
- held_ast = pri->pvts[held_chanpos]->owner;
- if (!active_ast || !held_ast) {
- if (active_ast) {
- ast_channel_unlock(active_ast);
- }
- if (held_ast) {
- ast_channel_unlock(held_ast);
- }
- sig_pri_unlock_private(pri->pvts[active_chanpos]);
- sig_pri_unlock_private(pri->pvts[held_chanpos]);
- return -1;
- }
-
- bridged = ast_bridged_channel(held_ast);
- if (bridged) {
- ast_queue_control(held_ast, AST_CONTROL_UNHOLD);
-
- ast_verb(3, "TRANSFERRING %s to %s\n", held_ast->name, active_ast->name);
- retval = ast_channel_masquerade(active_ast, bridged);
- } else {
- /*
- * Could not transfer. Held channel is not bridged anymore.
- * Held party probably got tired of waiting and hung up.
- */
- retval = -1;
- }
-
- ast_channel_unlock(active_ast);
- ast_channel_unlock(held_ast);
- sig_pri_unlock_private(pri->pvts[active_chanpos]);
- sig_pri_unlock_private(pri->pvts[held_chanpos]);
-
- return retval;
-}
-#endif /* defined(HAVE_PRI_CALL_HOLD) */
#if defined(HAVE_PRI_CALL_HOLD)
/*!
@@ -4827,8 +4873,8 @@
&& pri->hold_disconnect_transfer) {
/* We are to transfer the call instead of simply hanging up. */
sig_pri_unlock_private(pri->pvts[chanpos]);
- if (!sig_pri_attempt_transfer(pri, e->hangup.call_active,
- e->hangup.call_held)) {
+ if (!sig_pri_attempt_transfer(pri, e->hangup.call_active, 0,
+ e->hangup.call_held, 1)) {
break;
}
sig_pri_lock_private(pri->pvts[chanpos]);
@@ -6053,6 +6099,9 @@
pri_cc_retain_signaling_req(pri->pri, pri->cc_qsig_signaling_link_req);
pri_cc_retain_signaling_rsp(pri->pri, pri->cc_qsig_signaling_link_rsp);
#endif /* defined(HAVE_PRI_CCSS) */
+#if defined(HAVE_PRI_TRANSFER)
+ pri_transfer_enable(pri->pri, 1);
+#endif /* defined(HAVE_PRI_TRANSFER) */
#if defined(HAVE_PRI_AOC_EVENTS)
pri_aoc_events_enable(pri->pri, 1);
#endif /* defined(HAVE_PRI_AOC_EVENTS) */
Modified: team/dvossel/generic_aoc/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/channels/sig_pri.h?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/channels/sig_pri.h (original)
+++ team/dvossel/generic_aoc/channels/sig_pri.h Wed Jun 2 12:43:47 2010
@@ -30,10 +30,6 @@
#include "asterisk/ccss.h"
#include <libpri.h>
#include <dahdi/user.h>
-#if defined(PRI_SUBCMD_AOC_S)
-/* BUGBUG the HAVE_PRI_AOC_EVENTS line is to be removed when the aoc_events branch is merged to trunk and the configure script is updated. */
-#define HAVE_PRI_AOC_EVENTS 1
-#endif /* defined(PRI_SUBCMD_AOC_S) */
#define SIG_PRI_AOC_GRANT_S (1 << 0)
#define SIG_PRI_AOC_GRANT_D (1 << 1)
@@ -274,6 +270,11 @@
/*! \brief TRUE if held calls are transferred on disconnect. */
unsigned int hold_disconnect_transfer:1;
#endif /* defined(HAVE_PRI_CALL_HOLD) */
+ /*!
+ * \brief TRUE if call transfer is enabled for the span.
+ * \note Support switch-side transfer (called 2BCT, RLT or other names)
+ */
+ unsigned int transfer:1;
int dialplan; /*!< Dialing plan */
int localdialplan; /*!< Local dialing plan */
char internationalprefix[10]; /*!< country access code ('00' for european dialplans) */
Modified: team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample (original)
+++ team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample Wed Jun 2 12:43:47 2010
@@ -554,6 +554,8 @@
; 'facilityenable' setting must also be enabled to allow sending
; the transfer to the ISDN switch, since it sent in a FACILITY
; message.
+; NOTE: This should be disabled for NT PTMP mode. Phones cannot
+; have tromboned calls pushed down to them.
;
transfer=yes
;
Modified: team/dvossel/generic_aoc/configs/voicemail.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/configs/voicemail.conf.sample?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/configs/voicemail.conf.sample (original)
+++ team/dvossel/generic_aoc/configs/voicemail.conf.sample Wed Jun 2 12:43:47 2010
@@ -93,7 +93,8 @@
; For the directory, you can override the intro file if you want
;directoryintro=dir-intro
; The character set for voicemail messages can be specified here
-;charset=ISO-8859-1
+; default: ISO-8859-1
+;charset=UTF-8
; The ADSI feature descriptor number to download to
;adsifdn=0000000F
; The ADSI security lock code
@@ -226,6 +227,13 @@
; overridden in the per-mailbox settings, unless listed otherwise.
;
; tz=central ; Timezone from zonemessages below. Irrelevant if envelope=no.
+; locale=de_DE.UTF-8 ; set the locale for generation of the date/time strings (make
+ ; sure the locales are installed in your operating system; e.g
+ ; on Debian Linux you can use "dpkg-reconfigure locales").
+ ; If you use UTF-8 locales, make sure to set the "charset" option
+ ; to UTF-8 too. If you mix different locales for different users
+ ; you should avoid words in the emaildateformat specification, e.g.:
+ ; emaildateformat=%A, %d %B %Y, %H:%M:%S
; attach=yes ; Attach the voicemail to the notification email *NOT* the pager email
; attachfmt=wav49 ; Which format to attach to the email. Normally this is the
; first format specified in the format parameter above, but this
Modified: team/dvossel/generic_aoc/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/configure.ac?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/configure.ac (original)
+++ team/dvossel/generic_aoc/configure.ac Wed Jun 2 12:43:47 2010
@@ -342,6 +342,7 @@
AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
AST_EXT_LIB_SETUP_DEPENDENT([PRI_AOC_EVENTS], [ISDN PRI advice of charge supplementary service events], [PRI], [pri])
+AST_EXT_LIB_SETUP_DEPENDENT([PRI_TRANSFER], [ISDN PRI call transfer supplementary service], [PRI], [pri])
AST_EXT_LIB_SETUP_DEPENDENT([PRI_CCSS], [ISDN PRI call completion supplementary service], [PRI], [pri])
AST_EXT_LIB_SETUP_DEPENDENT([PRI_HANGUP_FIX], [ISDN PRI hangup fix], [PRI], [pri])
AST_EXT_LIB_SETUP_DEPENDENT([PRI_SUBADDR], [ISDN PRI subaddressing], [PRI], [pri])
@@ -443,7 +444,7 @@
AC_FUNC_STRTOD
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob htonll ioperm inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap ntohll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv utime vasprintf getpeereid sysctl swapctl])
+AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob htonll ioperm inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap ntohll newlocale putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv utime vasprintf getpeereid sysctl swapctl])
# NOTE: we use AC_CHECK_LIB to get -lm into the arguments for later checks,
# so that AC_CHECK_FUNCS can detect functions in that library.
@@ -925,9 +926,6 @@
# Some distributions (like RedHat) add a libical subdirectory for the headers
AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_get_utc_timezone], [libical/ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
-if test x"${PBX_ICAL}" = x1; then
- ICAL_INCLUDE+=-I/usr/include/libical
-fi
AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_new], [ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
@@ -1595,6 +1593,7 @@
AST_EXT_LIB_CHECK([PRI], [pri], [pri_connected_line_update], [libpri.h])
AST_EXT_LIB_CHECK([PRI_AOC_EVENTS], [pri], [pri_aoc_events_enable], [libpri.h])
+AST_EXT_LIB_CHECK([PRI_TRANSFER], [pri], [pri_transfer_enable], [libpri.h])
AST_EXT_LIB_CHECK([PRI_CCSS], [pri], [pri_cc_enable], [libpri.h])
AST_EXT_LIB_CHECK([PRI_HANGUP_FIX], [pri], [pri_hangup_fix_enable], [libpri.h])
AST_EXT_LIB_CHECK([PRI_SUBADDR], [pri], [pri_sr_set_called_subaddress], [libpri.h])
Modified: team/dvossel/generic_aoc/contrib/init.d/rc.debian.asterisk
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/contrib/init.d/rc.debian.asterisk?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/contrib/init.d/rc.debian.asterisk (original)
+++ team/dvossel/generic_aoc/contrib/init.d/rc.debian.asterisk Wed Jun 2 12:43:47 2010
@@ -111,7 +111,7 @@
# "start-stop-daemon --oknodo" returns 0 even if Asterisk was already running (as LSB expects):
if test "x$COLOR" = "xyes" ; then
export TERM=linux
- start-stop-daemon --start --oknodo --background --exec $DAEMON -- $ASTARGS
+ start-stop-daemon --start --oknodo --background --exec $DAEMON -- $ASTARGS -c
else
start-stop-daemon --start --oknodo --exec $DAEMON -- $ASTARGS
fi
Modified: team/dvossel/generic_aoc/funcs/func_env.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/funcs/func_env.c?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/funcs/func_env.c (original)
+++ team/dvossel/generic_aoc/funcs/func_env.c Wed Jun 2 12:43:47 2010
@@ -44,6 +44,7 @@
</parameter>
</syntax>
<description>
+ <para>Variables starting with <literal>AST_</literal> are reserved to the system and may not be set.</para>
</description>
</function>
<function name="STAT" language="en_US">
@@ -106,7 +107,7 @@
static int env_write(struct ast_channel *chan, const char *cmd, char *data,
const char *value)
{
- if (!ast_strlen_zero(data)) {
+ if (!ast_strlen_zero(data) && strncmp(data, "AST_", 4)) {
if (!ast_strlen_zero(value)) {
setenv(data, value, 1);
} else {
Modified: team/dvossel/generic_aoc/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/include/asterisk/autoconfig.h.in?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/include/asterisk/autoconfig.h.in (original)
+++ team/dvossel/generic_aoc/include/asterisk/autoconfig.h.in Wed Jun 2 12:43:47 2010
@@ -466,6 +466,9 @@
/* Define if your system has the NETSNMP libraries. */
#undef HAVE_NETSNMP
+/* Define to 1 if you have the `newlocale' function. */
+#undef HAVE_NEWLOCALE
+
/* Define to 1 if you have the newt library. */
#undef HAVE_NEWT
@@ -528,6 +531,10 @@
/* Define to 1 if you have the ISDN PRI library. */
#undef HAVE_PRI
+
+/* Define to 1 if you have the ISDN PRI advice of charge supplementary service
+ events library. */
+#undef HAVE_PRI_AOC_EVENTS
/* Define to 1 if you have the ISDN PRI call hold library. */
#undef HAVE_PRI_CALL_HOLD
@@ -561,6 +568,10 @@
/* Define to 1 if you have the ISDN PRI subaddressing library. */
#undef HAVE_PRI_SUBADDR
+/* Define to 1 if you have the ISDN PRI call transfer supplementary service
+ library. */
+#undef HAVE_PRI_TRANSFER
+
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
@@ -770,7 +781,7 @@
/* Define to 1 if you have the `strtoq' function. */
#undef HAVE_STRTOQ
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+/* Define to 1 if `st_blksize' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
/* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -1037,9 +1048,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
Modified: team/dvossel/generic_aoc/include/asterisk/localtime.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/include/asterisk/localtime.h?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/include/asterisk/localtime.h (original)
+++ team/dvossel/generic_aoc/include/asterisk/localtime.h Wed Jun 2 12:43:47 2010
@@ -1,10 +1,10 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2010, Digium, Inc.
*
* Mark Spencer <markster at digium.com>
- * Tilghman Lesher <tlesher at vcch.com>
+ * Tilghman Lesher <tlesher AT digium DOT com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
@@ -23,6 +23,12 @@
#ifndef _ASTERISK_LOCALTIME_H
#define _ASTERISK_LOCALTIME_H
+
+#ifdef HAVE_NEWLOCALE
+#include <locale.h>
+#else
+typedef void * locale_t;
+#endif
struct ast_tm {
int tm_sec; /*!< Seconds. [0-60] (1 leap second) */
@@ -57,6 +63,9 @@
*/
struct timeval ast_mktime(struct ast_tm * const tmp, const char *zone);
+/*!\brief Set the thread-local representation of the current locale. */
+const char *ast_setlocale(const char *locale);
+
/*!\brief Special version of strftime(3) that handles fractions of a second.
* Takes the same arguments as strftime(3), with the addition of %q, which
* specifies microseconds.
@@ -64,9 +73,11 @@
* \param len Size of the chunk of memory buf.
* \param format A string specifying the format of time to be placed into buf.
* \param tm Pointer to the broken out time to be used for the format.
+ * \param locale Text string specifying the locale to be used for language strings.
* \retval An integer value specifying the number of bytes placed into buf or -1 on error.
*/
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm);
+int ast_strftime_locale(char *buf, size_t len, const char *format, const struct ast_tm *tm, const char *locale);
/*!\brief Special version of strptime(3) which places the answer in the common
* structure ast_tm. Also, unlike strptime(3), ast_strptime() initializes its
@@ -74,9 +85,11 @@
* \param s A string specifying some portion of a date and time.
* \param format The format in which the string, s, is expected.
* \param tm The broken-out time structure into which the parsed data is expected.
+ * \param locale Text string specifying the locale to be used for language strings.
* \retval A pointer to the first character within s not used to parse the date and time.
*/
char *ast_strptime(const char *s, const char *format, struct ast_tm *tm);
+char *ast_strptime_locale(const char *s, const char *format, struct ast_tm *tm, const char *locale);
/*!\brief Wakeup localtime monitor thread
* For use in testing. Normally, the failsafe monitor thread waits 60 seconds
Modified: team/dvossel/generic_aoc/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/main/asterisk.c?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/main/asterisk.c (original)
+++ team/dvossel/generic_aoc/main/asterisk.c Wed Jun 2 12:43:47 2010
@@ -571,7 +571,8 @@
static char *handle_show_sysinfo(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
uint64_t physmem, freeram;
- uint64_t totalswap = 0, freeswap = 0;
+ uint64_t freeswap = 0;
+ int totalswap = 0;
int nprocs = 0;
long uptime = 0;
#if defined(HAVE_SYSINFO)
@@ -656,8 +657,10 @@
#if defined(HAVE_SYSINFO)
ast_cli(a->fd, " Buffer RAM: %" PRIu64 " KiB\n", ((uint64_t) sys_info.bufferram * sys_info.mem_unit) / 1024);
#endif
- ast_cli(a->fd, " Total Swap Space: %" PRIu64 " KiB\n", totalswap);
+#if defined (HAVE_SYSCTL) && defined(HAVE_SWAPCTL)
+ ast_cli(a->fd, " Total Swap Space: %u KiB\n", totalswap);
ast_cli(a->fd, " Free Swap Space: %" PRIu64 " KiB\n\n", freeswap);
+#endif
ast_cli(a->fd, " Number of Processes: %d \n\n", nprocs);
return CLI_SUCCESS;
}
@@ -2173,7 +2176,7 @@
/* Write over the CLI prompt */
if (!ast_opt_exec && !lastpos) {
- if (write(STDOUT_FILENO, "\r", 1) < 0) {
+ if (write(STDOUT_FILENO, "\r[0K", 5) < 0) {
}
}
if (write(STDOUT_FILENO, buf, res) < 0) {
@@ -3126,6 +3129,18 @@
ast_config_destroy(cfg);
}
+static void env_init(void)
+{
+ setenv("AST_SYSTEMNAME", ast_config_AST_SYSTEM_NAME, 1);
+ setenv("AST_BUILD_HOST", ast_build_hostname, 1);
+ setenv("AST_BUILD_DATE", ast_build_date, 1);
+ setenv("AST_BUILD_KERNEL", ast_build_kernel, 1);
+ setenv("AST_BUILD_MACHINE", ast_build_machine, 1);
+ setenv("AST_BUILD_OS", ast_build_os, 1);
+ setenv("AST_BUILD_USER", ast_build_user, 1);
+ setenv("AST_VERSION", ast_get_version(), 1);
+}
+
int main(int argc, char *argv[])
{
int c;
@@ -3312,6 +3327,7 @@
}
ast_readconfig();
+ env_init();
if (ast_opt_remote && remotesock != NULL)
ast_copy_string((char *) cfg_paths.socket_path, remotesock, sizeof(cfg_paths.socket_path));
Modified: team/dvossel/generic_aoc/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/main/bridging.c?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/main/bridging.c (original)
+++ team/dvossel/generic_aoc/main/bridging.c Wed Jun 2 12:43:47 2010
@@ -635,11 +635,16 @@
if (new_technology->capabilities & AST_BRIDGE_CAPABILITY_THREAD) {
ast_debug(1, "Telling current bridge thread for bridge %p to refresh\n", bridge);
bridge->refresh = 1;
+ bridge_poke(bridge);
} else {
+ pthread_t bridge_thread = bridge->thread;
ast_debug(1, "Telling current bridge thread for bridge %p to stop\n", bridge);
bridge->stop = 1;
- }
- bridge_poke(bridge);
+ bridge_poke(bridge);
+ ao2_unlock(bridge);
+ pthread_join(bridge_thread, NULL);
+ ao2_lock(bridge);
+ }
}
/* Since we are soon going to pass this bridge to a new technology we need to NULL out the bridge_pvt pointer but don't worry as it still exists in temp_bridge, ditto for the old technology */
Modified: team/dvossel/generic_aoc/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/main/manager.c?view=diff&rev=267092&r1=267091&r2=267092
==============================================================================
--- team/dvossel/generic_aoc/main/manager.c (original)
+++ team/dvossel/generic_aoc/main/manager.c Wed Jun 2 12:43:47 2010
@@ -841,11 +841,12 @@
int usecount; /*!< # of clients who still need the event */
int category;
unsigned int seq; /*!< sequence number */
- AST_LIST_ENTRY(eventqent) eq_next;
[... 740 lines stripped ...]
More information about the asterisk-commits
mailing list