Indice de la Documentación
Voip server administration guide
http://www.wifi.com.ar/english/voip.html
- Important configuration and startup files
/usr/local/etc/ser/ser.cfg
/htdocs/config.php
- Save settings for reboot
check your startup files
/mnt/hda2/voip/startup/rc.local
make your bios boot sequence start with the cdrom
- To create new voip users
use the subscribe web form at
http://ip.of.cdrouter/user_interface/reg/index.php
you have to click on the link that you will receive by email to create
the account
Alternatively, from the command line
export SIP_DOMAIN="testvoip.com"
serctl add 8888 passwd your@email.com
you will be asked for the ser database password (heslo)
- Test calls
Use xten lite to register with the server and make test
calls to 393613, 411, 1800...., 613
- Administration Interface
http://ip.of.cdrouter/admin/index.php
initial user admin/heslo
- To add a pstn termination provider
on the file /usr/local/etc/ser/ser.cfg
modify these lines with your termination provider
# send out 00 prefix to wholesale voip.brujula.net termination
if (uri=~"^sip:00[0-9].*@.*") {
if (!is_user_in("From", "ld")) {
sl_send_reply("403", "Payment required");
break;
};
setflag(1);
rewritehostport("voip.brujula.net:5060");
if (!t_relay()) {
sl_reply_error();
};
break;
};
to restart ser run
sh /usr/local/etc/ser/restart-ser
check /var/adm/syslog to make sure there are no errors
tail --lines=50 /var/adm/syslog
To send calls to your PSTN termination provider using the B2BUA
# send out 222 prefix to B2BUA
if (uri=~"^sip:222[0-9].*@.*") {
if (!is_user_in("From", "ld")) {
sl_send_reply("403", "Payment required");
break;
};
strip (2);
rewritehostport("ipof.your.voipserver:6060");
if (!t_relay()) {
sl_reply_error();
};
break;
};
to restart ser run
sh /usr/local/etc/ser/restart-ser
check /var/adm/syslog to make sure there are no errors
tail --lines=50 /var/adm/syslog
- Add credit to subscriber accounts
Use web admin interface
http://ip.of.cdrouter/admin/index.php
Alternatively:
To add credit to subscriber accounts use the myadmin mysql web
interface.
http://ip.of.cdrouter/myadmin/index.php
Select ser, table balance
and insert a row such as
username saldo last_modified
81010 10 0000-00-00 00:00:00
You also need to assign LD grp to the user by inserting this
info in the grp table
username grp last_modified
81010 ld 0000-00-00 00:00:00
- Add / modify destinations on rate table
Use the myadmin mysql web interface
http://ip.of.cdrouter/myadmin/index.php
click on the table rate. examples are:
codigo nombre tarifa last_modified
54 Argentina 0.03942 0000-00-00 00:00:00
1 USA 0.01900 0000-00-00 00:00:00
1800 USA Toll Free 0.00000 0000-00-00 00:00:00
1888 USA Toll Free 0.00000 0000-00-00 00:00:00
To import a csv file click on the SQL tab
then click on the link at the bottom of the page:
insert data from a textfile into table
LOAD method: DATA (not DATA LOCAL)
- Security
mysql network access has been disabled at /etc/my.cfg
so access is only allowed from localhost.
thus you can safely leave the default password ser/heslo, and
root mysql password cdrouter
access to the serweb admin interface can be protected using a file
/htdocs/admin/.htaccess
access to the mysql web interface can be protected using a file
/htdocs/myadmin/.htaccess
an example file is located at
/htdocs/myadmin/htaccess
root passwd (for ssh) should be changed using the command passwd
- Web interface modification
All html files are located at the /html directory
use the inlcuded editor pico or vi to edit them
Important files are:
/htdocs/index.html
/htdocs/page.php
/htdocs/prolog.html
/htdocs/epilog.html
/htdocs/config.php
/htdocs/user
- Voicemail to email
To modify the email that is sent to the user modify the file:
/usr/local/lib/sems/plug-in/mail.template
- Swap space
It is recommended to have a swap space on the hard disk
such as a partition with 512 MBytes
for example to create it with
mkswap -c /dev/hda1
it will be used automatically on the next reboot of the livecd
- If you have corruption on a mysql table
you can fix it on the myadmin web interface using the "operations" tab
or from the command line with the command:
mysqlcheck --password=cdrouter --auto-repair --all-databases
- cron administration commands
to make ser server statistics
/htdocs/admin/cron_job#
php -q read_ser_moni.php | cat >> read_ser_moni.log
to keep the balance table up to date
/htdocs/admin/cron_job# php -q do-balance.php
to backup your mysql database you can use the command
mysqldump --user ser --password=heslo ser | gzip > ser.sql.gz
For running these commands automatically you can create a file
/etc/cron.hourly/ser-hourly
with the following commands
#!/bin/sh
mysqlcheck --password=cdrouter --auto-repair --all-databases
sleep 4
ser
sleep 4
chmod 777 /tmp/ser_fifo
sleep 4
cd /htdocs/admin/cron_job/
/usr/local/bin/php -q /htdocs/admin/cron_job/do-balance.php
sleep 2
/usr/local/bin/php -q read_ser_moni.php | cat >> read_ser_moni.log
- hard disk setup example
example partitions:
Command (m for help): p
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 63 506016 82 Linux swap
/dev/hda2 64 4865 38572065 83 Linux
example format commands:
mkswap -c /dev/hda1
mke2fs -j /dev/hda2
tune2fs -i 0 /dev/hda2
- mysql db creation
if you need to recreate you mysql db from scratch
# create mysql databases
su - mysql
mysql_install_db
# Start mysql
su -
/usr/bin/mysqld_safe -O max_connections=1000 &
/usr/bin/mysqladmin -u root password cdrouter
# create ser databases
/usr/local/sbin/ser_mysql.sh create
- Can I change the username convention ?
Yes, change in the file /htdocs/functions.php
$reg_validate_username="^((8[0-9]*)|([a-zA-Z][a-zA-Z0-9.]*))$";
you will also need to update the ser.cfg config file for dialling
- init: Id s2 respawning too fast: disabled for 5 minutes
what can be done about this problem ?
This is due to the console port not finding your serial port 1.
You can disable it it by commenting
#s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100
on /etc/inittab
and restarting inittab with:
init q
Indice de la Documentación
|