<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> 
<base href="https://wiki.asterisk.org/wiki" /> 
<title>Message Title</title>  
<style type="text/css">@media only screen and (max-device-width: 480px) {.mobile-only {
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        line-height: normal !important;
        font-size: inherit !important;
        mso-hide: all;
}

.desktop-only {
        display: none !important;
}

/* iPhone 3GS fix for unwanted 20px right margin */
body { min-width: 100% !important; padding: 0; margin: 0; }

#center-content-table { max-width: none; !important; }
#header-pattern-container { padding: 10px 10px 10px 10px !important; line-height: 20px !important; }
#header-avatar-image-container { padding-right: 8px !important; }
#email-content-container { padding: 0 !important; }
.mobile-expand { border-radius: 0 !important; border-left: 0 !important; border-right: 0 !important; padding-left: 26px !important;}
.mobile-resize-text { font-size: 16px !important; line-height: 22px !important; }
#page-title-pattern-header { font-size: 20px !important; line-height: 28px !important; }
#page-title-pattern-icon-image-container-cell { padding-top: 7px !important; }
#inline-user-pattern { display: block !important; }
#inline-user-pattern-avatar { padding-top: 3px !important; }
.contextual-area-pattern { border-bottom: 1px solid #ccc !important; padding: 15px 10px 0 10px !important;}
.users-involved-pattern-column-table { width: 100% !important;  }
.users-involved-pattern-avatar-table-cell { padding: 3px 5px 5px 0 !important; }
.users-involved-pattern-column-container { padding-right: 0 !important; }
.contextual-excerpt-pattern, #users-involved-pattern { border: 0 !important; }

/** Aui Typography upsized for mobile **/
#content-excerpt-pattern-container, #contextual-excerpt-pattern-text-container { font-size: 16px !important; line-height: 22px !important; }
#content-excerpt-pattern-container h1, #contextual-excerpt-pattern-text-container h1 { font-size: 24px !important; line-height: 28px !important; }
#content-excerpt-pattern-container h2, #contextual-excerpt-pattern-text-container h2 { font-size: 20px !important; line-height: 28px !important; }
#content-excerpt-pattern-container h3, #contextual-excerpt-pattern-text-container h3 { font-size: 18px !important; line-height: 24px !important; }
#content-excerpt-pattern-container h4, #contextual-excerpt-pattern-text-container h4 { font-size: 16px !important; line-height: 22px !important; }
#content-excerpt-pattern-container h5, #contextual-excerpt-pattern-text-container h5 { font-size: 14px !important; line-height: 20px !important; }
#content-excerpt-pattern-container h6, #contextual-excerpt-pattern-text-container h6 { font-size: 14px !important; line-height: 20px !important; }
.user-mention { line-height: 18px !important; }
/** Aui Typography end **/

/* Show appropriate footer logo on mobile, display links vertically */
#footer-pattern { padding: 15px 10px !important; }
#footer-pattern-logo-desktop-container { padding: 0 !important; }
#footer-pattern-logo-desktop { width: 0 !important; height: 0 !important; }
#footer-pattern-logo-mobile {
    padding-top: 10px !important;
    width: 30px !important;
    height: 27px !important;
    display: inline !important;
}
#footer-pattern-text {
    display: block !important;
}
#footer-pattern-links-container { line-height: 0 !important;}
.footer-pattern-links.mobile-resize-text,
.footer-pattern-links.mobile-resize-text,
#footer-pattern-text.mobile-resize-text,
#footer-pattern-links-container.no-footer-links {
    font-size: 14px !important;
    line-height: 20px !important;
}
.footer-link { display: block !important; }
#footer-pattern-links-container table { display: inline-block !important; float: none !important; }
#footer-pattern-links-container, #footer-pattern-text { text-align: center !important; }
#footer-pattern-links { padding-bottom: 5px !important; }

/** Team Calendar overrides, these should be removed when notifications are updated in Team Calendars. For now CSS
    overrides are being used because the structure of the content can't change without rereleasing the plugin */
