<p>Jaco Kroon has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15496">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">func_callerid+res_agi: Fix compile errors related to -Werror=zero-length-bounds<br><br>Change-Id: I75152cece8a00b7523d542e5ac22796f9595692b<br>Signed-off-by: Jaco Kroon <jaco@uls.co.za><br>---<br>M funcs/func_callerid.c<br>M res/res_agi.c<br>2 files changed, 76 insertions(+), 76 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/96/15496/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c</span><br><span>index 033366a..64aeffc 100644</span><br><span>--- a/funcs/func_callerid.c</span><br><span>+++ b/funcs/func_callerid.c</span><br><span>@@ -962,11 +962,11 @@</span><br><span> </span><br><span> ast_callerid_split(args.cid, name, sizeof(name), num, sizeof(num));</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (member.argc == 1 && !strcasecmp("all", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (member.argc == 1 && !strcasecmp("all", member.subnames[0])) {</span><br><span> snprintf(buf, len, "\"%s\" <%s>", name, num);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strcasecmp("name", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strcasecmp("name", member.subnames[0])) {</span><br><span> ast_copy_string(buf, name, len);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strncasecmp("num", member.argv[0], 3)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strncasecmp("num", member.subnames[0], 3)) {</span><br><span> /* Accept num[ber] */</span><br><span> ast_copy_string(buf, num, len);</span><br><span> } else {</span><br><span>@@ -976,18 +976,18 @@</span><br><span> enum ID_FIELD_STATUS status;</span><br><span> ast_channel_lock(chan);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (member.argc == 1 && !strcasecmp("rdnis", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (member.argc == 1 && !strcasecmp("rdnis", member.subnames[0])) {</span><br><span> if (ast_channel_redirecting(chan)->from.number.valid</span><br><span> && ast_channel_redirecting(chan)->from.number.str) {</span><br><span> ast_copy_string(buf, ast_channel_redirecting(chan)->from.number.str, len);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("dnid", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("dnid", member.subnames[0])) {</span><br><span> if (member.argc == 1) {</span><br><span> /* Setup as if user had given dnid-num instead. */</span><br><span> member.argc = 2;</span><br><span style="color: hsl(0, 100%, 40%);">- member.argv[1] = "num";</span><br><span style="color: hsl(120, 100%, 40%);">+ member.subnames[1] = "num";</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strncasecmp("num", member.argv[1], 3)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!strncasecmp("num", member.subnames[1], 3)) {</span><br><span> /*</span><br><span> * Accept num[ber]</span><br><span> * dnid-num...</span><br><span>@@ -997,18 +997,18 @@</span><br><span> if (ast_channel_dialed(chan)->number.str) {</span><br><span> ast_copy_string(buf, ast_channel_dialed(chan)->number.str, len);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 3 && !strcasecmp("plan", member.argv[2])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 3 && !strcasecmp("plan", member.subnames[2])) {</span><br><span> /* dnid-num-plan */</span><br><span> snprintf(buf, len, "%d", ast_channel_dialed(chan)->number.plan);</span><br><span> } else {</span><br><span> ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp("subaddr", member.argv[1], 7)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strncasecmp("subaddr", member.subnames[1], 7)) {</span><br><span> /*</span><br><span> * Accept subaddr[ess]</span><br><span> * dnid-subaddr...</span><br><span> */</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_subaddress_read(buf, len, member.argc - 2, member.argv + 2,</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_subaddress_read(buf, len, member.argc - 2, member.subnames + 2,</span><br><span> &ast_channel_dialed(chan)->subaddress);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1021,15 +1021,15 @@</span><br><span> } else {</span><br><span> ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strcasecmp("ani2", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strcasecmp("ani2", member.subnames[0])) {</span><br><span> snprintf(buf, len, "%d", ast_channel_caller(chan)->ani2);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("ani", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("ani", member.subnames[0])) {</span><br><span> if (member.argc == 1) {</span><br><span> /* Setup as if user had given ani-num instead. */</span><br><span> member.argc = 2;</span><br><span style="color: hsl(0, 100%, 40%);">- member.argv[1] = "num";</span><br><span style="color: hsl(120, 100%, 40%);">+ member.subnames[1] = "num";</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc - 1, member.argv + 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc - 1, member.subnames + 1,</span><br><span> &ast_channel_caller(chan)->ani);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1039,8 +1039,8 @@</span><br><span> ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);</span><br><span> break;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("priv", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc - 1, member.argv + 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("priv", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc - 1, member.subnames + 1,</span><br><span> &ast_channel_caller(chan)->priv);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1051,7 +1051,7 @@</span><br><span> break;</span><br><span> }</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc, member.argv, &ast_channel_caller(chan)->id);</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc, member.subnames, &ast_channel_caller(chan)->id);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> case ID_FIELD_INVALID:</span><br><span>@@ -1110,18 +1110,18 @@</span><br><span> value = ast_skip_blanks(value);</span><br><span> </span><br><span> ast_channel_lock(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- if (member.argc == 1 && !strcasecmp("rdnis", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (member.argc == 1 && !strcasecmp("rdnis", member.subnames[0])) {</span><br><span> ast_channel_redirecting(chan)->from.number.valid = 1;</span><br><span> ast_free(ast_channel_redirecting(chan)->from.number.str);</span><br><span> ast_channel_redirecting(chan)->from.number.str = ast_strdup(value);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("dnid", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("dnid", member.subnames[0])) {</span><br><span> ast_party_dialed_set_init(&dialed, ast_channel_dialed(chan));</span><br><span> if (member.argc == 1) {</span><br><span> /* Setup as if user had given dnid-num instead. */</span><br><span> member.argc = 2;</span><br><span style="color: hsl(0, 100%, 40%);">- member.argv[1] = "num";</span><br><span style="color: hsl(120, 100%, 40%);">+ member.subnames[1] = "num";</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strncasecmp("num", member.argv[1], 3)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!strncasecmp("num", member.subnames[1], 3)) {</span><br><span> /*</span><br><span> * Accept num[ber]</span><br><span> * dnid-num...</span><br><span>@@ -1131,7 +1131,7 @@</span><br><span> dialed.number.str = ast_strdup(value);</span><br><span> ast_trim_blanks(dialed.number.str);</span><br><span> ast_party_dialed_set(ast_channel_dialed(chan), &dialed);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 3 && !strcasecmp("plan", member.argv[2])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 3 && !strcasecmp("plan", member.subnames[2])) {</span><br><span> /* dnid-num-plan */</span><br><span> val = ast_strdupa(value);</span><br><span> ast_trim_blanks(val);</span><br><span>@@ -1145,13 +1145,13 @@</span><br><span> } else {</span><br><span> ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp("subaddr", member.argv[1], 7)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strncasecmp("subaddr", member.subnames[1], 7)) {</span><br><span> /*</span><br><span> * Accept subaddr[ess]</span><br><span> * dnid-subaddr...</span><br><span> */</span><br><span> status = party_subaddress_write(&dialed.subaddress, member.argc - 2,</span><br><span style="color: hsl(0, 100%, 40%);">- member.argv + 2, value);</span><br><span style="color: hsl(120, 100%, 40%);">+ member.subnames + 2, value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> ast_party_dialed_set(ast_channel_dialed(chan), &dialed);</span><br><span>@@ -1166,7 +1166,7 @@</span><br><span> ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);</span><br><span> }</span><br><span> ast_party_dialed_free(&dialed);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strcasecmp("ani2", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strcasecmp("ani2", member.subnames[0])) {</span><br><span> val = ast_strdupa(value);</span><br><span> ast_trim_blanks(val);</span><br><span> </span><br><span>@@ -1175,14 +1175,14 @@</span><br><span> } else {</span><br><span> ast_log(LOG_ERROR, "Unknown callerid ani2 '%s', value unchanged\n", val);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("ani", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("ani", member.subnames[0])) {</span><br><span> ast_party_caller_set_init(&caller, ast_channel_caller(chan));</span><br><span> if (member.argc == 1) {</span><br><span> /* Setup as if user had given ani-num instead. */</span><br><span> member.argc = 2;</span><br><span style="color: hsl(0, 100%, 40%);">- member.argv[1] = "num";</span><br><span style="color: hsl(120, 100%, 40%);">+ member.subnames[1] = "num";</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&caller.ani, member.argc - 1, member.argv + 1, value);</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&caller.ani, member.argc - 1, member.subnames + 1, value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> ast_party_caller_set(ast_channel_caller(chan), &caller, NULL);</span><br><span>@@ -1194,9 +1194,9 @@</span><br><span> break;</span><br><span> }</span><br><span> ast_party_caller_free(&caller);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("priv", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("priv", member.subnames[0])) {</span><br><span> ast_party_caller_set_init(&caller, ast_channel_caller(chan));</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&caller.priv, member.argc - 1, member.argv + 1, value);</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&caller.priv, member.argc - 1, member.subnames + 1, value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> ast_party_caller_set(ast_channel_caller(chan), &caller, NULL);</span><br><span>@@ -1210,7 +1210,7 @@</span><br><span> ast_party_caller_free(&caller);</span><br><span> } else {</span><br><span> ast_party_caller_set_init(&caller, ast_channel_caller(chan));</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&caller.id, member.argc, member.argv, value);</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&caller.id, member.argc, member.subnames, value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> ast_channel_set_caller_event(chan, &caller, NULL);</span><br><span>@@ -1263,10 +1263,10 @@</span><br><span> </span><br><span> ast_channel_lock(chan);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (member.argc == 1 && !strcasecmp("source", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (member.argc == 1 && !strcasecmp("source", member.subnames[0])) {</span><br><span> ast_copy_string(buf, ast_connected_line_source_name(ast_channel_connected(chan)->source), len);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("priv", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc - 1, member.argv + 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("priv", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc - 1, member.subnames + 1,</span><br><span> &ast_channel_connected(chan)->priv);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1277,7 +1277,7 @@</span><br><span> break;</span><br><span> }</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc, member.argv, &ast_channel_connected(chan)->id);</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc, member.subnames, &ast_channel_connected(chan)->id);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> case ID_FIELD_INVALID:</span><br><span>@@ -1352,7 +1352,7 @@</span><br><span> </span><br><span> value = ast_skip_blanks(value);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (member.argc == 1 && !strcasecmp("source", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (member.argc == 1 && !strcasecmp("source", member.subnames[0])) {</span><br><span> int source;</span><br><span> </span><br><span> val = ast_strdupa(value);</span><br><span>@@ -1370,8 +1370,8 @@</span><br><span> connected.source = source;</span><br><span> set_it(chan, &connected, NULL);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("priv", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&connected.priv, member.argc - 1, member.argv + 1, value);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("priv", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&connected.priv, member.argc - 1, member.subnames + 1, value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> set_it(chan, &connected, NULL);</span><br><span>@@ -1384,7 +1384,7 @@</span><br><span> }</span><br><span> ast_party_connected_line_free(&connected);</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&connected.id, member.argc, member.argv, value);</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&connected.id, member.argc, member.subnames, value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> set_it(chan, &connected, NULL);</span><br><span>@@ -1438,12 +1438,12 @@</span><br><span> ast_channel_lock(chan);</span><br><span> </span><br><span> ast_redirecting = ast_channel_redirecting(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strcasecmp("orig", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (member.argc == 2 && !strcasecmp("reason", member.argv[1])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!strcasecmp("orig", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (member.argc == 2 && !strcasecmp("reason", member.subnames[1])) {</span><br><span> ast_copy_string(buf,</span><br><span> ast_redirecting_reason_name(&ast_redirecting->orig_reason), len);</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc - 1, member.argv + 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc - 1, member.subnames + 1,</span><br><span> &ast_redirecting->orig);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1454,8 +1454,8 @@</span><br><span> break;</span><br><span> }</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("from", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc - 1, member.argv + 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("from", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc - 1, member.subnames + 1,</span><br><span> &ast_redirecting->from);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1465,8 +1465,8 @@</span><br><span> ast_log(LOG_ERROR, "Unknown redirecting data type '%s'.\n", data);</span><br><span> break;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("to", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc - 1, member.argv + 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("to", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc - 1, member.subnames + 1,</span><br><span> &ast_redirecting->to);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1476,7 +1476,7 @@</span><br><span> ast_log(LOG_ERROR, "Unknown redirecting data type '%s'.\n", data);</span><br><span> break;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strncasecmp("pres", member.argv[0], 4)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strncasecmp("pres", member.subnames[0], 4)) {</span><br><span> /*</span><br><span> * Accept pres[entation]</span><br><span> * This is the combined from name/number presentation.</span><br><span>@@ -1484,13 +1484,13 @@</span><br><span> ast_copy_string(buf,</span><br><span> ast_named_caller_presentation(</span><br><span> ast_party_id_presentation(&ast_redirecting->from)), len);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strcasecmp("reason", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strcasecmp("reason", member.subnames[0])) {</span><br><span> ast_copy_string(buf, ast_redirecting_reason_name(&ast_redirecting->reason), len);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strcasecmp("count", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strcasecmp("count", member.subnames[0])) {</span><br><span> snprintf(buf, len, "%d", ast_redirecting->count);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (1 < member.argc && !strcasecmp("priv", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strcasecmp("orig", member.argv[1])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc - 2, member.argv + 2,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (1 < member.argc && !strcasecmp("priv", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!strcasecmp("orig", member.subnames[1])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc - 2, member.subnames + 2,</span><br><span> &ast_redirecting->priv_orig);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1500,8 +1500,8 @@</span><br><span> ast_log(LOG_ERROR, "Unknown redirecting data type '%s'.\n", data);</span><br><span> break;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("from", member.argv[1])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc - 2, member.argv + 2,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("from", member.subnames[1])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc - 2, member.subnames + 2,</span><br><span> &ast_redirecting->priv_from);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1511,8 +1511,8 @@</span><br><span> ast_log(LOG_ERROR, "Unknown redirecting data type '%s'.\n", data);</span><br><span> break;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("to", member.argv[1])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_read(buf, len, member.argc - 2, member.argv + 2,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("to", member.subnames[1])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_read(buf, len, member.argc - 2, member.subnames + 2,</span><br><span> &ast_redirecting->priv_to);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1593,8 +1593,8 @@</span><br><span> </span><br><span> value = ast_skip_blanks(value);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!strcasecmp("orig", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (member.argc == 2 && !strcasecmp("reason", member.argv[1])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!strcasecmp("orig", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (member.argc == 2 && !strcasecmp("reason", member.subnames[1])) {</span><br><span> int reason;</span><br><span> </span><br><span> val = ast_strdupa(value);</span><br><span>@@ -1620,7 +1620,7 @@</span><br><span> set_it(chan, &redirecting, NULL);</span><br><span> }</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&redirecting.orig, member.argc - 1, member.argv + 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&redirecting.orig, member.argc - 1, member.subnames + 1,</span><br><span> value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1634,8 +1634,8 @@</span><br><span> }</span><br><span> ast_party_redirecting_free(&redirecting);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("from", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&redirecting.from, member.argc - 1, member.argv + 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("from", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&redirecting.from, member.argc - 1, member.subnames + 1,</span><br><span> value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1648,8 +1648,8 @@</span><br><span> break;</span><br><span> }</span><br><span> ast_party_redirecting_free(&redirecting);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("to", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&redirecting.to, member.argc - 1, member.argv + 1, value);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("to", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&redirecting.to, member.argc - 1, member.subnames + 1, value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> set_it(chan, &redirecting, NULL);</span><br><span>@@ -1661,7 +1661,7 @@</span><br><span> break;</span><br><span> }</span><br><span> ast_party_redirecting_free(&redirecting);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strncasecmp("pres", member.argv[0], 4)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strncasecmp("pres", member.subnames[0], 4)) {</span><br><span> int pres;</span><br><span> </span><br><span> val = ast_strdupa(value);</span><br><span>@@ -1683,7 +1683,7 @@</span><br><span> redirecting.to.number.presentation = pres;</span><br><span> set_it(chan, &redirecting, NULL);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strcasecmp("reason", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strcasecmp("reason", member.subnames[0])) {</span><br><span> int reason;</span><br><span> </span><br><span> val = ast_strdupa(value);</span><br><span>@@ -1708,7 +1708,7 @@</span><br><span> redirecting.reason.str = "";</span><br><span> set_it(chan, &redirecting, NULL);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (member.argc == 1 && !strcasecmp("count", member.argv[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (member.argc == 1 && !strcasecmp("count", member.subnames[0])) {</span><br><span> val = ast_strdupa(value);</span><br><span> ast_trim_blanks(val);</span><br><span> </span><br><span>@@ -1718,9 +1718,9 @@</span><br><span> } else {</span><br><span> ast_log(LOG_ERROR, "Unknown redirecting count '%s', value unchanged\n", val);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (1 < member.argc && !strcasecmp("priv", member.argv[0])) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strcasecmp("orig", member.argv[1])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&redirecting.priv_orig, member.argc - 2, member.argv + 2,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (1 < member.argc && !strcasecmp("priv", member.subnames[0])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!strcasecmp("orig", member.subnames[1])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&redirecting.priv_orig, member.argc - 2, member.subnames + 2,</span><br><span> value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1733,8 +1733,8 @@</span><br><span> break;</span><br><span> }</span><br><span> ast_party_redirecting_free(&redirecting);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("from", member.argv[1])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&redirecting.priv_from, member.argc - 2, member.argv + 2,</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("from", member.subnames[1])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&redirecting.priv_from, member.argc - 2, member.subnames + 2,</span><br><span> value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span>@@ -1747,8 +1747,8 @@</span><br><span> break;</span><br><span> }</span><br><span> ast_party_redirecting_free(&redirecting);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp("to", member.argv[1])) {</span><br><span style="color: hsl(0, 100%, 40%);">- status = party_id_write(&redirecting.priv_to, member.argc - 2, member.argv + 2, value);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcasecmp("to", member.subnames[1])) {</span><br><span style="color: hsl(120, 100%, 40%);">+ status = party_id_write(&redirecting.priv_to, member.argc - 2, member.subnames + 2, value);</span><br><span> switch (status) {</span><br><span> case ID_FIELD_VALID:</span><br><span> set_it(chan, &redirecting, NULL);</span><br><span>diff --git a/res/res_agi.c b/res/res_agi.c</span><br><span>index 77ba226..b10e4ab 100644</span><br><span>--- a/res/res_agi.c</span><br><span>+++ b/res/res_agi.c</span><br><span>@@ -4510,7 +4510,7 @@</span><br><span> memset(&agi, 0, sizeof(agi));</span><br><span> buf = ast_strdupa(data);</span><br><span> AST_STANDARD_APP_ARGS(args, buf);</span><br><span style="color: hsl(0, 100%, 40%);">- args.argv[args.argc] = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ args.arg[args.argc] = NULL;</span><br><span> #if 0</span><br><span> /* Answer if need be */</span><br><span> if (chan->_state != AST_STATE_UP) {</span><br><span>@@ -4518,7 +4518,7 @@</span><br><span> return -1;</span><br><span> }</span><br><span> #endif</span><br><span style="color: hsl(0, 100%, 40%);">- res = launch_script(chan, args.argv[0], args.argc, args.argv, fds, enhanced ? &efd : NULL, &pid);</span><br><span style="color: hsl(120, 100%, 40%);">+ res = launch_script(chan, args.arg[0], args.argc, args.arg, fds, enhanced ? &efd : NULL, &pid);</span><br><span> /* Async AGI do not require run_agi(), so just proceed if normal AGI</span><br><span> or Fast AGI are setup with success. */</span><br><span> if (res == AGI_RESULT_SUCCESS || res == AGI_RESULT_SUCCESS_FAST) {</span><br><span>@@ -4527,7 +4527,7 @@</span><br><span> agi.ctrl = fds[0];</span><br><span> agi.audio = efd;</span><br><span> agi.fast = (res == AGI_RESULT_SUCCESS_FAST) ? 1 : 0;</span><br><span style="color: hsl(0, 100%, 40%);">- res = run_agi(chan, args.argv[0], &agi, pid, &status, dead, args.argc, args.argv);</span><br><span style="color: hsl(120, 100%, 40%);">+ res = run_agi(chan, args.arg[0], &agi, pid, &status, dead, args.argc, args.arg);</span><br><span> /* If the fork'd process returns non-zero, set AGISTATUS to FAILURE */</span><br><span> if ((res == AGI_RESULT_SUCCESS || res == AGI_RESULT_SUCCESS_FAST) && status)</span><br><span> res = AGI_RESULT_FAILURE;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15496">change 15496</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15496"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I75152cece8a00b7523d542e5ac22796f9595692b </div>
<div style="display:none"> Gerrit-Change-Number: 15496 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>