VoIPuser - 2013-07-29

If you have installed the Wake Up Calls module, and have ever used *68 to schedule a wake up call, you may have noticed that after it answers there is quite a delay before it starts speaking. That particular module comes from POSSA, not the regular FreePBX developers, and my theory is that POSSA does their development on VERY fast computers, because they introduce deliberate waits into their program that just aren't necessary when running on a Raspberry Pi. Fortunately, it is easy to shave a couple of seconds off the answer time just by commenting out a single line in each of two files - NOTE: I strongly urge you to make a backup copy of each file before working on it, just in case something goes wrong during your edits):

In /var/www/html/admin/modules/hotelwakeup/functions.inc.php find this line:

  $ext->add($id, $c, '', new ext_wait(1));

Comment it out by adding two forward slashes (//) at the start of the line

//      $ext->add($id, $c, '', new ext_wait(1));

Then, in /var/www/html/admin/modules/hotelwakeup/agi-bin/wakeupphp fibd this section:

  sleep(1);       // Wait for the channel to get created and RTP packets to be sent
                  // On my system the welcome you would only hear 'elcome'  So I paused for 1 second

Comment out the first line by adding two forward slashes (//) at the start of the line:

//      sleep(1);       // Wait for the channel to get created and RTP packets to be sent

These changes will not take effect until the next time you reload the FreePBX configuration. Even with these changes, it still takes about three seconds before Allison says "Hello", but at least by shaving off a couple of seconds of useless delay you reduce the chance that you will fall asleep before you get around to entering your wake up call! :)

Note that if you ever upgrade the Wake Up Calls module, or uninstall and reinstall it for any reason, you will probably need to do this procedure again.