Ticket #3042 (closed Patches: fixed)

Opened 4 months ago

Last modified 1 month ago

Call Me feature for ARI (click-to-call voicemail playback)

Reported by: sasargen Assigned to: sasargen
Priority: minor Milestone: 2.6
Component: ARI Version: 2.5-branch
Keywords: voicemail userportal Cc:
Confirmation: Confirmed SVN Revision (if applicable):
Backend Engine: Asterisk 1.4.x Backend Engine Version:

Description (Last modified by sasargen)

This patch set updates ARI to provide voicemail playback and download from the Voicemail page without popups. It also adds the option to call a user defined number to play the voicemail over a phone instead of a computer. It should address the features requested on tickets #1689 and #3039.

Call Me Number: field is added to the Settings page. This field is automatically populated with the user's extension, but it can be changed to any number dialable from your PBX.

On the Voicemail page the Message column of the voicemail table is replaced by two columns, Playback and Download. For each voicemail message the Playback column has a speaker icon for computer playback and a phone icon for phone playback. Clicking either of these links slides open a new row in the voicemail table that displays the computer playback controls or informs the user of the progress of the Call Me call and provides a link to hang up the call when it is connected.

To install:

1. Copy the contents of the attached extensions_custom.conf to the extensions_custom.conf already on your FreePBX server.

2. Copy the callme.patch file or the callme-2.5.1.1.tgz file to the recordings directory in the webroot of your FreePBX server. Typically, this is /var/www/recordings/ on Debian/Ubuntu systems and /var/www/html/recordings/ on CentOS.

3. Copy the png files to recordings/theme/images

4. From the recordings directory of your webroot execute

patch -p0 < callme.patch

or

tar -zxvf callme-2.5.1.1.tgz 

.

Attachments

drive_go.png (0.6 kB) - added by sasargen on 08/15/08 13:16:33.
Icon for Download link.
sound.png (0.6 kB) - added by sasargen on 08/15/08 13:17:09.
Icon for computer Playback.
telephone.png (0.8 kB) - added by sasargen on 08/15/08 13:17:32.
Icon for telephone Playback.
recordings.png (37.5 kB) - added by dani on 08/19/08 12:17:08.
Links not shown
callme.patch (24.0 kB) - added by sasargen on 09/24/08 09:51:09.
Patch to add Callme Feature to FreePBX ARI Framework 2.5.1.1
callme-2.5.1.1.tgz (21.8 kB) - added by sasargen on 09/25/08 10:43:42.
Full copies of files updated by the patch file
callme_extensions_custom.conf (479 bytes) - added by sasargen on 09/29/08 14:01:23.
Custom dialplan code for handling click-to-call voicemail playback.

Change History

08/11/08 15:04:23 changed by p_lindheimer

  • confirmation changed from Unreviewed to Confirmed.
  • milestone changed from 2.5 to 3.0.

08/15/08 13:15:09 changed by sasargen

  • description changed.

08/15/08 13:16:33 changed by sasargen

  • attachment drive_go.png added.

Icon for Download link.

08/15/08 13:17:09 changed by sasargen

  • attachment sound.png added.

Icon for computer Playback.

08/15/08 13:17:32 changed by sasargen

  • attachment telephone.png added.

Icon for telephone Playback.

(follow-up: ↓ 4 ) 08/18/08 09:10:30 changed by totalimpact

copied everything over and got this error:

[root@asterisk1 html]# patch -p0 < callme.patch patch: **** Only garbage was found in the patch input.

(in reply to: ↑ 3 ) 08/18/08 09:24:13 changed by w5waf

Replying to totalimpact:

copied everything over and got this error: [root@asterisk1 html]# patch -p0 < callme.patch patch: **** Only garbage was found in the patch input.

ME Too!!

Bill/W5WAF

08/18/08 11:03:19 changed by warmbowski

Recently tried patching on PiaF 1.2 and some hunks failed.

root@voip2:/var/www/html $ patch -p0 < callme.patch patching file recordings/includes/callme.php patching file recordings/includes/common.php Hunk #1 succeeded at 428 (offset -8 lines). patching file recordings/misc/callme_page.php patching file recordings/misc/play_page.php patching file recordings/modules/settings.module patching file recordings/modules/voicemail.module Hunk #3 succeeded at 378 with fuzz 1 (offset -5 lines). Hunk #4 FAILED at 399. Hunk #5 FAILED at 424. Hunk #6 succeeded at 464 (offset -9 lines). Hunk #7 succeeded at 486 (offset -5 lines). Hunk #8 succeeded at 504 (offset -9 lines). Hunk #9 succeeded at 563 (offset -5 lines). 2 out of 9 hunks FAILED -- saving rejects to file recordings/modules/voicemail.module.rej

08/18/08 13:33:57 changed by warmbowski

You should probably tell us what version of ARI your patch file is for, because my voicemail.module doesn't jibe with your patch file. It has a few differences in the code that will probably cause problems. I am patching ARI that comes with FreePBX version 2.4.1.0. I managed to manually patch the voicemail.module to avoid the errors in the previous post, but it won't work.

08/18/08 19:17:42 changed by sasargen

totalimpact, w5waf, and warmbowski,