.mail-calendar-container .day-header + table tr td:first-child {
    vertical-align: top !important;
    padding-top: 5px !important;
}}
@media (min-width: 900px) {#center-content-table { width: 900px; }}
@media all {#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
/* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
body{-webkit-text-size-adjust:100%; -ms-text-size-adjust:100%;}
.ExternalClass {width:100%;} /* Force Hotmail to display emails at full width */
#background-table {margin:0; padding:0; width:100% !important; }
/* Needed to override highlighting on date and time links in iOS */
.grey a {color: #707070; text-decoration: none; }/* These styles are appended to the head element of a notification in order to prevent Apple Mail and similar
   clients from underlining the due dates with a blue hyperlink */
/* a lozenge outside an inline task should always be #333, lozenges inside an inline task should be
   colored according to their upcoming due dates, a completed task date lozenge or deleted task date
   lozenge should always be #707070 */
.date-time-lozenge a {color: #333333; text-decoration: none; }
.inline-task-text-container .date-time-lozenge.date-upcoming a {color: #DF6F00; text-decoration: none; }
.inline-task-text-container .date-time-lozenge.date-past a {color: #D04437; text-decoration: none; }
.inline-task-text-container.content-deleted-color .date-time-lozenge a,
.inline-task-text-container.checked .date-time-lozenge a {
    color: #707070; text-decoration: none;
}}
</style> 
</head>
<body>
<table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; background-color: #f5f5f5"> 
<tbody> 
<tr> 
<td id="header-pattern-container" style="padding: 0px; border-collapse: collapse; padding: 10px 20px"> 
<table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td id="header-avatar-image-container" valign="top" style="padding: 0px; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 9px"><a href="https://wiki.asterisk.org/wiki/display/~mmichelson?src=email" style="color: #3b73af; text-decoration: none"><img id="header-avatar-image" class="image_fix" src="cid:avatar_99ed0aa29d6f204db4785296f8170422" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top" /></a></td>
<td id="header-text-container" valign="middle" style="padding: 0px; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px">Mark Michelson <strong>edited</strong> a page</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<!-- End Header pattern --> 
<tr> 
<td id="email-content-container" style="padding: 0px; border-collapse: collapse; padding: 0 20px"> 
<table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; border-spacing: 0; border-collapse: separate"> 
<tbody> 
<tr> 
<td class="email-content-rounded-top mobile-expand" style="padding: 0px; border-collapse: collapse; color: #fff; padding: 0 15px 0 16px; height: 15px; background-color: #fff; border-left: 1px solid #ccc; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px"> </td> 
</tr> 
<tr> 
<td class="email-content-main mobile-expand" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 15px 16px; background-color: #fff"> 
<table class="notification-comment-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
<tbody> 
<tr> 
<td class="notification-comment-pattern-container mobile-resize-text" style="padding: 0px; border-collapse: collapse; padding: 0px"><strong>Change comment:</strong> Modified javascript samples based on review feedback.</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td class="email-content-main mobile-expand padding-top border-top" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 15px 16px; background-color: #fff; border-top: 1px solid #ccc; padding-top: 15px"> 
<table id="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td id="page-title-pattern-icon-image-container" valign="top" style="padding: 0px; border-collapse: collapse; width: 16px; vertical-align: top"> 
<table cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td id="page-title-pattern-icon-image-container-cell" style="padding: 0px; border-collapse: collapse; width: 16px; padding: 9px 8px 0px 0px; mso-text-raise: 5px; mso-line-height-rule: exactly"><a href="https://wiki.asterisk.org/wiki/display/AST/Part+2%3A+Playbacks?src=email" title="page icon" style="vertical-align: top;; color: #3b73af; text-decoration: none"><img style="vertical-align: top; display: block;" src="cid:page-icon" alt="page icon" title="page icon" height="16" width="16" border="0" /></a></td> 
</tr> 
</tbody> 
</table> </td>
<td style="vertical-align: top;; padding: 0px; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" id="page-title-pattern-header-container"><span id="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"><a href="https://wiki.asterisk.org/wiki/display/AST/Part+2%3A+Playbacks?src=email" title="Part 2: Playbacks" style="color: #3b73af; text-decoration: none">Part 2: Playbacks</a></span></td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td class="email-content-main mobile-expand" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 15px 16px; background-color: #fff"> 
<table class="content-excerpt-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
<tbody> 
<tr> 
<td class="content-excerpt-pattern-container mobile-resize-text " style="padding: 0px; border-collapse: collapse; padding: 0 0 0 24px"> <p class="diff-context-placeholder" style="margin: 10px 0 0 0; margin-top: 0">...</p> 
<table class="diff-macro diff-block-target" style="background-color: #f0f0f0;border: 1px solid #dddddd;margin: 10px 1px;padding: 0 2px 2px;width: 100%;; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<thead> 
<tr> 
<th class="diff-macro-title" style="background-color: transparent; text-align: left; font-weight: normal;padding: 5px;"><span class="icon macro-placeholder-icon" style="background-color: ;line-height: 20px;"><img src="https://wiki.asterisk.org/wiki/s/en_GB/5635/60fd2eb45debbf4ede2b669f4c9b96b4ce40a937.48/_/plugins/servlet/confluence/placeholder/macro-icon?name=code" style="padding-right: 5px; vertical-align: text-bottom;" /> </span>Code Block</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
<td class="diff-macro-properties" style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;padding: 0; border: 1px solid #dddddd;; padding: 0px; border-collapse: collapse"> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">title</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">greeting_state.js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">language</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">collapse</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">true</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
<tbody> 
<tr> 
<td class="diff-macro-body" style="background-color: #fff;border: 1px solid #dddddd;padding: 10px;; padding: 0px; border-collapse: collapse"> <pre style="margin: 10px 0 0 0; margin-top: 0">var Event = require('./event');

function sounds_installed(client) {
    client.sounds.get({soundId: 'vm-intro'}, function(err) {
        if (err) {
            console.log("Required sound 'vm-intro' not installed. Aborting");
            throw err;
        }
    });
}

<span class="diff-html-removed" id="removed-diff-0" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">var</span><span class="diff-html-added" id="added-diff-0" style="font-size: 100%; background-color: #ddfade;">function</span> GreetingState<span class="diff-html-removed" id="removed-diff-1" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;"> = function</span>(call) {
    this.state_name = "greeting";
    <span class="diff-html-removed" id="removed-diff-2" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.call = call;
    </span>sounds_installed(call.client);
<span class="diff-html-removed" id="removed-diff-3" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">}</span>
 <span class="diff-html-removed" id="removed-diff-4" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">GreetingState.prototype.</span><span class="diff-html-added" id="added-diff-1" style="font-size: 100%; background-color: #ddfade;">   this.</span>enter = function() {
    <span class="diff-html-removed" id="removed-diff-5" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">var</span> <span class="diff-html-removed" id="removed-diff-6" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self</span> <span class="diff-html-removed" id="removed-diff-7" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">=</span> <span class="diff-html-removed" id="removed-diff-8" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this;</span> <span class="diff-html-removed" id="removed-diff-9" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">    </span>var playback = <span class="diff-html-removed" id="removed-diff-10" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.client.Playback();
    <span class="diff-html-added" id="added-diff-2" style="font-size: 100%; background-color: #ddfade;">    </span>console.log("Entering greeting state");
    <span class="diff-html-removed" id="removed-diff-11" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-3" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.on("ChannelHangupRequest", on_hangup);
    <span class="diff-html-removed" id="removed-diff-12" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-4" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.on("ChannelDtmfReceived", on_dtmf);
    <span class="diff-html-removed" id="removed-diff-13" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-5" style="font-size: 100%; background-color: #ddfade;">    </span>call.client.on("PlaybackFinished", on_playback_finished);
    <span class="diff-html-removed" id="removed-diff-14" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-6" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.play({media: 'sound:vm-intro'}, playback);

    <span class="diff-html-added" id="added-diff-7" style="font-size: 100%; background-color: #ddfade;">    </span>function cleanup() {
        <span class="diff-html-removed" id="removed-diff-15" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-8" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.removeListener('ChannelHangupRequest', on_hangup);
        <span class="diff-html-removed" id="removed-diff-16" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-9" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.removeListener('ChannelDtmfReceived', on_dtmf);
        <span class="diff-html-removed" id="removed-diff-17" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-10" style="font-size: 100%; background-color: #ddfade;">    </span>call.client.removeListener('PlaybackFinished', on_playback_finished);
    <span class="diff-html-added" id="added-diff-11" style="font-size: 100%; background-color: #ddfade;">        if (playback) {
                playback.stop();
            </span>}
     <span class="diff-html-added" id="added-diff-12" style="font-size: 100%; background-color: #ddfade;">   }

        </span>function on_hangup(event, channel) {
        <span class="diff-html-added" id="added-diff-13" style="font-size: 100%; background-color: #ddfade;">    </span>console.log("Abandoning voicemail recording on hangup");
        <span class="diff-html-added" id="added-diff-14" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
        <span class="diff-html-removed" id="removed-diff-18" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-15" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.HANGUP);
    <span class="diff-html-added" id="added-diff-16" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-17" style="font-size: 100%; background-color: #ddfade;">    </span>function on_playback_finished(event) {
        <span class="diff-html-added" id="added-diff-18" style="font-size: 100%; background-color: #ddfade;">    </span>if (playback && playback.id === event.playback.id) {
            <span class="diff-html-added" id="added-diff-19" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
            <span class="diff-html-removed" id="removed-diff-19" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-20" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.PLAYBACK_COMPLETE);
        <span class="diff-html-added" id="added-diff-21" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-22" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-23" style="font-size: 100%; background-color: #ddfade;">    </span>function on_dtmf(event, channel) {
        <span class="diff-html-added" id="added-diff-24" style="font-size: 100%; background-color: #ddfade;">    </span>switch (event.digit) {
        <span class="diff-html-added" id="added-diff-25" style="font-size: 100%; background-color: #ddfade;">    </span>case '#':
            <span class="diff-html-added" id="added-diff-26" style="font-size: 100%; background-color: #ddfade;">    </span>console.log("Skipping greeting");
            <span class="diff-html-removed" id="removed-diff-20" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">playback.stop</span><span class="diff-html-added" id="added-diff-27" style="font-size: 100%; background-color: #ddfade;">    cleanup</span>();
            <span class="diff-html-removed" id="removed-diff-21" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">//Let on_playback_finished take care of state change</span><span class="diff-html-added" id="added-diff-28" style="font-size: 100%; background-color: #ddfade;">    call.state_machine.change_state(Event.DTMF_OCTOTHORPE);
    </span>        <span class="diff-html-added" id="added-diff-29" style="font-size: 100%; background-color: #ddfade;">}</span>
<span class="diff-html-added" id="added-diff-30" style="font-size: 100%; background-color: #ddfade;">        </span>}
    }
}
<span class="diff-html-removed" id="removed-diff-22" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">
module</span><span class="diff-html-added" id="added-diff-31" style="font-size: 100%; background-color: #ddfade;"> module</span>.exports = GreetingState;</pre> </td> 
</tr> 
</tbody> 
</table> <p class="diff-context-placeholder" style="margin: 10px 0 0 0">...</p> 
<table class="diff-macro diff-block-target" style="background-color: #f0f0f0;border: 1px solid #dddddd;margin: 10px 1px;padding: 0 2px 2px;width: 100%;; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<thead> 
<tr> 
<th class="diff-macro-title" style="background-color: transparent; text-align: left; font-weight: normal;padding: 5px;"><span class="icon macro-placeholder-icon" style="background-color: ;line-height: 20px;"><img src="https://wiki.asterisk.org/wiki/s/en_GB/5635/60fd2eb45debbf4ede2b669f4c9b96b4ce40a937.48/_/plugins/servlet/confluence/placeholder/macro-icon?name=code" style="padding-right: 5px; vertical-align: text-bottom;" /> </span>Code Block</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
<td class="diff-macro-properties" style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;padding: 0; border: 1px solid #dddddd;; padding: 0px; border-collapse: collapse"> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">title</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">vm-call.js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">language</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">collapse</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">true</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
<tbody> 
<tr> 
<td class="diff-macro-body" style="background-color: #fff;border: 1px solid #dddddd;padding: 10px;; padding: 0px; border-collapse: collapse"> <pre style="margin: 10px 0 0 0; margin-top: 0">//At the top of the file
var GreetingState = require('./greeting_state');

//In VoicemailCall::setup_state_machine()
<span class="diff-html-removed" id="removed-diff-23" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">VoiceMailCall</span><span class="diff-html-added" id="added-diff-32" style="font-size: 100%; background-color: #ddfade;">this</span>.<span class="diff-html-removed" id="removed-diff-24" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">prototype.</span>setup_state_machine = function() {
    var hungup_state = new HungUpState(this);
    var recording_state = new RecordingState(this);
    var ending_state = new EndingState(this);
    var reviewing_state = new ReviewingState(this);
    var greeting_state = new GreetingState(this);
    this.state_machine = new StateMachine();
    this.state_machine.add_transition(recording_state, Event.DTMF_OCTOTHORPE, reviewing_state);
    this.state_machine.add_transition(recording_state, Event.HANGUP, hungup_state);
    this.state_machine.add_transition(recording_state, Event.DTMF_STAR, recording_state);
    this.state_machine.add_transition(reviewing_state, Event.DTMF_OCTOTHORPE, ending_state);
    this.state_machine.add_transition(reviewing_state, Event.HANGUP, hungup_state);
    this.state_machine.add_transition(reviewing_state, Event.DTMF_STAR, recording_state);
    this.state_machine.add_transition(greeting_state, Event.HANGUP, hungup_state);
    this.state_machine.add_transition(greeting_state, Event.PLAYBACK_COMPLETE, recording_state);
    this.state_machine.start(greeting_state);
}</pre> </td> 
</tr> 
</tbody> 
</table> <p class="diff-context-placeholder" style="margin: 10px 0 0 0">...</p> 
<table class="diff-macro diff-block-target" style="background-color: #f0f0f0;border: 1px solid #dddddd;margin: 10px 1px;padding: 0 2px 2px;width: 100%;; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<thead> 
<tr> 
<th class="diff-macro-title" style="background-color: transparent; text-align: left; font-weight: normal;padding: 5px;"><span class="icon macro-placeholder-icon" style="background-color: ;line-height: 20px;"><img src="https://wiki.asterisk.org/wiki/s/en_GB/5635/60fd2eb45debbf4ede2b669f4c9b96b4ce40a937.48/_/plugins/servlet/confluence/placeholder/macro-icon?name=code" style="padding-right: 5px; vertical-align: text-bottom;" /> </span>Code Block</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
<td class="diff-macro-properties" style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;padding: 0; border: 1px solid #dddddd;; padding: 0px; border-collapse: collapse"> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">title</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">vm-playback.js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">language</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">collapse</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">true</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
<tbody> 
<tr> 
<td class="diff-macro-body" style="background-color: #fff;border: 1px solid #dddddd;padding: 10px;; padding: 0px; border-collapse: collapse"> <pre style="margin: 10px 0 0 0; margin-top: 0">/*jshint node:true*/
'use strict';
 
var ari = require('ari-client');
var util = require('util');
var path = require('path');

var Event = require('./event');
var StateMachine = require('./state_machine');
var EndingState = require('./ending_state');
var HungUpState = require('./hungup_state');
var PreambleState = require('./preamble_state');
var EmptyState = require('./empty_state');
var ListeningState = require('./listening_state');

ari.connect('http://10.24.20.249:8088', 'asterisk', 'asterisk', clientLoaded);

var VoiceMailCall = function(ari_client, channel, mailbox) {
    <span class="diff-html-removed" id="removed-diff-25" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">var self = </span>this<span class="diff-html-removed" id="removed-diff-26" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">;
    self</span>.client = ari_client;
    <span class="diff-html-removed" id="removed-diff-27" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self</span><span class="diff-html-added" id="added-diff-33" style="font-size: 100%; background-color: #ddfade;">this</span>.channel = channel;
    <span class="diff-html-removed" id="removed-diff-28" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-34" style="font-size: 100%; background-color: #ddfade;">var </span>current_voicemail = 0;
    <span class="diff-html-removed" id="removed-diff-29" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.voicemails = [];
    ari_client.recordings.listStored(function (err, recordings) {
        var vm_number = 1;
        var regex = new RegExp('^voicemail/' + mailbox);
        for (var i = 0; i < recordings.length; i++) {
            var rec_name = recordings[i].name</span><span class="diff-html-added" id="added-diff-35" style="font-size: 100%; background-color: #ddfade;">var voicemails = []</span>;

    <span class="diff-html-removed" id="removed-diff-30" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">       if (rec_name.search(regex) != -1) {
                console.log("Found voicemail", rec_name);
                self.voicemails.push({'number': vm_number, 'file': rec_name});
                vm_number++;
            }
        }

        self.</span><span class="diff-html-added" id="added-diff-36" style="font-size: 100%; background-color: #ddfade;">this.</span>setup_state_machine<span class="diff-html-removed" id="removed-diff-31" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">();</span> <span class="diff-html-removed" id="removed-diff-32" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">    });
}

VoiceMailCall.prototype.setup_state_machine = function() {</span><span class="diff-html-added" id="added-diff-37" style="font-size: 100%; background-color: #ddfade;">= function() {
    </span>    <span class="diff-html-removed" id="removed-diff-33" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;"> </span>var hungup_state = new HungUpState(this);
    <span class="diff-html-added" id="added-diff-38" style="font-size: 100%; background-color: #ddfade;">    </span>var ending_state = new EndingState(this);
    <span class="diff-html-added" id="added-diff-39" style="font-size: 100%; background-color: #ddfade;">    </span>var listening_state = new ListeningState(this);
    <span class="diff-html-added" id="added-diff-40" style="font-size: 100%; background-color: #ddfade;">    </span>var preamble_state = new PreambleState(this);
    <span class="diff-html-added" id="added-diff-41" style="font-size: 100%; background-color: #ddfade;">    </span>var empty_state = new EmptyState(this);
    <span class="diff-html-added" id="added-diff-42" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine = new StateMachine(this);
    <span class="diff-html-added" id="added-diff-43" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(listening_state, Event.DTMF_4, preamble_state);
    <span class="diff-html-added" id="added-diff-44" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(listening_state, Event.DTMF_6, preamble_state);
    <span class="diff-html-added" id="added-diff-45" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(listening_state, Event.HANGUP, hungup_state);
    <span class="diff-html-added" id="added-diff-46" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(listening_state, Event.DTMF_OCTOTHORPE, ending_state);
    <span class="diff-html-added" id="added-diff-47" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(listening_state, Event.DTMF_STAR, preamble_state);
    <span class="diff-html-added" id="added-diff-48" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(preamble_state, Event.DTMF_OCTOTHORPE, listening_state);
    <span class="diff-html-added" id="added-diff-49" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(preamble_state, Event.PLAYBACK_COMPLETE, listening_state);
    <span class="diff-html-added" id="added-diff-50" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(preamble_state, Event.MAILBOX_EMPTY, empty_state);
    <span class="diff-html-added" id="added-diff-51" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(preamble_state, Event.HANGUP, hungup_state);
    <span class="diff-html-added" id="added-diff-52" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(empty_state, Event.HANGUP, hungup_state);
    <span class="diff-html-added" id="added-diff-53" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.add_transition(empty_state, Event.PLAYBACK_COMPLETE, ending_state);
    <span class="diff-html-added" id="added-diff-54" style="font-size: 100%; background-color: #ddfade;">    </span>this.state_machine.start(preamble_state);
<span class="diff-html-added" id="added-diff-55" style="font-size: 100%; background-color: #ddfade;">    </span>}

<span class="diff-html-removed" id="removed-diff-34" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">VoiceMailCall.prototype.</span><span class="diff-html-added" id="added-diff-56" style="font-size: 100%; background-color: #ddfade;">    this.</span>next_message = function() {
    <span class="diff-html-removed" id="removed-diff-35" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span><span class="diff-html-added" id="added-diff-57" style="font-size: 100%; background-color: #ddfade;">    </span>current_voicemail++;
    <span class="diff-html-added" id="added-diff-58" style="font-size: 100%; background-color: #ddfade;">    </span>if (<span class="diff-html-removed" id="removed-diff-36" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span>current_voicemail === <span class="diff-html-removed" id="removed-diff-37" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span>voicemails.length) {
        <span class="diff-html-removed" id="removed-diff-38" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span><span class="diff-html-added" id="added-diff-59" style="font-size: 100%; background-color: #ddfade;">    </span>current_voicemail = 0;
    <span class="diff-html-added" id="added-diff-60" style="font-size: 100%; background-color: #ddfade;">    </span>}
<span class="diff-html-added" id="added-diff-61" style="font-size: 100%; background-color: #ddfade;">    </span>}

<span class="diff-html-removed" id="removed-diff-39" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">VoiceMailCall.prototype.</span><span class="diff-html-added" id="added-diff-62" style="font-size: 100%; background-color: #ddfade;">    this.</span>previous_message = function() {
    <span class="diff-html-removed" id="removed-diff-40" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span><span class="diff-html-added" id="added-diff-63" style="font-size: 100%; background-color: #ddfade;">    </span>current_voicemail--;
    <span class="diff-html-added" id="added-diff-64" style="font-size: 100%; background-color: #ddfade;">    </span>if (<span class="diff-html-removed" id="removed-diff-41" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span>current_voicemail < 0) {
        <span class="diff-html-removed" id="removed-diff-42" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span><span class="diff-html-added" id="added-diff-65" style="font-size: 100%; background-color: #ddfade;">    </span>current_voicemail = <span class="diff-html-removed" id="removed-diff-43" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span>voicemails.length - 1;
    <span class="diff-html-added" id="added-diff-66" style="font-size: 100%; background-color: #ddfade;">    </span>}
<span class="diff-html-added" id="added-diff-67" style="font-size: 100%; background-color: #ddfade;">    </span>}

<span class="diff-html-removed" id="removed-diff-44" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">VoiceMailCall.prototype.</span><span class="diff-html-added" id="added-diff-68" style="font-size: 100%; background-color: #ddfade;">    this.</span>delete_message = function() {
    <span class="diff-html-removed" id="removed-diff-45" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span><span class="diff-html-added" id="added-diff-69" style="font-size: 100%; background-color: #ddfade;">    </span>voicemails.splice(<span class="diff-html-removed" id="removed-diff-46" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span>current_voicemail, 1);
    <span class="diff-html-added" id="added-diff-70" style="font-size: 100%; background-color: #ddfade;">    </span>if (<span class="diff-html-removed" id="removed-diff-47" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span>current_voicemail === <span class="diff-html-removed" id="removed-diff-48" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span>voicemails.length) {
        <span class="diff-html-removed" id="removed-diff-49" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span><span class="diff-html-added" id="added-diff-71" style="font-size: 100%; background-color: #ddfade;">    </span>current_voicemail = 0;
    <span class="diff-html-added" id="added-diff-72" style="font-size: 100%; background-color: #ddfade;">    </span>}
<span class="diff-html-added" id="added-diff-73" style="font-size: 100%; background-color: #ddfade;">    </span>}

<span class="diff-html-removed" id="removed-diff-50" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">VoiceMailCall.prototype.</span><span class="diff-html-added" id="added-diff-74" style="font-size: 100%; background-color: #ddfade;">    this.</span>get_current_voicemail_<span class="diff-html-removed" id="removed-diff-51" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">number</span><span class="diff-html-added" id="added-diff-75" style="font-size: 100%; background-color: #ddfade;">file</span> = function() {
    <span class="diff-html-added" id="added-diff-76" style="font-size: 100%; background-color: #ddfade;">    </span>return <span class="diff-html-removed" id="removed-diff-52" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span>voicemails[<span class="diff-html-removed" id="removed-diff-53" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.</span>current_voicemail]['<span class="diff-html-removed" id="removed-diff-54" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">number</span><span class="diff-html-added" id="added-diff-77" style="font-size: 100%; background-color: #ddfade;">file</span>'];
<span class="diff-html-added" id="added-diff-78" style="font-size: 100%; background-color: #ddfade;">    </span>}

