From 1bff400df7ff1fda353fab49de2fcf9cbba5cd89 Mon Sep 17 00:00:00 2001 From: Alexander Traud Date: Mon, 9 Nov 2015 10:04:24 +0100 Subject: ast_format_cap_get_names: To display all formats, the buffer was increased. ASTERISK-25533 #close Change-Id: Ie1a9d1a6511b3f1a56b93d04475fbf8a4e40010a --- channels/chan_alsa.c | 2 +- channels/chan_console.c | 2 +- channels/chan_iax2.c | 44 ++++++++++++++++++++++---------------------- channels/chan_mgcp.c | 10 +++++----- channels/chan_motif.c | 2 +- channels/chan_nbs.c | 2 +- channels/chan_oss.c | 2 +- channels/chan_phone.c | 2 +- channels/chan_pjsip.c | 2 +- channels/chan_sip.c | 36 ++++++++++++++++++------------------ channels/chan_skinny.c | 12 ++++++------ channels/chan_unistim.c | 18 +++++++++--------- channels/chan_vpb.cc | 2 +- 13 files changed, 68 insertions(+), 68 deletions(-) (limited to 'channels') diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c index 74a61398a..6508a1e07 100644 --- a/channels/chan_alsa.c +++ b/channels/chan_alsa.c @@ -620,7 +620,7 @@ static struct ast_channel *alsa_request(const char *type, struct ast_format_cap struct ast_channel *tmp = NULL; if (ast_format_cap_iscompatible_format(cap, ast_format_slin) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_NOTICE, "Asked to get a channel of format '%s'\n", ast_format_cap_get_names(cap, &codec_buf)); return NULL; } diff --git a/channels/chan_console.c b/channels/chan_console.c index 74f2922eb..02d68870b 100644 --- a/channels/chan_console.c +++ b/channels/chan_console.c @@ -479,7 +479,7 @@ static struct ast_channel *console_request(const char *type, struct ast_format_c } if (!(ast_format_cap_iscompatible(cap, console_tech.capabilities))) { - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_NOTICE, "Channel requested with unsupported format(s): '%s'\n", ast_format_cap_get_names(cap, &cap_buf)); goto return_unref; diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index efe1bd394..5af0bfe1d 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -3816,7 +3816,7 @@ static char *handle_cli_iax2_show_peer(struct ast_cli_entry *e, int cmd, struct char status[30]; char cbuf[256]; struct iax2_peer *peer; - struct ast_str *codec_buf = ast_str_alloca(256); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); struct ast_str *encmethods = ast_str_alloca(256); int load_realtime = 0; @@ -5589,8 +5589,8 @@ static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_cha return AST_BRIDGE_FAILED_NOWARN; } if (!(ast_format_cap_identical(ast_channel_nativeformats(c0), ast_channel_nativeformats(c1)))) { - struct ast_str *c0_buf = ast_str_alloca(64); - struct ast_str *c1_buf = ast_str_alloca(64); + struct ast_str *c0_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *c1_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_verb(3, "Operating with different codecs [%s] [%s] , can't native bridge...\n", ast_format_cap_get_names(ast_channel_nativeformats(c0), &c0_buf), @@ -10815,9 +10815,9 @@ static int socket_process_helper(struct iax2_thread *thread) break; } if (authdebug) { - struct ast_str *peer_buf = ast_str_alloca(64); - struct ast_str *cap_buf = ast_str_alloca(64); - struct ast_str *peer_form_buf = ast_str_alloca(64); + struct ast_str *peer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *peer_form_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); if (ast_test_flag64(iaxs[fr->callno], IAX_CODEC_NOCAP)) { ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested '%s' incompatible with our capability '%s'.\n", @@ -10862,9 +10862,9 @@ static int socket_process_helper(struct iax2_thread *thread) } if (!format) { - struct ast_str *peer_buf = ast_str_alloca(64); - struct ast_str *cap_buf = ast_str_alloca(64); - struct ast_str *peer_form_buf = ast_str_alloca(64); + struct ast_str *peer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *peer_form_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); memset(&ied0, 0, sizeof(ied0)); iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec"); @@ -11042,8 +11042,8 @@ static int socket_process_helper(struct iax2_thread *thread) break; } if (authdebug) { - struct ast_str *peer_buf = ast_str_alloca(64); - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *peer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_NOTICE, "Rejected call to %s, format %s incompatible with our capability %s.\n", ast_sockaddr_stringify(&addr), @@ -11056,7 +11056,7 @@ static int socket_process_helper(struct iax2_thread *thread) ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED); iax2_lock_owner(fr->callno); if (iaxs[fr->callno] && iaxs[fr->callno]->owner && native) { - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); /* Switch us to use a compatible format */ iax2_codec_pref_best_bitfield2cap( @@ -11260,9 +11260,9 @@ static int socket_process_helper(struct iax2_thread *thread) iax2_codec_pref_string(&iaxs[fr->callno]->prefs, host_pref_buf, sizeof(host_pref_buf) - 1); } if (!format) { - struct ast_str *cap_buf = ast_str_alloca(64); - struct ast_str *peer_buf = ast_str_alloca(64); - struct ast_str *peer_form_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *peer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *peer_form_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); if(!ast_test_flag64(iaxs[fr->callno], IAX_CODEC_NOCAP)) { ast_debug(1, "We don't do requested format %s, falling back to peer capability '%s'\n", @@ -11323,9 +11323,9 @@ static int socket_process_helper(struct iax2_thread *thread) } } if (!format) { - struct ast_str *cap_buf = ast_str_alloca(64); - struct ast_str *peer_buf = ast_str_alloca(64); - struct ast_str *peer_form_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *peer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *peer_form_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_ERROR, "No best format in %s???\n", iax2_getformatname_multiple(iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability, &cap_buf)); @@ -11449,7 +11449,7 @@ immediatedial: break; } } else { - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED); ast_verb(3, "Accepting DIAL from %s, formats = %s\n", ast_sockaddr_stringify(&addr), @@ -12530,8 +12530,8 @@ static struct ast_channel *iax2_request(const char *type, struct ast_format_cap res = ast_translator_best_choice(cap, ast_channel_nativeformats(c), &best_fmt_cap, &best_fmt_native); if (res < 0) { - struct ast_str *native_cap_buf = ast_str_alloca(256); - struct ast_str *cap_buf = ast_str_alloca(256); + struct ast_str *native_cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_WARNING, "Unable to create translator path for %s to %s on %s\n", ast_format_cap_get_names(ast_channel_nativeformats(c), &native_cap_buf), @@ -14384,7 +14384,7 @@ static int function_iaxpeer(struct ast_channel *chan, const char *cmd, char *dat } else if (!strcasecmp(colname, "callerid_num")) { ast_copy_string(buf, peer->cid_num, len); } else if (!strcasecmp(colname, "codecs")) { - struct ast_str *codec_buf = ast_str_alloca(256); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); iax2_getformatname_multiple(peer->capability, &codec_buf); ast_copy_string(buf, ast_str_buffer(codec_buf), len); diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 030df89c7..16ba7ec30 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -1253,7 +1253,7 @@ static int mgcp_write(struct ast_channel *ast, struct ast_frame *frame) } } else { if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), frame->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_WARNING, "Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n", ast_format_get_name(frame->subclass.format), @@ -1986,9 +1986,9 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req) int codec, codec_count=0; int iterator; struct mgcp_endpoint *p = sub->parent; - struct ast_str *global_buf = ast_str_alloca(64); - struct ast_str *peer_buf = ast_str_alloca(64); - struct ast_str *pvt_buf = ast_str_alloca(64); + struct ast_str *global_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *peer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *pvt_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); /* Get codec and RTP info from SDP */ m = get_sdp(req, "m"); @@ -3972,7 +3972,7 @@ static struct ast_channel *mgcp_request(const char *type, struct ast_format_cap char tmp[256]; if (!(ast_format_cap_iscompatible(cap, global_capability))) { - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%s'\n", ast_format_cap_get_names(cap, &cap_buf)); /*return NULL;*/ diff --git a/channels/chan_motif.c b/channels/chan_motif.c index 48f1b1fc7..24575fae0 100644 --- a/channels/chan_motif.c +++ b/channels/chan_motif.c @@ -1706,7 +1706,7 @@ static int jingle_write(struct ast_channel *ast, struct ast_frame *frame) switch (frame->frametype) { case AST_FRAME_VOICE: if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), frame->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_WARNING, "Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n", diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c index 36c3435bb..2abde61e3 100644 --- a/channels/chan_nbs.c +++ b/channels/chan_nbs.c @@ -232,7 +232,7 @@ static struct ast_channel *nbs_request(const char *type, struct ast_format_cap * struct ast_channel *tmp = NULL; if (ast_format_cap_iscompatible_format(cap, ast_format_slin) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%s'\n", ast_format_cap_get_names(cap, &cap_buf)); diff --git a/channels/chan_oss.c b/channels/chan_oss.c index 51fce44c0..912a5ebbe 100644 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -863,7 +863,7 @@ static struct ast_channel *oss_request(const char *type, struct ast_format_cap * return NULL; } if (ast_format_cap_iscompatible_format(cap, ast_format_slin) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_NOTICE, "Format %s unsupported\n", ast_format_cap_get_names(cap, &codec_buf)); return NULL; } diff --git a/channels/chan_phone.c b/channels/chan_phone.c index 2bf7bddb4..451d9f261 100644 --- a/channels/chan_phone.c +++ b/channels/chan_phone.c @@ -1282,7 +1282,7 @@ static struct ast_channel *phone_request(const char *type, struct ast_format_cap restart_monitor(); if (tmp == NULL) { if (!(ast_format_cap_iscompatible(cap, phone_tech.capabilities))) { - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%s'\n", ast_format_cap_get_names(cap, &codec_buf)); return NULL; diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c index 6195d1032..1319094cf 100644 --- a/channels/chan_pjsip.c +++ b/channels/chan_pjsip.c @@ -673,7 +673,7 @@ static int chan_pjsip_write(struct ast_channel *ast, struct ast_frame *frame) return 0; } if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), frame->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *cap_buf = ast_str_alloca(128); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); struct ast_str *write_transpath = ast_str_alloca(256); struct ast_str *read_transpath = ast_str_alloca(256); diff --git a/channels/chan_sip.c b/channels/chan_sip.c index acb7d535f..cda437024 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -7209,7 +7209,7 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame) switch (frame->frametype) { case AST_FRAME_VOICE: if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), frame->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_WARNING, "Asked to transmit frame type %s, while native formats is %s read/write = %s/%s\n", ast_format_get_name(frame->subclass.format), ast_format_cap_get_names(ast_channel_nativeformats(ast), &codec_buf), @@ -7846,7 +7846,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit struct ast_variable *v = NULL; struct ast_format *fmt; struct ast_format_cap *what = NULL; /* SHALLOW COPY DO NOT DESTROY! */ - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); int needvideo = 0; int needtext = 0; char *exten; @@ -9921,7 +9921,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action int debug = sip_debug_test_pvt(p); /* START UNKNOWN */ - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); struct ast_format *tmp_fmt; /* END UNKNOWN */ @@ -10570,11 +10570,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action if (debug) { /* shame on whoever coded this.... */ - struct ast_str *cap_buf = ast_str_alloca(64); - struct ast_str *peer_buf = ast_str_alloca(64); - struct ast_str *vpeer_buf = ast_str_alloca(64); - struct ast_str *tpeer_buf = ast_str_alloca(64); - struct ast_str *joint_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *peer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *vpeer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *tpeer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *joint_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_verbose("Capabilities: us - %s, peer - audio=%s/video=%s/text=%s, combined - %s\n", ast_format_cap_get_names(p->caps, &cap_buf), @@ -10781,8 +10781,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action unsigned int framing; if (debug) { - struct ast_str *cap_buf = ast_str_alloca(64); - struct ast_str *joint_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *joint_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_debug(1, "Setting native formats after processing SDP. peer joint formats %s, old nativeformats %s\n", ast_format_cap_get_names(p->jointcaps, &joint_buf), @@ -13116,7 +13116,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int int min_video_packet_size = 0; int min_text_packet_size = 0; - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); /* Set the SDP session name */ snprintf(subject, sizeof(subject), "s=%s\r\n", ast_strlen_zero(global_sdpsession) ? "-" : global_sdpsession); @@ -20298,7 +20298,7 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct char status[30] = ""; char cbuf[256]; struct sip_peer *peer; - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); struct ast_variable *v; int x = 0, load_realtime; int realtimepeers; @@ -20944,7 +20944,7 @@ static char *sip_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_ { int realtimepeers; int realtimeregs; - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); const char *msg; /* temporary msg pointer */ struct sip_auth_container *credentials; @@ -21261,7 +21261,7 @@ static int show_channels_cb(void *__cur, void *__arg, int flags) if (cur->subscribed == NONE && !arg->subscriptions) { /* set if SIP transfer in progress */ const char *referstatus = cur->refer ? referstatus2str(cur->refer->status) : ""; - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_cli(arg->fd, FORMAT, ast_sockaddr_stringify_addr(dst), S_OR(cur->username, S_OR(cur->cid_num, "(None)")), @@ -21507,7 +21507,7 @@ static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_a if (!strncasecmp(cur->callid, a->argv[3], len)) { struct ast_str *strbuf; - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_cli(a->fd, "\n"); if (cur->subscribed != NONE) { @@ -22466,7 +22466,7 @@ static int function_sippeer(struct ast_channel *chan, const char *cmd, char *dat } else if (!strcasecmp(colname, "callerid_num")) { ast_copy_string(buf, peer->cid_num, len); } else if (!strcasecmp(colname, "codecs")) { - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_format_cap_get_names(peer->caps, &codec_buf); ast_copy_string(buf, ast_str_buffer(codec_buf), len); } else if (!strcasecmp(colname, "encryption")) { @@ -29609,8 +29609,8 @@ static struct ast_channel *sip_request_call(const char *type, struct ast_format_ struct ast_channel *tmpc = NULL; char *ext = NULL, *host; char tmp[256]; - struct ast_str *codec_buf = ast_str_alloca(64); - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); char *dnid; char *secret = NULL; char *md5secret = NULL; diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 23a48356f..b6d269d95 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -4176,7 +4176,7 @@ static char *_skinny_show_device(int type, int fd, struct mansession *s, const s struct skinny_speeddial *sd; struct skinny_addon *sa; struct skinny_serviceurl *surl; - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); if (argc < 4) { return CLI_SHOWUSAGE; @@ -4425,7 +4425,7 @@ static char *_skinny_show_line(int type, int fd, struct mansession *s, const str struct skinny_device *d; struct skinny_line *l; struct skinny_subline *subline; - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); char group_buf[256]; char cbuf[256]; @@ -5075,7 +5075,7 @@ static int skinny_write(struct ast_channel *ast, struct ast_frame *frame) } } else { if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), frame->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_WARNING, "Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n", ast_format_get_name(frame->subclass.format), ast_format_cap_get_names(ast_channel_nativeformats(ast), &codec_buf), @@ -5351,7 +5351,7 @@ static struct ast_channel *skinny_new(struct skinny_line *l, struct skinny_subli struct ast_format *tmpfmt; struct ast_format_cap *caps; #ifdef AST_DEVMODE - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); #endif if (!l->device || !l->device->session) { @@ -6638,7 +6638,7 @@ static int handle_capabilities_res_message(struct skinny_req *req, struct skinny struct ast_format_cap *codecs = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT); int i; #ifdef AST_DEVMODE - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); #endif @@ -7681,7 +7681,7 @@ static struct ast_channel *skinny_request(const char *type, struct ast_format_ca char tmp[256]; if (!(ast_format_cap_has_type(cap, AST_MEDIA_TYPE_AUDIO))) { - struct ast_str *codec_buf = ast_str_alloca(64); + struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%s'\n", ast_format_cap_get_names(cap, &codec_buf)); return NULL; } diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c index f42961725..db4720d1a 100644 --- a/channels/chan_unistim.c +++ b/channels/chan_unistim.c @@ -2889,7 +2889,7 @@ static void start_rtp(struct unistim_subchannel *sub) ast_rtp_instance_set_remote_address(sub->rtp, &sin_tmp); if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(sub->owner), ast_channel_readformat(sub->owner)) == AST_FORMAT_CMP_NOT_EQUAL) { struct ast_format *tmpfmt; - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); tmpfmt = ast_format_cap_get_format(ast_channel_nativeformats(sub->owner), 0); ast_log(LOG_WARNING, @@ -5142,7 +5142,7 @@ static struct ast_frame *unistim_rtp_read(const struct ast_channel *ast, /* We already hold the channel lock */ if (f->frametype == AST_FRAME_VOICE) { if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(sub->owner), f->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); struct ast_format_cap *caps; ast_debug(1, @@ -5192,7 +5192,7 @@ static int unistim_write(struct ast_channel *ast, struct ast_frame *frame) } } else { if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), frame->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) { - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_WARNING, "Asked to transmit frame type %s, while native formats is %s (read/write = (%s/%s)\n", @@ -5723,9 +5723,9 @@ static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state tmpfmt = ast_format_cap_get_format(ast_channel_nativeformats(tmp), 0); if (unistimdebug) { - struct ast_str *native_buf = ast_str_alloca(64); - struct ast_str *cap_buf = ast_str_alloca(64); - struct ast_str *global_buf = ast_str_alloca(64); + struct ast_str *native_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *global_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_verb(0, "Best codec = %s from nativeformats %s (line cap=%s global=%s)\n", ast_format_get_name(tmpfmt), @@ -5938,8 +5938,8 @@ static struct ast_channel *unistim_request(const char *type, struct ast_format_c char tmp[256]; if (!(ast_format_cap_iscompatible(cap, global_cap))) { - struct ast_str *cap_buf = ast_str_alloca(64); - struct ast_str *global_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); + struct ast_str *global_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format %s while capability is %s\n", ast_format_cap_get_names(cap, &cap_buf), @@ -6014,7 +6014,7 @@ static char *unistim_show_info(struct ast_cli_entry *e, int cmd, struct ast_cli_ struct unistim_line *line; struct unistim_subchannel *sub; struct unistimsession *s; - struct ast_str *cap_buf = ast_str_alloca(64); + struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN); switch (cmd) { case CLI_INIT: diff --git a/channels/chan_vpb.cc b/channels/chan_vpb.cc index f1ed39217..0f050a837 100644 --- a/channels/chan_vpb.cc +++ b/channels/chan_vpb.cc @@ -2508,7 +2508,7 @@ static struct ast_channel *vpb_request(const char *type, struct ast_format_cap * if (!(ast_format_cap_iscompatible_format(cap, ast_format_slin))) { struct ast_str *buf; - buf = ast_str_create(256); + buf = ast_str_create(AST_FORMAT_CAP_NAMES_LEN); if (!buf) { return NULL; } -- cgit v1.2.3