[Asterisk-cvs] asterisk/channels chan_agent.c,1.66,1.67 chan_iax2.c,1.116,1.117 chan_mgcp.c,1.38,1.39 chan_sip.c,1.318,1.319 chan_skinny.c,1.32,1.33
markster at lists.digium.com
markster at lists.digium.com
Sat Mar 27 01:52:45 CST 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv1845/channels
Modified Files:
chan_agent.c chan_iax2.c chan_mgcp.c chan_sip.c chan_skinny.c
Log Message:
Make read/write mode have a lock parameter and use it properly.
Index: chan_agent.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_agent.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- chan_agent.c 4 Mar 2004 01:11:25 -0000 1.66
+++ chan_agent.c 27 Mar 2004 06:50:12 -0000 1.67
@@ -137,13 +137,13 @@
/* Native formats changed, reset things */ \
ast->nativeformats = p->chan->nativeformats; \
ast_log(LOG_DEBUG, "Resetting read to %d and write to %d\n", ast->readformat, ast->writeformat);\
- ast_set_read_format(ast, ast->readformat); \
- ast_set_write_format(ast, ast->writeformat); \
+ ast_set_read_format(ast, ast->readformat, 0); \
+ ast_set_write_format(ast, ast->writeformat, 0); \
} \
if (p->chan->readformat != ast->pvt->rawreadformat) \
- ast_set_read_format(p->chan, ast->pvt->rawreadformat); \
+ ast_set_read_format(p->chan, ast->pvt->rawreadformat, 0); \
if (p->chan->writeformat != ast->pvt->rawwriteformat) \
- ast_set_write_format(p->chan, ast->pvt->rawwriteformat); \
+ ast_set_write_format(p->chan, ast->pvt->rawwriteformat, 0); \
} \
} while(0)
@@ -464,7 +464,7 @@
ast_log( LOG_DEBUG, "Waited for stream, result '%d'\n", res);
}
if (!res) {
- res = ast_set_read_format(p->chan, ast_best_codec(p->chan->nativeformats));
+ res = ast_set_read_format(p->chan, ast_best_codec(p->chan->nativeformats), 0);
ast_log( LOG_DEBUG, "Set read format, result '%d'\n", res);
if (res)
ast_log(LOG_WARNING, "Unable to set read format to %s\n", ast_getformatname(ast_best_codec(p->chan->nativeformats)));
@@ -474,7 +474,7 @@
}
if (!res) {
- ast_set_write_format(p->chan, ast_best_codec(p->chan->nativeformats));
+ ast_set_write_format(p->chan, ast_best_codec(p->chan->nativeformats), 0);
ast_log( LOG_DEBUG, "Set write format, result '%d'\n", res);
if (res)
ast_log(LOG_WARNING, "Unable to set write format to %s\n", ast_getformatname(ast_best_codec(p->chan->nativeformats)));
@@ -1261,12 +1261,12 @@
ast_mutex_lock(&agentlock);
ast_mutex_lock(&p->lock);
if (!res) {
- res = ast_set_read_format(chan, ast_best_codec(chan->nativeformats));
+ res = ast_set_read_format(chan, ast_best_codec(chan->nativeformats), 0);
if (res)
ast_log(LOG_WARNING, "Unable to set read format to %d\n", ast_best_codec(chan->nativeformats));
}
if (!res) {
- ast_set_write_format(chan, ast_best_codec(chan->nativeformats));
+ ast_set_write_format(chan, ast_best_codec(chan->nativeformats), 0);
if (res)
ast_log(LOG_WARNING, "Unable to set write format to %d\n", ast_best_codec(chan->nativeformats));
}
Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- chan_iax2.c 25 Mar 2004 18:10:52 -0000 1.116
+++ chan_iax2.c 27 Mar 2004 06:50:12 -0000 1.117
@@ -4725,7 +4725,7 @@
orignative = iaxs[fr.callno]->owner->nativeformats;
iaxs[fr.callno]->owner->nativeformats = f.subclass;
if (iaxs[fr.callno]->owner->readformat)
- ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat);
+ ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat, 0);
iaxs[fr.callno]->owner->nativeformats = orignative;
ast_mutex_unlock(&iaxs[fr.callno]->owner->lock);
}
@@ -4962,9 +4962,9 @@
if (iaxs[fr.callno] && iaxs[fr.callno]->owner) {
/* Setup read/write formats properly. */
if (iaxs[fr.callno]->owner->writeformat)
- ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat);
+ ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat, 0);
if (iaxs[fr.callno]->owner->readformat)
- ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat);
+ ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat, 0);
ast_mutex_unlock(&iaxs[fr.callno]->owner->lock);
}
}
Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- chan_mgcp.c 19 Mar 2004 22:57:08 -0000 1.38
+++ chan_mgcp.c 27 Mar 2004 06:50:12 -0000 1.39
@@ -1015,8 +1015,8 @@
if (f->subclass != sub->owner->nativeformats) {
ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
sub->owner->nativeformats = f->subclass;
- ast_set_read_format(sub->owner, sub->owner->readformat);
- ast_set_write_format(sub->owner, sub->owner->writeformat);
+ ast_set_read_format(sub->owner, sub->owner->readformat, 0);
+ ast_set_write_format(sub->owner, sub->owner->writeformat, 0);
}
/* Courtesy fearnor aka alex at pilosoft.com */
if (sub->parent->dtmfinband) {
Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.318
retrieving revision 1.319
diff -u -d -r1.318 -r1.319
--- chan_sip.c 24 Mar 2004 21:21:59 -0000 1.318
+++ chan_sip.c 27 Mar 2004 06:50:12 -0000 1.319
@@ -1675,8 +1675,8 @@
if (f->subclass != p->owner->nativeformats) {
ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
p->owner->nativeformats = f->subclass;
- ast_set_read_format(p->owner, p->owner->readformat);
- ast_set_write_format(p->owner, p->owner->writeformat);
+ ast_set_read_format(p->owner, p->owner->readformat, 0);
+ ast_set_write_format(p->owner, p->owner->writeformat, 0);
}
if (p->dtmfmode & SIP_DTMF_INBAND) {
f = ast_dsp_process(p->owner,p->vad,f,0);
@@ -2132,8 +2132,8 @@
if (!(p->owner->nativeformats & p->jointcapability)) {
ast_log(LOG_DEBUG, "Oooh, we need to change our formats since our peer supports only %d and not %d\n", p->jointcapability, p->owner->nativeformats);
p->owner->nativeformats = sip_codec_choose(p->jointcapability);
- ast_set_read_format(p->owner, p->owner->readformat);
- ast_set_write_format(p->owner, p->owner->writeformat);
+ ast_set_read_format(p->owner, p->owner->readformat, 0);
+ ast_set_write_format(p->owner, p->owner->writeformat, 0);
}
if (p->owner->bridge) {
/* Turn on/off music on hold if we are holding/unholding */
Index: chan_skinny.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- chan_skinny.c 15 Mar 2004 09:14:16 -0000 1.32
+++ chan_skinny.c 27 Mar 2004 06:50:12 -0000 1.33
@@ -1602,8 +1602,8 @@
if (f->subclass != sub->owner->nativeformats) {
ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
sub->owner->nativeformats = f->subclass;
- ast_set_read_format(sub->owner, sub->owner->readformat);
- ast_set_write_format(sub->owner, sub->owner->writeformat);
+ ast_set_read_format(sub->owner, sub->owner->readformat, 0);
+ ast_set_write_format(sub->owner, sub->owner->writeformat, 0);
}
}
}
More information about the svn-commits
mailing list