wdoekes / asterisk-chan-dongle

chan_dongle channel driver for Huawei UMTS cards, works with Asterisk 14+
Other
298 stars 104 forks source link

Logging fix #114

Closed hardillb closed 3 years ago

hardillb commented 3 years ago

A potential Fix for #111

It's not as elegant as the original but I think it should do the same and let it work with v13.x up. (Only tested with v13.14 as shipped with Raspbian)

wdoekes commented 3 years ago

Wouldn't it have been easier to replace:

            ast_log(AST_LOG_DEBUG, "[%s] Command response error suppressed:\n", PVT_ID(pvt));
            va_start(ap, fmt);
            ast_log_ap(AST_LOG_DEBUG, fmt, ap);
            va_end(ap);

with

char buf[1024];
ast_log(AST_LOG_DEBUG, "[%s] Command response error suppressed:\n", PVT_ID(pvt));
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
ast_log(AST_LOG_DEBUG, "%s", buf);
hardillb commented 3 years ago

yes, having just hit send on this I went back and looked at it again... I'm half way through testing that.