<span class="diff-html-removed" id="removed-diff-55" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">VoiceMailCall.prototype.get_current_voicemail_file</span><span class="diff-html-added" id="added-diff-79" style="font-size: 100%; background-color: #ddfade;">    this.mailbox_empty</span> = function() {
    <span class="diff-html-added" id="added-diff-80" style="font-size: 100%; background-color: #ddfade;">    </span>return <span class="diff-html-removed" id="removed-diff-56" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.voicemails[this.current_voicemail]['file'];
}

VoiceMailCall.prototype.mailbox_empty = function() </span><span class="diff-html-added" id="added-diff-81" style="font-size: 100%; background-color: #ddfade;">voicemails.length === 0;
    }

    var self = this;
    ari_client.recordings.listStored(function (err, recordings) {
        var vm_number = 1;
        var regex = new RegExp('^voicemail/' + mailbox);
        for (var i = 0; i < recordings.length; i++) {
            var rec_name = recordings[i].name;
            if (rec_name.search(regex) != -1) </span>{
    <span class="diff-html-removed" id="removed-diff-57" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">return this.voicemails.length === 0;
}

</span><span class="diff-html-added" id="added-diff-82" style="font-size: 100%; background-color: #ddfade;">            console.log("Found voicemail", rec_name);
                voicemails.push({'number': vm_number, 'file': rec_name});
                vm_number++;
            }
        }
        self.setup_state_machine();
    });
}

