improve a bit of suboptimal code
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 13 Mar 2009 16:55:38 +0000 (16:55 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 13 Mar 2009 16:55:38 +0000 (16:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181985 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index a2bb9fc..5d80ef3 100644 (file)
@@ -19865,11 +19865,7 @@ static int acf_channel_read(struct ast_channel *chan, const char *funcname, char
        } else if (!strcasecmp(args.param, "peername")) {
                ast_copy_string(buf, p->peername, buflen);
        } else if (!strcasecmp(args.param, "t38passthrough")) {
-               if (p->t38.state == T38_DISABLED) {
-                       ast_copy_string(buf, "0", sizeof("0"));
-               } else {  /* T38 is offered or enabled in this call */
-                       ast_copy_string(buf, "1", sizeof("1"));
-               }
+               ast_copy_string(buf, (p->t38.state == T38_DISABLED) ? "0" : "1", buflen);
        } else if (!strcasecmp(args.param, "rtpdest")) {
                struct sockaddr_in sin;