Home Forum Developers IP0x "visual" voicemail

JRPassphrase Registration Control

In order to register on this site, you must first submit the passphrase below.

TODO list for each hardware target can be found as sticky topic in the corresponding forum


luckman212
useravatar
User Info

"visual" voicemail

Hi guys,
well this is a short question.
does anybody know of any package that we can add into switchfin to give some kind of GUI or interface onto voicemails? 

best would be individual pages for each extension, with a password protected page of some kind.

this would be a really great feature to have.
yes I know the pbx can deliver as an email attachment but it would be great to be able to log in from anywhere, listen to a voicemail, delete messages etc. without dialing in.

any ideas?



Edited By:  luckman212
Jul-07-10 19:51:55

Administrator has disabled public posting
Gilles
useravatar
User Info

Re: "visual" voicemail

+1, definitely. It'd be great for users to be able to listen to their VM through a web interface while they're on the road, so that they don't need to either call into the Asterisk server, or launch an SIP client and connect to the server.


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

Hi Guys

This is a great idea and something i have spent allot of time thinking about. There is one major problem with allowing users to access the system this is the security provided by the AMI (asterisk management interface).

The bigest security issue comes with using javascript.
The current admin interface works like so:

Admin logs in > AMI Accepts > Javascript asks AMI for all major config files > Config files parsed into arrays and stored by web browser > configs edited and passed back to AMI to be saved.

This is fine on an internal network with one user (as we always know who has access), but when it comes to allowing users to enter the system we would have to add each user to manager.conf, even if we only allow read only access that user would be able to parse the configs and see all settings in the system including the admin password - this is a big security issue.

So to sum it up it can be done but at huge risk to the security of your system, or with the use of a scripting language like PHP - not really viable on an embedded system due to resource usage.

If any one has any ideas on how to solve these issues let me know as I think a user management portal would be a great addition to the GUI


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

hmm that Is interesing, I didn't realize the security implications of this, thought it would be a fairly straightforward task.   I have heard some people talk about asterisk being able to store voicemail on an IMAP server.   So then it could be accessed via a desktop email client such as MS Outlook. 

for example,
http://www.voip-info.org/wiki/view/Aste … AP+storage

What about this as an alternative?  possible?


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

mmm IMAP looks good and would be simple to integrate into the GUI I will try and do some testing this weekend.


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

mmmmm looks like it requires UW IMAP, not sure how easy this would be to port


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

Jason what about storing the vm's in an external SQLlite database?  then a PHP app could be written (running on the external host) to securely access those.  Of course its not ideal but it does make storage space a non-issue. 

It makes it much less self-contained but I don't know if there would be another way.  Could switchfin have SQLlite support?


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

Hi Luke

sorry for the delay SwitchFin already has sqlite3 built in, but i think the simplest way would still be using IMAP when i get a chance ill try to get it working.


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

ok definitely sounds interesting!


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: "visual" voicemail

Albi90 wrote:

mmmmm looks like it requires UW IMAP, not sure how easy this would be to port
BTW, if you have the time, it'd be useful to document how you ported a Linux app to the Blackfin/uClinux, so that other users can help porting apps to Switchfin.


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

Hi guys

Im just finishing the testing on uw-imap port as requested i have documented the details below.  This only includes the basic's and not any of the changes to make it compile hope it helps.


Cross compiling uw-imap to SwitchFin

1. Create a new folder in ‘package/’ name the folder ‘uw-imap’ this will hold the config for the make menuselect and also the SwitchFin makefile for uw-imap

2. In the newly created ‘package/uw-imap’ folder create a file called ‘Config.in’

3. Add the following to ‘Config.in’ file

Code:


config SF_PACKAGE_UW-IMAP
    bool "uw-imap"
    depends on (SF_PACKAGE_ASTERISK)
    default n
    help
        IMAP support for asterisk

• The ‘config SF_PACKAGE_UW-IMAP’ line tells SwitchFin to declare a variable called ‘SF_PACKAGE_UW-IMAP’

• The ‘bool "uw-imap"’ line tells SwitchFin that this is a Boolean  field and to name it ‘uw-imap’ in the make menu