</span>function clientLoaded(err, client) {
    if (err) {
        throw err;
    }
    client.on('StasisStart', stasisStart);
    function stasisStart(event, channel) {
        var mailbox = event.args[0]
        channel.answer(function(err) {
            if (err) {
                throw err;
            }
            new VoiceMailCall(client, channel, mailbox);
        });
    }
    client.start(process.argv[2]);
}</pre> </td> 
</tr> 
</tbody> 
</table> <p class="diff-context-placeholder" style="margin: 10px 0 0 0">...</p> 
<table class="diff-macro diff-block-target" style="background-color: #f0f0f0;border: 1px solid #dddddd;margin: 10px 1px;padding: 0 2px 2px;width: 100%;; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<thead> 
<tr> 
<th class="diff-macro-title" style="background-color: transparent; text-align: left; font-weight: normal;padding: 5px;"><span class="icon macro-placeholder-icon" style="background-color: ;line-height: 20px;"><img src="https://wiki.asterisk.org/wiki/s/en_GB/5635/60fd2eb45debbf4ede2b669f4c9b96b4ce40a937.48/_/plugins/servlet/confluence/placeholder/macro-icon?name=code" style="padding-right: 5px; vertical-align: text-bottom;" /> </span>Code Block</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
<td class="diff-macro-properties" style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;padding: 0; border: 1px solid #dddddd;; padding: 0px; border-collapse: collapse"> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">title</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">preamble_state.js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">language</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">collapse</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">true</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
<tbody> 
<tr> 
<td class="diff-macro-body" style="background-color: #fff;border: 1px solid #dddddd;padding: 10px;; padding: 0px; border-collapse: collapse"> <pre style="margin: 10px 0 0 0; margin-top: 0">var Event = require('./event');

function sounds_installed(client) {
    client.sounds.get({soundId: 'vm-message'}, function(err) {
        if (err) {
            console.log("Required sound 'vm-message' not installed. Aborting");
            throw err;
        }
    });
}

<span class="diff-html-removed" id="removed-diff-58" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">var</span><span class="diff-html-added" id="added-diff-83" style="font-size: 100%; background-color: #ddfade;">function</span> PreambleState<span class="diff-html-removed" id="removed-diff-59" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;"> = function</span>(call) {
    this.state_name = "preamble";
    <span class="diff-html-removed" id="removed-diff-60" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this.call = call;
}

