Menggunakan opensipsdbctl: Difference between revisions

From OnnoCenterWiki
Jump to navigationJump to search
Onnowpurbo (talk | contribs)
No edit summary
Onnowpurbo (talk | contribs)
No edit summary
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
Setup database  
Jika kita menggunakan database, maka kita perlu melakukan setup [[database]].


  # vi /usr/local/etc/opensips/opensipsctlrc  
 
Setup [[database]]
 
  vi /usr/local/etc/opensips/opensipsctlrc  


atau
atau


  # vi /etc/opensips/opensipsctlrc  
  vi /etc/opensips/opensipsctlrc  


Pastikan
Pastikan
Line 11: Line 14:
  DBENGINE=MYSQL
  DBENGINE=MYSQL
  DBHOST=localhost
  DBHOST=localhost
DBROUSER=opensipsro
DBROPW=opensipsro
  DBNAME=opensips
  DBNAME=opensips
  DBRWUSER=opensips
  DBRWUSER=opensips
DBRWPW="opensipsrw"
DBROOTUSER="root"


Copy opensipsdbctl.mysql
Pastikan MySQL beroperasi
 
# cp /usr/local/src/opensips-1.5.0-tls/scripts/opensipsdbctl.mysql /usr/local/lib/opensips/opensipsctl/


sudo su
/etc/init.d/mysql restart


Pastikan MySQL beroperasi
==Menu Help==
 
$ sudo su -
# /etc/init.d/mysql restart


Help file
cd /usr/local/lib/opensips/opensipsctl
opensipsdbctl -h


# opensipsdbctl -h
  MySQL password for root:  
  MySQL password for root:  
  /usr/local/sbin/opensipsdbctl $Revision: 3997 $
  /usr/local/sbin/opensipsdbctl $Revision: 3997 $
 
  usage: opensipsdbctl create <db name or db_path, optional> .....(creates a new database)
  usage: opensipsdbctl create <db name or db_path, optional> ...(creates a new database)
         opensipsdbctl drop <db name or db_path, optional> .......(!entirely deletes tables!)
         opensipsdbctl drop <db name or db_path, optional> .....(!entirely deletes tables!)
         opensipsdbctl reinit <db name or db_path, optional> .....(!entirely deletes and than re-creates tables!)
         opensipsdbctl reinit <db name or db_path, optional> ...(!entirely deletes and then re-creates tables!)
         opensipsdbctl backup <file> .................................(dumps current database to file)
         opensipsdbctl backup <file> ...........................(dumps current database to file)
         opensipsdbctl restore <file> ................................(restores tables from a file)
         opensipsdbctl restore <file> ..........................(restores tables from a file)
         opensipsdbctl copy <new_db> .................................(creates a new db from an existing one)
         opensipsdbctl copy <new_db> ...........................(creates a new db from an existing one)
         opensipsdbctl migrate <old_db> <new_db> .....................(migrates DB from 1.2 to 1.3, not implemented yet!)
         opensipsdbctl migrate <old_db> <new_db> ...............(migrates DB from 2.1.x to 2.2.x)
         opensipsdbctl presence ......................................(adds the presence related tables)
         opensipsdbctl presence ................................(adds the presence related tables)
         opensipsdbctl extra .........................................(adds the extra tables)
         opensipsdbctl extra ...................................(adds the extra tables)  
 
         if you want to manipulate database as other database user than  
         if you want to manipulate database as other database user than
         root, want to change database name from default value "opensips",
         root, want to change database name from default value "opensips",
         or want to use other values for users and password, edit the
         or want to use other values for users and password, edit the
         "config vars" section of the command opensipsdbctl.
         "config vars" section of the command opensipsdbctl.
        opensipsdbctl pframework create .......................(creates a sample provisioning framework file)


==Inisialisasi Database==


Membuat database opensips
Membuat [[database]] opensips. Pastikan perintah opensipsdbctl di jalankan dari folder /usr/local/lib/opensips/opensipsctl


  # opensipsdbctl create
  cd /usr/local/lib/opensips/opensipsctl
opensipsdbctl create


  MySQL password for root:  
  MySQL password for root:  
  INFO: test server charset
  INFO: test server charset
  INFO: creating database opensips ...
  INFO: creating database opensips ...
