Difference between revisions of "Instalasi SER"

From OnnoWiki
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 21: Line 21:
  
 
  # apt-get install ser
 
  # apt-get install ser
 +
# apt-get install ser-mysql-module
  
 
Restart SER
 
Restart SER
Line 38: Line 39:
 
  export SIP_DOMAIN="foo.bar”
 
  export SIP_DOMAIN="foo.bar”
  
 +
Sebaiknya di test dulu ini, kadang-kadang membuat masalah di saat login
  
----
+
 
 +
 
 +
 
 +
==Siapkan Database MySQL untuk SER==
  
  
Line 51: Line 56:
  
  
 +
Cek apakah database telah dibuat dengan baik
 +
 +
# mysql -u root -p
 +
password: (masukan password root MySQL)
 +
 +
mysql> connect mysql;
 +
mysql> select * from user;
 +
| Host              | User  | Password        | Select_priv | ...
 +
| %                  | ser  | 4e633cf914a735a0 | N          | ...
 +
| localhost          | ser  | 4e633cf914a735a0 | Y          | ...
 +
| %                  | serro | 7cb73a267cb7bd5f | N          | ...
 +
| localhost          | serro | 7cb73a267cb7bd5f | Y          | ...
 +
 +
mysql> connect ser;
 +
mysql> show tables;
 +
mysql> select * from subscriber;
 +
| phplib_id                        | USERNAME | PASSWORD | FIRST_NAME | ...
 +
| 4cefa7a4d3c8c2dbf6328520bd873a19 | admin    | heslo | first        | ...
 +
 +
Perhatikan '''default password admin adalah heslo.'''
 +
 +
 +
==Siapkan ser.cfg Untuk MySQL==
 +
 +
Edit /etc/ser/ser.cfg
 +
 +
# vi /etc/ser/ser.cfg
 +
 +
----
  
  
 +
Uncomment beberapa module agar
  
 +
loadmodule "/usr/lib/ser/modules/mysql.so"
 +
loadmodule "/usr/lib/ser/modules/auth.so"
 +
loadmodule "/usr/lib/ser/modules/auth_db.so"
  
  
==Menggunakan SERctl==
+
----
  
# serctl
 
/usr/sbin/serctl $Revision: 1.83.2.2 $
 
parameter usage:
 
  
          * subscribers *
+
Agar SER menggunakan database & menulis semua ke database, maka pastikan
add <username> <password> <email> .. add a new subscriber (*)
 
passwd <username> <passwd> ......... change user's password (*)
 
rm <username> ...................... delete a user (*)
 
mail <username> .................... send an email to a user
 
alias show [<alias>] ............... show aliases
 
alias rm <alias> ................... remove an alias
 
alias add <alias> <uri> ............ add an aliases
 
rpid add <username> <rpid> ......... add rpid for a user (*)
 
rpid rm <username> ................. set rpid to NULL for a user (*)
 
rpid show <username> ............... show rpid of a user
 
  
          * access control lists *
+
  #modparam ("usrloc", "db_mode", 0)
  acl show [<username>] .............. show user membership
+
  modparam ("usrloc", "db_mode", 2)
acl grant <username> <group> ....... grant user membership (*)
 
  acl revoke <username> [<group>] .... grant user membership(s) (*)
 
  
          * usrloc *
+
Catatan untuk db_modes,
ul show [<username>]................ show in-RAM online users
 
ul rm <username> ................... delete user's UsrLoc entries
 
ul add <username> <uri> ............ introduce a permanent UrLoc entry
 
showdb [<username>] ................ show online users flushed in DB
 
  
          * pa *
+
* Mode 0 - Disables writes to the database. Contact information will not be preserved if the server is restarted.
  pa pres <p_uri> <pstate>............ set pstate for a presentity
+
* Mode 1 - Writes all changes to the database immediately. Contact information is saved to the database immediately. This can slow the response to clients as they connect.
pa loc <p_uri> <loc>................ set location for a presentity
+
* Mode 2 - Periodically writes contact information to the database based in the in memory cache.
  
          * domains *
 
domain show ........................ show list of served domains
 
domain add <domainname> ............ add a new served domain
 
domain rm <domainname> ............. remove a served domain
 
  
          * control and diagnostics *
+
----
moni ... show internal status      start .... start ser
 
ps ..... show runnig processes    stop ..... stop ser
 
