<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15608">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><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;"><span>diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c</span><br><span>index 0b6ab51..445ff3e 100644</span><br><span>--- a/funcs/func_callerid.c</span><br><span>+++ b/funcs/func_callerid.c</span><br><span>@@ -1010,11 +1010,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>@@ -1024,18 +1024,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>@@ -1045,18 +1045,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>@@ -1069,15 +1069,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>@@ -1087,8 +1087,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>@@ -1099,7 +1099,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>@@ -1158,18 +1158,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>@@ -1179,7 +1179,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>@@ -1193,13 +1193,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>@@ -1214,7 +1214,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>@@ -1223,14 +1223,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>@@ -1242,9 +1242,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>@@ -1258,7 +1258,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>@@ -1311,10 +1311,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>@@ -1325,7 +1325,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>@@ -1400,7 +1400,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>@@ -1418,8 +1418,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>@@ -1432,7 +1432,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>@@ -1486,12 +1486,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>@@ -1502,8 +1502,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>@@ -1513,8 +1513,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>@@ -1524,7 +1524,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>@@ -1532,13 +1532,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>@@ -1548,8 +1548,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>@@ -1559,8 +1559,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>@@ -1641,8 +1641,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>@@ -1668,7 +1668,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>@@ -1682,8 +1682,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>@@ -1696,8 +1696,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>@@ -1709,7 +1709,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>@@ -1731,7 +1731,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>@@ -1756,7 +1756,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>@@ -1766,9 +1766,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>@@ -1781,8 +1781,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>@@ -1795,8 +1795,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 6f8815d..5763a5b 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/+/15608">change 15608</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/+/15608"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I75152cece8a00b7523d542e5ac22796f9595692b </div>
<div style="display:none"> Gerrit-Change-Number: 15608 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>