• The ‘depends on (SF_PACKAGE_ASTERISK)’ line tells SwitchFin that this package requires asterisk to be enabled.

• The ‘default n’ line tells SwitchFin not to enable this feature by default.

4. Edit the ‘package/Config.in’ add ‘source "package/uw-imap/Config.in"’ this allows the SwitchFin make menu to see our new config.

5. Now in the ‘package/uw-imap/’ folder create a file called ‘uw-imap.mk’ this will be out make file.

6. Add the following to the ‘uw-imap.mk’

Code:


UW-IMAP_VERSION=2007e
UW-IMAP_NAME=imap-$(UW-IMAP_VERSION)
UW-IMAP_DIR=$(BUILD_DIR)/$(UW-IMAP_NAME)
UW-IMAP_SOURCE=$(UW-IMAP_NAME).tar.gz
UW-IMAP_SITE=ftp://ftp.cac.washington.edu/imap
UW-IMAP_UNZIP=zcat
UW-IMAP_PATCH=uw-imap.patch

$(DL_DIR)/$(UW-IMAP_SOURCE):
    $(WGET) -P $(DL_DIR) $(UW-IMAP_SITE)/$(UW-IMAP_SOURCE)

$(UW-IMAP_DIR)/.unpacked: $(DL_DIR)/$(UW-IMAP_SOURCE)
    $(UW-IMAP_UNZIP) $(DL_DIR)/$(UW-IMAP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
    touch $(UW-IMAP_DIR)/.unpacked

$(UW-IMAP_DIR)/.configured: $(UW-IMAP_DIR)/.unpacked
    $(PATCH_KERNEL) $(UW-IMAP_DIR) package/uw-imap $(UW-IMAP_PATCH)
    touch $(UW-IMAP_DIR)/.configured

uw-imap: $(UW-IMAP_DIR)/.configured
    $(MAKE) -C $(UW-IMAP_DIR) lnx IP=4 SSLTYPE=none CC=$(CC) LDFLAGS=$(LDFLAGS)

uw-imap-clean:
    rm -f $(UW-IMAP_DIR)/.configured
    -$(MAKE) -C $(UW-IMAP_DIR) clean

uw-imap-dirclean:
    rm -rf $(UW-IMAP_DIR)

ifeq ($(strip $(SF_PACKAGE_UW-IMAP)),y)
TARGETS+=uw-imap
Endif

How does this work
• First we download the uw-imap source using wget

• Next we check for the presence of a file called ‘.unpacked’ in the ‘build_ip04/imap-2007e’ if this doesn’t exist we check that the source is found in the ‘dl’ directory if it is then we extract the source into the ‘build_ip04’ dir and add a file called .unpacked so next time we build this step will be passed.

• Next we check for the ‘.unpacked’ file again and if it exists we first run a patch – this patch fixes issues with the cross compiling of uw-imap, you might not need to patch anything if the application cross compiles smoothly.  Then we run make telling uw-imap that the system is not using a shadow password (lnx) and only IPv4 (ip=4) and that we don’t have SSL (SSLTYPE=none)

• The other steps are pretty self explanatory ‘uw-imap-clean:’ = run make clean.  ‘uw-imap-dirclean:’ = remove imap2007e dir from the build dir.

7. Run make uw-imap from the SwitchFin dir, and see if it compiles


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

uw-imap should now be in the SVN, you will have to configure manually in voicemail.conf until i work out the best way to integrate it in the GUI


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

wow this is so cool!! I am going to try to compile a new build now smile


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: "visual" voicemail

Albi90 wrote:

Im just finishing the testing on uw-imap port as requested i have documented the details below.  This only includes the basic's and not any of the changes to make it compile hope it helps.
Thanks a lot Jason.

One other thing: Did you just copy/paste the original Makefile or did you have to tweak it to so that UW compiles with the Blackfin toolchain? If the latter, what did you do, are there error messages that an application displays that can help porting it to Blackfin, etc.?


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

guys I compiled this new build, uw-imap seems to be running but I am getting nonstop errors in my Asterisk console

Code:


[Jul 17 19:29:09] ERROR[325]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 6000 in context default
[Jul 17 19:29:10] ERROR[325]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 6000 in context default
[Jul 17 19:29:11] ERROR[325]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 6000 in context default
[Jul 17 19:29:11] ERROR[338]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 113537 in context default
[Jul 17 19:29:12] ERROR[338]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 17772345678 in context default
[Jul 17 19:29:12] ERROR[338]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 6000 in context default
[Jul 17 19:29:12] ERROR[325]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 6000 in context default

I know I need to manually configure voicemail.conf but where do I find documentation on the format of this file?  Also several users on my pbx do NOT have voicemail or mailboxes -- does having the uw-imap installed cause a problem in this case? (i mean, are voicemail boxes mandatory for all users now).

Notice that I am also getting this error for my TRUNKS too (113537 and 17772345678) which should definitely not have mailboxes so I am sure this is some kind of .conf file error.  But how to fix it? 

edit: by the way I tested enabling a voicemail box on one extension & reloading asterisk but the error continues.  So I think I need to create entries in the default context of voicemail.conf but again I don't know the proper format of these.


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

pulled this from the wiki

Code:


[general]
imapserver=hostname of IMAP server

; Here you may specify an alternate folder for voicemail.
; Needs to be created manually on server
imapfolder=Voicemail

in the Voicemail specification

; Syntax:
; <mailbox #> => <password>,<full name>,<email address>,<pager email address>,imapuser=<IMAP username>|imappassword=<IMAP password>
;
; For example:
[default]
4200 => 9855,Mark Spencer,myemail@digium.com,mypager@digium.com,imapuser=markster|imappassword=m@rk$ter
4201 => 7070,Johnny Smith,jsemail@digium.com,jspager@digium.com,imapuser=jsmith|imappassword=password1


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

we still use the original make file for uw-imap but have to patch it to make it compile properly, the biggest issues with uw-imap was it was shadowing LDFLAGS in each applications Makefile simple solution rename LDFLAGS to LFLAGS also -lcrypt needed to be added to the LDFLAGS!!

but each application is different.


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

hmm OK, I need to understand some basic fundamentals about this I guess:

1) vm storage is local right? so imapserver=localhost is the only valid option?
2) i hear talk about people using gmail IMAP for storage-  is this possible or even recommended?  I am guessing 'no' but just want to be sure
3) in the syntax, I guess values can be omitted if not needed right -- for example <pager email address> ?
4) still not sure what to do about the app_voicemail.c:1258 kicking out errors about not finding mailboxes for my trunk lines, e.g.:

