<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8548">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Verified
George Joseph: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail: Fix json blob errors<br><br>When app_voicemail calls ast_test_suite_notify with the results of<br>a user keypress, it formats the keypress as '%c'. If the user hung up<br>or some other error occurrs, the result of the keypress is a non<br>printable character. This ultimately causes json_vpack_ex to think<br>it's being passed a non utf-8 string and return an error.<br><br>* Keypress results passed to ast_test_suite_notify are now checked with<br> isprint() and a '?' is substituted if the check fails.<br><br>Change-Id: I78ee188916bbac840f3d03f40201b692347ea865<br>---<br>M apps/app_voicemail.c<br>1 file changed, 24 insertions(+), 12 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c<br>index 82fa3b3..1ab1169 100644<br>--- a/apps/app_voicemail.c<br>+++ b/apps/app_voicemail.c<br>@@ -7872,7 +7872,8 @@<br> ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", '#', '#');<br> return '#';<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", res, res);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(res) ? res : '?', isprint(res) ? res : '?');<br> return res;<br> }<br> <br>@@ -8035,7 +8036,8 @@<br> if (retries > 3) {<br> cmd = '*'; /* Let's cancel this beast */<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", cmd, cmd);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');<br> }<br> }<br> <br>@@ -8263,7 +8265,8 @@<br> cmd = 't';<br> done = 1;<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", cmd, cmd);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');<br> }<br> }<br> if (cmd < 0 || cmd == 't')<br>@@ -8928,7 +8931,8 @@<br> ast_log(AST_LOG_WARNING, "Playback of message %s failed\n", vms->fn);<br> res = 0;<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", res, res);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(res) ? res : '?', isprint(res) ? res : '?');<br> }<br> DISPOSE(vms->curdir, vms->curmsg);<br> return res;<br>@@ -10783,7 +10787,8 @@<br> if (retries > 3) {<br> cmd = 't';<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", cmd, cmd);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');<br> }<br> }<br> if (cmd == 't')<br>@@ -10863,7 +10868,8 @@<br> if (retries > 3) {<br> cmd = 't';<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", cmd, cmd);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');<br> }<br> }<br> DISPOSE(prefile, -1);<br>@@ -11685,7 +11691,8 @@<br> } else {<br> cmd = vm_intro(chan, vmu, &vms);<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", cmd, cmd);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');<br> <br> vms.repeats = 0;<br> vms.starting = 1;<br>@@ -11705,7 +11712,8 @@<br> adsi_folders(chan, 0, "Change to folder...");<br> <br> cmd = get_folder2(chan, "vm-changeto", 0);<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", cmd, cmd);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');<br> if (cmd == '#') {<br> cmd = 0;<br> } else if (cmd > 0) {<br>@@ -11837,7 +11845,8 @@<br> if (vms.repeats > 3) {<br> cmd = 't';<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", cmd, cmd);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');<br> }<br> }<br> if (cmd == 't') {<br>@@ -12015,7 +12024,8 @@<br> if (useadsi)<br> adsi_folders(chan, 1, "Save to folder...");<br> cmd = get_folder2(chan, "vm-savefolder", 1);<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", cmd, cmd);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');<br> box = 0; /* Shut up compiler */<br> if (cmd == '#') {<br> cmd = 0;<br>@@ -15181,7 +15191,8 @@<br> else<br> cmd = 't';<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", cmd, cmd);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(cmd) ? cmd : '?', isprint(cmd) ? cmd : '?');<br> }<br> if (retries >= 3) {<br> return 0;<br>@@ -15346,7 +15357,8 @@<br> res = 't';<br> }<br> }<br>- ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", res, res);<br>+ ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c",<br>+ isprint(res) ? res : '?', isprint(res) ? res : '?');<br> break;<br> <br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8548">change 8548</a>. To unsubscribe, 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/8548"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I78ee188916bbac840f3d03f40201b692347ea865 </div>
<div style="display:none"> Gerrit-Change-Number: 8548 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>