[asterisk-commits] russell: branch russell/chan_console r50226 - in
/team/russell/chan_console: ...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Jan 9 19:05:13 MST 2007
Author: russell
Date: Tue Jan 9 20:05:12 2007
New Revision: 50226
URL: http://svn.digium.com/view/asterisk?view=rev&rev=50226
Log:
Merged revisions 49706,49709,49711,49713,49716,49727,49730,49735,49741,49743,49769,49784-49786,49801,49816,49832,49835,49870,49891,49931,49946,49968,49984,50007,50033-50034,50056,50074-50075,50099,50132,50152,50187 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r49706 | qwell | 2007-01-05 18:17:45 -0500 (Fri, 05 Jan 2007) | 12 lines
Merged revisions 49705 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49705 | qwell | 2007-01-05 17:16:16 -0600 (Fri, 05 Jan 2007) | 4 lines
Make codec_zap and chan_zap also depend on zaptel.
This fixes an issue (8727) with zaptel being in a different directory, using --with-zaptel.
........
................
r49709 | mogorman | 2007-01-05 18:31:33 -0500 (Fri, 05 Jan 2007) | 2 lines
no need to spam everyone with show transcoder messages
................
r49711 | kpfleming | 2007-01-05 18:32:42 -0500 (Fri, 05 Jan 2007) | 2 lines
const-ify some more APIs, and fix rev 49710 from branch-1.4 in a better way here
................
r49713 | kpfleming | 2007-01-05 18:41:33 -0500 (Fri, 05 Jan 2007) | 10 lines
Merged revisions 49712 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49712 | kpfleming | 2007-01-05 17:40:29 -0600 (Fri, 05 Jan 2007) | 2 lines
if --with-foo=<path> is specific for a configure option, ensure that it is used for header file checking as well
........
................
r49716 | file | 2007-01-05 18:51:43 -0500 (Fri, 05 Jan 2007) | 2 lines
It is possible for framein to get called and no channel be available, so do a check before we increment the count.
................
r49727 | kpfleming | 2007-01-05 18:58:53 -0500 (Fri, 05 Jan 2007) | 2 lines
a little more const-ification
................
r49730 | kpfleming | 2007-01-05 19:00:19 -0500 (Fri, 05 Jan 2007) | 15 lines
Merged revisions 49714-49715 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49714 | kpfleming | 2007-01-05 17:49:52 -0600 (Fri, 05 Jan 2007) | 2 lines
proper fix for r49712
........
r49715 | kpfleming | 2007-01-05 17:51:31 -0600 (Fri, 05 Jan 2007) | 2 lines
one more time...
........
................
r49735 | kpfleming | 2007-01-05 19:02:06 -0500 (Fri, 05 Jan 2007) | 2 lines
probably shouldn't leave the mmap'ed file hanging around in memory
................
r49741 | kpfleming | 2007-01-05 19:13:33 -0500 (Fri, 05 Jan 2007) | 2 lines
finish const-ifying ast_func_read()
................
r49743 | qwell | 2007-01-05 19:28:16 -0500 (Fri, 05 Jan 2007) | 15 lines
Merged revisions 49742 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49742 | qwell | 2007-01-05 18:24:38 -0600 (Fri, 05 Jan 2007) | 7 lines
Save 1 whopping byte of allocated memory!
This looks like it may have been a chicken/egg scenario..
You had to call a cleanup func, because everything was allocated.
Then since you had to call a cleanup func, you were forced to allocate - ie; strdup("").
........
................
r49769 | qwell | 2007-01-07 02:43:52 -0500 (Sun, 07 Jan 2007) | 2 lines
Fix a segfault when using "countries" that don't have a matching zone.
................
r49784 | tilghman | 2007-01-07 09:32:20 -0500 (Sun, 07 Jan 2007) | 2 lines
Reduce duplication of code (Issue 6542)
................
r49785 | tilghman | 2007-01-07 09:40:48 -0500 (Sun, 07 Jan 2007) | 2 lines
Add function to execute a shell command and return the output (Issue 8676)
................
r49786 | tilghman | 2007-01-07 09:44:49 -0500 (Sun, 07 Jan 2007) | 2 lines
Modifications to allow the output of SHELL() to be split per line (Issue 8676)
................
r49801 | tilghman | 2007-01-07 11:21:12 -0500 (Sun, 07 Jan 2007) | 4 lines
When calling the Realtime app more than once, unset fields which were
previously set are erroneously still set (Bug 6701). After discussion,
it was determined this should only be changed in trunk.
................
r49816 | file | 2007-01-07 14:00:36 -0500 (Sun, 07 Jan 2007) | 2 lines
One const, two const. Let's stick with everything else - one const. Plus older versions of GCC don't support double const either.
................
r49832 | tilghman | 2007-01-07 16:26:43 -0500 (Sun, 07 Jan 2007) | 10 lines
Merged revisions 49831 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49831 | tilghman | 2007-01-07 15:24:04 -0600 (Sun, 07 Jan 2007) | 2 lines
Second condition was a subset of the first, so hold was never decremented, thus hint stayed stuck (Issue 8747)
........
................
r49835 | tilghman | 2007-01-07 16:46:38 -0500 (Sun, 07 Jan 2007) | 18 lines
Merged revisions 49834 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r49834 | tilghman | 2007-01-07 15:44:52 -0600 (Sun, 07 Jan 2007) | 10 lines
Merged revisions 49833 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r49833 | tilghman | 2007-01-07 15:43:10 -0600 (Sun, 07 Jan 2007) | 2 lines
If openstream fails, then we crash (Issue 8564)
........
................
................
r49870 | kpfleming | 2007-01-07 22:56:06 -0500 (Sun, 07 Jan 2007) | 10 lines
Merged revisions 49866 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49866 | kpfleming | 2007-01-07 21:53:53 -0600 (Sun, 07 Jan 2007) | 2 lines
since we use AC_PATH_TOOL to find tools, we should use the results it provides for us (reported by Brian Capouch on the asterisk-dev list)
........
................
r49891 | file | 2007-01-08 00:13:24 -0500 (Mon, 08 Jan 2007) | 18 lines
Merged revisions 49890 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r49890 | file | 2007-01-08 00:11:54 -0500 (Mon, 08 Jan 2007) | 10 lines
Merged revisions 49889 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r49889 | file | 2007-01-08 00:10:07 -0500 (Mon, 08 Jan 2007) | 2 lines
Ensure we use the default refresh value of 60 if the remote server does not send one. (issue #8746 reported by maethor)
........
................
................
r49931 | oej | 2007-01-08 03:57:35 -0500 (Mon, 08 Jan 2007) | 10 lines
Merged revisions 49925 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49925 | oej | 2007-01-08 09:55:03 +0100 (Mon, 08 Jan 2007) | 2 lines
Issue 8735: Terminate state when extension is unavailable for subscription
........
................
r49946 | oej | 2007-01-08 04:22:53 -0500 (Mon, 08 Jan 2007) | 10 lines
Merged revisions 49945 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49945 | oej | 2007-01-08 10:08:10 +0100 (Mon, 08 Jan 2007) | 2 lines
We only need one forward declaration
........
................
r49968 | oej | 2007-01-08 06:49:23 -0500 (Mon, 08 Jan 2007) | 2 lines
Issue #8663 - Add passthrough support for MPEG4 (neutrino88).
................
r49984 | oej | 2007-01-08 08:34:56 -0500 (Mon, 08 Jan 2007) | 11 lines
Merged revisions 49983 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49983 | oej | 2007-01-08 14:28:18 +0100 (Mon, 08 Jan 2007) | 3 lines
Issue #8524, support multiple via header values (tardieu)
Thanks!
........
................
r50007 | oej | 2007-01-08 09:31:16 -0500 (Mon, 08 Jan 2007) | 19 lines
Merged revisions 50006 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r50006 | oej | 2007-01-08 15:26:14 +0100 (Mon, 08 Jan 2007) | 11 lines
Issue #8677 - Handle failure of T.38 re-invite
This is not a fix, but adding an error message to tell the admin that
we have a bad configuration. We should not send T.38 re-invites to devices
that can't handle it (with the current architecture where you have to
hard-code t.38 support per device).
To really fix this, we need to figure out a way to tell the incoming
call that the re-invite failed, so we can signal failure on that
end and go back to the original call.
........
................
r50033 | file | 2007-01-08 13:23:39 -0500 (Mon, 08 Jan 2007) | 10 lines
Merged revisions 50032 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r50032 | file | 2007-01-08 13:21:31 -0500 (Mon, 08 Jan 2007) | 2 lines
Disable the more intense packet2packet bridging until the bugs can be worked out.
........
................
r50034 | file | 2007-01-08 13:26:50 -0500 (Mon, 08 Jan 2007) | 2 lines
Change trylock output for what already has the lock from an error to a warning.
................
r50056 | file | 2007-01-08 15:10:23 -0500 (Mon, 08 Jan 2007) | 2 lines
Make callback declaration match one used in trunk.
................
r50074 | mogorman | 2007-01-08 16:17:51 -0500 (Mon, 08 Jan 2007) | 9 lines
Merged revisions 50073 via svnmerge from
https://svn.digium.com/svn/asterisk/branches/1.4
........
r50073 | mogorman | 2007-01-08 15:11:16 -0600 (Mon, 08 Jan 2007) | 1 line
we can't unlock a channel if we cant find it. - AnthonyL bug #8741
........
................
r50075 | file | 2007-01-08 16:40:45 -0500 (Mon, 08 Jan 2007) | 2 lines
Move channel acquisition to when the translation path is setup, and clean up.
................
r50099 | qwell | 2007-01-08 18:40:28 -0500 (Mon, 08 Jan 2007) | 12 lines
Merged revisions 50098 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r50098 | qwell | 2007-01-08 17:39:12 -0600 (Mon, 08 Jan 2007) | 4 lines
Fix an issue with voicemail and users.conf, where it wouldn't ever parse a password, since it was using "secret" instead of "password"
Issue 8761, reported by and patch suggestion from ssokol.
........
................
r50132 | oej | 2007-01-09 07:25:33 -0500 (Tue, 09 Jan 2007) | 13 lines
Based on the following patch, changed for trunk...
Merged revisions 50124 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r50124 | oej | 2007-01-09 12:25:20 +0100 (Tue, 09 Jan 2007) | 3 lines
- handle re-invites properly in sip_hangup()
- Add some invitestate status changes just to be sure
........
................
r50152 | tilghman | 2007-01-09 08:45:14 -0500 (Tue, 09 Jan 2007) | 20 lines
Merged revisions 50151 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r50151 | tilghman | 2007-01-09 07:40:45 -0600 (Tue, 09 Jan 2007) | 12 lines
Merged revisions 50150 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r50150 | tilghman | 2007-01-09 07:30:04 -0600 (Tue, 09 Jan 2007) | 4 lines
The advent of realtime has enabled people to use commas in the fullname field.
This could cause an issue with sending voicemails, when the field is unquoted.
(Issue 8595)
........
................
................
r50187 | qwell | 2007-01-09 12:12:45 -0500 (Tue, 09 Jan 2007) | 11 lines
Blocked revisions 50186 via svnmerge
........
r50186 | qwell | 2007-01-09 11:11:53 -0600 (Tue, 09 Jan 2007) | 4 lines
Re-add CLI command that should have only been deprecated in 1.4.
Thanks kshumard! (reported in person, so no associated issue #)
........
................
Added:
team/russell/chan_console/funcs/func_shell.c
- copied unchanged from r50187, trunk/funcs/func_shell.c
Modified:
team/russell/chan_console/ (props changed)
team/russell/chan_console/acinclude.m4
team/russell/chan_console/apps/app_dictate.c
team/russell/chan_console/apps/app_queue.c
team/russell/chan_console/apps/app_senddtmf.c
team/russell/chan_console/apps/app_speech_utils.c
team/russell/chan_console/apps/app_voicemail.c
team/russell/chan_console/channels/chan_agent.c
team/russell/chan_console/channels/chan_iax2.c
team/russell/chan_console/channels/chan_sip.c
team/russell/chan_console/channels/chan_zap.c
team/russell/chan_console/codecs/codec_zap.c
team/russell/chan_console/configure
team/russell/chan_console/configure.ac
team/russell/chan_console/funcs/func_base64.c
team/russell/chan_console/funcs/func_blacklist.c
team/russell/chan_console/funcs/func_callerid.c
team/russell/chan_console/funcs/func_cdr.c
team/russell/chan_console/funcs/func_channel.c
team/russell/chan_console/funcs/func_curl.c
team/russell/chan_console/funcs/func_cut.c
team/russell/chan_console/funcs/func_db.c
team/russell/chan_console/funcs/func_enum.c
team/russell/chan_console/funcs/func_env.c
team/russell/chan_console/funcs/func_global.c
team/russell/chan_console/funcs/func_groupcount.c
team/russell/chan_console/funcs/func_logic.c
team/russell/chan_console/funcs/func_math.c
team/russell/chan_console/funcs/func_md5.c
team/russell/chan_console/funcs/func_module.c
team/russell/chan_console/funcs/func_odbc.c
team/russell/chan_console/funcs/func_rand.c
team/russell/chan_console/funcs/func_realtime.c
team/russell/chan_console/funcs/func_sha1.c
team/russell/chan_console/funcs/func_strings.c
team/russell/chan_console/funcs/func_timeout.c
team/russell/chan_console/funcs/func_uri.c
team/russell/chan_console/funcs/func_version.c
team/russell/chan_console/funcs/func_vmcount.c
team/russell/chan_console/include/asterisk/astdb.h
team/russell/chan_console/include/asterisk/channel.h
team/russell/chan_console/include/asterisk/config.h
team/russell/chan_console/include/asterisk/frame.h
team/russell/chan_console/include/asterisk/lock.h
team/russell/chan_console/include/asterisk/pbx.h
team/russell/chan_console/main/channel.c
team/russell/chan_console/main/config.c
team/russell/chan_console/main/db.c
team/russell/chan_console/main/frame.c
team/russell/chan_console/main/indications.c
team/russell/chan_console/main/manager.c
team/russell/chan_console/main/pbx.c
team/russell/chan_console/main/rtp.c
team/russell/chan_console/pbx/pbx_config.c
team/russell/chan_console/pbx/pbx_dundi.c
team/russell/chan_console/res/res_config_odbc.c
team/russell/chan_console/res/res_features.c
team/russell/chan_console/res/res_realtime.c
Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
automerge = *
Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 9 20:05:12 2007
@@ -1,1 +1,1 @@
-/trunk:1-49699
+/trunk:1-50221
Modified: team/russell/chan_console/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/acinclude.m4?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/acinclude.m4 (original)
+++ team/russell/chan_console/acinclude.m4 Tue Jan 9 20:05:12 2007
@@ -123,12 +123,15 @@
if test "x${$1_DIR}" != "x"; then
$1_LIB="${pbxlibdir} ${$1_LIB}"
$1_INCLUDE="-I${$1_DIR}/include"
+ saved_cppflags="${CPPFLAGS}"
+ CPPFLAGS="${CPPFLAGS} -I${$1_DIR}/include"
if test "x$4" != "x" ; then
- AC_CHECK_HEADER([${$1_DIR}/include/$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
+ AC_CHECK_HEADER([${$1_DIR}/include/$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
fi
+ CPPFLAGS="${saved_cppflags}"
else
if test "x$4" != "x" ; then
- AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
+ AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
fi
fi
if test "x${$1_HEADER_FOUND}" = "x0" ; then
Modified: team/russell/chan_console/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_dictate.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/apps/app_dictate.c (original)
+++ team/russell/chan_console/apps/app_dictate.c Tue Jan 9 20:05:12 2007
@@ -267,7 +267,8 @@
if (lastop != DFLAG_PLAY) {
lastop = DFLAG_PLAY;
ast_closestream(fs);
- fs = ast_openstream(chan, path, chan->language);
+ if (!(fs = ast_openstream(chan, path, chan->language)))
+ break;
ast_seekstream(fs, samples, SEEK_SET);
chan->stream = NULL;
}
Modified: team/russell/chan_console/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_queue.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/apps/app_queue.c (original)
+++ team/russell/chan_console/apps/app_queue.c Tue Jan 9 20:05:12 2007
@@ -3637,7 +3637,7 @@
return res;
}
-static int queue_function_var(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int queue_function_var(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
int res = -1;
struct call_queue *q;
@@ -3689,7 +3689,7 @@
return 0;
}
-static int queue_function_qac(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int queue_function_qac(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
int count = 0;
struct call_queue *q;
@@ -3731,7 +3731,7 @@
return 0;
}
-static int queue_function_queuewaitingcount(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int queue_function_queuewaitingcount(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
int count = 0;
struct call_queue *q;
@@ -3766,7 +3766,7 @@
return 0;
}
-static int queue_function_queuememberlist(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int queue_function_queuememberlist(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
struct ast_module_user *u;
struct call_queue *q;
Modified: team/russell/chan_console/apps/app_senddtmf.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_senddtmf.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/apps/app_senddtmf.c (original)
+++ team/russell/chan_console/apps/app_senddtmf.c Tue Jan 9 20:05:12 2007
@@ -102,7 +102,6 @@
if (!chan) {
astman_send_error(s, m, "Channel not specified");
- ast_mutex_unlock(&chan->lock);
return 0;
}
if (!digit) {
Modified: team/russell/chan_console/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_speech_utils.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/apps/app_speech_utils.c (original)
+++ team/russell/chan_console/apps/app_speech_utils.c Tue Jan 9 20:05:12 2007
@@ -144,7 +144,7 @@
}
/*! \brief SPEECH_SCORE() Dialplan Function */
-static int speech_score(struct ast_channel *chan, char *cmd, char *data,
+static int speech_score(struct ast_channel *chan, const char *cmd, char *data,
char *buf, size_t len)
{
struct ast_speech_result *result = NULL;
@@ -172,7 +172,7 @@
};
/*! \brief SPEECH_TEXT() Dialplan Function */
-static int speech_text(struct ast_channel *chan, char *cmd, char *data,
+static int speech_text(struct ast_channel *chan, const char *cmd, char *data,
char *buf, size_t len)
{
struct ast_speech_result *result = NULL;
@@ -198,7 +198,7 @@
};
/*! \brief SPEECH_GRAMMAR() Dialplan Function */
-static int speech_grammar(struct ast_channel *chan, char *cmd, char *data,
+static int speech_grammar(struct ast_channel *chan, const char *cmd, char *data,
char *buf, size_t len)
{
struct ast_speech_result *result = NULL;
@@ -224,7 +224,7 @@
};
/*! \brief SPEECH_ENGINE() Dialplan Function */
-static int speech_engine_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
+static int speech_engine_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
{
struct ast_speech *speech = find_speech(chan);
@@ -247,7 +247,7 @@
};
/*! \brief SPEECH() Dialplan Function */
-static int speech_read(struct ast_channel *chan, char *cmd, char *data,
+static int speech_read(struct ast_channel *chan, const char *cmd, char *data,
char *buf, size_t len)
{
int results = 0;
Modified: team/russell/chan_console/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_voicemail.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/apps/app_voicemail.c (original)
+++ team/russell/chan_console/apps/app_voicemail.c Tue Jan 9 20:05:12 2007
@@ -679,7 +679,7 @@
tmp = var;
while (tmp) {
ast_log(LOG_DEBUG, "Name: %s Value: %s\n", tmp->name, tmp->value);
- if (!strcasecmp(tmp->name, "password")) {
+ if (!strcasecmp(tmp->name, "password") || !strcasecmp(tmp->name, "secret")) {
ast_copy_string(retval->password, tmp->value, sizeof(retval->password));
} else if (!strcasecmp(tmp->name, "uniqueid")) {
ast_copy_string(retval->uniqueid, tmp->value, sizeof(retval->uniqueid));
@@ -1848,6 +1848,22 @@
pbx_builtin_setvar_helper(ast, "VM_CATEGORY", category ? ast_strdupa(category) : "no category");
}
+static char *quote(const char *from, char *to, size_t len)
+{
+ char *ptr = to;
+ *ptr++ = '"';
+ for (; ptr < to + len - 1; from++) {
+ if (*from == '"')
+ *ptr++ = '\\';
+ else if (*from == '\0')
+ break;
+ *ptr++ = *from;
+ }
+ if (ptr < to + len - 1)
+ *ptr++ = '"';
+ *ptr = '\0';
+ return to;
+}
/*
* fill in *tm for current time according to the proper timezone, if any.
* Return tm so it can be used as a function argument.
@@ -1896,6 +1912,8 @@
char dur[256];
char tmpcmd[256];
struct tm tm;
+ char *passdata2;
+ size_t len_passdata;
gethostname(host, sizeof(host)-1);
if (strchr(srcemail, '@'))
@@ -1919,7 +1937,9 @@
memset(passdata, 0, vmlen);
prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category);
pbx_substitute_variables_helper(ast, fromstring, passdata, vmlen);
- fprintf(p, "From: %s <%s>\r\n",passdata,who);
+ len_passdata = strlen(passdata) * 2 + 1;
+ passdata2 = alloca(len_passdata);
+ fprintf(p, "From: %s <%s>\r\n", quote(passdata, passdata2, len_passdata), who);
} else
ast_log(LOG_WARNING, "Cannot allocate workspace for variable substitution\n");
ast_channel_free(ast);
@@ -1927,7 +1947,9 @@
ast_log(LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
} else
fprintf(p, "From: Asterisk PBX <%s>\r\n", who);
- fprintf(p, "To: %s <%s>\r\n", vmu->fullname, vmu->email);
+ len_passdata = strlen(vmu->fullname) * 2 + 1;
+ passdata2 = alloca(len_passdata);
+ fprintf(p, "To: %s <%s>\r\n", quote(vmu->fullname, passdata2, len_passdata), vmu->email);
if (emailsubject) {
struct ast_channel *ast;
if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, 0))) {
@@ -6914,7 +6936,7 @@
return 0;
}
-static int acf_mailbox_exists(struct ast_channel *chan, char *cmd, char *args, char *buf, size_t len)
+static int acf_mailbox_exists(struct ast_channel *chan, const char *cmd, char *args, char *buf, size_t len)
{
struct ast_vm_user svm;
AST_DECLARE_APP_ARGS(arg,
Modified: team/russell/chan_console/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_agent.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/channels/chan_agent.c (original)
+++ team/russell/chan_console/channels/chan_agent.c Tue Jan 9 20:05:12 2007
@@ -2384,7 +2384,7 @@
return cur;
}
-static int function_agent(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int function_agent(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
char *parse;
AST_DECLARE_APP_ARGS(args,
Modified: team/russell/chan_console/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_iax2.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/channels/chan_iax2.c (original)
+++ team/russell/chan_console/channels/chan_iax2.c Tue Jan 9 20:05:12 2007
@@ -5423,7 +5423,7 @@
/* Start pessimistic */
char peer[256] = "";
char msgstatus[60];
- int refresh = 0;
+ int refresh = 60;
char ourip[256] = "<Unspecified>";
struct sockaddr_in oldus;
struct sockaddr_in us;
@@ -9589,7 +9589,7 @@
return -1;
}
-static int function_iaxpeer(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int function_iaxpeer(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
struct iax2_peer *peer;
char *peername, *colname;
Modified: team/russell/chan_console/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_sip.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/channels/chan_sip.c (original)
+++ team/russell/chan_console/channels/chan_sip.c Tue Jan 9 20:05:12 2007
@@ -1395,10 +1395,6 @@
static int sip_notify(int fd, int argc, char *argv[]);
static int sip_do_history(int fd, int argc, char *argv[]);
static int sip_no_history(int fd, int argc, char *argv[]);
-static int func_header_read(struct ast_channel *chan, char *function, char *data, char *buf, size_t len);
-static int func_check_sipdomain(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len);
-static int function_sippeer(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len);
-static int function_sipchaninfo_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len);
static int sip_dtmfmode(struct ast_channel *chan, void *data);
static int sip_addheader(struct ast_channel *chan, void *data);
static int sip_do_reload(enum channelreloadreason reason);
@@ -1523,7 +1519,6 @@
static int handle_request_options(struct sip_pvt *p, struct sip_request *req);
static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, int debug, int ignore, int seqno, struct sockaddr_in *sin);
static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, char *e);
-static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, int debug, int ignore, int seqno, struct sockaddr_in *sin);
static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *current, struct sip_request *req, int seqno);
/*------Response handling functions */
@@ -3411,7 +3406,8 @@
return 0;
}
/* If the call is not UP, we need to send CANCEL instead of BYE */
- if (p->invitestate < INV_COMPLETED) {
+ /* In case of re-invites, the call might be UP even though we have an incomplete invite transaction */
+ if (p->invitestate < INV_COMPLETED && p->owner->_state != AST_STATE_UP) {
needcancel = TRUE;
if (option_debug > 3)
ast_log(LOG_DEBUG, "Hanging up channel in state %s (not UP)\n", ast_state2str(ast->_state));
@@ -3761,7 +3757,7 @@
case AST_CONTROL_BUSY:
if (ast->_state != AST_STATE_UP) {
transmit_response(p, "486 Busy Here", &p->initreq);
- p->invitestate = INV_TERMINATED;
+ p->invitestate = INV_COMPLETED;
sip_alreadygone(p);
ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
break;
@@ -3771,7 +3767,7 @@
case AST_CONTROL_CONGESTION:
if (ast->_state != AST_STATE_UP) {
transmit_response(p, "503 Service Unavailable", &p->initreq);
- p->invitestate = INV_TERMINATED;
+ p->invitestate = INV_COMPLETED;
sip_alreadygone(p);
ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
break;
@@ -5435,21 +5431,25 @@
break;
if (!copied) { /* Only check for empty rport in topmost via header */
- char *rport;
+ char leftmost[256], *others, *rport;
+
+ /* Only work on leftmost value */
+ ast_copy_string(leftmost, oh, sizeof(leftmost));
+ others = strchr(leftmost, ',');
+ if (others)
+ *others++ = '\0';
/* Find ;rport; (empty request) */
- rport = strstr(oh, ";rport");
+ rport = strstr(leftmost, ";rport");
if (rport && *(rport+6) == '=')
rport = NULL; /* We already have a parameter to rport */
/* Check rport if NAT=yes or NAT=rfc3581 (which is the default setting) */
if (rport && ((ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_ALWAYS) || (ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_RFC3581))) {
/* We need to add received port - rport */
- char tmp[256], *end;
-
- ast_copy_string(tmp, oh, sizeof(tmp));
-
- rport = strstr(tmp, ";rport");
+ char *end;
+
+ rport = strstr(leftmost, ";rport");
if (rport) {
end = strchr(rport + 1, ';');
@@ -5460,13 +5460,15 @@
}
/* Add rport to first VIA header if requested */
- snprintf(new, sizeof(new), "%s;received=%s;rport=%d",
- tmp, ast_inet_ntoa(p->recv.sin_addr),
- ntohs(p->recv.sin_port));
+ snprintf(new, sizeof(new), "%s;received=%s;rport=%d%s%s",
+ leftmost, ast_inet_ntoa(p->recv.sin_addr),
+ ntohs(p->recv.sin_port),
+ others ? "," : "", others ? others : "");
} else {
/* We should *always* add a received to the topmost via */
- snprintf(new, sizeof(new), "%s;received=%s",
- oh, ast_inet_ntoa(p->recv.sin_addr));
+ snprintf(new, sizeof(new), "%s;received=%s%s%s",
+ leftmost, ast_inet_ntoa(p->recv.sin_addr),
+ others ? "," : "", others ? others : "");
}
oh = new; /* the header to copy */
} /* else add the following via headers untouched */
@@ -6922,7 +6924,7 @@
pidfnote = "On the phone";
break;
case AST_EXTENSION_UNAVAILABLE:
- statestring = "confirmed";
+ statestring = "terminated";
local_state = NOTIFY_CLOSED;
pidfstate = "away";
pidfnote = "Unavailable";
@@ -8181,7 +8183,7 @@
/* If they put someone on hold, increment the value... otherwise decrement it */
if (hold)
peer->onHold++;
- else if (hold > 0)
+ else
peer->onHold--;
/* Request device state update */
@@ -8901,6 +8903,11 @@
struct ast_hostent ahp;
ast_copy_string(via, get_header(req, "Via"), sizeof(via));
+
+ /* Work on the leftmost value of the topmost Via header */
+ c = strchr(via, ',');
+ if (c)
+ *c = '\0';
/* Check for rport */
c = strstr(via, ";rport");
@@ -11403,7 +11410,7 @@
" Provides detailed list of the configuration of the SIP channel.\n";
/*! \brief Read SIP header (dialplan function) */
-static int func_header_read(struct ast_channel *chan, char *function, char *data, char *buf, size_t len)
+static int func_header_read(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len)
{
struct sip_pvt *p;
const char *content = NULL;
@@ -11467,7 +11474,7 @@
};
/*! \brief Dial plan function to check if domain is local */
-static int func_check_sipdomain(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int func_check_sipdomain(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "CHECKSIPDOMAIN requires an argument - A domain name\n");
@@ -11492,7 +11499,7 @@
};
/*! \brief ${SIPPEER()} Dialplan function - reads peer data */
-static int function_sippeer(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int function_sippeer(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
struct sip_peer *peer;
char *colname;
@@ -11582,7 +11589,7 @@
};
/*! \brief ${SIPCHANINFO()} Dialplan function - reads sip channel data */
-static int function_sipchaninfo_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int function_sipchaninfo_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
struct sip_pvt *p;
@@ -11959,6 +11966,33 @@
ast_queue_hangup(p->owner);
else if (!ast_test_flag(req, SIP_PKT_IGNORE))
update_call_counter(p, DEC_CALL_LIMIT);
+ break;
+ case 488: /* Not acceptable here */
+ transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
+ if (reinvite && p->udptl) {
+ /* If this is a T.38 call, we should go back to
+ audio. If this is an audio call - something went
+ terribly wrong since we don't renegotiate codecs,
+ only IP/port .
+ */
+ p->t38.state = T38_DISABLED;
+ /* Try to reset RTP timers */
+ ast_rtp_set_rtptimers_onhold(p->rtp);
+ ast_log(LOG_ERROR, "Got error on T.38 re-invite. Bad configuration. Peer needs to have T.38 disabled.\n");
+
+ /*! \bug Is there any way we can go back to the audio call on both
+ sides here?
+ */
+ /* While figuring that out, hangup the call */
+ if (p->owner && !ast_test_flag(req, SIP_PKT_IGNORE))
+ ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+ ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ } else {
+ /* We can't set up this call, so give up */
+ if (p->owner && !ast_test_flag(req, SIP_PKT_IGNORE))
+ ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+ ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ }
break;
case 491: /* Pending */
/* we really should have to wait a while, then retransmit */
@@ -12398,6 +12432,10 @@
if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, seqno);
break;
+ case 488: /* Not acceptable here - codec error */
+ if (sipmethod == SIP_INVITE)
+ handle_response_invite(p, resp, rest, req, seqno);
+ break;
case 491: /* Pending */
if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, seqno);
@@ -12454,7 +12492,6 @@
ast_string_field_build(p->owner, call_forward,
"Local/%s@%s", p->username, p->context);
/* Fall through */
- case 488: /* Not acceptable here - codec error */
case 480: /* Temporarily Unavailable */
case 404: /* Not Found */
case 410: /* Gone */
@@ -13231,6 +13268,7 @@
/* At this point we only support REPLACES */
transmit_response_with_unsupported(p, "420 Bad extension (unsupported)", req, required);
ast_log(LOG_WARNING,"Received SIP INVITE with unsupported required extension: %s\n", required);
+ p->invitestate = INV_COMPLETED;
if (!p->lastinvite)
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
return -1;
@@ -13245,6 +13283,7 @@
/* If pedantic is on, we need to check the tags. If they're different, this is
in fact a forked call through a SIP proxy somewhere. */
transmit_response(p, "482 Loop Detected", req);
+ p->invitestate = INV_COMPLETED;
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
return 0;
}
@@ -13285,6 +13324,7 @@
transmit_response(p, "500 Server Internal Error", req);
append_history(p, "Xfer", "INVITE/Replace Failed. Out of memory.");
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+ p->invitestate = INV_COMPLETED;
return -1;
}
@@ -13358,6 +13398,7 @@
sip_pvt_unlock(p->refer->refer_call);
ast_channel_unlock(p->refer->refer_call->owner);
}
+ p->invitestate = INV_COMPLETED;
return -1;
}
}
@@ -13410,6 +13451,7 @@
/* Handle authentication if this is our first invite */
res = check_user(p, req, SIP_INVITE, e, XMIT_RELIABLE, sin);
if (res == AUTH_CHALLENGE_SENT)
+ p->invitestate = INV_COMPLETED; /* Needs to restart in another INVITE transaction */
return 0;
if (res < 0) { /* Something failed in authentication */
if (res == AUTH_FAKE_AUTH) {
@@ -13419,6 +13461,7 @@
ast_log(LOG_NOTICE, "Failed to authenticate user %s\n", get_header(req, "From"));
transmit_response_reliable(p, "403 Forbidden", req);
}
+ p->invitestate = INV_COMPLETED;
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
ast_string_field_free(p, theirtag);
return 0;
@@ -13429,6 +13472,7 @@
if (process_sdp(p, req)) {
/* Unacceptable codecs */
transmit_response_reliable(p, "488 Not acceptable here", req);
+ p->invitestate = INV_COMPLETED;
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
if (option_debug)
ast_log(LOG_DEBUG, "No compatible codecs for this SIP call.\n");
@@ -13459,6 +13503,7 @@
ast_log(LOG_NOTICE, "Failed to place call for user %s, too many calls\n", p->username);
transmit_response_reliable(p, "480 Temporarily Unavailable (Call limit) ", req);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+ p->invitestate = INV_COMPLETED;
}
return 0;
}
@@ -13477,6 +13522,7 @@
transmit_response_reliable(p, "484 Address Incomplete", req);
else
transmit_response_reliable(p, "404 Not Found", req);
+ p->invitestate = INV_COMPLETED;
update_call_counter(p, DEC_CALL_LIMIT);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
return 0;
@@ -13677,6 +13723,7 @@
/* No bridged peer with T38 enabled*/
}
}
+ /* Respond to normal re-invite */
if (sendok)
transmit_response_with_sdp(p, "200 OK", req, XMIT_CRITICAL);
@@ -14761,7 +14808,7 @@
case SIP_ACK:
/* Make sure we don't ignore this */
if (seqno == p->pendinginvite) {
- p->invitestate = INV_CONFIRMED;
+ p->invitestate = INV_TERMINATED;
p->pendinginvite = 0;
__sip_ack(p, seqno, FLAG_RESPONSE, 0);
if (find_sdp(req)) {
Modified: team/russell/chan_console/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_zap.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/channels/chan_zap.c (original)
+++ team/russell/chan_console/channels/chan_zap.c Tue Jan 9 20:05:12 2007
@@ -39,6 +39,7 @@
/*** MODULEINFO
<depend>zaptel_vldtmf</depend>
+ <depend>zaptel</depend>
<depend>tonezone</depend>
<use>pri</use>
<use>ss7</use>
@@ -762,7 +763,7 @@
static int zt_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen);
static int zt_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static int zt_setoption(struct ast_channel *chan, int option, void *data, int datalen);
-static int zt_func_read(struct ast_channel *chan, char *function, char *data, char *buf, size_t len);
+static int zt_func_read(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len);
static const struct ast_channel_tech zap_tech = {
.type = "Zap",
@@ -3248,7 +3249,7 @@
return 0;
}
-static int zt_func_read(struct ast_channel *chan, char *function, char *data, char *buf, size_t len)
+static int zt_func_read(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len)
{
struct zt_pvt *p = chan->tech_pvt;
Modified: team/russell/chan_console/codecs/codec_zap.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/codecs/codec_zap.c?view=diff&rev=50226&r1=50225&r2=50226
==============================================================================
--- team/russell/chan_console/codecs/codec_zap.c (original)
+++ team/russell/chan_console/codecs/codec_zap.c Tue Jan 9 20:05:12 2007
@@ -28,6 +28,7 @@
/*** MODULEINFO
[... 2308 lines stripped ...]
More information about the asterisk-commits
mailing list