[asterisk-commits] file: branch group/media_formats r408365 - in /team/group/media_formats: addo...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Feb 19 06:27:41 CST 2014
Author: file
Date: Wed Feb 19 06:27:38 2014
New Revision: 408365
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=408365
Log:
Move chan_ooh323 over.
Modified:
team/group/media_formats/addons/chan_ooh323.c
team/group/media_formats/addons/chan_ooh323.h
team/group/media_formats/addons/ooh323cDriver.c
team/group/media_formats/addons/ooh323cDriver.h
team/group/media_formats/include/asterisk/format_cache.h
Modified: team/group/media_formats/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/addons/chan_ooh323.c?view=diff&rev=408365&r1=408364&r2=408365
==============================================================================
--- team/group/media_formats/addons/chan_ooh323.c (original)
+++ team/group/media_formats/addons/chan_ooh323.c Wed Feb 19 06:27:38 2014
@@ -91,8 +91,6 @@
struct ast_rtp_instance *vrtp, struct ast_rtp_instance *trtp, const struct ast_format_cap *codecs, int nat_active);
static void ooh323_get_codec(struct ast_channel *chan, struct ast_format_cap *result);
void setup_rtp_remote(ooCallData *call, const char *remoteIp, int remotePort);
-
-static void print_codec_to_cli(int fd, struct ast_codec_pref *pref);
struct ooh323_peer *find_friend(const char *name, int port);
@@ -174,10 +172,9 @@
char callee_url[AST_MAX_EXTENSION];
int port;
- struct ast_format readformat; /* negotiated read format */
- struct ast_format writeformat; /* negotiated write format */
+ struct ast_format *readformat; /* negotiated read format */
+ struct ast_format *writeformat; /* negotiated write format */
struct ast_format_cap *cap;
- struct ast_codec_pref prefs;
int dtmfmode;
int dtmfcodec;
char exten[AST_MAX_EXTENSION]; /* Requested extension */
@@ -211,7 +208,6 @@
char accountcode[20];
int amaflags;
struct ast_format_cap *cap;
- struct ast_codec_pref prefs;
int dtmfmode;
int dtmfcodec;
int faxdetect;
@@ -237,7 +233,6 @@
unsigned outgoinglimit;
unsigned outUse;
struct ast_format_cap *cap;
- struct ast_codec_pref prefs;
char accountcode[20];
int amaflags;
int dtmfmode;
@@ -305,7 +300,6 @@
static char gCallerID[AST_MAX_EXTENSION] = "";
static struct ooAliases *gAliasList;
static struct ast_format_cap *gCap;
-static struct ast_codec_pref gPrefs;
static int gDTMFMode = H323_DTMF_RFC2833;
static int gDTMFCodec = 101;
static int gFAXdetect = FAXDETECT_CNG;
@@ -362,15 +356,17 @@
static struct ast_channel *ooh323_new(struct ooh323_pvt *i, int state,
const char *host, struct ast_format_cap *cap, const char *linkedid)
{
+ struct ast_format_cap *caps = NULL;
struct ast_channel *ch = NULL;
- struct ast_format tmpfmt;
+ struct ast_format *tmpfmt = NULL;
int features = 0;
if (gH323Debug) {
ast_verb(0, "--- ooh323_new - %s\n", host);
}
- ast_format_clear(&tmpfmt);
+ caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+
/* Don't hold a h323 pvt lock while we allocate a channel */
ast_mutex_unlock(&i->lock);
ast_mutex_lock(&ooh323c_cn_lock);
@@ -382,17 +378,23 @@
ast_mutex_lock(&i->lock);
- if (ch) {
+ if (ch && caps) {
ast_channel_tech_set(ch, &ooh323_tech);
if (cap)
ast_best_codec(cap, &tmpfmt);
- if (!tmpfmt.id)
- ast_codec_pref_index(&i->prefs, 0, &tmpfmt);
-
- ast_format_cap_add(ast_channel_nativeformats(ch), &tmpfmt);
- ast_format_copy(ast_channel_rawwriteformat(ch), &tmpfmt);
- ast_format_copy(ast_channel_rawreadformat(ch), &tmpfmt);
+ if (!tmpfmt)
+ tmpfmt = ast_format_cap_get_format(i->cap, 0);
+
+ ast_format_cap_add(caps, tmpfmt, 0);
+ ast_channel_nativeformats_set(ch, caps);
+ ao2_ref(caps, -1);
+
+ ast_channel_set_rawwriteformat(ch, tmpfmt);
+ ast_channel_set_rawreadformat(ch, tmpfmt);
+ ast_set_write_format(ch, tmpfmt);
+ ast_set_read_format(ch, tmpfmt);
+ ao2_ref(tmpfmt, -1);
ast_jb_configure(ch, &global_jbconf);
@@ -400,8 +402,6 @@
ast_channel_rings_set(ch, 1);
ast_channel_adsicpe_set(ch, AST_ADSI_UNAVAILABLE);
- ast_set_write_format(ch, &tmpfmt);
- ast_set_read_format(ch, &tmpfmt);
ast_channel_tech_pvt_set(ch, i);
i->owner = ch;
ast_module_ref(myself);
@@ -481,8 +481,10 @@
ast_publish_channel_state(ch);
}
- } else
+ } else {
+ ao2_cleanup(caps);
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
+ }
if(ch) ast_channel_unlock(ch);
@@ -508,7 +510,7 @@
ast_log(LOG_ERROR, "Couldn't allocate private ooh323 structure\n");
return NULL;
}
- if (!(pvt->cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_NOLOCK))) {
+ if (!(pvt->cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
ast_free(pvt);
ast_log(LOG_ERROR, "Couldn't allocate private ooh323 structure\n");
return NULL;
@@ -542,8 +544,7 @@
ast_copy_string(pvt->accountcode, gAccountcode, sizeof(pvt->accountcode));
pvt->amaflags = gAMAFLAGS;
- ast_format_cap_copy(pvt->cap, gCap);
- memcpy(&pvt->prefs, &gPrefs, sizeof(pvt->prefs));
+ ast_format_cap_append_by_type(pvt->cap, gCap, AST_MEDIA_TYPE_UNKNOWN);
ast_mutex_unlock(&pvt->lock);
/* Add to interface list */
@@ -580,7 +581,7 @@
ast_verb(0, "--- ooh323_request - data %s format %s\n", data,
ast_getformatname_multiple(formats,FORMAT_STRING_SIZE,cap));
- if (!(ast_format_cap_has_type(cap, AST_FORMAT_TYPE_AUDIO))) {
+ if (!(ast_format_cap_has_type(cap, AST_MEDIA_TYPE_AUDIO))) {
ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%s'\n", ast_getformatname_multiple(formats,FORMAT_STRING_SIZE,cap));
return NULL;
}
@@ -645,8 +646,7 @@
if (ext)
ast_copy_string(p->exten, ext, sizeof(p->exten));
- ast_format_cap_copy(p->cap, peer->cap);
- memcpy(&p->prefs, &peer->prefs, sizeof(struct ast_codec_pref));
+ ast_format_cap_append_by_type(p->cap, peer->cap, AST_MEDIA_TYPE_UNKNOWN);
p->g729onlyA = peer->g729onlyA;
p->dtmfmode |= peer->dtmfmode;
p->dtmfcodec = peer->dtmfcodec;
@@ -691,7 +691,7 @@
p->t38support = gT38Support;
p->rtptimeout = gRTPTimeout;
p->nat = gNat;
- ast_format_cap_copy(p->cap, gCap);
+ ast_format_cap_append_by_type(p->cap, gCap, AST_MEDIA_TYPE_UNKNOWN);
p->rtdrinterval = gRTDRInterval;
p->rtdrcount = gRTDRCount;
p->faststart = gFastStart;
@@ -699,7 +699,6 @@
p->directrtp = gDirectRTP;
p->earlydirect = gEarlyDirect;
- memcpy(&p->prefs, &gPrefs, sizeof(struct ast_codec_pref));
p->username = strdup(dest);
p->host = strdup(dest);
@@ -1186,16 +1185,16 @@
}
- if (!(ast_format_cap_iscompatible(ast_channel_nativeformats(ast), &f->subclass.format))) {
- if (!(ast_format_cap_is_empty(ast_channel_nativeformats(ast)))) {
+ if (!(ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), f->subclass.format))) {
+ if (ast_format_cap_count(ast_channel_nativeformats(ast))) {
ast_log(LOG_WARNING,
"Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
- ast_getformatname(&f->subclass.format),
+ f->subclass.format->codec->name,
ast_getformatname_multiple(buf, sizeof(buf), ast_channel_nativeformats(ast)),
- ast_getformatname(ast_channel_readformat(ast)),
- ast_getformatname(ast_channel_writeformat(ast)));
-
- ast_set_write_format(ast, &f->subclass.format);
+ ast_channel_readformat(ast)->codec->name,
+ ast_channel_writeformat(ast)->codec->name);
+
+ ast_set_write_format(ast, f->subclass.format);
} else {
/* ast_set_write_format(ast, f->subclass);
ast->nativeformats = f->subclass; */
@@ -1507,7 +1506,7 @@
if (gH323Debug)
ast_verb(0, "--- ooh323_update_writeformat %s/%d\n",
- ast_getformatname(fmt), txframes);
+ fmt->codec->name, txframes);
p = find_call(call);
if (!p) {
@@ -1517,9 +1516,18 @@
ast_mutex_lock(&p->lock);
- ast_format_copy(&(p->writeformat), fmt);
+ ao2_cleanup(p->writeformat);
+ p->writeformat = ast_format_copy(fmt);
if (p->owner) {
+ struct ast_format_cap *caps;
+
+ caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ if (!caps) {
+ ast_log(LOG_ERROR, "Could not allocate capabilities structure\n");
+ return;
+ }
+
while (p->owner && ast_channel_trylock(p->owner)) {
ast_debug(1,"Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
@@ -1527,15 +1535,16 @@
if (!p->owner) {
ast_mutex_unlock(&p->lock);
ast_log(LOG_ERROR, "Channel has no owner\n");
+ ao2_ref(caps, -1);
return;
}
if (gH323Debug)
ast_verb(0, "Writeformat before update %s/%s\n",
- ast_getformatname(ast_channel_writeformat(p->owner)),
+ ast_channel_writeformat(p->owner)->codec->name,
ast_getformatname_multiple(formats, sizeof(formats), ast_channel_nativeformats(p->owner)));
- if (txframes)
- ast_codec_pref_setsize(&p->prefs, fmt, txframes);
- ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(p->rtp), p->rtp, &p->prefs);
+// if (txframes)
+// ast_codec_pref_setsize(&p->prefs, fmt, txframes);
+// ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(p->rtp), p->rtp, &p->prefs);
if (p->dtmfmode & H323_DTMF_RFC2833 && p->dtmfcodec) {
ast_rtp_codecs_payloads_set_rtpmap_type(ast_rtp_instance_get_codecs(p->rtp),
p->rtp, p->dtmfcodec, "audio", "telephone-event", 0);
@@ -1545,7 +1554,9 @@
p->rtp, p->dtmfcodec, "audio", "cisco-telephone-event", 0);
}
- ast_format_cap_set(ast_channel_nativeformats(p->owner), fmt);
+ ast_format_cap_add(caps, fmt, 0);
+ ast_channel_nativeformats_set(p->owner, caps);
+ ao2_ref(caps, -1);
ast_set_write_format(p->owner, ast_channel_writeformat(p->owner));
ast_set_read_format(p->owner, ast_channel_readformat(p->owner));
ast_channel_unlock(p->owner);
@@ -1565,7 +1576,7 @@
if (gH323Debug)
ast_verb(0, "--- ooh323_update_readformat %s\n",
- ast_getformatname(fmt));
+ fmt->codec->name);
p = find_call(call);
if (!p) {
@@ -1575,9 +1586,18 @@
ast_mutex_lock(&p->lock);
- ast_format_copy(&(p->readformat), fmt);
+ ao2_cleanup(p->readformat);
+ p->readformat = ast_format_copy(fmt);
if (p->owner) {
+ struct ast_format_cap *caps;
+
+ caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ if (!caps) {
+ ast_log(LOG_ERROR, "Could not allocate capabilities structure\n");
+ return;
+ }
+
while (p->owner && ast_channel_trylock(p->owner)) {
ast_debug(1,"Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
@@ -1585,13 +1605,16 @@
if (!p->owner) {
ast_mutex_unlock(&p->lock);
ast_log(LOG_ERROR, "Channel has no owner\n");
+ ao2_ref(caps, -1);
return;
}
if (gH323Debug)
ast_verb(0, "Readformat before update %s\n",
- ast_getformatname(ast_channel_readformat(p->owner)));
- ast_format_cap_set(ast_channel_nativeformats(p->owner), fmt);
+ ast_channel_readformat(p->owner)->codec->name);
+ ast_format_cap_add(caps, fmt, 0);
+ ast_channel_nativeformats_set(p->owner, caps);
+ ao2_ref(caps, -1);
ast_set_read_format(p->owner, ast_channel_readformat(p->owner));
ast_channel_unlock(p->owner);
} else
@@ -1849,9 +1872,8 @@
ast_copy_string(p->context, user->context, sizeof(p->context));
ast_copy_string(p->accountcode, user->accountcode, sizeof(p->accountcode));
p->amaflags = user->amaflags;
- ast_format_cap_copy(p->cap, user->cap);
+ ast_format_cap_append_by_type(p->cap, user->cap, AST_MEDIA_TYPE_UNKNOWN);
p->g729onlyA = user->g729onlyA;
- memcpy(&p->prefs, &user->prefs, sizeof(struct ast_codec_pref));
p->dtmfmode |= user->dtmfmode;
p->dtmfcodec = user->dtmfcodec;
p->faxdetect = user->faxdetect;
@@ -1906,7 +1928,7 @@
}
}
- ooh323c_set_capability_for_call(call, &p->prefs, p->cap, p->dtmfmode, p->dtmfcodec,
+ ooh323c_set_capability_for_call(call, p->cap, p->dtmfmode, p->dtmfcodec,
p->t38support, p->g729onlyA);
/* Incoming call */
c = ooh323_new(p, AST_STATE_RING, p->username, 0, NULL);
@@ -2076,13 +2098,14 @@
}
if (gH323Debug) {
- char prefsBuf[256];
- ast_codec_pref_string(&p->prefs, prefsBuf, sizeof(prefsBuf));
+ char formats[FORMAT_STRING_SIZE];
+
ast_verb(0, " Outgoing call %s(%s) - Codec prefs - %s\n",
- p->username?p->username:"NULL", call->callToken, prefsBuf);
- }
-
- ooh323c_set_capability_for_call(call, &p->prefs, p->cap,
+ p->username?p->username:"NULL", call->callToken,
+ ast_getformatname_multiple(formats,FORMAT_STRING_SIZE,p->cap));
+ }
+
+ ooh323c_set_capability_for_call(call, p->cap,
p->dtmfmode, p->dtmfcodec, p->t38support, p->g729onlyA);
configure_local_rtp(p, call);
@@ -2268,7 +2291,7 @@
if(peer->url) free(peer->url);
if(peer->e164) free(peer->e164);
- peer->cap = ast_format_cap_destroy(peer->cap);
+ ao2_cleanup(peer->cap);
free(peer);
}
@@ -2295,8 +2318,7 @@
}
ast_mutex_init(&user->lock);
ast_copy_string(user->name, name, sizeof(user->name));
- ast_format_cap_copy(user->cap, gCap);
- memcpy(&user->prefs, &gPrefs, sizeof(user->prefs));
+ ast_format_cap_append_by_type(user->cap, gCap, AST_MEDIA_TYPE_UNKNOWN);
user->rtptimeout = gRTPTimeout;
user->nat = gNat;
user->dtmfmode = gDTMFMode;
@@ -2351,15 +2373,13 @@
sizeof(user->rtpmaskstr));
} else user->rtpmask = NULL;
} else if (!strcasecmp(v->name, "disallow")) {
- ast_parse_allow_disallow(&user->prefs,
- user->cap, v->value, 0);
+ ast_parse_allow_disallow(user->cap, v->value, 0);
} else if (!strcasecmp(v->name, "allow")) {
const char* tcodecs = v->value;
if (!strcasecmp(v->value, "all")) {
tcodecs = "ulaw,alaw,g729,g723,gsm";
}
- ast_parse_allow_disallow(&user->prefs,
- user->cap, tcodecs, 1);
+ ast_parse_allow_disallow(user->cap, tcodecs, 1);
} else if (!strcasecmp(v->name, "amaflags")) {
user->amaflags = ast_channel_string2amaflag(v->value);
} else if (!strcasecmp(v->name, "ip") || !strcasecmp(v->name, "host")) {
@@ -2443,8 +2463,7 @@
}
ast_mutex_init(&peer->lock);
ast_copy_string(peer->name, name, sizeof(peer->name));
- ast_format_cap_copy(peer->cap, gCap);
- memcpy(&peer->prefs, &gPrefs, sizeof(peer->prefs));
+ ast_format_cap_append_by_type(peer->cap, gCap, AST_MEDIA_TYPE_UNKNOWN);
peer->rtptimeout = gRTPTimeout;
peer->nat = gNat;
ast_copy_string(peer->accountcode, gAccountcode, sizeof(peer->accountcode));
@@ -2547,15 +2566,13 @@
sizeof(peer->rtpmaskstr));
} else peer->rtpmask = NULL;
} else if (!strcasecmp(v->name, "disallow")) {
- ast_parse_allow_disallow(&peer->prefs, peer->cap,
- v->value, 0);
+ ast_parse_allow_disallow(peer->cap, v->value, 0);
} else if (!strcasecmp(v->name, "allow")) {
const char* tcodecs = v->value;
if (!strcasecmp(v->value, "all")) {
tcodecs = "ulaw,alaw,g729,g723,gsm";
}
- ast_parse_allow_disallow(&peer->prefs, peer->cap,
- tcodecs, 1);
+ ast_parse_allow_disallow(peer->cap, tcodecs, 1);
} else if (!strcasecmp(v->name, "amaflags")) {
peer->amaflags = ast_channel_string2amaflag(v->value);
} else if (!strcasecmp(v->name, "roundtrip")) {
@@ -2736,7 +2753,6 @@
struct ooh323_peer *peer = NULL;
char *cat;
const char *utype;
- struct ast_format tmpfmt;
if (gH323Debug)
ast_verb(0, "--- reload_config\n");
@@ -2772,8 +2788,8 @@
gPort = 1720;
gIP[0] = '\0';
strcpy(gCallerID, DEFAULT_H323ID);
- ast_format_cap_set(gCap, ast_format_set(&tmpfmt, AST_FORMAT_ALAW, 0));
- memset(&gPrefs, 0, sizeof(struct ast_codec_pref));
+ ast_format_cap_remove_bytype(gCap, AST_MEDIA_TYPE_UNKNOWN);
+ ast_format_cap_add(gCap, ast_format_ulaw, 0);
gDTMFMode = H323_DTMF_RFC2833;
gDTMFCodec = 101;
gFAXdetect = FAXDETECT_CNG;
@@ -2974,13 +2990,13 @@
} else if (!strcasecmp(v->name, "accountcode")) {
ast_copy_string(gAccountcode, v->value, sizeof(gAccountcode));
} else if (!strcasecmp(v->name, "disallow")) {
- ast_parse_allow_disallow(&gPrefs, gCap, v->value, 0);
+ ast_parse_allow_disallow(gCap, v->value, 0);
} else if (!strcasecmp(v->name, "allow")) {
const char* tcodecs = v->value;
if (!strcasecmp(v->value, "all")) {
tcodecs = "ulaw,alaw,g729,g723,gsm";
}
- ast_parse_allow_disallow(&gPrefs, gCap, tcodecs, 1);
+ ast_parse_allow_disallow(gCap, tcodecs, 1);
} else if (!strcasecmp(v->name, "dtmfmode")) {
if (!strcasecmp(v->value, "inband"))
gDTMFMode = H323_DTMF_INBAND;
@@ -3130,9 +3146,6 @@
peer->h245tunneling?"yes":"no");
ast_cli(a->fd, "%-15s%s\n", "DirectRTP", peer->directrtp ? "yes" : "no");
ast_cli(a->fd, "%-15s%s\n", "EarlyDirectRTP", peer->earlydirect ? "yes" : "no");
- ast_cli(a->fd, "%-15.15s%s", "Format Prefs: ", "(");
- print_codec_to_cli(a->fd, &peer->prefs);
- ast_cli(a->fd, ")\n");
ast_cli(a->fd, "%-15.15s", "DTMF Mode: ");
if (peer->dtmfmode & H323_DTMF_CISCO) {
ast_cli(a->fd, "%s\n", "cisco");
@@ -3233,24 +3246,6 @@
return CLI_SUCCESS;
}
-/*! \brief Print codec list from preference to CLI/manager */
-static void print_codec_to_cli(int fd, struct ast_codec_pref *pref)
-{
- int x;
- struct ast_format tmpfmt;
- for (x = 0; x < 32; x++) {
- ast_codec_pref_index(pref, x, &tmpfmt);
- if (!tmpfmt.id)
- break;
- ast_cli(fd, "%s", ast_getformatname(&tmpfmt));
- ast_cli(fd, ":%d", pref->framing[x]);
- if (x < 31 && ast_codec_pref_index(pref, x + 1, &tmpfmt))
- ast_cli(fd, ",");
- }
- if (!x)
- ast_cli(fd, "none");
-}
-
static char *handle_cli_ooh323_show_user(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct ooh323_user *prev = NULL, *user = NULL;
@@ -3289,9 +3284,6 @@
user->h245tunneling?"yes":"no");
ast_cli(a->fd, "%-15s%s\n", "DirectRTP", user->directrtp ? "yes" : "no");
ast_cli(a->fd, "%-15s%s\n", "EarlyDirectRTP", user->earlydirect ? "yes" : "no");
- ast_cli(a->fd, "%-15.15s%s", "Format Prefs: ", "(");
- print_codec_to_cli(a->fd, &user->prefs);
- ast_cli(a->fd, ")\n");
ast_cli(a->fd, "%-15.15s", "DTMF Mode: ");
if (user->dtmfmode & H323_DTMF_CISCO) {
ast_cli(a->fd, "%s\n", "cisco");
@@ -3717,7 +3709,6 @@
{
struct ooAliases * pNewAlias = NULL;
struct ooh323_peer *peer = NULL;
- struct ast_format tmpfmt;
OOH225MsgCallbacks h225Callbacks = {0, 0, 0, 0};
OOH323CALLBACKS h323Callbacks = {
@@ -3733,14 +3724,14 @@
.onModeChanged = onModeChanged,
.onMediaChanged = (cb_OnMediaChanged) setup_rtp_remote,
};
- if (!(gCap = ast_format_cap_alloc(0))) {
+ if (!(gCap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
return 1;
}
- if (!(ooh323_tech.capabilities = ast_format_cap_alloc(0))) {
+ if (!(ooh323_tech.capabilities = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
return 1;
}
- ast_format_cap_add(gCap, ast_format_set(&tmpfmt, AST_FORMAT_ULAW, 0));
- ast_format_cap_add_all(ooh323_tech.capabilities);
+ ast_format_cap_add(gCap, ast_format_ulaw, 0);
+ ast_format_cap_add_all_by_type(ooh323_tech.capabilities, AST_MEDIA_TYPE_UNKNOWN);
myself = ast_module_info->self;
@@ -3856,7 +3847,7 @@
ooH323EpSetH323Callbacks(h323Callbacks);
/* Add endpoint capabilities */
- if (ooh323c_set_capability(&gPrefs, gCap, gDTMFMode, gDTMFCodec) < 0) {
+ if (ooh323c_set_capability(gCap, gDTMFMode, gDTMFCodec) < 0) {
ast_log(LOG_ERROR, "Capabilities failure for OOH323. OOH323 Disabled.\n");
return 1;
}
@@ -4103,7 +4094,9 @@
ast_mutex_unlock(&cur->lock);
ast_mutex_destroy(&cur->lock);
- cur->cap = ast_format_cap_destroy(cur->cap);
+ ao2_cleanup(cur->writeformat);
+ ao2_cleanup(cur->readformat);
+ ao2_cleanup(cur->cap);
ast_free(cur);
}
@@ -4168,7 +4161,7 @@
free(prev->rtpmask);
}
}
- prev->cap = ast_format_cap_destroy(prev->cap);
+ ao2_cleanup(prev->cap);
free(prev);
if (cur == userl.users) {
break;
@@ -4296,8 +4289,10 @@
ast_verb(0, "+++ ooh323 unload_module \n");
}
- gCap = ast_format_cap_destroy(gCap);
- ooh323_tech.capabilities = ast_format_cap_destroy(ooh323_tech.capabilities);
+ ao2_ref(gCap, -1);
+ gCap = NULL;
+ ao2_ref(ooh323_tech.capabilities, -1);
+ ooh323_tech.capabilities = NULL;
return 0;
}
@@ -4309,8 +4304,11 @@
}
if (p) {
- ast_format_cap_append(result, ast_format_cap_is_empty(ast_channel_nativeformats(chan)) ?
- (ast_format_cap_is_empty(p->cap) ? NULL : p->cap) : ast_channel_nativeformats(chan));
+ if (ast_format_cap_count(ast_channel_nativeformats(chan))) {
+ ast_format_cap_append_by_type(result, ast_channel_nativeformats(chan), AST_MEDIA_TYPE_UNKNOWN);
+ } else if (ast_format_cap_count(p->cap)) {
+ ast_format_cap_append_by_type(result, p->cap, AST_MEDIA_TYPE_UNKNOWN);
+ }
}
if (gH323Debug) {
@@ -4384,56 +4382,28 @@
return res;
}
-
-int ooh323_update_capPrefsOrderForCall
- (ooCallData *call, struct ast_codec_pref *prefs)
-{
- int i = 0;
- struct ast_format tmpfmt;
-
- ast_codec_pref_index(prefs, i, &tmpfmt);
-
- ooResetCapPrefs(call);
- while (tmpfmt.id) {
- ooAppendCapToCapPrefs(call, ooh323_convertAsteriskCapToH323Cap(&tmpfmt));
- ast_codec_pref_index(prefs, ++i, &tmpfmt);
- }
-
- return 0;
-}
-
-
int ooh323_convertAsteriskCapToH323Cap(struct ast_format *format)
{
- switch (format->id) {
- case AST_FORMAT_ULAW:
+ if (ast_format_cmp(format, ast_format_ulaw) == AST_FORMAT_CMP_EQUAL) {
return OO_G711ULAW64K;
- case AST_FORMAT_ALAW:
+ } else if (ast_format_cmp(format, ast_format_alaw) == AST_FORMAT_CMP_EQUAL) {
return OO_G711ALAW64K;
- case AST_FORMAT_GSM:
+ } else if (ast_format_cmp(format, ast_format_gsm) == AST_FORMAT_CMP_EQUAL) {
return OO_GSMFULLRATE;
-
-#ifdef AST_FORMAT_AMRNB
- case AST_FORMAT_AMRNB:
- return OO_AMRNB;
-#endif
-#ifdef AST_FORMAT_SPEEX
- case AST_FORMAT_SPEEX:
+ } else if (ast_format_cmp(format, ast_format_speex) == AST_FORMAT_CMP_EQUAL) {
return OO_SPEEX;
-#endif
-
- case AST_FORMAT_G729A:
+ } else if (ast_format_cmp(format, ast_format_g729) == AST_FORMAT_CMP_EQUAL) {
return OO_G729A;
- case AST_FORMAT_G726:
+ } else if (ast_format_cmp(format, ast_format_g726) == AST_FORMAT_CMP_EQUAL) {
return OO_G726;
- case AST_FORMAT_G726_AAL2:
+ } else if (ast_format_cmp(format, ast_format_g726_aal2) == AST_FORMAT_CMP_EQUAL) {
return OO_G726AAL2;
- case AST_FORMAT_G723_1:
+ } else if (ast_format_cmp(format, ast_format_g723) == AST_FORMAT_CMP_EQUAL) {
return OO_G7231;
- case AST_FORMAT_H263:
+ } else if (ast_format_cmp(format, ast_format_h263) == AST_FORMAT_CMP_EQUAL) {
return OO_H263VIDEO;
- default:
- ast_log(LOG_NOTICE, "Don't know how to deal with mode %s\n", ast_getformatname(format));
+ } else {
+ ast_log(LOG_NOTICE, "Don't know how to deal with mode %s\n", format->codec->name);
return -1;
}
}
@@ -4512,9 +4482,6 @@
struct ast_sockaddr tmp;
ooMediaInfo mediaInfo;
int x;
- struct ast_format tmpfmt;
-
- ast_format_clear(&tmpfmt);
if (gH323Debug)
ast_verb(0, "--- configure_local_rtp\n");
@@ -4560,7 +4527,7 @@
ast_channel_unlock(p->owner);
if (p->rtp) {
- ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(p->rtp), p->rtp, &p->prefs);
+// ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(p->rtp), p->rtp, &p->prefs);
if (p->nat) {
ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_NAT, 1);
}
@@ -4597,9 +4564,11 @@
ast_copy_string(mediaInfo.lMediaIP, lhost, sizeof(mediaInfo.lMediaIP));
mediaInfo.lMediaPort = lport;
mediaInfo.lMediaCntrlPort = mediaInfo.lMediaPort + 1;
- for (x = 0; ast_codec_pref_index(&p->prefs, x, &tmpfmt); x++) {
+ for (x = 0; x < ast_format_cap_count(p->cap); x++) {
+ struct ast_format *format = ast_format_cap_get_format(p->cap, x);
+
strcpy(mediaInfo.dir, "transmit");
- mediaInfo.cap = ooh323_convertAsteriskCapToH323Cap(&tmpfmt);
+ mediaInfo.cap = ooh323_convertAsteriskCapToH323Cap(format);
ooAddMediaInfo(call, mediaInfo);
strcpy(mediaInfo.dir, "receive");
ooAddMediaInfo(call, mediaInfo);
@@ -4616,6 +4585,8 @@
strcpy(mediaInfo.dir, "receive");
ooAddMediaInfo(call, mediaInfo);
}
+
+ ao2_ref(format, -1);
}
if (p->udptl) {
@@ -4699,7 +4670,7 @@
ast_sockaddr_set_port(&tmp, remotePort);
ast_rtp_instance_set_remote_address(p->rtp, &tmp);
- if (p->writeformat.id == AST_FORMAT_G726_AAL2) {
+ if (ast_format_cmp(p->writeformat, ast_format_g726_aal2) == AST_FORMAT_CMP_EQUAL) {
ast_rtp_codecs_payloads_set_rtpmap_type(ast_rtp_instance_get_codecs(p->rtp), p->rtp, 2,
"audio", "G726-32", AST_RTP_OPT_G726_NONSTANDARD);
}
@@ -4916,15 +4887,24 @@
if (f && p->owner && !p->faxmode && (f->frametype == AST_FRAME_VOICE)) {
/* We already hold the channel lock */
- if (!(ast_format_cap_iscompatible(ast_channel_nativeformats(p->owner), &f->subclass.format))) {
- ast_debug(1, "Oooh, voice format changed to %s\n", ast_getformatname(&f->subclass.format));
- ast_format_cap_set(ast_channel_nativeformats(p->owner), &f->subclass.format);
+ if (!(ast_format_cap_iscompatible_format(ast_channel_nativeformats(p->owner), f->subclass.format))) {
+ struct ast_format_cap *caps;
+
+ ast_debug(1, "Oooh, voice format changed to %s\n", f->subclass.format->codec->name);
+
+ caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ if (caps) {
+ ast_format_cap_add(caps, f->subclass.format, 0);
+ ast_channel_nativeformats_set(p->owner, caps);
+ ao2_ref(caps, -1);
+ }
ast_set_read_format(p->owner, ast_channel_readformat(p->owner));
ast_set_write_format(p->owner, ast_channel_writeformat(p->owner));
}
if (((p->dtmfmode & H323_DTMF_INBAND) || (p->faxdetect & FAXDETECT_CNG)) && p->vad &&
- (f->subclass.format.id == AST_FORMAT_SLINEAR || f->subclass.format.id == AST_FORMAT_ALAW ||
- f->subclass.format.id == AST_FORMAT_ULAW)) {
+ ((ast_format_cmp(f->subclass.format, ast_format_slin) == AST_FORMAT_CMP_EQUAL) ||
+ (ast_format_cmp(f->subclass.format, ast_format_ulaw) == AST_FORMAT_CMP_EQUAL) ||
+ (ast_format_cmp(f->subclass.format, ast_format_alaw) == AST_FORMAT_CMP_EQUAL))) {
dfr = ast_frdup(f);
dfr = ast_dsp_process(p->owner, p->vad, dfr);
}
Modified: team/group/media_formats/addons/chan_ooh323.h
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/addons/chan_ooh323.h?view=diff&rev=408365&r1=408364&r2=408365
==============================================================================
--- team/group/media_formats/addons/chan_ooh323.h (original)
+++ team/group/media_formats/addons/chan_ooh323.h Wed Feb 19 06:27:38 2014
@@ -65,6 +65,7 @@
#include "asterisk/format_cap.h"
#include "asterisk/udptl.h"
#include "asterisk/stasis_channels.h"
+#include "asterisk/format_cache.h"
#include "ootypes.h"
#include "ooUtils.h"
@@ -104,9 +105,6 @@
void ooh323_set_write_format(ooCallData *call, struct ast_format *fmt, int txframes);
void ooh323_set_read_format(ooCallData *call, struct ast_format *fmt);
-int ooh323_update_capPrefsOrderForCall
- (ooCallData *call, struct ast_codec_pref *prefs);
-
int ooh323_convertAsteriskCapToH323Cap(struct ast_format *format);
int ooh323_convert_hangupcause_asteriskToH323(int cause);
Modified: team/group/media_formats/addons/ooh323cDriver.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/addons/ooh323cDriver.c?view=diff&rev=408365&r1=408364&r2=408365
==============================================================================
--- team/group/media_formats/addons/ooh323cDriver.c (original)
+++ team/group/media_formats/addons/ooh323cDriver.c Wed Feb 19 06:27:38 2014
@@ -225,17 +225,17 @@
}
int ooh323c_set_capability
- (struct ast_codec_pref *prefs, struct ast_format_cap *cap, int dtmf, int dtmfcodec)
+ (struct ast_format_cap *cap, int dtmf, int dtmfcodec)
{
int ret = 0, x;
- struct ast_format tmpfmt;
if (gH323Debug) {
ast_verb(0, "\tAdding capabilities to H323 endpoint\n");
}
- for(x=0; ast_codec_pref_index(prefs, x, &tmpfmt); x++)
+ for(x=0; x<ast_format_cap_count(cap); x++)
{
- if(tmpfmt.id == AST_FORMAT_ULAW)
+ struct ast_format *format = ast_format_cap_get_format(cap, x);
+ if(ast_format_cmp(format, ast_format_ulaw) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g711 ulaw capability to H323 endpoint\n");
@@ -246,7 +246,7 @@
&ooh323c_stop_receive_channel,
&ooh323c_stop_transmit_channel);
}
- if(tmpfmt.id == AST_FORMAT_ALAW)
+ if(ast_format_cmp(format, ast_format_alaw) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g711 alaw capability to H323 endpoint\n");
@@ -258,7 +258,7 @@
&ooh323c_stop_transmit_channel);
}
- if(tmpfmt.id == AST_FORMAT_G729A)
+ if(ast_format_cmp(format, ast_format_g729) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g729A capability to H323 endpoint\n");
@@ -287,7 +287,7 @@
&ooh323c_stop_transmit_channel);
}
- if(tmpfmt.id == AST_FORMAT_G723_1)
+ if(ast_format_cmp(format, ast_format_g723) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g7231 capability to H323 endpoint\n");
@@ -300,7 +300,7 @@
}
- if(tmpfmt.id == AST_FORMAT_G726)
+ if(ast_format_cmp(format, ast_format_g726) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g726 capability to H323 endpoint\n");
@@ -313,7 +313,7 @@
}
- if(tmpfmt.id == AST_FORMAT_G726_AAL2)
+ if(ast_format_cmp(format, ast_format_g726_aal2) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g726aal2 capability to H323 endpoint\n");
@@ -326,7 +326,7 @@
}
- if(tmpfmt.id == AST_FORMAT_H263)
+ if(ast_format_cmp(format, ast_format_h263) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding h263 capability to H323 endpoint\n");
@@ -339,7 +339,7 @@
}
- if(tmpfmt.id == AST_FORMAT_GSM)
+ if(ast_format_cmp(format, ast_format_gsm) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding gsm capability to H323 endpoint\n");
@@ -351,24 +351,8 @@
&ooh323c_stop_transmit_channel);
}
-
-#ifdef AST_FORMAT_AMRNB
- if(tmpfmt.id == AST_FORMAT_AMRNB)
- {
- if (gH323Debug) {
- ast_verb(0, "\tAdding amr nb capability to H323 endpoint\n");
- }
- ret = ooH323EpAddAMRNBCapability(OO_AMRNB, 4, 4, FALSE,
- OORXANDTX, &ooh323c_start_receive_channel,
- &ooh323c_start_transmit_channel,
- &ooh323c_stop_receive_channel,
- &ooh323c_stop_transmit_channel);
-
- }
-#endif
-
-#ifdef AST_FORMAT_SPEEX
- if(tmpfmt.id == AST_FORMAT_SPEEX)
+
+ if(ast_format_cmp(format, ast_format_speex) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding speex capability to H323 endpoint\n");
@@ -380,8 +364,8 @@
&ooh323c_stop_transmit_channel);
}
-#endif
-
+
+ ao2_ref(format, -1);
}
if(dtmf & H323_DTMF_CISCO)
@@ -397,11 +381,10 @@
}
int ooh323c_set_capability_for_call
- (ooCallData *call, struct ast_codec_pref *prefs, struct ast_format_cap *cap, int dtmf, int dtmfcodec,
+ (ooCallData *call, struct ast_format_cap *cap, int dtmf, int dtmfcodec,
int t38support, int g729onlyA)
{
int ret = 0, x, txframes;
- struct ast_format tmpfmt;
if (gH323Debug) {
ast_verb(0, "\tAdding capabilities to call(%s, %s)\n", call->callType,
call->callToken);
@@ -423,15 +406,16 @@
&ooh323c_stop_transmit_datachannel,
0);
- for(x=0; ast_codec_pref_index(prefs, x, &tmpfmt); x++)
+ for(x=0; x<ast_format_cap_count(cap); x++)
{
- if(tmpfmt.id == AST_FORMAT_ULAW)
+ struct ast_format *format = ast_format_cap_get_format(cap, x);
+ if(ast_format_cmp(format, ast_format_ulaw) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g711 ulaw capability to call(%s, %s)\n",
call->callType, call->callToken);
}
- txframes = prefs->framing[x];
+ txframes = ast_format_cap_get_framing(cap, format);
ret= ooCallAddG711Capability(call, OO_G711ULAW64K, txframes,
txframes, OORXANDTX,
&ooh323c_start_receive_channel,
@@ -439,13 +423,13 @@
&ooh323c_stop_receive_channel,
&ooh323c_stop_transmit_channel);
}
- if(tmpfmt.id == AST_FORMAT_ALAW)
+ if(ast_format_cmp(format, ast_format_alaw) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g711 alaw capability to call(%s, %s)\n",
call->callType, call->callToken);
}
- txframes = prefs->framing[x];
+ txframes = ast_format_cap_get_framing(cap, format);
ret= ooCallAddG711Capability(call, OO_G711ALAW64K, txframes,
txframes, OORXANDTX,
&ooh323c_start_receive_channel,
@@ -454,13 +438,13 @@
&ooh323c_stop_transmit_channel);
}
- if(tmpfmt.id == AST_FORMAT_G726)
+ if(ast_format_cmp(format, ast_format_g726) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g726 capability to call (%s, %s)\n",
call->callType, call->callToken);
}
- txframes = prefs->framing[x];
+ txframes = ast_format_cap_get_framing(cap, format);
ret = ooCallAddG726Capability(call, OO_G726, txframes, grxframes, FALSE,
OORXANDTX, &ooh323c_start_receive_channel,
&ooh323c_start_transmit_channel,
@@ -469,13 +453,13 @@
}
- if(tmpfmt.id == AST_FORMAT_G726_AAL2)
+ if(ast_format_cmp(format, ast_format_g726_aal2) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g726aal2 capability to call (%s, %s)\n",
call->callType, call->callToken);
}
- txframes = prefs->framing[x];
+ txframes = ast_format_cap_get_framing(cap, format);
ret = ooCallAddG726Capability(call, OO_G726AAL2, txframes, grxframes, FALSE,
OORXANDTX, &ooh323c_start_receive_channel,
&ooh323c_start_transmit_channel,
@@ -484,10 +468,10 @@
}
- if(tmpfmt.id == AST_FORMAT_G729A)
+ if(ast_format_cmp(format, ast_format_g729) == AST_FORMAT_CMP_EQUAL)
{
- txframes = (prefs->framing[x])/10;
+ txframes = (ast_format_cap_get_framing(cap, format))/10;
if (gH323Debug) {
ast_verb(0, "\tAdding g729A capability to call(%s, %s)\n",
call->callType, call->callToken);
@@ -520,7 +504,7 @@
}
- if(tmpfmt.id == AST_FORMAT_G723_1)
+ if(ast_format_cmp(format, ast_format_g723) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding g7231 capability to call (%s, %s)\n",
@@ -534,7 +518,7 @@
}
- if(tmpfmt.id == AST_FORMAT_H263)
+ if(ast_format_cmp(format, ast_format_h263) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding h263 capability to call (%s, %s)\n",
@@ -548,7 +532,7 @@
}
- if(tmpfmt.id == AST_FORMAT_GSM)
+ if(ast_format_cmp(format, ast_format_gsm) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding gsm capability to call(%s, %s)\n",
@@ -561,22 +545,7 @@
&ooh323c_stop_transmit_channel);
}
-#ifdef AST_FORMAT_AMRNB
- if(tmpfmt.id == AST_FORMAT_AMRNB)
- {
- if (gH323Debug) {
- ast_verb(0, "\tAdding AMR capability to call(%s, %s)\n",
- call->callType, call->callToken);
- }
- ret = ooCallAddAMRNBCapability(call, OO_AMRNB, 4, 4, FALSE,
- OORXANDTX, &ooh323c_start_receive_channel,
- &ooh323c_start_transmit_channel,
- &ooh323c_stop_receive_channel,
- &ooh323c_stop_transmit_channel);
- }
-#endif
-#ifdef AST_FORMAT_SPEEX
- if(tmpfmt.id == AST_FORMAT_SPEEX)
+ if(ast_format_cmp(format, ast_format_speex) == AST_FORMAT_CMP_EQUAL)
{
if (gH323Debug) {
ast_verb(0, "\tAdding Speex capability to call(%s, %s)\n",
@@ -588,7 +557,8 @@
&ooh323c_stop_receive_channel,
&ooh323c_stop_transmit_channel);
}
-#endif
+
+ ao2_ref(format, -1);
}
return ret;
}
@@ -622,9 +592,9 @@
int ooh323c_start_receive_channel(ooCallData *call, ooLogicalChannel *pChannel)
{
- struct ast_format tmpfmt;
- convertH323CapToAsteriskCap(pChannel->chanCap->cap, &tmpfmt);
- if(tmpfmt.id) {
+ struct ast_format *tmpfmt = NULL;
+ tmpfmt = convertH323CapToAsteriskCap(pChannel->chanCap->cap);
+ if(tmpfmt) {
/* ooh323_set_read_format(call, fmt); */
}else{
ast_log(LOG_ERROR, "Invalid capability type for receive channel %s\n",
@@ -636,19 +606,17 @@
int ooh323c_start_transmit_channel(ooCallData *call, ooLogicalChannel *pChannel)
{
- struct ast_format tmpfmt;
- convertH323CapToAsteriskCap(pChannel->chanCap->cap, &tmpfmt);
- if(tmpfmt.id) {
- switch (tmpfmt.id) {
- case AST_FORMAT_ALAW:
- case AST_FORMAT_ULAW:
- ooh323_set_write_format(call, &tmpfmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes);
- break;
- case AST_FORMAT_G729A:
- ooh323_set_write_format(call, &tmpfmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes*10);
- break;
- default:
- ooh323_set_write_format(call, &tmpfmt, 0);
+ struct ast_format *tmpfmt = NULL;
+ tmpfmt = convertH323CapToAsteriskCap(pChannel->chanCap->cap);
+
+ if (tmpfmt) {
+ if ((ast_format_cmp(tmpfmt, ast_format_alaw) == AST_FORMAT_CMP_EQUAL) ||
+ (ast_format_cmp(tmpfmt, ast_format_ulaw) == AST_FORMAT_CMP_EQUAL)) {
+ ooh323_set_write_format(call, tmpfmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes);
+ } else if (ast_format_cmp(tmpfmt, ast_format_g729) == AST_FORMAT_CMP_EQUAL) {
+ ooh323_set_write_format(call, tmpfmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes*10);
+ } else {
+ ooh323_set_write_format(call, tmpfmt, 0);
}
}else{
ast_log(LOG_ERROR, "Invalid capability type for receive channel %s\n",
@@ -693,41 +661,32 @@
return 1;
}
-struct ast_format *convertH323CapToAsteriskCap(int cap, struct ast_format *result)
-{
- ast_format_clear(result);
+struct ast_format *convertH323CapToAsteriskCap(int cap)
+{
switch(cap)
{
case OO_G711ULAW64K:
- return ast_format_set(result, AST_FORMAT_ULAW, 0);
+ return ast_format_ulaw;
case OO_G711ALAW64K:
- return ast_format_set(result, AST_FORMAT_ALAW, 0);
+ return ast_format_alaw;
case OO_GSMFULLRATE:
[... 75 lines stripped ...]
More information about the asterisk-commits
mailing list