Code:

[Jul 17 20:27:40] ERROR[338]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 17772637627 in context default

[Jul 17 20:27:40] ERROR[338]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 17772653591 in context default

^^^^ those are SIP trunks ^^^^

5) I set up an account for myself, mailbox is 6001... but I cannot connect to it with any IMAP client.  I even tested if port 143 (IMAP) is open and no, it is not open.  scratching my head now.  Maybe I just need to get out of the house for a bit.  starting to go batty here.


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

1) hehe no you will need an external IMAP server
2) if gmail uses standard IMAP should be fine then
3) should be OK just removing the values like so ,,


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

ok thanks!  what about item #4 ?  any idea??


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

not sure i haven't tested it yet will try now.


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

if you edit users.conf and remove 'mailbox = xxxx' from users.conf and set 'hasvoicemail = no' you should get around the error, i am currently getting a authentication error now not to sure why.


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

got it to work heheh the authentication error was due to me having my password wrong stupid me was the last thing i checked too hhehhehe


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

Jason I am pulling out my hair with this one... I have checked and double checked all my config files, but all I get is constant (3-4 per second) in my CLI logs:

Code:

[Jul 17 22:26:26] ERROR[325]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 6000 in context default

[Jul 17 22:26:27] ERROR[325]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 6000 in context default
[Jul 17 22:26:28] ERROR[325]: app_voicemail.c:1258 messagecount: Couldn't find mailbox 6000 in context default

here is my voicemail.conf:

Code:

;!

;! Automatically generated configuration file
;! Filename: voicemail.conf (/etc/asterisk/voicemail.conf)
;! Generator: Manager
;! Creation Date: Thu Dec 25 11:27:13 2008
;!

