[asterisk-commits] moy: branch moy/mfcr2 r170046 - in /team/moy/mfcr2: ./ apps/ build_tools/ cdr...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jan 21 22:24:03 CST 2009
Author: moy
Date: Wed Jan 21 22:24:03 2009
New Revision: 170046
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=170046
Log:
merged changes from trunk rev 170042
Added:
team/moy/mfcr2/contrib/scripts/sip_nat_settings
- copied unchanged from r170042, trunk/contrib/scripts/sip_nat_settings
Modified:
team/moy/mfcr2/ (props changed)
team/moy/mfcr2/CHANGES
team/moy/mfcr2/CREDITS
team/moy/mfcr2/Makefile
team/moy/mfcr2/apps/app_disa.c
team/moy/mfcr2/apps/app_meetme.c
team/moy/mfcr2/apps/app_minivm.c
team/moy/mfcr2/apps/app_page.c
team/moy/mfcr2/apps/app_queue.c
team/moy/mfcr2/apps/app_read.c
team/moy/mfcr2/apps/app_readexten.c
team/moy/mfcr2/apps/app_userevent.c
team/moy/mfcr2/apps/app_voicemail.c
team/moy/mfcr2/build_tools/menuselect-deps.in
team/moy/mfcr2/cdr/cdr_adaptive_odbc.c
team/moy/mfcr2/cdr/cdr_odbc.c
team/moy/mfcr2/channels/chan_agent.c
team/moy/mfcr2/channels/chan_alsa.c
team/moy/mfcr2/channels/chan_dahdi.c
team/moy/mfcr2/channels/chan_local.c
team/moy/mfcr2/channels/chan_misdn.c
team/moy/mfcr2/channels/chan_sip.c
team/moy/mfcr2/channels/chan_skinny.c
team/moy/mfcr2/channels/chan_unistim.c
team/moy/mfcr2/channels/misdn/isdn_lib.c
team/moy/mfcr2/configs/chan_dahdi.conf.sample
team/moy/mfcr2/configs/extconfig.conf.sample
team/moy/mfcr2/configs/indications.conf.sample
team/moy/mfcr2/configs/sip.conf.sample
team/moy/mfcr2/configure
team/moy/mfcr2/configure.ac
team/moy/mfcr2/contrib/scripts/autosupport
team/moy/mfcr2/doc/tex/extensions.tex
team/moy/mfcr2/funcs/func_channel.c
team/moy/mfcr2/funcs/func_logic.c
team/moy/mfcr2/funcs/func_odbc.c
team/moy/mfcr2/include/asterisk/autoconfig.h.in
team/moy/mfcr2/include/asterisk/channel.h
team/moy/mfcr2/include/asterisk/indications.h
team/moy/mfcr2/include/asterisk/linkedlists.h
team/moy/mfcr2/include/asterisk/options.h
team/moy/mfcr2/include/asterisk/res_odbc.h
team/moy/mfcr2/include/asterisk/say.h
team/moy/mfcr2/include/asterisk/strings.h
team/moy/mfcr2/include/asterisk/tcptls.h
team/moy/mfcr2/main/app.c
team/moy/mfcr2/main/ast_expr2.c
team/moy/mfcr2/main/ast_expr2.h
team/moy/mfcr2/main/ast_expr2.y
team/moy/mfcr2/main/asterisk.c
team/moy/mfcr2/main/channel.c
team/moy/mfcr2/main/cli.c
team/moy/mfcr2/main/features.c
team/moy/mfcr2/main/http.c
team/moy/mfcr2/main/indications.c
team/moy/mfcr2/main/logger.c
team/moy/mfcr2/main/manager.c
team/moy/mfcr2/main/pbx.c
team/moy/mfcr2/main/say.c
team/moy/mfcr2/main/srv.c
team/moy/mfcr2/main/taskprocessor.c
team/moy/mfcr2/main/tcptls.c
team/moy/mfcr2/main/udptl.c
team/moy/mfcr2/makeopts.in
team/moy/mfcr2/pbx/pbx_dundi.c
team/moy/mfcr2/res/ael/pval.c
team/moy/mfcr2/res/res_agi.c
team/moy/mfcr2/res/res_config_odbc.c
team/moy/mfcr2/res/res_http_post.c
team/moy/mfcr2/res/res_indications.c
team/moy/mfcr2/res/res_musiconhold.c
team/moy/mfcr2/res/res_odbc.c
team/moy/mfcr2/res/res_phoneprov.c
team/moy/mfcr2/res/res_timing_timerfd.c
team/moy/mfcr2/res/snmp/agent.c
team/moy/mfcr2/sounds/Makefile
team/moy/mfcr2/utils/refcounter.c
Propchange: team/moy/mfcr2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/moy/mfcr2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: team/moy/mfcr2/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/CHANGES?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/CHANGES (original)
+++ team/moy/mfcr2/CHANGES Wed Jan 21 22:24:03 2009
@@ -40,7 +40,12 @@
version received is different from the current SDP session version. This
option is required to interoperate with devices that have non-standard SDP
session version implementations (observed with Microsoft OCS). This option
- is diabled by default.
+ is disabled by default.
+ * The parsing of register => lines in sip.conf has been modified to allow a port
+ to be present in the "user" portion. Please see the sip.conf.sample file for more
+ information
+ * Added a function to remove SIP headers added in the dialplan before the
+ first INVITE is generated - SIPRemoveHeader()
Skinny Changes
--------------
@@ -114,6 +119,9 @@
timezones, especially if those daylight savings time ranges vary from your
machine's native timezone. See GotoIfTime, ExecIfTime, IFTIME(), and timed
includes.
+ * The contrib/scripts/ directory now has a script called sip_nat_settings that will
+ give you the correct output for an asterisk box behind nat. It will give you the
+ externhost and localnet settings.
Asterisk Manager Interface
--------------------------
Modified: team/moy/mfcr2/CREDITS
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/CREDITS?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/CREDITS (original)
+++ team/moy/mfcr2/CREDITS Wed Jan 21 22:24:03 2009
@@ -192,6 +192,8 @@
- See http://voip-info.org/users/view/sergee
serg(AT)voipsolutions.ru
+Klaus Darillon - the SIPremoveHeader function in chan_sip
+
=== OTHER CONTRIBUTIONS ===
John Todd - Monkey sounds and associated teletorture prompt
Michael Jerris - bug marshaling
Modified: team/moy/mfcr2/Makefile
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/Makefile?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/Makefile (original)
+++ team/moy/mfcr2/Makefile Wed Jan 21 22:24:03 2009
@@ -726,6 +726,7 @@
echo ";rungroup = asterisk ; The group to run as" ; \
echo ";lightbackground = yes ; If your terminal is set for a light-colored background" ; \
echo "documentation_language = en_US ; Set the Language you want Documentation displayed in. Value is in the same format as locale names" ; \
+ echo ";hideconnect = yes ; Hide messages displayed when a remote console connects and disconnects" ; \
echo "" ; \
echo "; Changing the following lines may compromise your security." ; \
echo ";[files]" ; \
Modified: team/moy/mfcr2/apps/app_disa.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/apps/app_disa.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/apps/app_disa.c (original)
+++ team/moy/mfcr2/apps/app_disa.c Wed Jan 21 22:24:03 2009
@@ -124,7 +124,7 @@
static void play_dialtone(struct ast_channel *chan, char *mailbox)
{
- const struct ind_tone_zone_sound *ts = NULL;
+ const struct tone_zone_sound *ts = NULL;
if(ast_app_has_voicemail(mailbox, NULL))
ts = ast_get_indication_tone(chan->zone, "dialrecall");
else
Modified: team/moy/mfcr2/apps/app_meetme.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/apps/app_meetme.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/apps/app_meetme.c (original)
+++ team/moy/mfcr2/apps/app_meetme.c Wed Jan 21 22:24:03 2009
@@ -2187,10 +2187,12 @@
user->user_no = AST_LIST_LAST(&conf->userlist)->user_no + 1;
if (rt_schedule && conf->maxusers)
- if (user->user_no > conf->maxusers) {
+ if (conf->users >= conf->maxusers) {
/* Sorry, but this confernce has reached the participant limit! */
if (!ast_streamfile(chan, "conf-full", chan->language))
ast_waitstream(chan, "");
+ ast_mutex_unlock(&conf->playlock);
+ user->user_no = 0;
goto outrun;
}
Modified: team/moy/mfcr2/apps/app_minivm.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/apps/app_minivm.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/apps/app_minivm.c (original)
+++ team/moy/mfcr2/apps/app_minivm.c Wed Jan 21 22:24:03 2009
@@ -2261,7 +2261,7 @@
if(!(vmu = find_account(domain, username, TRUE))) {
/* We could not find user, let's exit */
ast_log(LOG_WARNING, "Could not allocate temporary memory for '%s@%s'\n", username, domain);
- pbx_builtin_setvar_helper(chan, "MVM_NOTIFY_STATUS", "FAILED");
+ pbx_builtin_setvar_helper(chan, "MVM_ACCMESS_STATUS", "FAILED");
return -1;
}
@@ -2292,7 +2292,7 @@
if(ast_test_flag(vmu, MVM_ALLOCED))
free_user(vmu);
- pbx_builtin_setvar_helper(chan, "MVM_NOTIFY_STATUS", "SUCCESS");
+ pbx_builtin_setvar_helper(chan, "MVM_ACCMESS_STATUS", "SUCCESS");
/* Ok, we're ready to rock and roll. Return to dialplan */
return 0;
Modified: team/moy/mfcr2/apps/app_page.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/apps/app_page.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/apps/app_page.c (original)
+++ team/moy/mfcr2/apps/app_page.c Wed Jan 21 22:24:03 2009
@@ -117,7 +117,6 @@
AST_APP_OPTION('i', PAGE_IGNORE_FORWARDS),
});
-#define MAX_DIALS 128
static int page_exec(struct ast_channel *chan, void *data)
{
@@ -127,7 +126,8 @@
unsigned int confid = ast_random();
struct ast_app *app;
int res = 0, pos = 0, i = 0;
- struct ast_dial *dials[MAX_DIALS];
+ struct ast_dial **dial_list;
+ unsigned int num_dials;
int timeout = 0;
char *parse;
@@ -166,6 +166,18 @@
snprintf(meetmeopts, sizeof(meetmeopts), "MeetMe,%ud,%s%sqxdw(5)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"),
(ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") );
+
+ /* Count number of extensions in list by number of ampersands + 1 */
+ num_dials = 1;
+ tmp = args.devices;
+ while (*tmp && *tmp++ == '&') {
+ num_dials++;
+ }
+
+ if (!(dial_list = ast_calloc(num_dials, sizeof(void *)))) {
+ ast_log(LOG_ERROR, "Can't allocate %ld bytes for dial list\n", (long)(sizeof(void *) * num_dials));
+ return -1;
+ }
/* Go through parsing/calling each device */
while ((tech = strsep(&args.devices, "&"))) {
@@ -222,7 +234,7 @@
ast_dial_run(dial, chan, 1);
/* Put in our dialing array */
- dials[pos++] = dial;
+ dial_list[pos++] = dial;
}
if (!ast_test_flag(&flags, PAGE_QUIET)) {
@@ -239,7 +251,7 @@
/* Go through each dial attempt cancelling, joining, and destroying */
for (i = 0; i < pos; i++) {
- struct ast_dial *dial = dials[i];
+ struct ast_dial *dial = dial_list[i];
/* We have to wait for the async thread to exit as it's possible Meetme won't throw them out immediately */
ast_dial_join(dial);
Modified: team/moy/mfcr2/apps/app_queue.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/apps/app_queue.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/apps/app_queue.c (original)
+++ team/moy/mfcr2/apps/app_queue.c Wed Jan 21 22:24:03 2009
@@ -1032,7 +1032,7 @@
ast_copy_string(interface, m->state_interface, sizeof(interface));
if ((slash_pos = strchr(interface, '/')))
- if ((slash_pos = strchr(slash_pos + 1, '/')))
+ if (!strncasecmp(interface, "Local/", 6) && (slash_pos = strchr(slash_pos + 1, '/')))
*slash_pos = '\0';
if (!strcasecmp(interface, sc->dev)) {
@@ -1146,7 +1146,7 @@
q->dead = 0;
q->retry = DEFAULT_RETRY;
- q->timeout = -1;
+ q->timeout = DEFAULT_TIMEOUT;
q->maxlen = 0;
q->announcefrequency = 0;
q->minannouncefrequency = DEFAULT_MIN_ANNOUNCE_FREQUENCY;
@@ -2228,9 +2228,13 @@
struct callattempt *oo;
while (outgoing) {
+ /* If someone else answered the call we should indicate this in the CANCEL */
/* Hangup any existing lines we have open */
- if (outgoing->chan && (outgoing->chan != exception))
+ if (outgoing->chan && (outgoing->chan != exception)) {
+ if (exception)
+ ast_set_flag(outgoing->chan, AST_FLAG_ANSWERED_ELSEWHERE);
ast_hangup(outgoing->chan);
+ }
oo = outgoing;
outgoing = outgoing->q_next;
if (oo->member)
@@ -2761,7 +2765,7 @@
if (numlines == (numbusies + numnochan)) {
ast_debug(1, "Everyone is busy at this time\n");
} else {
- ast_log(LOG_NOTICE, "No one is answering queue '%s' (%d/%d/%d)\n", queue, numlines, numbusies, numnochan);
+ ast_debug(3, "No one is answering queue '%s' (%d numlines / %d busies / %d failed channels)\n", queue, numlines, numbusies, numnochan);
}
*to = 0;
return NULL;
@@ -3332,8 +3336,9 @@
update_queue(qe->parent, member, callcompletedinsl, (time(NULL) - callstart));
- if ((datastore = ast_channel_datastore_find(new_chan, &queue_transfer_info, NULL))) {
- ast_channel_datastore_remove(new_chan, datastore);
+ /* No need to lock the channels because they are already locked in ast_do_masquerade */
+ if ((datastore = ast_channel_datastore_find(old_chan, &queue_transfer_info, NULL))) {
+ ast_channel_datastore_remove(old_chan, datastore);
} else {
ast_log(LOG_WARNING, "Can't find the queue_transfer datastore.\n");
}
@@ -3344,6 +3349,8 @@
* When a caller is atxferred, then the queue_transfer_info datastore
* is removed from the channel. If it's still there after the bridge is
* broken, then the caller was not atxferred.
+ *
+ * \note Only call this with chan locked
*/
static int attended_transfer_occurred(struct ast_channel *chan)
{
@@ -3667,9 +3674,11 @@
* to which the datastore was moved hangs up, it will attempt to free this
* datastore again, causing a crash
*/
+ ast_channel_lock(qe->chan);
if (datastore && !ast_channel_datastore_remove(qe->chan, datastore)) {
ast_datastore_free(datastore);
}
+ ast_channel_unlock(qe->chan);
ao2_lock(qe->parent);
if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY) {
store_next_rr(qe, outgoing);
@@ -4078,6 +4087,7 @@
/* If the queue member did an attended transfer, then the TRANSFER already was logged in the queue_log
* when the masquerade occurred. These other "ending" queue_log messages are unnecessary
*/
+ ast_channel_lock(qe->chan);
if (!attended_transfer_occurred(qe->chan)) {
struct ast_datastore *tds;
if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
@@ -4094,17 +4104,16 @@
(long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), AGENT);
}
- ast_channel_lock(qe->chan);
- if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) {
+ if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) {
ast_channel_datastore_remove(qe->chan, tds);
}
- ast_channel_unlock(qe->chan);
update_queue(qe->parent, member, callcompletedinsl, (time(NULL) - callstart));
}
if (transfer_ds) {
ast_datastore_free(transfer_ds);
}
+ ast_channel_unlock(qe->chan);
ast_hangup(peer);
res = bridge ? bridge : 1;
ao2_ref(member, -1);
Modified: team/moy/mfcr2/apps/app_read.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/apps/app_read.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/apps/app_read.c (original)
+++ team/moy/mfcr2/apps/app_read.c Wed Jan 21 22:24:03 2009
@@ -132,7 +132,7 @@
int tries = 1, to = 0, x = 0;
double tosec;
char *argcopy = NULL;
- struct ind_tone_zone_sound *ts = NULL;
+ struct tone_zone_sound *ts = NULL;
struct ast_flags flags = {0};
const char *status = "ERROR";
Modified: team/moy/mfcr2/apps/app_readexten.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/apps/app_readexten.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/apps/app_readexten.c (original)
+++ team/moy/mfcr2/apps/app_readexten.c Wed Jan 21 22:24:03 2009
@@ -132,7 +132,7 @@
int maxdigits = sizeof(exten) - 1;
int timeout = 0, digit_timeout = 0, x = 0;
char *argcopy = NULL, *status = "";
- struct ind_tone_zone_sound *ts = NULL;
+ struct tone_zone_sound *ts = NULL;
struct ast_flags flags = {0};
AST_DECLARE_APP_ARGS(arglist,
Modified: team/moy/mfcr2/apps/app_userevent.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/apps/app_userevent.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/apps/app_userevent.c (original)
+++ team/moy/mfcr2/apps/app_userevent.c Wed Jan 21 22:24:03 2009
@@ -58,15 +58,22 @@
static int userevent_exec(struct ast_channel *chan, void *data)
{
- char *parse, buf[2048] = "";
- int x, buflen = 0;
+ char *parse;
+ int x;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(eventname);
AST_APP_ARG(extra)[100];
);
+ struct ast_str *body = ast_str_create(16);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "UserEvent requires an argument (eventname,optional event body)\n");
+ ast_free(body);
+ return -1;
+ }
+
+ if (!body) {
+ ast_log(LOG_WARNING, "Unable to allocate buffer\n");
return -1;
}
@@ -75,13 +82,11 @@
AST_STANDARD_APP_ARGS(args, parse);
for (x = 0; x < args.argc - 1; x++) {
- ast_copy_string(buf + buflen, args.extra[x], sizeof(buf) - buflen - 2);
- buflen += strlen(args.extra[x]);
- ast_copy_string(buf + buflen, "\r\n", 3);
- buflen += 2;
+ ast_str_append(&body, 0, "%s\r\n", args.extra[x]);
}
- manager_event(EVENT_FLAG_USER, "UserEvent", "UserEvent: %s\r\n%s", args.eventname, buf);
+ manager_event(EVENT_FLAG_USER, "UserEvent", "UserEvent: %s\r\n%s", args.eventname, ast_str_buffer(body));
+ ast_free(body);
return 0;
}
Modified: team/moy/mfcr2/apps/app_voicemail.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/apps/app_voicemail.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/apps/app_voicemail.c (original)
+++ team/moy/mfcr2/apps/app_voicemail.c Wed Jan 21 22:24:03 2009
@@ -47,10 +47,8 @@
/*** MAKEOPTS
<category name="MENUSELECT_OPTS_app_voicemail" displayname="Voicemail Build Options" positive_output="yes" remove_on_change="apps/app_voicemail.o apps/app_voicemail.so apps/app_directory.o apps/app_directory.so">
<member name="ODBC_STORAGE" displayname="Storage of Voicemail using ODBC">
- <depend>odbc</depend>
+ <depend>generic_odbc</depend>
<depend>ltdl</depend>
- <use>unixodbc</use>
- <use>iodbc</use>
<conflict>IMAP_STORAGE</conflict>
<defaultenabled>no</defaultenabled>
</member>
@@ -7176,7 +7174,102 @@
return res;
}
-/* Hebrew syntax */
+/* Version of vm_intro() designed to work for many languages.
+ *
+ * It is hoped that this function can prevent the proliferation of
+ * language-specific vm_intro() functions and in time replace the language-
+ * specific functions which already exist. An examination of the language-
+ * specific functions revealed that they all corrected the same deficiencies
+ * in vm_intro_en() (which was the default function). Namely:
+ *
+ * 1) The vm-Old and vm-INBOX sound files were overloaded. The English
+ * wording of the voicemail greeting hides this problem. For example,
+ * vm-INBOX contains only the word "new". This means that both of these
+ * sequences produce valid utterances:
+ * * vm-youhave digit/1 vm-INBOX vm-message (you have one new message)
+ * * vm-press digit/1 vm-for vm-INBOX vm-messages (press 1 for new messages)
+ * However, if we rerecord vm-INBOX to say "the new" (which is unavoidable
+ * in many languages) the first utterance becomes "you have 1 the new message".
+ * 2) The function contains hardcoded rules for pluralizing the word "message".
+ * These rules are correct for English, but not for many other languages.
+ * 3) No attempt is made to pluralize the adjectives ("old" and "new") as
+ * required in many languages.
+ * 4) The gender of the word for "message" is not specified. This is a problem
+ * because in many languages the gender of the number in phrases such
+ * as "you have one new message" must match the gender of the word
+ * meaning "message".
+ *
+ * Fixing these problems for each new language has meant duplication of effort.
+ * This new function solves the problems in the following general ways:
+ * 1) Add new sound files vm-new and vm-old. These can be linked to vm-INBOX
+ * and vm-Old respectively for those languages where it makes sense.
+ * 2) Call ast_say_counted_noun() to put the proper gender and number prefix
+ * on vm-message.
+ * 3) Call ast_say_counted_adjective() to put the proper gender and number
+ * prefix on vm-new and vm-old (none for English).
+ * 4) Pass the gender of the language's word for "message" as an agument to
+ * this function which is can in turn pass on to the functions which
+ * say numbers and put endings on nounds and adjectives.
+ *
+ * All languages require these messages:
+ * vm-youhave "You have..."
+ * vm-and "and"
+ * vm-no "no" (in the sense of "none", as in "you have no messages")
+ *
+ * To use it for English, you will need these additional sound files:
+ * vm-new "new"
+ * vm-message "message", singular
+ * vm-messages "messages", plural
+ *
+ * If you use it for Russian and other slavic languages, you will need these additional sound files:
+ *
+ * vm-newn "novoye" (singular, neuter)
+ * vm-newx "novikh" (counting plural form, genative plural)
+ * vm-message "sobsheniye" (singular form)
+ * vm-messagex1 "sobsheniya" (first counting plural form, genative singular)
+ * vm-messagex2 "sobsheniy" (second counting plural form, genative plural)
+ * digits/1n "odno" (neuter singular for phrases such as "one message" or "thirty one messages")
+ * digits/2n "dva" (neuter singular)
+ */
+static int vm_intro_multilang(struct ast_channel *chan, struct vm_state *vms, const char message_gender[])
+{
+ int res;
+ int lastnum = 0;
+
+ res = ast_play_and_wait(chan, "vm-youhave");
+
+ if (!res && vms->newmessages) {
+ lastnum = vms->newmessages;
+
+ if (!(res = ast_say_number(chan, lastnum, AST_DIGIT_ANY, chan->language, message_gender))) {
+ res = ast_say_counted_adjective(chan, lastnum, "vm-new", message_gender);
+ }
+
+ if (!res && vms->oldmessages) {
+ res = ast_play_and_wait(chan, "vm-and");
+ }
+ }
+
+ if (!res && vms->oldmessages) {
+ lastnum = vms->oldmessages;
+
+ if (!(res = ast_say_number(chan, lastnum, AST_DIGIT_ANY, chan->language, message_gender))) {
+ res = ast_say_counted_adjective(chan, lastnum, "vm-old", message_gender);
+ }
+ }
+
+ if (!res) {
+ if (lastnum == 0) {
+ res = ast_play_and_wait(chan, "vm-no");
+ } else {
+ res = ast_say_counted_noun(chan, lastnum, "vm-message");
+ }
+ }
+
+ return res;
+}
+
+/* Default Hebrew syntax */
static int vm_intro_he(struct ast_channel *chan, struct vm_state *vms)
{
int res = 0;
@@ -7859,78 +7952,6 @@
return res;
}
-static int get_lastdigits(int num)
-{
- num %= 100;
- return (num < 20) ? num : num % 10;
-}
-
-static int vm_intro_ru(struct ast_channel *chan,struct vm_state *vms)
-{
- int res;
- int lastnum = 0;
- int dcnum;
-
- res = ast_play_and_wait(chan, "vm-youhave");
- if (!res && vms->newmessages) {
- lastnum = get_lastdigits(vms->newmessages);
- dcnum = vms->newmessages - lastnum;
- if (dcnum)
- res = say_and_wait(chan, dcnum, chan->language);
- if (!res && lastnum) {
- if (lastnum == 1)
- res = ast_play_and_wait(chan, "digits/odno");
- else
- res = say_and_wait(chan, lastnum, chan->language);
- }
-
- if (!res)
- res = ast_play_and_wait(chan, (lastnum == 1) ? "vm-novoe" : "vm-novyh");
-
- if (!res && vms->oldmessages)
- res = ast_play_and_wait(chan, "vm-and");
- }
-
- if (!res && vms->oldmessages) {
- lastnum = get_lastdigits(vms->oldmessages);
- dcnum = vms->oldmessages - lastnum;
- if (dcnum)
- res = say_and_wait(chan, dcnum, chan->language);
- if (!res && lastnum) {
- if (lastnum == 1)
- res = ast_play_and_wait(chan, "digits/odno");
- else
- res = say_and_wait(chan, lastnum, chan->language);
- }
-
- if (!res)
- res = ast_play_and_wait(chan, (lastnum == 1) ? "vm-staroe" : "vm-staryh");
- }
-
- if (!res && !vms->newmessages && !vms->oldmessages) {
- lastnum = 0;
- res = ast_play_and_wait(chan, "vm-no");
- }
-
- if (!res) {
- switch (lastnum) {
- case 1:
- res = ast_play_and_wait(chan, "vm-soobshenie");
- break;
- case 2:
- case 3:
- case 4:
- res = ast_play_and_wait(chan, "vm-soobsheniya");
- break;
- default:
- res = ast_play_and_wait(chan, "vm-soobsheniy");
- break;
- }
- }
-
- return res;
-}
-
/* CHINESE (Taiwan) syntax */
static int vm_intro_tw(struct ast_channel *chan, struct vm_state *vms)
{
@@ -7967,77 +7988,6 @@
if (!res)
res = ast_play_and_wait(chan, "vm-messages");
}
- return res;
-}
-
-/* UKRAINIAN syntax */
-/* in ukrainian the syntax is different so we need the following files
- * --------------------------------------------------------
- * /digits/ua/1e 'odne'
- * vm-nove 'nove'
- * vm-stare 'stare'
- */
-static int vm_intro_ua(struct ast_channel *chan,struct vm_state *vms)
-{
- int res;
- int lastnum = 0;
- int dcnum;
-
- res = ast_play_and_wait(chan, "vm-youhave");
- if (!res && vms->newmessages) {
- lastnum = get_lastdigits(vms->newmessages);
- dcnum = vms->newmessages - lastnum;
- if (dcnum)
- res = say_and_wait(chan, dcnum, chan->language);
- if (!res && lastnum) {
- if (lastnum == 1)
- res = ast_play_and_wait(chan, "digits/ua/1e");
- else
- res = say_and_wait(chan, lastnum, chan->language);
- }
-
- if (!res)
- res = ast_play_and_wait(chan, (lastnum == 1) ? "vm-nove" : "vm-INBOX");
-
- if (!res && vms->oldmessages)
- res = ast_play_and_wait(chan, "vm-and");
- }
-
- if (!res && vms->oldmessages) {
- lastnum = get_lastdigits(vms->oldmessages);
- dcnum = vms->oldmessages - lastnum;
- if (dcnum)
- res = say_and_wait(chan, dcnum, chan->language);
- if (!res && lastnum) {
- if (lastnum == 1)
- res = ast_play_and_wait(chan, "digits/ua/1e");
- else
- res = say_and_wait(chan, lastnum, chan->language);
- }
-
- if (!res)
- res = ast_play_and_wait(chan, (lastnum == 1) ? "vm-stare" : "vm-Old");
- }
-
- if (!res && !vms->newmessages && !vms->oldmessages) {
- lastnum = 0;
- res = ast_play_and_wait(chan, "vm-no");
- }
-
- if (!res) {
- switch (lastnum) {
- case 1:
- case 2:
- case 3:
- case 4:
- res = ast_play_and_wait(chan, "vm-message");
- break;
- default:
- res = ast_play_and_wait(chan, "vm-messages");
- break;
- }
- }
-
return res;
}
@@ -8081,11 +8031,11 @@
} else if (!strcasecmp(chan->language, "no")) { /* NORWEGIAN syntax */
return vm_intro_no(chan, vms);
} else if (!strcasecmp(chan->language, "ru")) { /* RUSSIAN syntax */
- return vm_intro_ru(chan, vms);
+ return vm_intro_multilang(chan, vms, "n");
} else if (!strcasecmp(chan->language, "tw")) { /* CHINESE (Taiwan) syntax */
return vm_intro_tw(chan, vms);
} else if (!strcasecmp(chan->language, "ua")) { /* UKRAINIAN syntax */
- return vm_intro_ua(chan, vms);
+ return vm_intro_multilang(chan, vms, "n");
} else if (!strcasecmp(chan->language, "he")) { /* HEBREW syntax */
return vm_intro_he(chan, vms);
} else { /* Default to ENGLISH */
Modified: team/moy/mfcr2/build_tools/menuselect-deps.in
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/build_tools/menuselect-deps.in?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/build_tools/menuselect-deps.in (original)
+++ team/moy/mfcr2/build_tools/menuselect-deps.in Wed Jan 21 22:24:03 2009
@@ -3,6 +3,7 @@
CURL=@PBX_CURL@
DAHDI=@PBX_DAHDI@
FREETDS=@PBX_FREETDS@
+GENERIC_ODBC=@PBX_GENERIC_ODBC@
GMIME=@PBX_GMIME@
GNU_LD=@GNU_LD@
GSM=@PBX_GSM@
@@ -24,7 +25,6 @@
NBS=@PBX_NBS@
NETSNMP=@PBX_NETSNMP@
NEWT=@PBX_NEWT@
-ODBC=@PBX_ODBC@
OGG=@PBX_OGG@
OPENH323=@PBX_OPENH323@
OSPTK=@PBX_OSPTK@
Modified: team/moy/mfcr2/cdr/cdr_adaptive_odbc.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/cdr/cdr_adaptive_odbc.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/cdr/cdr_adaptive_odbc.c (original)
+++ team/moy/mfcr2/cdr/cdr_adaptive_odbc.c Wed Jan 21 22:24:03 2009
@@ -25,9 +25,8 @@
*/
/*** MODULEINFO
- <depend>odbc</depend>
- <use>unixodbc</use>
- <use>iodbc</use>
+ <depend>generic_odbc</depend>
+ <depend>ltdl</depend>
***/
#include "asterisk.h"
Modified: team/moy/mfcr2/cdr/cdr_odbc.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/cdr/cdr_odbc.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/cdr/cdr_odbc.c (original)
+++ team/moy/mfcr2/cdr/cdr_odbc.c Wed Jan 21 22:24:03 2009
@@ -29,10 +29,8 @@
*/
/*** MODULEINFO
- <depend>odbc</depend>
+ <depend>generic_odbc</depend>
<depend>ltdl</depend>
- <use>unixodbc</use>
- <use>iodbc</use>
***/
#include "asterisk.h"
Modified: team/moy/mfcr2/channels/chan_agent.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/channels/chan_agent.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/channels/chan_agent.c (original)
+++ team/moy/mfcr2/channels/chan_agent.c Wed Jan 21 22:24:03 2009
@@ -256,7 +256,8 @@
char name[AST_MAX_AGENT];
int inherited_devicestate; /*!< Does the underlying channel have a devicestate to pass? */
ast_mutex_t app_lock; /**< Synchronization between owning applications */
- volatile pthread_t owning_app; /**< Owning application thread id */
+ int app_lock_flag;
+ ast_cond_t app_complete_cond;
volatile int app_sleep_cond; /**< Sleep condition for the login app */
struct ast_channel *owner; /**< Agent */
char loginchan[80]; /**< channel they logged in from */
@@ -451,7 +452,8 @@
ast_copy_string(p->agent, agt, sizeof(p->agent));
ast_mutex_init(&p->lock);
ast_mutex_init(&p->app_lock);
- p->owning_app = (pthread_t) -1;
+ ast_cond_init(&p->app_complete_cond, NULL);
+ p->app_lock_flag = 0;
p->app_sleep_cond = 1;
p->group = group;
p->pending = pending;
@@ -509,12 +511,14 @@
chan->tech_pvt = NULL;
p->app_sleep_cond = 1;
/* Release ownership of the agent to other threads (presumably running the login app). */
- ast_mutex_unlock(&p->app_lock);
+ p->app_lock_flag = 0;
+ ast_cond_signal(&p->app_complete_cond);
if (chan)
ast_channel_free(chan);
if (p->dead) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
+ ast_cond_destroy(&p->app_complete_cond);
ast_free(p);
}
return 0;
@@ -1001,6 +1005,7 @@
} else if (p->dead) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
+ ast_cond_destroy(&p->app_complete_cond);
ast_free(p);
} else {
if (p->chan) {
@@ -1011,8 +1016,10 @@
ast_mutex_unlock(&p->lock);
}
/* Release ownership of the agent to other threads (presumably running the login app). */
- if (ast_strlen_zero(p->loginchan))
- ast_mutex_unlock(&p->app_lock);
+ if (ast_strlen_zero(p->loginchan)) {
+ p->app_lock_flag = 0;
+ ast_cond_signal(&p->app_complete_cond);
+ }
}
return 0;
}
@@ -1099,6 +1106,7 @@
static struct ast_channel *agent_new(struct agent_pvt *p, int state)
{
struct ast_channel *tmp;
+ int alreadylocked;
#if 0
if (!p->chan) {
ast_log(LOG_WARNING, "No channel? :(\n");
@@ -1144,11 +1152,15 @@
* implemented in the kernel for this.
*/
p->app_sleep_cond = 0;
- if(ast_strlen_zero(p->loginchan) && ast_mutex_trylock(&p->app_lock)) {
+
+ alreadylocked = p->app_lock_flag;
+ p->app_lock_flag = 1;
+
+ if(ast_strlen_zero(p->loginchan) && alreadylocked) {
if (p->chan) {
ast_queue_frame(p->chan, &ast_null_frame);
ast_mutex_unlock(&p->lock); /* For other thread to read the condition. */
- ast_mutex_lock(&p->app_lock);
+ p->app_lock_flag = 1;
ast_mutex_lock(&p->lock);
} else {
ast_log(LOG_WARNING, "Agent disconnected while we were connecting the call\n");
@@ -1157,7 +1169,8 @@
p->app_sleep_cond = 1;
ast_channel_free( tmp );
ast_mutex_unlock(&p->lock); /* For other thread to read the condition. */
- ast_mutex_unlock(&p->app_lock);
+ p->app_lock_flag = 0;
+ ast_cond_signal(&p->app_complete_cond);
return NULL;
}
} else if (!ast_strlen_zero(p->loginchan)) {
@@ -1175,14 +1188,6 @@
}
if (p->chan)
ast_indicate(p->chan, AST_CONTROL_UNHOLD);
- p->owning_app = pthread_self();
- /* After the above step, there should not be any blockers. */
- if (p->chan) {
- if (ast_test_flag(p->chan, AST_FLAG_BLOCKING)) {
- ast_log( LOG_ERROR, "A blocker exists after agent channel ownership acquired\n" );
- ast_assert(ast_test_flag(p->chan, AST_FLAG_BLOCKING) == 0);
- }
- }
return tmp;
}
@@ -1347,6 +1352,7 @@
if (!p->chan) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
+ ast_cond_destroy(&p->app_complete_cond);
ast_free(p);
} else {
/* Cause them to hang up */
@@ -2233,15 +2239,17 @@
ast_mutex_unlock(&p->lock);
AST_LIST_UNLOCK(&agents);
/* Synchronize channel ownership between call to agent and itself. */
- ast_mutex_lock( &p->app_lock );
+ ast_mutex_lock(&p->app_lock);
+ if (p->app_lock_flag == 1) {
+ ast_cond_wait(&p->app_complete_cond, &p->app_lock);
+ }
+ ast_mutex_unlock(&p->app_lock);
ast_mutex_lock(&p->lock);
- p->owning_app = pthread_self();
ast_mutex_unlock(&p->lock);
if (p->ackcall > 1)
res = agent_ack_sleep(p);
else
res = ast_safe_sleep_conditional( chan, 1000, agent_cont_sleep, p );
- ast_mutex_unlock( &p->app_lock );
if ((p->ackcall > 1) && (res == 1)) {
AST_LIST_LOCK(&agents);
ast_mutex_lock(&p->lock);
@@ -2276,6 +2284,7 @@
if (p->dead && !p->owner) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
+ ast_cond_destroy(&p->app_complete_cond);
ast_free(p);
}
}
Modified: team/moy/mfcr2/channels/chan_alsa.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/channels/chan_alsa.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/channels/chan_alsa.c (original)
+++ team/moy/mfcr2/channels/chan_alsa.c Wed Jan 21 22:24:03 2009
@@ -381,13 +381,17 @@
state = snd_pcm_state(alsa.ocard);
if (state == SND_PCM_STATE_XRUN)
snd_pcm_prepare(alsa.ocard);
- res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2);
+ while ((res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2)) == -EAGAIN) {
+ usleep(1);
+ }
if (res == -EPIPE) {
#if DEBUG
ast_debug(1, "XRUN write\n");
#endif
snd_pcm_prepare(alsa.ocard);
- res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2);
+ while ((res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2)) == -EAGAIN) {
+ usleep(1);
+ }
if (res != len / 2) {
ast_log(LOG_ERROR, "Write error: %s\n", snd_strerror(res));
res = -1;
Modified: team/moy/mfcr2/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2/channels/chan_dahdi.c?view=diff&rev=170046&r1=170045&r2=170046
==============================================================================
--- team/moy/mfcr2/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2/channels/chan_dahdi.c Wed Jan 21 22:24:03 2009
@@ -21,8 +21,8 @@
* \brief DAHDI for Pseudo TDM
*
* \author Mark Spencer <markster at digium.com>
- *
- * Connects to the DAHDI telephony library as well as
+ *
+ * Connects to the DAHDI telephony library as well as
* libpri. Libpri is optional and needed only if you are
* going to use ISDN connections.
*
@@ -126,7 +126,7 @@
</synopsis>
<syntax argsep=",">
<parameter name="destination" required="true">
- <para>Destination number.</para>
+ <para>Destination number.</para>
</parameter>
<parameter name="original">
<para>Original called number.</para>
@@ -168,7 +168,7 @@
/* define this to send PRI user-user information elements */
#undef SUPPORT_USERUSER
-/*!
+/*!
* \note Define ZHONE_HACK to cause us to go off hook and then back on hook when
* the user hangs up to reset the state machine so ring works properly.
* This is used to be able to support kewlstart by putting the zhone in
@@ -195,7 +195,7 @@
/*! \brief Signaling types that need to use MF detection should be placed in this macro */
-#define NEED_MFDETECT(p) (((p)->sig == SIG_FEATDMF) || ((p)->sig == SIG_FEATDMF_TA) || ((p)->sig == SIG_E911) || ((p)->sig == SIG_FGC_CAMA) || ((p)->sig == SIG_FGC_CAMAMF) || ((p)->sig == SIG_FEATB))
+#define NEED_MFDETECT(p) (((p)->sig == SIG_FEATDMF) || ((p)->sig == SIG_FEATDMF_TA) || ((p)->sig == SIG_E911) || ((p)->sig == SIG_FGC_CAMA) || ((p)->sig == SIG_FGC_CAMAMF) || ((p)->sig == SIG_FEATB))
static const char tdesc[] = "DAHDI Telephony Driver"
#if defined(HAVE_PRI) || defined(HAVE_SS7) || defined(HAVE_OPENR2)
@@ -273,7 +273,6 @@
#define DAHDI_OVERLAPDIAL_INCOMING 2
#define DAHDI_OVERLAPDIAL_BOTH (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING)
-
#define CALLPROGRESS_PROGRESS 1
#define CALLPROGRESS_FAX_OUTGOING 2
#define CALLPROGRESS_FAX_INCOMING 4
@@ -286,7 +285,9 @@
/*! Run this script when the MWI state changes on an FXO line, if mwimonitor is enabled */
static char mwimonitornotify[PATH_MAX] = "";
+#ifndef DAHDI_VMWI_FSK
static int mwisend_rpas = 0;
+#endif
static char progzone[10] = "";
@@ -602,7 +603,7 @@
#define MAX_SLAVES 4
/* States for sending MWI message
- * First three states are required for send Ring Pulse Alert Signal
+ * First three states are required for send Ring Pulse Alert Signal
*/
typedef enum {
MWI_SEND_NULL = 0,
@@ -623,7 +624,7 @@
ast_mutex_t lock;
struct ast_channel *owner; /*!< Our current active owner (if applicable) */
/*!< Up to three channels can be associated with this call */
-
+
struct dahdi_subchannel sub_unused; /*!< Just a safety precaution */
struct dahdi_subchannel subs[3]; /*!< Sub-channels */
struct dahdi_confinfo saveconf; /*!< Saved conference info */
@@ -631,7 +632,7 @@
struct dahdi_pvt *slaves[MAX_SLAVES]; /*!< Slave to us (follows our conferencing) */
struct dahdi_pvt *master; /*!< Master to us (we follow their conferencing) */
int inconference; /*!< If our real should be in the conference */
-
+
int buf_no; /*!< Number of buffers */
int buf_policy; /*!< Buffer policy */
int sig; /*!< Signalling style */
@@ -694,6 +695,7 @@
unsigned int transfertobusy:1; /*!< allow flash-transfers to busy channels */
unsigned int mwimonitor_neon:1; /*!< monitor this FXO port for neon type MWI indication from other end */
unsigned int mwimonitor_fsk:1; /*!< monitor this FXO port for fsk MWI indication from other end */
+ unsigned int mwimonitor_rpas:1; /*!< monitor this FXO port for rpas precursor to fsk MWI indication */
unsigned int mwimonitoractive:1; /*!< an MWI monitor thread is currently active */
unsigned int mwisendactive:1; /*!< a MWI message sending thread is active */
/* Channel state or unavilability flags */
@@ -701,7 +703,7 @@
unsigned int locallyblocked:1;
unsigned int remotelyblocked:1;
#if defined(HAVE_PRI) || defined(HAVE_SS7)
- unsigned int rlt:1;
+ unsigned int rlt:1;
unsigned int alerting:1;
unsigned int alreadyhungup:1;
[... 12033 lines stripped ...]
More information about the asterisk-commits
mailing list