[Command]# cat /etc/redhat-release
The Guru Of Tech - Gobind
Asterisk Insall, Codec Install, Vicidial Install.
Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS
All in One
Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS
Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS
Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS
Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS.
Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS
Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS.
Wednesday, December 28, 2011
How to change SSH port on Centos,Ubuntu,Debian
Tuesday, December 27, 2011
Asterisk as a SIP client
Format:
register => user[:secret[:authuser]]@host[:port][/extension]
or
register => fromuser@fromdomain:secret@host
or
register => fromuser@fromdomain:secret:authuser@host:port/extension
Example1:
register => username:pwd:username@216.144.238.155/extension
; Register 2345@mysipprovider.com with authname 2345 at mysipprovider.com at sip provider as 1234 here:
register => 2345:password@mysipprovider.com/1234
; Register 1235@mysipprovider.com with authname 1235 and realm mysipprovider.com at proxyof.mysipprovider.com as s here.
; (as needed by budgetphone.nl):
register => 1235@mysipprovider.com:password:1235@proxyof.mysipprovider.com
Asterisk configuration templates
like extensions.conf, sip.conf or iax.conf. Templates are not to be confused with
macros in extensions.conf.
For template configurations, the syntax for defining a section is as follows:
[section](options)
label = value
The options field is used to define templates, refer to templates and hide
templates. Any object can be used as a template.
No whitespace is allowed between the closing "]" and the parenthesis "(".
Adding to an existing section
(this is actually not template-related, but still an interesting method)
[section]
label = value
[section](+)
label2 = value2
In this case, the plus sign indicates that the second section (with the
same name) is an addition to the first section. The second section can
be in another file (by using the #include statement). If the section
name referred to before the plus is missing, the configuration will fail
to load.
Defining a template-only section
[section](!)
label = value
The exclamation mark indicates to the config parser that this is a only
a template and should not itself be used by the Asterisk module for
configuration. The section can be inherited by other sections (see section
"Using templates" below) but is not used by itself.
Using templates (or other configuration sections)
[section](name[,name])
label = value
The name within the parenthesis refers to other sections, either
templates or standard sections. The referred sections are included
before the configuration engine parses the local settings within the
section as though their entire contents (and anything they were
previously based upon) were included in the new section.
Example 1
[tpl_ext](!) ; a template
dtmfmode=rfc2833
context=from-internal
type=friend
disallow=all
allow=gsm
qualify=yes
host=dynamic
[1000](tpl_ext)
secret=1000
callcounter=yes ; Enable call counter
busylevel=1
Example 2
[foo]
permit=192.168.0.2
host=asdf
deny=192.168.0.1
[bar]
permit=192.168.1.2
host=jkl
deny=192.168.1.1
[baz](foo,bar)
permit=192.168.3.1
host=bnm
The [baz] section will be processed as though it had been written in the
following way:
[baz]
permit=192.168.0.2
host=asdf
deny=192.168.0.1
permit=192.168.1.2
host=jkl
deny=192.168.1.1
permit=192.168.3.1
host=bnm
Example 3
In top-level sip.conf:
[defaults](!)
type=friend
nat=yes
qualify=on
dtmfmode=rfc2833
disallow=all
allow=alaw
include accounts/*/sip.conf
In accounts/customer1/sip.conf:
[def-customer1](!,defaults)
secret=this_is_not_secret
context=from-customer1
callerid=Customer 1 <300>
accountcode=0001
[phone1](def-customer1)
mailbox=phone1@customer1
[phone2](def-customer1)
mailbox=phone2@customer1
Monday, December 26, 2011
Change the Linux User Root Password
su to root
Type "passwd" (without quotes)
It will then prompt you to type your new pass, and then to confirm it.
Wednesday, December 21, 2011
How to Reset forgotten root password on Centos/Red Hat
If you are desperate because you have forgotten root password, don’t be. This tutorial will show you how to reset root.
Please note that you cannot perform this remotely, you must be physically at the machine.
1. Step : Reboot The Server
2. Step : Look for the centos blue screen saying booting press DOWN arrow key
3. Step : Select any Kernel and Press “ e ”
4. Step : Select Kernel /vmlinuz and Press “ e ”
5. Step : Type “ single “ and Press Enter
6. Step : You Will see the kernel /vmlinuz selected Press “ b ” Server will reboot
7. Step : After Rebooting the server you will get the Shell Prompt and Type Command “ passwd ”
8. Step : Type password “ newpassword “
9. Step : Reboot server using command “ init 6”
10. You Are Done!!
Repairing a Corrupted Database in MYSQL
[root@123]#
mysqlcheck --auto-repair --databases database-name -uUser -pPass (for {INNODB} and MYSQL service should be running)
And
[root@123]#
myisamchk /var/lib/mysql/database-name/*.MYI ( for {MyISAM} and MYSQL service should be stopped)
Sunday, December 18, 2011
HOW TO CHANGE NAME OF AUTHOR in Blogger
1.Log in to your dashboard--> template- -> Edit HTML
2.Click on "Expand Widget Templates"
3.Scroll down to where you see this:
<span class='post-author vcard'><b:if cond='data:top.showAuthor'><data:top.authorLabel/><span class='fn'><data:post.author/></span></b:if></span>
4.Replace <data:post.author/> of above code with your new name.
5.Click on "Save Templates" and Refresh your site.
Friday, December 16, 2011
Dialplan that will act as a plug-in replacement for AgentCallbackLogin
This is a sample dialplan that will act as a plug-in replacement for AgentCallbackLogin
for Asterisk 1.6's.
It offers the following features:
- Single log-on and log-off, managing queue/agent associations centrally
- Agent pause (with pause reason) and unpause
- Managed device state - the queue will not try calling members that are busy
on other queues or because of other calls
- Tracking of the current hot-desk extension
- Fully compatible with QueueMetrics
- Very compact and easy to expand
It requires Asterisk 1.6.1 or newer to run.
SETTING UP
----------
First, make sure that the extension that you plan to use in sip.conf have
callconter=yes
busylevel=1
so that when one call is being made or received, the telephone state is BUSY.
Then define your queues in queues.conf (see file here for an example configuration).
For this example we define two queues aclled "q1" and "q2".
We leave the file agents.conf completely alone (agent/queue associations are managed
in the dialplan).
Import the file "agent16_queuemetrics.conf" in the main extension.conf file and create
"hooks" that your agents will dial (see examples in the extensions.conf file included).
Edit "agent16_queuemetrics.conf" to define which agents work on which queues (see below).
Included hooks:
- 820 -> Agent login. It will ask you the agent code and the current extension (as in SIP/ext)
- 821 -> Agent log off. It will ask you the current agent number.
- 823 -> Agent pause. It will autodetect the current agent based on the extension and will
ask you for a pause code. Enter # if none.
- 824 -> Agent unpause. It will autodetect the current agent.
Then at 827/828 you see an example of routing calls to each queue. Set up queues as you best
see fir in your dialplan.
Enjoy!
DEFINING WHICH AGENTS WORK ON WHICH QUEUES
------------------------------------------
Edit the file agent16_queuemetrics.conf where it says:
[macro-xagents-allqueues]
....
exten => s,n,Macro(xagents-associate,${ARG1},${ARG2},${ARG3},q1,100:101:103:105)
....
As you can see, here we say that for "q1" we have agents 100, 101, 103 and 105.
You must separate agents using a semicolon.
Add a line for each queue that you have defined in your dialplan.
SETTING UP QUEUEMETRICS
-----------------------
QueueMetrics requires no special setup:
1. make sure that default.rewriteLocalChannel=true (this should be the current default anyway)
2. manually assign agents to the queues
++++++++++++++++++++++++++++++++++++++++++++
QUEUS.CONF
++++++++++++++++++++++++++++++++++++++++++++
[general]
persistentmembers = yes
keepstats = no
autofill = yes
monitor-type = MixMonitor
shared_lastcall=no
[q1]
music=default
strategy=rrmemory
eventwhencalled=no
timeout=15
retry=1
wrapuptime=0
maxlen = 0
announce-frequency = 0
announce-holdtime = no
autopause=no
autofill=yes
joinempty=yes
[q2]
music=default
strategy=rrmemory
eventwhencalled=no
timeout=15
retry=1
wrapuptime=0
maxlen=0
announce-frequency = 0
announce-holdtime=no
autopause=no
autofill=yes
joinempty=yes
++++++++++++++++++++++++++++++++++++++++++++
SIP.CONF
++++++++++++++++++++++++++++++++++++++++++++
[tpl_grandstream](!) ; a template
dtmfmode=rfc2833
context=from-internal
type=friend
disallow=all
allow=gsm
qualify=yes
host=dynamic
[999](tpl_grandstream)
secret=999
callcounter=yes ; Enable call counter
busylevel=1
++++++++++++++++++++++++++++++++++++++++++++
agents16_queuemetrics.conf
++++++++++++++++++++++++++++++++++++++++++++
[xagents]
exten => _.,1,Set(realchan=${DB(Xagent/${EXTEN})})
exten => _.,n,NoOP("Trying Xagent/${EXTEN} as ${realchan}")
exten => _.,n,Dial(${realchan},60,tT)
exten => h,1,NoOp
[macro-xagents-associate]
;
; ARG1 : operation: ADD or REM
; ARG2 : Agent ID
, ARG3 : Device to be used as state for agent ID
; ARG4 : queue name
, ARG5 : queue members, as 100:103:104
;
exten => s,1,NoOp("Macro2")
exten => s,n,Set(queue=${ARG4})
exten => s,n,Set(agentlist=:${ARG5}:)
exten => s,n,Set(agent=${ARG2})
exten => s,n,Set(oper=${ARG1})
exten => s,n,Set(devstate=${ARG3})
exten => s,n,Set(fnd=${REGEX(":${agent}:" ${agentlist})})
exten => s,n,GotoIf(${fnd}?found)
exten => s,n,NoOP( "NOTFOUND" )
exten => s,n,MacroExit
exten => s,n(found),Goto(op-${oper})
exten => s,n,MacroExit
exten => s,n(op-ADD),AddQueueMember(${queue},Local/${agent}@xagents,,,,${devstate})
exten => s,n,MacroExit
exten => s,n(op-REM),RemoveQueueMember(${queue},Local/${agent}@xagents)
exten => s,n,MacroExit
[macro-xagents-allqueues]
; AGR1: operation: ADD or REM
; ARG2: Agent ID
; ARG3: Device to be used as a source of state
exten => s,1,NoOP("")
exten => s,n,Macro(xagents-associate,${ARG1},${ARG2},${ARG3},q1,100:101:103:105)
exten => s,n,Macro(xagents-associate,${ARG1},${ARG2},${ARG3},q2,101:100:103:105)
exten => s,n,Macro(xagents-associate,${ARG1},${ARG2},${ARG3},q3,108:101:103:105)
exten => s,n,MacroExit
[xagents-logon]
exten => s,1,Answer
exten => s,n,Read(agent,agent-user)
exten => s,n,Read(phone,agent-newlocation)
exten => s,n,Set(DB(Xagent/${agent})=SIP/${phone})
exten => s,n,Set(DB(Xagent_byphone/${phone})=${agent})
exten => s,n,QueueLog(NONE,${UNIQUEID},Local/${agent}@xagents,AGENTCALLBACKLOGIN,${phone})
exten => s,n,Macro(xagents-allqueues,ADD,${agent},SIP/${phone})
exten => s,n,Playback(agent-loginok)
exten => s,n,Hangup
[xagents-logoff]
exten => s,1,Answer
exten => s,n,Read(agent,agent-user)
exten => s,n,Set(chan=${DB(Xagent/${agent})})
exten => s,n,Set(DB(Xagent/${agent})=)
exten => s,n,Macro(xagents-allqueues,REM,${agent},-)
exten => s,n,QueueLog(NONE,${UNIQUEID},Local/${agent}@xagents,AGENTCALLBACKLOGOFF,)
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Hangup
[xagents-pause]
exten => s,1,Answer
exten => s,n,Set(agent=${DB(Xagent_byphone/${CALLERID(num)}})
exten => s,n,Read(code,agent-user)
exten => s,n,PauseQueueMember(,Local/${agent}@xagents,,${code})
exten => s,n,QueueLog(NONE,${UNIQUEID},Local/${agent}@xagents,PAUSEREASON,${code})
exten => s,n,Hangup
[xagents-unpause]
exten => s,1,Answer
exten => s,n,Set(agent=${DB(Xagent_byphone/${CALLERID(num)}})
exten => s,n,UnpauseQueueMember(,Local/${agent}@xagents)
exten => s,n,Hangup
++++++++++++++++++++++++++++++++++++++++++++
EXTENSIONS.CONF
++++++++++++++++++++++++++++++++++++++++++++
#include "agents16_queuemetrics.conf"
[from-internal]
exten => 820,1,Dial(Local/s@xagents-logon)
exten => 821,1,Dial(Local/s@xagents-logoff)
exten => 823,1,Dial(Local/s@xagents-pause)
exten => 824,1,Dial(Local/s@xagents-unpause)
exten => 827,1,Answer
exten => 827,n,Queue(q1)
exten => 828,1,Answer
exten => 828,n,Queue(q2)
----------------------
YOU ARE DONE!!!
Friday, December 9, 2011
Multiple Logins In Windows Live Messenger
The support for multi-WLM is not enabled by default, but can be easily turned on and enable with registry hack.
- Run Registry Editor (regedit).
- Navigate to the following registry key: KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Live\Messenge
For 64-bit (x64) OS, go to following registry branch instead:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows Live\Messenger - In the right pane, right click on any blank space, select New on context menu, and then click on DWORD (32-bit) Value.
- Name the new registry value entry as MultipleInstances.
- Modify the MultipleInstances and set its value data as 1.
- Start as many Windows Live Messenger windows as you want from Start Menu.
Thursday, December 8, 2011
Adding User Accounts in MYSQL
CREATE USER 'sam'@'localhost' IDENTIFIED BY 'some-password';
GRANT ALL PRIVILEGES ON *.* TO 'sam'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES; (telling the server to reload the grant tables using flush command)
The accounts created by these statements have the following properties:
Two of the accounts have a user name of sam and a password of some_pass. Both accounts are superuser accounts with full privileges to do anything. The 'sam'@'localhost' account can be used only when connecting from the local host. The 'sam'@'%' account uses the '%' wildcard for the host part, so it can be used to connect from any host.
Monday, December 5, 2011
Exporting Table Data in a File
SELECT * FROM table_name INTO OUTFILE 'C:/new_file.xls'
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n';
Friday, December 2, 2011
Remote UNIX connection
If getting an error in asterisk cli (1.6.1.8)
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- Remote UNIX connection
-- Remote UNIX connection disconnected
then use the following command in asterisk cli
cli>core set verbose 0
Thursday, December 1, 2011
SHOW CREATE TABLE displays the CREATE TABLE statement to create a given table.
Shows the CREATE TABLE
statement that creates the given table. The statement requires the SELECT
privilege for the table. As of MySQL 5.0.1, this statement also works with views.
mysql> SHOW CREATE TABLE tablename
check directory/dir/file size in linux
#check partition sizes df -h
#check directory size du -s -h /var/log/
#check every directory and file sizes under a dir.
du -s -h /var/log/*
#check individual size size du -s -h /var/log/lastlog
Send Mail from CLI (LINUX)
body message here => ctrl+d for CC return key
to check the logs:
cd /var/log
tail -100 maillog
Change the system date in Linux
Set the current date to May 7 2011 8:42:45pm.
#date -s "7 May 2011 20:42:45"
Asterisk updating from 1.6.1.8 to 1.6.2.19
tar -zxvf asterisk-1.6.2.19.tar.gz
cd asterisk-1.6.2.19
./configure
make
make install (Do not delete G729 module)
asterisk -vvvgc
asterisk -vr
http://www.blog.manhag.org/2010/05/installing-the-free-g729-codec-for-asterisk/
Download from here: (Depend on 32bit or 64bit)["i686" means 32-bit. If it was 64-bit, it would be "x86_64"] Check by "uname -a" command
wget http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-pentium.so
(codec_g729-ast16-gcc4-glibc-pentium4.so)
Notice that we are in the modules directory
Rename the codec file
mv codec_g729-ast14-gcc4-glibc-pentium4.so codec_g729.so
Restart Asterisk
/etc/init.d/asterisk restart
Check your work
Connect to Asterisk
asterisk -r
Then show all of the codec translations available using the command below, and check g729 at the left, you should see that it can be translated to many other codecs on the top of the table
Machine*CLI> show translations
**********
After that install mysql module in a proper directory
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.2.3.tar.gz
tar -zxvf asterisk-addons-1.6.2.3.tar.gz
cd asterisk-addons-1.6.2.3
./configure
make clean
make
make install
How to Compile Asterisk module like (app_Voicemail.c)
At starting of the file add this lines
#ifndef AST_MODULE
#define AST_MODULE "app_voicemail"
#endif
AFTER THAT COMPILE THE MODULE
cd /usr/src/asterisk-1.6.1.8/apps/
gcc -shared app_voicemail.c -o app_voicemail.so
cp app_voicemail.so /usr/lib/asterisk/modules/
CLI> restart now
MYSQL Packet too large
If you are using MySQL 4.0 or newer, enter:
[mysqld]
# Allow packets up to 16M (change its value)
max_allowed_packet=16M
If you are using an older version of MySQL, enter:
[mysqld]
# Allow packets up to 16M
set-variable = max_allowed_packet=16M
To store 8 MB objects (default is 16M).
LoopProtection in OTRS
LoopProtection!!! Send no more emails to 'emailid@.com'! Max. count of 40 has been reached!
PostmasterMaxEmails 40 Default
Change its value from 40 to whatever you want
[otrs] State change New to Open
Frontend::Agent::Ticket::ViewNote
Then --> Ticket::Frontend::AgentTicketNote###State: "YES" --> Update
After adding this, you will have the otion to change the state of a ticket
under notes.
Check Size of Database [in MB]
Run the below command
SELECT table_schema "Data Base Name", sum( data_length + index_length) / 1024 / 1024
"Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
Setting for MYSQL replication in my.cnf
In /etc/my.cnf
server-id=2
replicate-same-server-id = 0
auto-increment-increment = 2
auto-increment-offset = 2
replicate-do-db = databasename
Trouble Shooting MySQL Replication.
Mysql> Show slave status;
Above command will show the status of replication. we see two column -- value for both should be 'Yes'.
a. SlaveIORunning -- 'Yes'
b.SlaveSQLRunning --'Yes'
Incase of replication failure value for the columns will be 'No'.
If value is 'No' look for the error. Note the logfile and logposition being read.
Stop slave. First Diagnose error and resync replication from the log position it broke.
Maintenance of Replicated Mysql Server
Deleting Binlogs of mysql. ----->
Log into Secondary Server
mysql> show slave status;
Above command will give the file name being read by slave machine.
Go to master and execute--->
mysql> purge binlogs to 'file_name_got_from_above_command'
In case of master to master replication we have to delete binlog from both machines. Do the same as above on both machines.
Complete Master to Slave MySQL DB Replicate
My.ini/My.cnf configuration for Master
-------------------------------
log-bin=mysql-bin
server-id=1
--------------------------------
INNODB Specific options
--------------------------------
innodb_flush_log_at_trx_commit=1
sync_binlog=1
--------------------------------
Restart MySql Service
FLUSH PRIVILEGES;
-----------------------------------------
mysql>USE exampledb;
mysql>FLUSH TABLES WITH READ LOCK;
Take a backup (or MYSQLDUMP) of the DB to be replicated
Restore DB on Slave
************************************************** *********************************
Step 2 – Configure the Slave Server(Windows XP)
Edit the my.ini/my.cnf
server-id=2
replicate-do-db = exampledb
Step 3 – Restart Mysql Service
Restart mysql Service
mysql > Stop slave;
mysql>CHANGE MASTER TO MASTER_HOST='master_IP', MASTER_USER='user', MASTER_PASSWORD='password',MASTER_LOG_FILE='mysql-bin.000006',MASTER_LOG_POS=183;
mysql > Start slave;
mysql > show slave_status; [This command will show whether your replication is running fine.]
To know if your replication is working check output of above command.
IN Out put of above command value of these two running status should be yes.
Slave_IO_Running | Slave_SQL_Running
Yes | Yes |
If any of these is NO than your replication is not working. To resynchronize DB and start replication again contact your MYSQL DBA.
Wednesday, November 30, 2011
Install And Maintain Kamailio (OpenSER) v3.0.x From GIT on CentOS 5.x
Install And Maintain Kamailio (OpenSER) v3.0.x From GIT on CentOS 5.x
Main author:
Elena-Ramona Modroiu <ramona (at) asipto.com>
This is a step by step tutorial about how to install and maintain Kamailio (OpenSER) using the sources from GIT on CentOS 5.x.
Using the GIT, you get access to the latest code very quickly.
This document focuses on Kamailio (OpenSER) v3.0.x with MySQL support, using CentOS 5.5 system - should works more or less in the same way with CentOS 5.3 or 5.4.
Kamailio 3.0.0 was released on January 11, 2010:
- release notes are available here
- what is new:
You need git 1.5.x at least and might not be available on your CentOS installation, if it is too old. In case git is not available on your yum repository, then install Fedora repository for enterprise release.
On CentOS i386, do:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
On CentOS x86_64, do:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm
Then install suing yum:
yum install git
Of course, as alternative, you can install it from sources, download it from:
Then compile and make install.
- gcc
- make
- flex
- bison
- mysql-server
- mysql-client
- mysql-devel
Create the directory on the file system where to store the sources.
mkdir -p /usr/local/src/kamailio-3.0
cd /usr/local/src/kamailio-3.0
Download the sources from GIT using the following commands.
git clone --depth 1 git://git.sip-router.org/sip-router kamailio
cd kamailio
git checkout -b kamailio_3.0 origin/kamailio_3.0
Generate the config for Makefile system and include MySQL connector module for installation:
make include_modules="db_mysql" cfg
If you want other modules which are not enabled by default to be compiled, add them in include_modules, separated by whitespace.
Compile and install:
make all
make install
The binaries and executable scripts were installed in:
/usr/local/sbin
These are:
- kamailio - Kamailio (OpenSER) server
- kamdbctl - script to create and manage the Databases
- kamctl - script to manage and control Kamailio (OpenSER) server
- sercmd - CLI - command line tool to interface with Kamailio (OpenSER) server
To be able to use the binaries from command line, make sure that '/usr/local/sbin' is set in PATH environment variable. You can check that with 'echo $PATH'. If not and you are using 'bash', open '/root/.bash_profile' and at the end add:
PATH=$PATH:/usr/local/sbin
export PATH
Kamailio (OpenSER) modules are installed in:
/usr/local/lib/kamailio/modules/
/usr/local/lib/kamailio/modules_k/
The documentation and readme files are installed in:
/usr/local/share/doc/kamailio/
The man pages are installed in:
/usr/local/share/man/man5/
/usr/local/share/man/man8/
The configuration file was installed in:
/usr/local/etc/kamailio/kamailio.cfg
To create the MySQL database, you have to use the database setup script:
/usr/local/sbin/kamdbctl create
In order to create the database you need to specify the wanted db type (DBENGINE=MYSQL) in the
/usr/local/etc/kamailio/kamctlrc
file. Call this script without any parameter to get some help for the usage. You will be asked for the domain name Kamailio (OpenSER) is going to serve (e.g., mysipserver.com) and the password of the 'root' MySQL user. The script will create a database named 'openser' containing the tables required by Kamailio (OpenSER). You can change the default settings in the kamctlrc file mentioned above.
The script will add two users in MySQL:
- openser - having the password 'openserrw', user which has full access rights to 'openser' database
- openserro - having the password 'openserro', user which has read-only access rights to 'openser' database
Do change the passwords for these two users immediately after the database is created.
To fit your requirements for the VoIP platform, you have to edit the configuration file.
/usr/local/etc/kamailio/kamailio.cfg
Follow the instruction in the comments to enable usage of MySQL. Basically you have to add several lines at the top of config file, like:
#!define WITH_MYSQL
#!define WITH_AUTH
#!define WITH_USRLOCDB
init.d script
The init.d script can be used to start/stop the Kamailio (OpenSER) server in a nicer way. A sample of init.d script for Kamailio (OpenSER) is provided at:
copy the init scripts :
#cp /usr/local/src/kamailio-3.1.2/pkg/kamailio/rpm/kamailio.init /etc/init.d/kamailio
#chmod 755 /etc/init.d/kamailio
#cp /usr/local/src/kamailio-3.1.2/pkg/kamailio/rpm/kamailio.default /etc/default/kamailio
#vi /etc/default/kamailio and set RUN_KAMAILIO=yes
#vi /etc/init.d/kamailio and update :
KAM=/usr/local/sbin/kamailio
/usr/local/etc/kamailio/kamailio.cfg edit this file to fit your requirements.
For WEB-Interface please install siremis http://techgobind.blogspot.com/2011/11/siremis-open-source-web-management.html
SIREMIS: Open Source Web Management Interface for SIP Routing Engines:
SIREMIS: Open Source Web Management Interface for SIP Routing Engines:
- Kamailio (OpenSER)
- SIP-Router.org
Latest version of SIREMIS 2.x is available at:
- http://siremis.asipto.com/pub/downloads/siremis/
- it includes everything, so you do not need to download something extra
Untar the archive on the local file system (e.g., in your web server root folder):
- cd /var/www
- tar xvfz siremis-x.y.z.tgz
If you want to setup an alias for Apache 2.x, you can run 'make apache-conf' and you get the config snippet printed:
siremis-2.0# make apache-conf
# siremis apache conf snippet ...
Alias /siremis "/var/www/siremis-2.0/siremis"
<Directory "/var/www/siremis-2.0/siremis">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
<FilesMatch "\.xml$">
Order deny,allow
Deny from all
</FilesMatch>
<FilesMatch "\.inc$">
Order deny,allow
Deny from all
</FilesMatch>
</Directory>
You can copy&paste it to Apache conf file (e.g., for Apache2 on Debian/Ubuntu: /etc/apache2/sites-available/default).
This will make SIREMIS available under http://yourwebserver.com/siremis/. If you want to use a different alias, edit Makefile and change the value of URLBASE
Next step is to create .htaccess and Siremis configuration files, you have to run 'make prepare':
siremis-2.0# make prepare
updating htaccess file...
updating app.inc file...
done
Make sure that following directories have write access for web server user:
- siremis/log
- siremis/session
- siremis/files
- siremis/themes/default/template/cpl
Do not forget to restart the web server after doing the changes in its configuration file.
Database server to be used is MySQL.
You have to create a MySQL user that has access to Siremis database, for example:
GRANT ALL PRIVILEGES ON siremis.* TO siremis@localhost IDENTIFIED BY 'siremisrw';
This user will be needed later during the installation, of course, you can use an existing MySQL user that has enough privileges.
Also, you have to create Kamailio database with kamdbctl tool, if you don't have it already:
kamdbctl create
You don't need to do anything else to setup the database of Siremis 2.0, the rest of the process is down via web installation wizard.
Once you have done the steps above, access the web page:
Step 1
First step shows the status of required items. You have to update local configuration until all the items are checked ok.
Step 2
In the second step you have to introduce the details to access Kamailio and Siremis database.
When you install Siremis first time, you probably have to check:
- Create Siremis Database - this create database 'siremis'
- Import Default Data - this imports initial data into database 'siremis'
- Update SIP Database - this updates the structure of Kamailio database for accounting and charts modules
- Replace DB Config - this updates Siremis configuration file with the details to access databases
Step 3
This page presents a status report of installation, showing whether the required directories have writable access and summary of database access details.
Step 4
This is the end of installation, presenting the username and password to login to Siremis. This page is automatically redirected to login page after a short period of time.
Login Page
The login page has a protection for blocking login bots, asking to enter a code printed in an image.
After first login, do not forget to update the password for user admin.
- remove the install directory: siremis/install
If you want to run again installation wizard:
- restore directory: siremis/install
- remove file: siremis/install.lock