Thanks for your interest in this patch. As the ticket says, this feature is for Version: 2.5-branch. The patch file is specifically for 2.5rc1.1, as noted in the comments for the patch file. This patch file should not be installed on a FreePBX 2.4 or earlier system.

If you are trying to install this patch on 2.5rc1.1 and receive a message that only garbage was found in the patch input, please open the patch file in a text editor and compare the file contents with what is displayed in the Trac when you click on the callme.patch link above. Please post back any additional troubleshooting information.

Thanks, Seth

08/19/08 12:16:45 changed by dani

I've just tested on a 2.5rc1 system. Patch apply correctly, but:

- it's not compatible with php 4 (gives this error:

httpd: PHP Parse error:  parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /opt/freepbx/recordings/modules/voicemail.module on line 12

)

- with php 5.1.6, I can log into the ARI, but playback and download links are not shown, see the screenshot

08/19/08 12:17:08 changed by dani

  • attachment recordings.png added.

Links not shown

(follow-up: ↓ 12 ) 08/19/08 12:35:45 changed by p_lindheimer

php 4 does not support 'private' - try getting rid of that. I didn't review the code but I think that will be sufficient to fix it. (and if I'm saying something bad I'm sure sasargen will jump in and correct me.

08/19/08 12:38:36 changed by dani

Sorry, you can forget the problem about missing links (it' was just a problem with the 3 png). Links are displayed now. I havn't tested a lot for now, but downloads do not work, I've got

404 File not found!

08/20/08 07:49:19 changed by sasargen

dani,

Thanks for testing this patch. The error:

404 File not found!

is from the audio.php file and indicates that it has a bad path to the recording file or that the file extension does not match mp3, wav, Wav, WAV, or gsm. Please edit your copy of recordings/misc/audio.php and change the two occurences of:

die("<b>404 File not found!</b>")

to:

die("<b>404 File not found!</b><br>$path")

This should display the full unencrypted path of the recording file on the line after the 404 message. If the errors continue, please post the new error message with the path.

Also, did philippel's suggestion to remove 'private' from line 12 of voicemail.module allow this patch to run on php 4?

Thanks, Seth

(in reply to: ↑ 9 ) 08/22/08 12:13:53 changed by sasargen

Replying to p_lindheimer:

Thanks for that catch. Just removing the 'private' will still result in the same error. Instead, replace 'private' with 'var'. This is the way to declare class variables in PHP4. This also works in PHP5, since PHP5 recognizes 'var' as a synonym for 'public' when declaring class members.

Further details at http://us2.php.net/manual/en/language.oop5.visibility.php

08/23/08 05:09:10 changed by dani

Hi. It seems to be a problem while the path is decrypted. $path content looks like this:

!-°khz“ºñ¼8¢á]ÈÃ1e
þwÕFa<öÎeuñÓš§bЂbìßDQÆîÄÎ>jéìYÚtýør9ÆÉxs·5’

For the php4 compatibility, I'll test this as soon as I re-install my test server as I've upgraded it to php5.

08/23/08 05:13:24 changed by dani

Ok, the problem comes from urlencode:

If I replace this line (audio.php, line 19):

$path = $crypt->decrypt(urlencode($_GET['recording']),$ARI_CRYPT_PASSWORD);

by this:

$path = $crypt->decrypt($_GET['recording'],$ARI_CRYPT_PASSWORD);

I can download the file

08/23/08 07:42:24 changed by p_lindheimer

sasargen, that is correct and it represents a general bug in ARI. (It may be what you had introduced or maybe it was not there). In crypt.php, this is wrong:

     $enc = base64_decode(urldecode($enc));                                                                                                                  

It is already decoded by the browser. I think the solution is to do what we did for system recordings. Remove the urlencode and urldecode from the crypt methods, and put the responsibility on the calling party to do the urlencode after it is encrypted. This keeps the call symmetrical. Do you want to change that in the main ARI base? (And then we can merge that change and other changes since the branch to your branch.

09/10/08 11:18:32 changed by sasargen

  • owner changed from pkaplan to sasargen.

Additional work on this feature can be found in the ari_changes branch of the SVN. See:

http://freepbx.org/trac/browser/freepbx/branches/ari_changes/amp_conf/htdocs/recordings

09/24/08 09:51:09 changed by sasargen

  • attachment callme.patch added.

Patch to add Callme Feature to FreePBX ARI Framework 2.5.1.1

09/25/08 10:43:42 changed by sasargen

  • attachment callme-2.5.1.1.tgz added.

Full copies of files updated by the patch file

09/25/08 13:46:39 changed by sasargen

  • description changed.

09/26/08 18:52:20 changed by sasargen

  • description changed.

09/29/08 14:01:23 changed by sasargen

  • attachment callme_extensions_custom.conf added.

Custom dialplan code for handling click-to-call voicemail playback.

10/19/08 20:31:20 changed by p_lindheimer

(In [7014]) re #3042 removed vm-starmain since that is not an option

10/24/08 15:03:07 changed by sasargen

  • status changed from new to closed.
  • resolution set to fixed.

In [7130] added in code to make vm-starmain option work. Marked ticket as fixed, since this patch has merged into FreePBX 2.5 as part of fw_ari-2.5.2.rc1.

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads