summaryrefslogtreecommitdiff
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2015-11-09 10:04:24 +0100
committerAlexander Traud <pabstraud@compuserve.com>2015-11-09 17:02:52 +0100
commit1bff400df7ff1fda353fab49de2fcf9cbba5cd89 (patch)
tree21e47ad2a45ffa5197e8469654171860aba7d87f /channels/chan_iax2.c
parent506aea26e6c67cd53874aa3ffef278524dfd7878 (diff)
ast_format_cap_get_names: To display all formats, the buffer was increased.
ASTERISK-25533 #close Change-Id: Ie1a9d1a6511b3f1a56b93d04475fbf8a4e40010a
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c44
1 files changed, 22 insertions, 22 deletions
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);