During the phreaknet.sh install it would be nice to have an option that during the Asterisk install to do the "make webvmail". More has to be done to get access to the installed vmail.cgi. If you would like I can document it all and post it here.
10/4/2024 4:13 PM — InterLinked
*what they are
10/4/2024 4:19 PM — KFKHome
The "make webvmail" is part of the Asterisk install process and is included with Asterisk. You install it just after the "make install". vmail.cgi allows www access to a Phone's Voicemail (Read, Play and Delete).
10/4/2024 4:28 PM — InterLinked
This seems like a rather niche thing (for one, I'd never heard of this before)... a lot of folks don't even run a web server on their Asterisk server.
It could certainly be part of the tool, but I don't think it's something that would be enabled by default since the majority of users would not need/want this.
If you're able to share the steps are that you had in mind, we could certainly consider that - PRs are also welcome.
10/4/2024 5:23 PM — KFKHome
There really not much to it.
apt install apache2
On some older Versions of Asterisk you had to do a: "mkdir /var/www/cgi-bin".
After the Asterisk "make install" do a "make webvmail"
The file /etc/apache2/conf-enabled/serve-cgi-bin.conf needs to be modified to have the correct directory or you need to move vmail.cgi.
----- Modified File -----
<IfModule mod_alias.c>
<IfModule mod_cgi.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>
<IfModule mod_cgid.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>
<IfDefine ENABLE_USR_LIB_CGI_BIN>
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
</IfDefine>
</IfModule>
----- End File -----
You need an HTML File in /var/www/html. Create a New HTML File Named index.html
----- HTML File -----
<HTML>
<HEAD><TITLE>VoIP Phone Server</TITLE></HEAD>
<BODY>
<P align=center><FONT size=7>VoIP Phone Server</FONT></P>
<HR><HR>
<P align=center><FONT size=7>
<A href="cgi-bin/vmail.cgi">Voice Mail</A></FONT></P>
</BODY>
</HTML>
----- End HTML File -----
a2enmod cgi
systemctl restart apache2
In order for vmail.cgi to be able to Delete Voicemail you need: /etc/asterisk/vmail.fix
----- Begin File -----
chmod -R a+rwx /var/spool/asterisk/voicemail/default/$2/
----- End File -----
chmod 755 vmail.fix
Then in voicemail.conf you need:
externnotify=/etc/asterisk/vmail.fix
Then an Asterisk Command: "voicemail reload" Or just Restart Asterisk.
I think that's all. Give it a try.
10/4/2024 5:31 PM — KFKHome
Well some of the didn'd format right. the :a2enmod cgi" is on a linr by itself.
And the HTML is:
----- HTML File -----
<HTML>
<HEAD><TITLE>VoIP Phone Server</TITLE></HEAD>
<BODY>
<P align=center><FONT size=7>VoIP Phone Server</FONT></P>
<HR><HR>
<P align=center><FONT size=7>
<A href="cgi-bin/vmail.cgi">Voice Mail</A></FONT></P>
</BODY>
</HTML>
----- End HTML ---
Some extra blank lines for formatting.
10/4/2024 5:38 PM — InterLinked
Hmm... I was assuming there were more steps involved on the Asterisk side, but this seems to be mostly web server configuration... it's not even that it's mostly outside of the scope of Asterisk itself, but web server configuration is not trivial to automate. Every user might have a different hostname / virtualhost they want to use. TLS certificates are often involved. Even if this were included, a lot of assumptions are being made here - it might work for your use case, but not everybody that wanted to set it up the way that they might want to set it up.
10/4/2024 5:59 PM — KFKHome
The only Web Server item is the one file that defines the location of cgi Files. I guess you could just move vmail.cgi to the old location and not change end serve-cgi-bin.conf File at all. Then there is the small HTML File. You could probably leave the rest of apache2 alone. Except for the "a2enmod cgi"
10/4/2024 6:12 PM — InterLinked
What I'm trying to say is that defining the location of a CGI file isn't necessarily enough to make a web server work - if this is a public-facing server and the Asterisk server is terminating TLS, then that opens up a whole another can of worms as well. The hostname also needs to be configured, etc. Most people are going to want a more fleshed out webpage to run in production, and most likely will have their own webpage with customizations already made to it. I think it's something most people will want to do manually or use their own (custom) automated process for.
Apart from running make webvmail
, which is only 1 command to begin with, this is all (somewhat opinionated) Apache/web server configuration in some way which is why I don't think it's appropriate to kludge it into an Asterisk-focused tool. For example, there is another tool I wrote that generates a webpage of Asterisk documentation, but that's maintained as a separate project, not part of PhreakScript, and neither of them configures the web server for the user.
You must be
10/4/2024 4:13 PM — InterLinked
I'm not sure what webvmail or vmail.cgi, I don't think they are part of Asterisk.