</span>PreambleState.prototype.enter = function() {
    <span class="diff-html-removed" id="removed-diff-61" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">var</span> <span class="diff-html-removed" id="removed-diff-62" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self</span> <span class="diff-html-removed" id="removed-diff-63" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">=</span> <span class="diff-html-removed" id="removed-diff-64" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this;</span> <span class="diff-html-removed" id="removed-diff-65" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">    </span>var current_playback;
    <span class="diff-html-added" id="added-diff-84" style="font-size: 100%; background-color: #ddfade;">    </span>var sounds_to_play;
    <span class="diff-html-added" id="added-diff-85" style="font-size: 100%; background-color: #ddfade;">    </span>var playback;
    <span class="diff-html-added" id="added-diff-86" style="font-size: 100%; background-color: #ddfade;">    </span>console.log("Entering preamble state");
    <span class="diff-html-added" id="added-diff-87" style="font-size: 100%; background-color: #ddfade;">    </span>if (<span class="diff-html-removed" id="removed-diff-66" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.mailbox_empty()) {
        <span class="diff-html-removed" id="removed-diff-67" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-88" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.MAILBOX_EMPTY);
        <span class="diff-html-added" id="added-diff-89" style="font-size: 100%; background-color: #ddfade;">    </span>return;
    <span class="diff-html-removed" id="removed-diff-68" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">}</span>    <span class="diff-html-added" id="added-diff-90" style="font-size: 100%; background-color: #ddfade;">}</span>
<span class="diff-html-removed" id="removed-diff-69" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">console.log("Mailbox</span> <span class="diff-html-removed" id="removed-diff-70" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">not</span> <span class="diff-html-removed" id="removed-diff-71" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">empty?");</span>     <span class="diff-html-removed" id="removed-diff-72" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-91" style="font-size: 100%; background-color: #ddfade;"> </span>call.channel.on("ChannelHangupRequest", on_hangup);
    <span class="diff-html-removed" id="removed-diff-73" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-92" style="font-size: 100%; background-color: #ddfade;">    </span>call.client.on("PlaybackFinished", on_playback_finished);
    <span class="diff-html-removed" id="removed-diff-74" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-93" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.on("ChannelDtmfReceived", on_dtmf);
    <span class="diff-html-added" id="added-diff-94" style="font-size: 100%; background-color: #ddfade;">    </span>initialize_playbacks();

    <span class="diff-html-added" id="added-diff-95" style="font-size: 100%; background-color: #ddfade;">    </span>function initialize_playbacks() {
        <span class="diff-html-removed" id="removed-diff-75" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">console.log("Initializing</span> <span class="diff-html-removed" id="removed-diff-76" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">playbacks");</span>   <span class="diff-html-removed" id="removed-diff-77" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">      </span>current_playback = 0;
        <span class="diff-html-added" id="added-diff-96" style="font-size: 100%; background-color: #ddfade;">    </span>sounds_to_play = [
            <span class="diff-html-added" id="added-diff-97" style="font-size: 100%; background-color: #ddfade;">    </span>{
                <span class="diff-html-added" id="added-diff-98" style="font-size: 100%; background-color: #ddfade;">    </span>'playback': <span class="diff-html-removed" id="removed-diff-78" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.client.Playback(),
                <span class="diff-html-added" id="added-diff-99" style="font-size: 100%; background-color: #ddfade;">    </span>'media': 'sound:vm-message'
            <span class="diff-html-added" id="added-diff-100" style="font-size: 100%; background-color: #ddfade;">    </span>},
            <span class="diff-html-added" id="added-diff-101" style="font-size: 100%; background-color: #ddfade;">    </span>{
                <span class="diff-html-added" id="added-diff-102" style="font-size: 100%; background-color: #ddfade;">    </span>'playback': <span class="diff-html-removed" id="removed-diff-79" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.client.Playback(),
                <span class="diff-html-added" id="added-diff-103" style="font-size: 100%; background-color: #ddfade;">    </span>'media': 'number:' + <span class="diff-html-removed" id="removed-diff-80" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.get_current_voicemail_number()
            <span class="diff-html-added" id="added-diff-104" style="font-size: 100%; background-color: #ddfade;">    </span>}
        <span class="diff-html-added" id="added-diff-105" style="font-size: 100%; background-color: #ddfade;">    </span>];
        <span class="diff-html-added" id="added-diff-106" style="font-size: 100%; background-color: #ddfade;">    </span>start_playback();
    <span class="diff-html-added" id="added-diff-107" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-108" style="font-size: 100%; background-color: #ddfade;">    </span>function start_playback() {
        <span class="diff-html-added" id="added-diff-109" style="font-size: 100%; background-color: #ddfade;">    </span>current_sound = sounds_to_play[current_playback];
        <span class="diff-html-added" id="added-diff-110" style="font-size: 100%; background-color: #ddfade;">    </span>playback = current_sound['playback'];
        <span class="diff-html-removed" id="removed-diff-81" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">console.log("Starting</span> <span class="diff-html-removed" id="removed-diff-82" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">a</span> <span class="diff-html-removed" id="removed-diff-83" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">playback</span> <span class="diff-html-removed" id="removed-diff-84" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">of",</span> <span class="diff-html-removed" id="removed-diff-85" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">current_sound['media']);
        self.</span>call.channel.play({media: current_sound['media']}, playback);
    <span class="diff-html-added" id="added-diff-111" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-112" style="font-size: 100%; background-color: #ddfade;">    </span>function cleanup() {
        <span class="diff-html-removed" id="removed-diff-86" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-113" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.removeListener('ChannelHangupRequest', on_hangup);
        <span class="diff-html-removed" id="removed-diff-87" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-114" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.removeListener('ChannelDtmfReceived', on_dtmf);
        <span class="diff-html-removed" id="removed-diff-88" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-115" style="font-size: 100%; background-color: #ddfade;">    </span>call.client.removeListener('PlaybackFinished', on_playback_finished);
        <span class="diff-html-added" id="added-diff-116" style="font-size: 100%; background-color: #ddfade;">    </span>if (playback) {
            <span class="diff-html-added" id="added-diff-117" style="font-size: 100%; background-color: #ddfade;">    </span>playback.stop();
        <span class="diff-html-added" id="added-diff-118" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-119" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-120" style="font-size: 100%; background-color: #ddfade;">    </span>function on_hangup(event, channel) {
        <span class="diff-html-added" id="added-diff-121" style="font-size: 100%; background-color: #ddfade;">    </span>playback = null;
        <span class="diff-html-added" id="added-diff-122" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
        <span class="diff-html-removed" id="removed-diff-89" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-123" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.HANGUP);
    <span class="diff-html-added" id="added-diff-124" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-125" style="font-size: 100%; background-color: #ddfade;">    </span>function on_playback_finished(event) {
        <span class="diff-html-added" id="added-diff-126" style="font-size: 100%; background-color: #ddfade;">    </span>var current_sound = sounds_to_play[current_playback];
        <span class="diff-html-removed" id="removed-diff-90" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">console.log("Got</span> <span class="diff-html-removed" id="removed-diff-91" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">told</span> <span class="diff-html-removed" id="removed-diff-92" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">playback</span> <span class="diff-html-removed" id="removed-diff-93" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">finished");</span> <span class="diff-html-removed" id="removed-diff-94" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">        </span>if (playback && (playback.id === event.playback.id)) {
            <span class="diff-html-added" id="added-diff-127" style="font-size: 100%; background-color: #ddfade;">    </span>playback = null;
            <span class="diff-html-added" id="added-diff-128" style="font-size: 100%; background-color: #ddfade;">    </span>current_playback++;
            <span class="diff-html-added" id="added-diff-129" style="font-size: 100%; background-color: #ddfade;">    </span>if (current_playback === sounds_to_play.length) {
                <span class="diff-html-added" id="added-diff-130" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
                <span class="diff-html-removed" id="removed-diff-95" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-131" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.PLAYBACK_COMPLETE);
            <span class="diff-html-added" id="added-diff-132" style="font-size: 100%; background-color: #ddfade;">    </span>} else {
                <span class="diff-html-added" id="added-diff-133" style="font-size: 100%; background-color: #ddfade;">    </span>start_playback();
            <span class="diff-html-added" id="added-diff-134" style="font-size: 100%; background-color: #ddfade;">    </span>}
        <span class="diff-html-added" id="added-diff-135" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-136" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-137" style="font-size: 100%; background-color: #ddfade;">    </span>function on_dtmf(event, channel) {
        <span class="diff-html-added" id="added-diff-138" style="font-size: 100%; background-color: #ddfade;">    </span>switch(event.digit) {
        <span class="diff-html-added" id="added-diff-139" style="font-size: 100%; background-color: #ddfade;">    </span>case '#':
            <span class="diff-html-added" id="added-diff-140" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
            <span class="diff-html-removed" id="removed-diff-96" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-141" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.DTMF_OCTOTHORPE);
        <span class="diff-html-added" id="added-diff-142" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-143" style="font-size: 100%; background-color: #ddfade;">    </span>}
<span class="diff-html-added" id="added-diff-144" style="font-size: 100%; background-color: #ddfade;">    </span>}
<span class="diff-html-added" id="added-diff-145" style="font-size: 100%; background-color: #ddfade;">}</span>
<span class="diff-html-added" id="added-diff-146" style="font-size: 100%; background-color: #ddfade;">


</span>module.exports = PreambleState;</pre> </td> 
</tr> 
</tbody> 
</table> <p class="diff-context-placeholder" style="margin: 10px 0 0 0">...</p> 
<table class="diff-macro diff-block-target" style="background-color: #f0f0f0;border: 1px solid #dddddd;margin: 10px 1px;padding: 0 2px 2px;width: 100%;; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<thead> 
<tr> 
<th class="diff-macro-title" style="background-color: transparent; text-align: left; font-weight: normal;padding: 5px;"><span class="icon macro-placeholder-icon" style="background-color: ;line-height: 20px;"><img src="https://wiki.asterisk.org/wiki/s/en_GB/5635/60fd2eb45debbf4ede2b669f4c9b96b4ce40a937.48/_/plugins/servlet/confluence/placeholder/macro-icon?name=code" style="padding-right: 5px; vertical-align: text-bottom;" /> </span>Code Block</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
<td class="diff-macro-properties" style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;padding: 0; border: 1px solid #dddddd;; padding: 0px; border-collapse: collapse"> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">title</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">empty_state.js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">language</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">collapse</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">true</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
<tbody> 
<tr> 
<td class="diff-macro-body" style="background-color: #fff;border: 1px solid #dddddd;padding: 10px;; padding: 0px; border-collapse: collapse"> <pre style="margin: 10px 0 0 0; margin-top: 0">var Event = require('./event');

function sounds_installed(client) {
    client.sounds.get({soundId: 'vm-nomore'}, function(err) {
        if (err) {
            console.log("Required sound 'vm-nomore' not installed. Aborting");
            throw err;
        }
    });
}

<span class="diff-html-removed" id="removed-diff-97" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">var</span><span class="diff-html-added" id="added-diff-147" style="font-size: 100%; background-color: #ddfade;">function</span> EmptyState<span class="diff-html-removed" id="removed-diff-98" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;"> = function</span>(call) {
    this.state_name = "empty";

   <span class="diff-html-added" id="added-diff-148" style="font-size: 100%; background-color: #ddfade;"> </span>this.<span class="diff-html-removed" id="removed-diff-99" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">call = call;
}

EmptyState.prototype.</span>enter = function() {
    <span class="diff-html-removed" id="removed-diff-100" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">var</span> <span class="diff-html-removed" id="removed-diff-101" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self</span> <span class="diff-html-removed" id="removed-diff-102" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">=</span> <span class="diff-html-removed" id="removed-diff-103" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this;</span> <span class="diff-html-removed" id="removed-diff-104" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">    </span>console.log("Entering empty state");
    <span class="diff-html-added" id="added-diff-149" style="font-size: 100%; background-color: #ddfade;">    </span>playback = <span class="diff-html-removed" id="removed-diff-105" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.client.Playback();
    <span class="diff-html-removed" id="removed-diff-106" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-150" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.on("ChannelHangup", on_hangup);
    <span class="diff-html-removed" id="removed-diff-107" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-151" style="font-size: 100%; background-color: #ddfade;">    </span>call.client.on("PlaybackFinished", on_playback_finished);
    <span class="diff-html-removed" id="removed-diff-108" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-152" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.play({media: 'sound:vm-nomore'}, playback);

    <span class="diff-html-added" id="added-diff-153" style="font-size: 100%; background-color: #ddfade;">    </span>function cleanup() {
        <span class="diff-html-removed" id="removed-diff-109" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-154" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.removeListener('ChannelHangupRequest', on_hangup);
        <span class="diff-html-removed" id="removed-diff-110" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-155" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.removeListener('PlaybackFinished', on_playback_finished);
        <span class="diff-html-added" id="added-diff-156" style="font-size: 100%; background-color: #ddfade;">    </span>if (playback) {
            <span class="diff-html-added" id="added-diff-157" style="font-size: 100%; background-color: #ddfade;">    </span>playback.stop();
        <span class="diff-html-added" id="added-diff-158" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-159" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-160" style="font-size: 100%; background-color: #ddfade;">    </span>function on_hangup(event, channel) {
        <span class="diff-html-added" id="added-diff-161" style="font-size: 100%; background-color: #ddfade;">    </span>playback = null;
        <span class="diff-html-added" id="added-diff-162" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
        <span class="diff-html-removed" id="removed-diff-111" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-163" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.HANGUP);
    <span class="diff-html-added" id="added-diff-164" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-165" style="font-size: 100%; background-color: #ddfade;">    </span>function on_playback_finished(event) {
        <span class="diff-html-added" id="added-diff-166" style="font-size: 100%; background-color: #ddfade;">    </span>if (playback && playback.id === event.playback.id) {
            <span class="diff-html-added" id="added-diff-167" style="font-size: 100%; background-color: #ddfade;">    </span>playback = null;
            <span class="diff-html-added" id="added-diff-168" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
            <span class="diff-html-removed" id="removed-diff-112" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-169" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.PLAYBACK_COMPLETE);
        <span class="diff-html-added" id="added-diff-170" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-171" style="font-size: 100%; background-color: #ddfade;">    </span>}
<span class="diff-html-added" id="added-diff-172" style="font-size: 100%; background-color: #ddfade;">    </span>}
<span class="diff-html-added" id="added-diff-173" style="font-size: 100%; background-color: #ddfade;">}</span>
<span class="diff-html-added" id="added-diff-174" style="font-size: 100%; background-color: #ddfade;">
</span>module.exports = EmptyState;</pre> </td> 
</tr> 
</tbody> 
</table> <p class="diff-context-placeholder" style="margin: 10px 0 0 0">...</p> 
<table class="diff-macro diff-block-target" style="background-color: #f0f0f0;border: 1px solid #dddddd;margin: 10px 1px;padding: 0 2px 2px;width: 100%;; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<thead> 
<tr> 
<th class="diff-macro-title" style="background-color: transparent; text-align: left; font-weight: normal;padding: 5px;"><span class="icon macro-placeholder-icon" style="background-color: ;line-height: 20px;"><img src="https://wiki.asterisk.org/wiki/s/en_GB/5635/60fd2eb45debbf4ede2b669f4c9b96b4ce40a937.48/_/plugins/servlet/confluence/placeholder/macro-icon?name=code" style="padding-right: 5px; vertical-align: text-bottom;" /> </span>Code Block</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
<td class="diff-macro-properties" style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;padding: 0; border: 1px solid #dddddd;; padding: 0px; border-collapse: collapse"> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">title</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">listening_state.js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">language</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">js</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">collapse</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">true</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
<tbody> 
<tr> 
<td class="diff-macro-body" style="background-color: #fff;border: 1px solid #dddddd;padding: 10px;; padding: 0px; border-collapse: collapse"> <pre style="margin: 10px 0 0 0; margin-top: 0">var Event = require('./event');

var ListeningState = function(call) {
   this.state_name = "listening";
   this.call = call;
}

<span class="diff-html-added" id="added-diff-175" style="font-size: 100%; background-color: #ddfade;">function </span>ListeningState<span class="diff-html-removed" id="removed-diff-113" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">.prototype</span><span class="diff-html-added" id="added-diff-176" style="font-size: 100%; background-color: #ddfade;">(call) {
    this.state_name = "listening";
    this</span>.enter = function() {
    <span class="diff-html-removed" id="removed-diff-114" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">var</span> <span class="diff-html-removed" id="removed-diff-115" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self</span> <span class="diff-html-removed" id="removed-diff-116" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">=</span> <span class="diff-html-removed" id="removed-diff-117" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">this;</span> <span class="diff-html-removed" id="removed-diff-118" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">    </span>var playback = <span class="diff-html-removed" id="removed-diff-119" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.client.Playback();
    <span class="diff-html-added" id="added-diff-177" style="font-size: 100%; background-color: #ddfade;">    </span>var url = "recording:" + <span class="diff-html-removed" id="removed-diff-120" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.get_current_voicemail_file();

   <span class="diff-html-added" id="added-diff-178" style="font-size: 100%; background-color: #ddfade;">     </span>console.log("Entering Listening state");
    <span class="diff-html-removed" id="removed-diff-121" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-179" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.on("ChannelHangupRequest", on_hangup);
    <span class="diff-html-removed" id="removed-diff-122" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-180" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.on("ChannelDtmfReceived", on_dtmf);
    <span class="diff-html-removed" id="removed-diff-123" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-181" style="font-size: 100%; background-color: #ddfade;">    </span>call.client.on("PlaybackFinished", on_playback_finished);
    <span class="diff-html-added" id="added-diff-182" style="font-size: 100%; background-color: #ddfade;">    </span>console.log("Playing file %s", url);
    <span class="diff-html-removed" id="removed-diff-124" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-183" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.play({media: url}, playback, function(err) {
        <span class="diff-html-added" id="added-diff-184" style="font-size: 100%; background-color: #ddfade;">    </span>if (err) {
            <span class="diff-html-added" id="added-diff-185" style="font-size: 100%; background-color: #ddfade;">    </span>console.error(err);
        <span class="diff-html-added" id="added-diff-186" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-187" style="font-size: 100%; background-color: #ddfade;">    </span>});

    <span class="diff-html-added" id="added-diff-188" style="font-size: 100%; background-color: #ddfade;">    </span>function cleanup() {
        <span class="diff-html-removed" id="removed-diff-125" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-189" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.removeListener('ChannelHangupRequest', on_hangup);
        <span class="diff-html-removed" id="removed-diff-126" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-190" style="font-size: 100%; background-color: #ddfade;">    </span>call.channel.removeListener('ChannelDtmfReceived', on_dtmf);
        <span class="diff-html-removed" id="removed-diff-127" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-191" style="font-size: 100%; background-color: #ddfade;">    </span>call.client.removeListener('PlaybackFinished', on_playback_finished);
        <span class="diff-html-added" id="added-diff-192" style="font-size: 100%; background-color: #ddfade;">    </span>if (playback) {
            <span class="diff-html-added" id="added-diff-193" style="font-size: 100%; background-color: #ddfade;">    </span>playback.stop();
        <span class="diff-html-added" id="added-diff-194" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-195" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-196" style="font-size: 100%; background-color: #ddfade;">    </span>function on_hangup(event, channel) {
        <span class="diff-html-added" id="added-diff-197" style="font-size: 100%; background-color: #ddfade;">    </span>playback = null;
        <span class="diff-html-added" id="added-diff-198" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
        <span class="diff-html-removed" id="removed-diff-128" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-199" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.HANGUP);
    <span class="diff-html-added" id="added-diff-200" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-201" style="font-size: 100%; background-color: #ddfade;">    </span>function on_playback_finished(event) {
        <span class="diff-html-added" id="added-diff-202" style="font-size: 100%; background-color: #ddfade;">    </span>if (playback && (playback.id === event.playback.id)) {
            <span class="diff-html-added" id="added-diff-203" style="font-size: 100%; background-color: #ddfade;">    </span>playback = null;
        <span class="diff-html-added" id="added-diff-204" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-205" style="font-size: 100%; background-color: #ddfade;">    </span>}

    <span class="diff-html-added" id="added-diff-206" style="font-size: 100%; background-color: #ddfade;">    </span>function on_dtmf(event, channel) {
        <span class="diff-html-added" id="added-diff-207" style="font-size: 100%; background-color: #ddfade;">    </span>switch (event.digit) {
        <span class="diff-html-added" id="added-diff-208" style="font-size: 100%; background-color: #ddfade;">    </span>case '1':
            <span class="diff-html-added" id="added-diff-209" style="font-size: 100%; background-color: #ddfade;">    </span>if (playback) {
                <span class="diff-html-added" id="added-diff-210" style="font-size: 100%; background-color: #ddfade;">    </span>playback.control({operation: 'reverse'});
            <span class="diff-html-added" id="added-diff-211" style="font-size: 100%; background-color: #ddfade;">    </span>}
            <span class="diff-html-added" id="added-diff-212" style="font-size: 100%; background-color: #ddfade;">    </span>break;
        <span class="diff-html-added" id="added-diff-213" style="font-size: 100%; background-color: #ddfade;">    </span>case '2':
            <span class="diff-html-added" id="added-diff-214" style="font-size: 100%; background-color: #ddfade;">    </span>if (!playback) {
                <span class="diff-html-added" id="added-diff-215" style="font-size: 100%; background-color: #ddfade;">    </span>break;
            <span class="diff-html-added" id="added-diff-216" style="font-size: 100%; background-color: #ddfade;">    </span>}
            <span class="diff-html-added" id="added-diff-217" style="font-size: 100%; background-color: #ddfade;">    </span>if (paused) {
                <span class="diff-html-added" id="added-diff-218" style="font-size: 100%; background-color: #ddfade;">    </span>playback.control({operation: 'unpause'});
                <span class="diff-html-added" id="added-diff-219" style="font-size: 100%; background-color: #ddfade;">    </span>paused = false;
            <span class="diff-html-added" id="added-diff-220" style="font-size: 100%; background-color: #ddfade;">    </span>} else {
                <span class="diff-html-added" id="added-diff-221" style="font-size: 100%; background-color: #ddfade;">    </span>playback.control({operation: 'pause'});
                <span class="diff-html-added" id="added-diff-222" style="font-size: 100%; background-color: #ddfade;">    </span>paused = true;
            <span class="diff-html-added" id="added-diff-223" style="font-size: 100%; background-color: #ddfade;">    </span>}
            <span class="diff-html-added" id="added-diff-224" style="font-size: 100%; background-color: #ddfade;">    </span>break;
        <span class="diff-html-added" id="added-diff-225" style="font-size: 100%; background-color: #ddfade;">    </span>case '3':
            <span class="diff-html-added" id="added-diff-226" style="font-size: 100%; background-color: #ddfade;">    </span>if (playback) {
                <span class="diff-html-added" id="added-diff-227" style="font-size: 100%; background-color: #ddfade;">    </span>playback.control({operation: 'forward'});
            <span class="diff-html-added" id="added-diff-228" style="font-size: 100%; background-color: #ddfade;">    </span>}
            <span class="diff-html-added" id="added-diff-229" style="font-size: 100%; background-color: #ddfade;">    </span>break;
        <span class="diff-html-added" id="added-diff-230" style="font-size: 100%; background-color: #ddfade;">    </span>case '4':
            <span class="diff-html-added" id="added-diff-231" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
            <span class="diff-html-removed" id="removed-diff-129" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-232" style="font-size: 100%; background-color: #ddfade;">    </span>call.previous_message();
            <span class="diff-html-removed" id="removed-diff-130" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-233" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.DTMF_4);
            <span class="diff-html-added" id="added-diff-234" style="font-size: 100%; background-color: #ddfade;">    </span>break;
        <span class="diff-html-added" id="added-diff-235" style="font-size: 100%; background-color: #ddfade;">    </span>case '5':
            <span class="diff-html-added" id="added-diff-236" style="font-size: 100%; background-color: #ddfade;">    </span>if (playback) {
                <span class="diff-html-added" id="added-diff-237" style="font-size: 100%; background-color: #ddfade;">    </span>playback.control({operation: 'restart'});
            <span class="diff-html-added" id="added-diff-238" style="font-size: 100%; background-color: #ddfade;">    </span>}
            <span class="diff-html-added" id="added-diff-239" style="font-size: 100%; background-color: #ddfade;">    </span>break;
        <span class="diff-html-added" id="added-diff-240" style="font-size: 100%; background-color: #ddfade;">    </span>case '6':
            <span class="diff-html-added" id="added-diff-241" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
            <span class="diff-html-removed" id="removed-diff-131" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-242" style="font-size: 100%; background-color: #ddfade;">    </span>call.next_message();
            <span class="diff-html-removed" id="removed-diff-132" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-243" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.DTMF_6);
            <span class="diff-html-added" id="added-diff-244" style="font-size: 100%; background-color: #ddfade;">    </span>break;
        <span class="diff-html-added" id="added-diff-245" style="font-size: 100%; background-color: #ddfade;">    </span>case '#':
            <span class="diff-html-added" id="added-diff-246" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
            <span class="diff-html-removed" id="removed-diff-133" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-247" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.DTMF_OCTOTHORPE);
            <span class="diff-html-added" id="added-diff-248" style="font-size: 100%; background-color: #ddfade;">    </span>break;
        <span class="diff-html-added" id="added-diff-249" style="font-size: 100%; background-color: #ddfade;">    </span>case '*':
            <span class="diff-html-added" id="added-diff-250" style="font-size: 100%; background-color: #ddfade;">    </span>console.log("Deleting stored recording", <span class="diff-html-removed" id="removed-diff-134" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.get_current_voicemail_file());
            <span class="diff-html-added" id="added-diff-251" style="font-size: 100%; background-color: #ddfade;">    </span>cleanup();
            <span class="diff-html-removed" id="removed-diff-135" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-252" style="font-size: 100%; background-color: #ddfade;">    </span>call.client.recordings.deleteStored({recordingName:<span class="diff-html-removed" id="removed-diff-136" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span>call.get_current_voicemail_file()});
            <span class="diff-html-removed" id="removed-diff-137" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-253" style="font-size: 100%; background-color: #ddfade;">    </span>call.delete_message();
            <span class="diff-html-removed" id="removed-diff-138" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">self.</span><span class="diff-html-added" id="added-diff-254" style="font-size: 100%; background-color: #ddfade;">    </span>call.state_machine.change_state(Event.DTMF_STAR);
        <span class="diff-html-added" id="added-diff-255" style="font-size: 100%; background-color: #ddfade;">    </span>}
    <span class="diff-html-added" id="added-diff-256" style="font-size: 100%; background-color: #ddfade;">    </span>}
 <span class="diff-html-added" id="added-diff-257" style="font-size: 100%; background-color: #ddfade;">   </span>}
<span class="diff-html-added" id="added-diff-258" style="font-size: 100%; background-color: #ddfade;">}</span>
<span class="diff-html-added" id="added-diff-259" style="font-size: 100%; background-color: #ddfade;">
</span>module.exports = ListeningState;</pre> </td> 
</tr> 
</tbody> 
</table> <p class="diff-context-placeholder" style="margin: 10px 0 0 0">...</p> 
<table class="diff-macro diff-block-context" style="background-color: #f0f0f0;border: 1px solid #dddddd;margin: 10px 1px;padding: 0 2px 2px;width: 100%;; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<thead> 
<tr> 
<th class="diff-macro-title" style="background-color: transparent; text-align: left; font-weight: normal;padding: 5px;"><span class="icon macro-placeholder-icon" style="background-color: ;line-height: 20px;"><img src="https://wiki.asterisk.org/wiki/s/en_GB/5635/60fd2eb45debbf4ede2b669f4c9b96b4ce40a937.48/_/images/icons/macrobrowser/dropdown/panel.png" style="padding-right: 5px; vertical-align: text-bottom;" /> </span>Panel</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
<td class="diff-macro-properties" style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;padding: 0; border: 1px solid #dddddd;; padding: 0px; border-collapse: collapse"> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">bgColor</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">silver</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">titleBGColor</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">seagreen</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">borderStyle</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">solid</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">title</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">Reader Exercise 2</td> 
</tr> 
<tr> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">titleColor</td> 
<td style="background-color: #fafafa; padding: 0 0 0 5px; font-size: 12px; text-align: left;; padding: 0px; border-collapse: collapse">black</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
<tbody> 
<tr> 
<td class="diff-macro-body" style="background-color: #fff;border: 1px solid #dddddd;padding: 10px;; padding: 0px; border-collapse: collapse"> <p style="margin: 10px 0 0 0; margin-top: 0">You may have noticed while exploring the playbacks API that the <code style="font-family: monospace">control()</code> method takes no parameters other than the operation. This means that certain properties of operations are determined when the playback is started on the channel.</p> <p style="margin: 10px 0 0 0">For this exercise, modify the <code style="font-family: monospace">ListeningState</code> so that DTMF '1' and '3' reverse or forward the playback by 5000 milliseconds instead of the default 3000 milliseconds.</p> </td> 
</tr> 
</tbody> 
</table> <p class="diff-block-target" style="margin: 10px 0 0 0"> <span class="diff-html-removed" id="removed-diff-139" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;"> </span> </p> <h1 id="Part2:Playbacks-Playbacksonbridges" class="diff-block-context" style="margin: 10px 0 0 0; font-size: 24px; font-weight: normal; line-height: 30px; margin: 40px 0 0 0">Playbacks on bridges</h1> <p class="diff-block-context" style="margin: 10px 0 0 0">Just as channels allow for playbacks to be performed on them, bridges also have the capacity to have sounds, recordings, tones, numbers, etc. played back on them. The difference is is that all participants in the bridge will hear the playback instead of just a single channel. In bridging situations, it can be useful to play certain sounds to an entire bridge (e.g. Telling participants the call is being recorded), but it can also be useful to play sounds to specific participants (e.g. Telling a caller he has joined a conference bridge). A playback on a bridge can be stopped or controlled exactly the same as a playback on a channel.</p> <p class="diff-context-placeholder" style="margin: 10px 0 0 0">...</p> </td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td class="email-content-main mobile-expand action-padding last-row-padding" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 15px 16px; background-color: #fff; padding-bottom: 10px; padding-bottom: 10px"> 
<table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
<tbody> 
<tr> 
<td id="actions-pattern-container" valign="middle" style="padding: 0px; border-collapse: collapse; padding: 15px 0 0 24px; vertical-align: middle"> 
<table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0px; vertical-align: middle"><a href="https://wiki.asterisk.org/wiki/display/AST/Part+2%3A+Playbacks?src=email" title="View page Icon" style="color: #3b73af; text-decoration: none"><img class="actions-pattern-action-icon-image" height="16" width="16" border="0" title="View page Icon" src="cid:com.atlassian.confluence.plugins.confluence-email-resources%3Aview-page-email-adg-footer-item%3Aicon" alt="View page Icon" style="vertical-align: middle" /></a></td>
<td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px; white-space: nowrap"><a href="https://wiki.asterisk.org/wiki/display/AST/Part+2%3A+Playbacks?src=email" title="View page" style="color: #3b73af; text-decoration: none">View page</a></td>
<td class="actions-pattern-action-bull" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; color: #999; padding: 0 5px">•</td> 
</tr> 
</tbody> 
</table> 
<table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0px; vertical-align: middle"><a href="https://wiki.asterisk.org/wiki/display/AST/Part+2%3A+Playbacks?showComments=true&showCommentArea=true&src=email#addcomment" title="Add comment Icon" style="color: #3b73af; text-decoration: none"><img class="actions-pattern-action-icon-image" height="16" width="16" border="0" title="Add comment Icon" src="cid:com.atlassian.confluence.plugins.confluence-email-resources%3Aadd-comment-to-content-email-adg-footer-item%3Aicon" alt="Add comment Icon" style="vertical-align: middle" /></a></td>
<td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px; white-space: nowrap"><a href="https://wiki.asterisk.org/wiki/display/AST/Part+2%3A+Playbacks?showComments=true&showCommentArea=true&src=email#addcomment" title="Add comment" style="color: #3b73af; text-decoration: none">Add comment</a></td>
<td class="actions-pattern-action-bull" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; color: #999; padding: 0 5px">•</td> 
</tr> 
</tbody> 
</table> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0px; vertical-align: middle"><a href="https://wiki.asterisk.org/wiki/plugins/likes/like.action?contentId=30277828&src=email" title="Like Icon" style="color: #3b73af; text-decoration: none"><img class="actions-pattern-action-icon-image" height="16" width="16" border="0" title="Like Icon" src="cid:com.atlassian.confluence.plugins.confluence-like%3Aview-email-adg-content-item%3Aicon" alt="Like Icon" style="vertical-align: middle" /></a></td>
<td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px; white-space: nowrap"><a href="https://wiki.asterisk.org/wiki/plugins/likes/like.action?contentId=30277828&src=email" title="Like" style="color: #3b73af; text-decoration: none">Like</a></td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td class="email-content-rounded-bottom mobile-expand" style="padding: 0px; border-collapse: collapse; color: #fff; height: 5px; line-height: 5px; padding: 0 15px 0 16px; background-color: #fff; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; border-top: 0; border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; mso-line-height-rule: exactly"> </td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td id="footer-pattern" style="padding: 0px; border-collapse: collapse; padding: 12px 20px"> 
<table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td id="footer-pattern-links-container" width="100%" style="padding: 0px; border-collapse: collapse; color: #999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
<table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
<tbody> 
<tr> 
<td class="footer-pattern-links mobile-resize-text" style="padding: 0px; border-collapse: collapse"><a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST&src=email" title="" style="color: #3b73af; text-decoration: none">Stop watching space</a></td>
<td class="footer-pattern-links-bull" style="padding: 0px; border-collapse: collapse; padding: 0 5px; color: #999">•</td> 
</tr> 
</tbody> 
</table> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
<tbody> 
<tr> 
<td class="footer-pattern-links mobile-resize-text" style="padding: 0px; border-collapse: collapse"><a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action?src=email" title="" style="color: #3b73af; text-decoration: none">Manage notifications</a></td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0px; border-collapse: collapse; color: #999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px; display: none">This message was sent by Atlassian Confluence 5.6.1</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
</table> 
<table id="sealed-section" border="0" cellpadding="0" cellspacing="0" width="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; display: none"> 
<tbody> 
<tr> 
<td style="padding: 0px; border-collapse: collapse; border: 0; font-size: 0px; line-height: 0; mso-line-height-rule: exactly"></td> 
</tr> 
</tbody> 
</table>
</body>
</html>