[asterisk-commits] murf: branch murf/bug_7506 r47071 - in
/team/murf/bug_7506: apps/ channels/ i...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Nov 2 22:33:54 MST 2006
Author: murf
Date: Thu Nov 2 23:33:53 2006
New Revision: 47071
URL: http://svn.digium.com/view/asterisk?rev=47071&view=rev
Log:
A little more work; still have some issues to resolve.
Modified:
team/murf/bug_7506/apps/app_voicemail.c
team/murf/bug_7506/channels/chan_iax2.c
team/murf/bug_7506/include/asterisk/stringfields.h
team/murf/bug_7506/main/channel.c
team/murf/bug_7506/main/pbx.c
team/murf/bug_7506/res/res_features.c
Modified: team/murf/bug_7506/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7506/apps/app_voicemail.c?rev=47071&r1=47070&r2=47071&view=diff
==============================================================================
--- team/murf/bug_7506/apps/app_voicemail.c (original)
+++ team/murf/bug_7506/apps/app_voicemail.c Thu Nov 2 23:33:53 2006
@@ -1893,7 +1893,7 @@
if (*fromstring) {
struct ast_channel *ast;
- if ((ast = ast_channel_alloc(0))) {
+ if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "nix"))) {
char *passdata;
int vmlen = strlen(fromstring)*3 + 200;
if ((passdata = alloca(vmlen))) {
@@ -1912,7 +1912,7 @@
if (emailsubject) {
struct ast_channel *ast;
- if ((ast = ast_channel_alloc(0))) {
+ if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "nix"))) {
char *passdata;
int vmlen = strlen(emailsubject)*3 + 200;
if ((passdata = alloca(vmlen))) {
@@ -1967,7 +1967,7 @@
fprintf(p, "Content-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n\n", charset);
if (emailbody) {
struct ast_channel *ast;
- if ((ast = ast_channel_alloc(0))) {
+ if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "nix"))) {
char *passdata;
int vmlen = strlen(emailbody)*3 + 200;
if ((passdata = alloca(vmlen))) {
@@ -2066,7 +2066,7 @@
if (*pagerfromstring) {
struct ast_channel *ast;
- if ((ast = ast_channel_alloc(0))) {
+ if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "nix"))) {
char *passdata;
int vmlen = strlen(fromstring)*3 + 200;
if ((passdata = alloca(vmlen))) {
@@ -2083,7 +2083,7 @@
fprintf(p, "To: %s\n", pager);
if (pagersubject) {
struct ast_channel *ast;
- if ((ast = ast_channel_alloc(0))) {
+ if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "nix"))) {
char *passdata;
int vmlen = strlen(pagersubject) * 3 + 200;
if ((passdata = alloca(vmlen))) {
@@ -2099,7 +2099,7 @@
strftime(date, sizeof(date), "%A, %B %d, %Y at %r", &tm);
if (pagerbody) {
struct ast_channel *ast;
- if ((ast = ast_channel_alloc(0))) {
+ if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "nix"))) {
char *passdata;
int vmlen = strlen(pagerbody)*3 + 200;
if ((passdata = alloca(vmlen))) {
Modified: team/murf/bug_7506/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7506/channels/chan_iax2.c?rev=47071&r1=47070&r2=47071&view=diff
==============================================================================
--- team/murf/bug_7506/channels/chan_iax2.c (original)
+++ team/murf/bug_7506/channels/chan_iax2.c Thu Nov 2 23:33:53 2006
@@ -6110,9 +6110,8 @@
struct iax_dual *d;
struct ast_channel *chan1m, *chan2m;
pthread_t th;
- tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "IAX2/%s-%d", i->host, i->callno);
- chan1m = ast_channel_alloc(0, state, 0, 0, "Parking/%s", chan1->name);
- chan2m = ast_channel_alloc(0, state, 0, 0, "IAXPeer/%s",chan2->name);
+ chan1m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "Parking/%s", chan1->name);
+ chan2m = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "IAXPeer/%s",chan2->name);
if (chan2m && chan1m) {
/* Make formats okay */
chan1m->readformat = chan1->readformat;
Modified: team/murf/bug_7506/include/asterisk/stringfields.h
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7506/include/asterisk/stringfields.h?rev=47071&r1=47070&r2=47071&view=diff
==============================================================================
--- team/murf/bug_7506/include/asterisk/stringfields.h (original)
+++ team/murf/bug_7506/include/asterisk/stringfields.h Thu Nov 2 23:33:53 2006
@@ -322,8 +322,8 @@
\param argslist a va_list of the args
\return nothing
*/
-#define ast_string_field_build_va(x, field, fmt, argslist) \
- ast_string_field_index_build_va(x, ast_string_field_index(x, field), fmt, argslist)
+#define ast_string_field_build_va(x, field, fmt, args1, args2) \
+ ast_string_field_index_build_va(x, ast_string_field_index(x, field), fmt, args1, args2)
/*!
\brief Free a field's value.
Modified: team/murf/bug_7506/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7506/main/channel.c?rev=47071&r1=47070&r2=47071&view=diff
==============================================================================
--- team/murf/bug_7506/main/channel.c (original)
+++ team/murf/bug_7506/main/channel.c Thu Nov 2 23:33:53 2006
@@ -696,9 +696,9 @@
* uses them to build the string, instead of forming the va_lists internally from the vararg ... list.
* This new function was written so this can be accomplished.
*/
- va_start(ap1, fmt);
- va_start(ap2, fmt);
- ast_string_field_build_va(tmp, name, fmt, ap1, ap2);
+ va_start(ap1, name_fmt);
+ va_start(ap2, name_fmt);
+ ast_string_field_build_va(tmp, name, name_fmt, ap1, ap2);
va_end(ap1);
va_end(ap2);
Modified: team/murf/bug_7506/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7506/main/pbx.c?rev=47071&r1=47070&r2=47071&view=diff
==============================================================================
--- team/murf/bug_7506/main/pbx.c (original)
+++ team/murf/bug_7506/main/pbx.c Thu Nov 2 23:33:53 2006
@@ -4501,12 +4501,10 @@
/* In order to do it when the channel doesn't really exist within
the PBX, we have to make a new channel, masquerade, and start the PBX
at the new location */
- struct ast_channel *tmpchan = ast_channel_alloc(0);
+ struct ast_channel *tmpchan = ast_channel_alloc(0, chan->_state, 0, 0, "AsyncGoto/%s", chan->name);
if (!tmpchan)
res = -1;
else {
- ast_string_field_build(tmpchan, name, "AsyncGoto/%s", chan->name);
- ast_setstate(tmpchan, chan->_state);
/* Make formats okay */
tmpchan->readformat = chan->readformat;
tmpchan->writeformat = chan->writeformat;
@@ -4863,7 +4861,7 @@
static int ast_pbx_outgoing_cdr_failed(void)
{
/* allocate a channel */
- struct ast_channel *chan = ast_channel_alloc(0);
+ struct ast_channel *chan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "nix");
if (!chan)
return -1; /* failure */
@@ -4976,9 +4974,8 @@
/* create a fake channel and execute the "failed" extension (if it exists) within the requested context */
/* check if "failed" exists */
if (ast_exists_extension(chan, context, "failed", 1, NULL)) {
- chan = ast_channel_alloc(0);
+ chan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "OutgoingSpoolFailed");
if (chan) {
- ast_string_field_set(chan, name, "OutgoingSpoolFailed");
if (!ast_strlen_zero(context))
ast_copy_string(chan->context, context, sizeof(chan->context));
set_ext_pri(chan, "failed", 1);
Modified: team/murf/bug_7506/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7506/res/res_features.c?rev=47071&r1=47070&r2=47071&view=diff
==============================================================================
--- team/murf/bug_7506/res/res_features.c (original)
+++ team/murf/bug_7506/res/res_features.c Thu Nov 2 23:33:53 2006
@@ -190,14 +190,13 @@
goto_on_transfer = ast_strdupa(val);
- if (!(xferchan = ast_channel_alloc(0)))
+ if (!(xferchan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, chan->name)))
return;
for (x = goto_on_transfer; x && *x; x++) {
if (*x == '^')
*x = '|';
}
- ast_string_field_set(xferchan, name, chan->name);
/* Make formats okay */
xferchan->readformat = chan->readformat;
xferchan->writeformat = chan->writeformat;
@@ -442,12 +441,10 @@
struct ast_frame *f;
/* Make a new, fake channel that we'll use to masquerade in the real one */
- if (!(chan = ast_channel_alloc(0))) {
+ if (!(chan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "Parked/%s",rchan->name))) {
ast_log(LOG_WARNING, "Unable to create parked channel\n");
return -1;
}
- /* Let us keep track of the channel name */
- ast_string_field_build(chan, name, "Parked/%s",rchan->name);
/* Make formats okay */
chan->readformat = rchan->readformat;
@@ -828,12 +825,11 @@
return -1;
}
- xferchan = ast_channel_alloc(0);
+ xferchan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "Transfered/%s", transferee->name);
if (!xferchan) {
ast_hangup(newchan);
return -1;
}
- ast_string_field_build(xferchan, name, "Transfered/%s", transferee->name);
/* Make formats okay */
xferchan->readformat = transferee->readformat;
xferchan->writeformat = transferee->writeformat;
More information about the asterisk-commits
mailing list