fifo ... send raw FIFO commands    restart .. restart ser
 
ping <uri> .. ping a URI (OPTIONS)
 
cisco_restart <uri> .. restart a Cisco phone (NOTIFY)
 
  
  
  Commands labeled with (*) will prompt for a MySQL password.
+
Pada saat debuging akan lebih mudah jika password di tulis dalam text. Agar memudahkan kita, maka uncomment,
  If the variable PW is set, the password will not be prompted.
 
  
    ACL privileges are: local ld int voicemail free-pstn prepaid
+
modparam ("auth", "calculate_ha1", yes)
 +
modparam ("auth", "password_column", "password")
  
  
 +
Save perubahan & keluar dari ser.cfg
  
  
 +
----
  
  
 +
Restart SER
  
 +
# /etc/init.d/ser restart
 +
 +
 +
 +
 +
  
  
Line 119: Line 138:
 
----
 
----
  
 +
 +
* [[SERWEB]]
 +
* [[SERctl untuk administrator SER]]
 +
* [[VoIP]]
 
* [[Linux Howto]]
 
* [[Linux Howto]]
* [[VoIP]]
 

Latest revision as of 09:58, 7 March 2008

Siapkan MySQL Server

# apt-get install mysql-server libmysqlclient15-dev 
# apt-get install libphp-adodb
# apt-get install libgd2-xpm libgd2-xpm-dev
# apt-get install php5-mysql
# apt-get install php5-gd
# apt-get install php5-curl
# apt-get install php-image-graph php-image-canvas php-pear

Siapkan Password Root untuk MySQL

mysql
mysql> SET PASSWORD FOR root@localhost=PASSWORD('password');


Instalasi SER

Install SER

# apt-get install ser
# apt-get install ser-mysql-module

Restart SER

# /etc/init.d/ser restart




Siapkan /etc/profile

# vi /etc/profile

Pastikan ada parameter SIP_DOMAIN

export SIP_DOMAIN="foo.bar”

Sebaiknya di test dulu ini, kadang-kadang membuat masalah di saat login



Siapkan Database MySQL untuk SER

Siapkan Database MySQL untuk SER

# ser_mysql.sh create
MySql password for root: (masukan password root MySQL)
Domain (realm) for the default user 'admin': (masukan domain / realm / ip-address mesin anda)
creating database ser ...
#


Cek apakah database telah dibuat dengan baik

# mysql -u root -p
password: (masukan password root MySQL)
mysql> connect mysql;
mysql> select * from user;
| Host               | User  | Password         | Select_priv | ...
| %                  | ser   | 4e633cf914a735a0 | N           | ... 
| localhost          | ser   | 4e633cf914a735a0 | Y           | ...
| %                  | serro | 7cb73a267cb7bd5f | N           | ...
| localhost          | serro | 7cb73a267cb7bd5f | Y           | ...
mysql> connect ser;
mysql> show tables;
mysql> select * from subscriber;
| phplib_id                        | USERNAME | PASSWORD | FIRST_NAME | ...
| 4cefa7a4d3c8c2dbf6328520bd873a19 | admin     | heslo | first        | ...

Perhatikan default password admin adalah heslo.


Siapkan ser.cfg Untuk MySQL

Edit /etc/ser/ser.cfg

# vi /etc/ser/ser.cfg


Uncomment beberapa module agar

loadmodule "/usr/lib/ser/modules/mysql.so" 
loadmodule "/usr/lib/ser/modules/auth.so"
loadmodule "/usr/lib/ser/modules/auth_db.so"




Agar SER menggunakan database & menulis semua ke database, maka pastikan

#modparam ("usrloc", "db_mode", 0)
modparam ("usrloc", "db_mode", 2)

Catatan untuk db_modes,

  • Mode 0 - Disables writes to the database. Contact information will not be preserved if the server is restarted.
  • Mode 1 - Writes all changes to the database immediately. Contact information is saved to the database immediately. This can slow the response to clients as they connect.
  • Mode 2 - Periodically writes contact information to the database based in the in memory cache.




Pada saat debuging akan lebih mudah jika password di tulis dalam text. Agar memudahkan kita, maka uncomment,

modparam ("auth", "calculate_ha1", yes)
modparam ("auth", "password_column", "password")


Save perubahan & keluar dari ser.cfg




Restart SER

# /etc/init.d/ser restart