<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8546">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
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 95d0e8d..234d8ad 100644<br>--- a/apps/app_voicemail.c<br>+++ b/apps/app_voicemail.c<br>@@ -7837,7 +7837,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>@@ -8000,7 +8001,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>@@ -8228,7 +8230,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>@@ -8885,7 +8888,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>@@ -10669,7 +10673,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>@@ -10749,7 +10754,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>@@ -11571,7 +11577,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>@@ -11591,7 +11598,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>@@ -11723,7 +11731,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>@@ -11901,7 +11910,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>@@ -15132,7 +15142,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>@@ -15297,7 +15308,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/8546">change 8546</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/8546"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </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: 8546 </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>