summaryrefslogtreecommitdiff
path: root/main/format_cap.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2015-03-14 02:29:29 +0000
committerMatthew Jordan <mjordan@digium.com>2015-03-14 02:29:29 +0000
commite89f83b3adaad637e2d3d2a11041f28a0459222c (patch)
treec77a4671b3e35a18242718ed827f5245dc21c08e /main/format_cap.c
parent0d52907d2b9147fb10d4d06edc9bb28169795ea7 (diff)
main/frame: Don't report empty disallow values as an error
In realtime, it is normal to have a database with both 'allow' and 'disallow' columns in the schema. It is perfectly valid to have an 'allow' value of '!all,g722,ulaw,alaw' and no 'disallow' value. Unlike in static conf files, you can't *not* provide the disallow value. Thus, the empty disallow value causes a spurious WARNING message, which is kind of annoying. This patch makes it so that a 'disallow' value with no ... value ... is ignored. Granted, you can still screw this up as well, as technically specifying 'disallow=all,!ulaw' allows only ulaw, and then you would have no 'allow' value in your database. But really, why would you do that? WHY? ASTERISK-16779 #close Reported by: Atis Lezdins ........ Merged revisions 432970 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 432971 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/format_cap.c')
-rw-r--r--main/format_cap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/format_cap.c b/main/format_cap.c
index 364c924bf..177652efb 100644
--- a/main/format_cap.c
+++ b/main/format_cap.c
@@ -319,6 +319,10 @@ int ast_format_cap_update_by_allow_disallow(struct ast_format_cap *cap, const ch
int res = 0, all = 0, iter_allowing;
char *parse = NULL, *this = NULL, *psize = NULL;
+ if (!allowing && ast_strlen_zero(list)) {
+ return 0;
+ }
+
parse = ast_strdupa(list);
while ((this = strsep(&parse, ","))) {
int framems = 0;