Line 60: Line 70:
  INFO: Presence tables succesfully created.
  INFO: Presence tables succesfully created.


  Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist? (y/n): y
  Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist registrant? (y/n): y


  INFO: creating extra tables into opensips ...
  INFO: creating extra tables into opensips ...
  INFO: Extra tables succesfully created.
  INFO: Extra tables succesfully created.
==Cek Database==
Cek apakah [[opensips]] [[database]] telah terbuat
  mysqlshow -u root -p
Akan keluar tampilan kira-kira
+--------------------+
|    Databases      |
+--------------------+
| information_schema |
| mysql              |
| opensips          |
| performance_schema |
| test              |
+--------------------+
==Delete / Drop Database==
Jika ada masalah dengan database & kita perlu mendelete database yang lama, maka lakukan perintah
mysql -u root -p
Enter password:
mysql> drop database opensips;
mysql> quit
==Pranala Menarik==
* [[OpenSIPS]]
* [[OpenSIPS Softswitch]]
* [[Compile OpenSIPS]]
* [[OpenSIPS: Cek Konfigurasi]]
* [[OpenSIPS: Demo Dial Plan]]
* [[Menggunakan opensipsdbctl]]
* [[Menggunakan opensipsctl]]
* [[Konfigurasi minimal OpenSIPS]]
* [[OpenSIPS: Demo User]]
* [[Relay ke PSTN Menggunakan OpenSIPS]]
* [[Relay ke Selular Menggunakan OpenSIPS]]
* [[ENUM Query di OpenSIPS]]

Latest revision as of 10:16, 21 October 2016

Jika kita menggunakan database, maka kita perlu melakukan setup database.


Setup database

vi /usr/local/etc/opensips/opensipsctlrc 

atau

vi /etc/opensips/opensipsctlrc 

Pastikan

DBENGINE=MYSQL
DBHOST=localhost
DBROUSER=opensipsro
DBROPW=opensipsro
DBNAME=opensips
DBRWUSER=opensips
DBRWPW="opensipsrw"
DBROOTUSER="root"

Pastikan MySQL beroperasi

sudo su
/etc/init.d/mysql restart
cd /usr/local/lib/opensips/opensipsctl
opensipsdbctl -h
MySQL password for root: 
/usr/local/sbin/opensipsdbctl $Revision: 3997 $

usage: opensipsdbctl create <db name or db_path, optional> ...(creates a new database)
       opensipsdbctl drop <db name or db_path, optional> .....(!entirely deletes tables!)
       opensipsdbctl reinit <db name or db_path, optional> ...(!entirely deletes and then re-creates tables!)
       opensipsdbctl backup <file> ...........................(dumps current database to file)
       opensipsdbctl restore <file> ..........................(restores tables from a file)
       opensipsdbctl copy <new_db> ...........................(creates a new db from an existing one)
       opensipsdbctl migrate <old_db> <new_db> ...............(migrates DB from 2.1.x to 2.2.x)
       opensipsdbctl presence ................................(adds the presence related tables)
       opensipsdbctl extra ...................................(adds the extra tables) 

       if you want to manipulate database as other database user than
       root, want to change database name from default value "opensips",
       or want to use other values for users and password, edit the
       "config vars" section of the command opensipsdbctl.

       opensipsdbctl pframework create .......................(creates a sample provisioning framework file)


Inisialisasi Database

Membuat database opensips. Pastikan perintah opensipsdbctl di jalankan dari folder /usr/local/lib/opensips/opensipsctl

cd /usr/local/lib/opensips/opensipsctl
opensipsdbctl create
MySQL password for root: 
INFO: test server charset
INFO: creating database opensips ...
INFO: Core OpenSIPS tables succesfully created.
Install presence related tables? (y/n): y
INFO: creating presence tables into opensips ...
INFO: Presence tables succesfully created.
Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist registrant? (y/n): y
INFO: creating extra tables into opensips ...
INFO: Extra tables succesfully created.

Cek Database

Cek apakah opensips database telah terbuat

 mysqlshow -u root -p

Akan keluar tampilan kira-kira

+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| opensips           |
| performance_schema |
| test               |
+--------------------+

Delete / Drop Database

Jika ada masalah dengan database & kita perlu mendelete database yang lama, maka lakukan perintah

mysql -u root -p
Enter password: 
mysql> drop database opensips;
mysql> quit



Pranala Menarik