[general]
imapserver=imap.gmail.com
imapfolder=vm
format = wav49
serveremail = pbx@switchfin.org
attach = yes
skipms = 3000
maxsilence = 4
silencethreshold = 128
maxlogins = 3
emaildateformat = %A, %B %d, %Y at %r
sendvoicemail = yes
maxgreet = 30
operator = yes
maxmsg = 25
maxmessage = 120
minmessage = 5
saycid = yes
sayduration = no
envelope = no
review = yes
emailonly = no
emailsubject = New Voicemail from ${VM_CALLERID}
emailbody = Hello ${VM_NAME}, you received a message lasting ${VM_DUR} at ${VM_DATE} from,  (${VM_CALLERID}).
mailcmd = /bin/ssmtp -t

[zonemessages]
eastern = America/New_York|'vm-received' Q 'digits/at' IMp
central = America/Chicago|'vm-received' Q 'digits/at' IMp
central24 = America/Chicago|'vm-received' q 'digits/at' H N 'hours'
military = Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'
european = Europe/Copenhagen|'vm-received' a d b 'digits/at' HM

[default]
6000 => 1111,Luke,luke@gmail.com,,imapuser=luke@gmail.com|imappassword=mypassword

[other]

I don't know where to go next!


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

did you change 'hasvoicemail = yes' to 'hasvoicemail = no' for each user in users.conf

this should make it work but breaks the ring time out to goto voice mail i think the dial cmd needs to be altered to.


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

Ok think i have fully worked it out hehe sorry luke

the correct way is to remove '6000 => 1111,Luke,luke@gmail.com,,imapuser=luke@gmail.com|imappassword=mypassword
' from the default context in voicemail.conf

add the following to each user in users.conf
'hasvoicemail = yes'
'imapuser = luke@gmail.com'
'imappassword = mypassword'

let me know how you go!!


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

I think that is working...... strange because *everywhere* on the web shows it set up in voicemail.conf.  Hummmm... ???

I don't think the imap client can support GMail anyway because I think Gmail requires SSL connection.  But I did not test this yet.   I use google apps for my email so unless uw-imap can support an SSL connection I guess I am out of luck in that case.

edit:yes this is as I feared.  I have completely locked out of switchfin GUI since adding in the gmail imap info.   It is getting 'hung up' while communicating I guess with the backend.  Here's a screenshot. 
http://i.imgur.com/BhoCU.png
I logged in via CLI and got this:

Code:

[Jul 18 00:10:57] ERROR[353]: app_voicemail.c:1875 mm_log: IMAP Error: Connection failed to gmail-imap.l.google.com,143: Connection timed out

[Jul 18 00:10:57] ERROR[353]: app_voicemail.c:1640 init_mailstream: Can't connect to imap server {imap.gmail.com:143/imap/user=luke@gmail.com}vm
[Jul 18 00:10:57] ERROR[353]: app_voicemail.c:1298 messagecount: IMAP mailstream is NULL

So I really need to just remove uw-imap for now I guess, and look for a different solution.  I am trying to make a new uImage now with madplay, mplayer etc But , but I cannot build it without uw-imap.   Make is failing, due to some dependency...  I made a separate post about it
http://switchfin.org/index.php?option=c … ;Itemid=54

any idea on that one?


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

uw-imap does support SSL but i disabled it during the make process if openssl was ported you could do it.


Administrator has disabled public posting
luckman212
useravatar
User Info

Re: "visual" voicemail

yes thats what I was afraid of sad
ok, please see my above post (edited) I am trying to make a new uImage without uw-imap but it wont make......... how can I remove that dependency?


Administrator has disabled public posting
Albi90
useravatar
User Info

Re: "visual" voicemail

you will have to run make asterisk-clean then run make


Administrator has disabled public posting

Board Info

Board Stats:   Total Users: 2587  Total Topics: 299  Total Polls: 1  Total Posts: 1727  Dormant
User Info:   Newest User :  user2553   Members Online: 0   Guests Online: 221
Online  There are no members online
Topic
New
Locked
Topic
New
Locked
Sticky
Active
New/Active
Sticky
Active
New/Active
New/Closed
New Sticky
Closed/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky Active Locked
Active/Sticky
Sticky/Locked
Sticky/Active/Locked