summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-12-19 18:26:12 +0000
committerMark Spencer <markster@digium.com>2004-12-19 18:26:12 +0000
commitf81cf74784362ddb38d5cf983dd29ed077f65849 (patch)
treecfedcec320ef983a3012f2470d8a909fb81b56f6 /channels
parent775e0953beed7e5fbdee4c8229bfab96cf361857 (diff)
Make sure read/write format are setup properly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_iax2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 2334d32d2..edc7293be 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -2697,8 +2697,8 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
tmp->type = type;
/* We can support any format by default, until we get restricted */
tmp->nativeformats = capability;
- tmp->readformat = 0;
- tmp->writeformat = 0;
+ tmp->readformat = ast_best_codec(capability);
+ tmp->writeformat = ast_best_codec(capability);
tmp->pvt->pvt = CALLNO_TO_PTR(i->callno);
tmp->pvt->send_digit = iax2_digit;
tmp->pvt->send_text = iax2_sendtext;
@@ -6351,7 +6351,7 @@ static struct ast_channel *iax2_request(const char *type, int format, void *data
ast_mutex_unlock(&iaxsl[callno]);
if (c) {
/* Choose a format we can live with */
- if (c->nativeformats & format)
+ if (c->nativeformats & format)
c->nativeformats &= format;
else {
native = c->nativeformats;
@@ -6364,6 +6364,8 @@ static struct ast_channel *iax2_request(const char *type, int format, void *data
}
c->nativeformats = native;
}
+ c->readformat = ast_best_codec(c->nativeformats);
+ c->writeformat = c->readformat;
}
return c;
}