Kamailio-V4.3.2 server set up under centos6.5

Source: Internet
Author: User
Tags sca egrep

Kamailio-V4.3.2 server set up under centos6.5

The installation environment is centos6.5.

The first thing to do is:

Configure various environments ..

Search for details on the Internet.

1. Download the source code:

Switch the directory to the user's main directory

Cd ~

Open the official website download link in the IE browser search window to view the latest version:

Http://www.kamailio.org/pub/kamailio/latest/src/

Then

Wgethttp: // www.kamailio.org/pub/kamailio/latest/src/ (the obtained Version)

:

Latest: http://www.kamailio.org/pub/kamailio/latest/src/kamailio-4.3.2_src.tar.gz

Decompress the package to the current directory:

# Tar zxvf kamailio-4.3.2_src.tar.gz

# Cdkamailio-4.3.2

# Make FLAVOUR = kamailio cfg

# Vim modules. lst Open modules. lst, find the "exclude_modules" variable, and delete the db_mysql field.

2 compile

# Make all

# Make install

The kamailio executable file is installed in the/usr/local/sbin path by default, and the configuration file is installed in/usr/local/etc/kamailio.

3 Configuration

Configure Environment Variables

The environment variables of Kamailio are stored in the/usr/local/etc/kamailio/kamctlrc file.

# Vi/usr/local/etc/kamailio/kamctlrc

The configuration in this file may be a little long. I marked the options to be modified in red for your reference.

Bytes ------------------------------------------------------------------------------------

1 # $ Id $

2 #

3 # The Kamailio configuration file for the control tools.

4 #

5 # Here you can set variables used in the kamctl and kamdbctl setup

6 # scripts. Per default all variables here are commented out, the control tools

7 # will use their internal default values.

8

9 ## your SIP domain

10 SIP_DOMAIN = 192.168.0.193 (this is a domain name, if you do a test in the LAN, you can use the Linux local IP address, my IP address is this)

11

12 ## chrooted directory

13 # $ CHROOT_DIR = "/path/to/chrooted/directory"

14

15 ## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE

16 # by default none is loaded

17 #

18 # If you want to setup a database with kamdbctl, you must at least specify

19 # this parameter.

20 DBENGINE = MYSQL (cancel the "#" comment, the same below is not explained)

21

22 # database host

23 DBHOST = localhost

24

25 ## database name (for ORACLE this is TNS name)

26 DBNAME = kamailio

27

28 # database path used by dbtext, db_berkeley or sqlite

29 # DB_PATH = "/usr/local/etc/kamailio/dbtext"

30

31 ## database read/write user

32 DBRWUSER = "kamailio"

33

34 ## password for database read/write user

35 DBRWPW = "kamailiorw"

36

37 # database read only user

38 DBROUSER = "kamailioro"

39

40 ## password for database read only user

41 DBROPW = "kamailioro"

42

43 ## database access host (from where is kamctl used)

44 DBACCESSHOST = 192.168.0.193

45

46 ## database super user (for ORACLE this is 'scheme-creator' user)

47 DBROOTUSER = "root"

48

49 # user name column

50 USERCOL = "username"

51

52

53 # SQL definitions

54 # If you change this definitions here, then you must change them

55 # in db/schema/entities. xml too.

56 # FIXME

57

58 # FOREVER = "2030-05-28 21:32:15"

59 # DEFAULT_Q = "1.0"

60

61

62 # Program to calculate a message-digest fingerprint

63 # MD5 = "md5sum"

64

65 # awk tool

66 # AWK = "awk"

67

68 # gdb tool

69 # GDB = "gdb"

70

71 # If you use a system with a grep and egrep that is not 100% gnu grep compatible,

72 # e.g. solaris, install the gnu grep (ggrep) and specify this below.

73 #

74 # grep tool

75 # GREP = "grep"

76

77 # egrep tool

78 # EGREP = "egrep"

79

80 # sed tool

81 # SED = "sed"

82

83 # tail tool

84 # LAST_LINE = "tail-n 1"

85

86 # expr tool

87 # EXPR = "expr"

88

89

90 # Describe what additional tables to install. Valid values for the variables

91 # below are yes/no/ask. With ask (default) it will interactively ask the user

92 # for an answer, while yes/no allow for automation, uninitialized ed instils.

93 #

94

95 # If to install tables for the modules in the EXTRA_MODULES variable.

96 # INSTALL_EXTRA_TABLES = ask

97

98 # If to install presence related tables.

99 # INSTALL_PRESENCE_TABLES = ask

100

101 # If to install uid modules related tables.

102 # INSTALL_DBUID_TABLES = ask

103

104 # Define what module tables shoshould be installed.

105 # If you use the same s database and want to change the installed tables, then you

106 # must also adjust the STANDARD_TABLES or EXTRA_TABLES variable accordingly in

107 # kamdbctl. base script.

108

109 # Kamailio standard modules

110 # STANDARD_MODULES = "standard acc lcr domain group permissions registrar usrloc msilo

111 # alias_db uri_db speeddial avpops auth_db pdt dialog dispatcher

112 # dialplan"

113

114 # Kamailio extra modules

115 # EXTRA_MODULES = "imc cpl siptrace domainpolicy carrierroute userblacklist htable purple sca"

116

117

118 # type of aliases used: DB-database aliases; UL-usrloc aliases

119 ##-default: none

120 # ALIASES_TYPE = "DB"

121

122 # control engine: FIFO or UNIXSOCK

123 ##-default FIFO

124 # CTLENGINE = "FIFO"

125

126 ## path to FIFO file

127 # export opath = "/var/run/kamailio/kamailio_fifo"

128

129 # check ACL names; default on (1); off (0)

130 # VERIFY_ACL = 1

131

132 # ACL names-if VERIFY_ACL is set, only the ACL names from below list

133 ## are accepted

134 # ACL_GROUPS = "local ld int voicemail free-pstn"

135

136 # verbose-debug purposes-default '0'

137 VERBOSE = 1

138

139 # do (1) or don't (0) store plaintext passwords

140 # in the subscriber table-default '1'

141 # STORE_PLAINTEXT_PW = 0

142

143 ## Kamailio START Options

144 ## PID file path-default is:/var/run/kamailio. pid

145 PID_FILE =/var/run/kamailio. pid

146

147 ## Extra start options-default is: not set

148 # example: start Kamailio with 64 MB share memory: STARTOPTIONS = "-m 64"

149 # STARTOPTIONS =

----------------------------------------------------------------------------------

Then

# Vi/usr/local/etc/kamailio. cfg

Before "####### Defined Values #########", add the following lines:

...

#! Define WITH_MYSQL
#! Define WITH_AUTH

#! Define WITH_USRLOCDB

...

Save and exit!

4. Create a database and add an account

Run the following command to create a supported database:

#/Usr/local/sbin/kamdbctl create

Start the kamailio Service

#/Usr/local/sbin/kamctl start

Enable the kamailio monitoring mode (skipped ..)

#/Usr/local/sbin/kamctl moni

Add User account and password (Register)

# Kamctl add 10001 10001

# Kamctl add 10002 10002

Two accounts are added. The first digit is the account, and the last digit is the password.

The server configuration is basically complete ..

Next, find some Android-based sip client software on the internet, install the configuration, and test the software.

I am using the CSipSimple app.

Test the APP Link on the mobile client (because the attachment cannot be uploaded more than 2 MB, I am posting the online drive link)

Http://yunpan.cn/cHgIvYYPnJ6gx access password e096

Or find the same or similar online.

Possible problems:

-------------------------------------------------

If the registration fails during the test, check whether the mobile phone and PC are in the same LAN.

Does the linux kamailio server Add the account to be registered?

Command:

# Kamctl add account password

After successfully adding an account

Check whether the linux firewall is disabled and whether the mobile phone security settings are correct...

--------------------------------------------------

Attachment and:

---------------------------

The installation environment is centos6.5.

The first thing to do is:

Configure various environments ..

Search for details on the Internet.

1. Download the source code:

Switch the directory to the user's main directory

Cd ~

Open the official website download link in the IE browser search window to view the latest version:

Http://www.kamailio.org/pub/kamailio/latest/src/

Then

Wgethttp: // www.kamailio.org/pub/kamailio/latest/src/ (the obtained Version)

:

Latest: http://www.kamailio.org/pub/kamailio/latest/src/kamailio-4.3.2_src.tar.gz

Decompress the package to the current directory:

# Tar zxvf kamailio-4.3.2_src.tar.gz

# Cdkamailio-4.3.2

# Make FLAVOUR = kamailio cfg

# Vim modules. lst Open modules. lst, find the "exclude_modules" variable, and delete the db_mysql field.

2 compile

# Make all

# Make install

The kamailio executable file is installed in the/usr/local/sbin path by default, and the configuration file is installed in/usr/local/etc/kamailio.

3 Configuration

Configure Environment Variables

The environment variables of Kamailio are stored in the/usr/local/etc/kamailio/kamctlrc file.

# Vi/usr/local/etc/kamailio/kamctlrc

The configuration in this file may be a little long. I marked the options to be modified in red for your reference.

Bytes ------------------------------------------------------------------------------------

1 # $ Id $

2 #

3 # The Kamailio configuration file for the control tools.

4 #

5 # Here you can set variables used in the kamctl and kamdbctl setup

6 # scripts. Per default all variables here are commented out, the control tools

7 # will use their internal default values.

8

9 ## your SIP domain

10 SIP_DOMAIN = 192.168.0.193 (this is a domain name, if you do a test in the LAN, you can use the Linux local IP address, my IP address is this)

11

12 ## chrooted directory

13 # $ CHROOT_DIR = "/path/to/chrooted/directory"

14

15 ## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE

16 # by default none is loaded

17 #

18 # If you want to setup a database with kamdbctl, you must at least specify

19 # this parameter.

20 DBENGINE = MYSQL (cancel the "#" comment, the same below is not explained)

21

22 # database host

23 DBHOST = localhost

24

25 ## database name (for ORACLE this is TNS name)

26 DBNAME = kamailio

27

28 # database path used by dbtext, db_berkeley or sqlite

29 # DB_PATH = "/usr/local/etc/kamailio/dbtext"

30

31 ## database read/write user

32 DBRWUSER = "kamailio"

33

34 ## password for database read/write user

35 DBRWPW = "kamailiorw"

36

37 # database read only user

38 DBROUSER = "kamailioro"

39

40 ## password for database read only user

41 DBROPW = "kamailioro"

42

43 ## database access host (from where is kamctl used)

44 DBACCESSHOST = 192.168.0.193

45

46 ## database super user (for ORACLE this is 'scheme-creator' user)

47 DBROOTUSER = "root"

48

49 # user name column

50 USERCOL = "username"

51

52

53 # SQL definitions

54 # If you change this definitions here, then you must change them

55 # in db/schema/entities. xml too.

56 # FIXME

57

58 # FOREVER = "2030-05-28 21:32:15"

59 # DEFAULT_Q = "1.0"

60

61

62 # Program to calculate a message-digest fingerprint

63 # MD5 = "md5sum"

64

65 # awk tool

66 # AWK = "awk"

67

68 # gdb tool

69 # GDB = "gdb"

70

71 # If you use a system with a grep and egrep that is not 100% gnu grep compatible,

72 # e.g. solaris, install the gnu grep (ggrep) and specify this below.

73 #

74 # grep tool

75 # GREP = "grep"

76

77 # egrep tool

78 # EGREP = "egrep"

79

80 # sed tool

81 # SED = "sed"

82

83 # tail tool

84 # LAST_LINE = "tail-n 1"

85

86 # expr tool

87 # EXPR = "expr"

88

89

90 # Describe what additional tables to install. Valid values for the variables

91 # below are yes/no/ask. With ask (default) it will interactively ask the user

92 # for an answer, while yes/no allow for automation, uninitialized ed instils.

93 #

94

95 # If to install tables for the modules in the EXTRA_MODULES variable.

96 # INSTALL_EXTRA_TABLES = ask

97

98 # If to install presence related tables.

99 # INSTALL_PRESENCE_TABLES = ask

100

101 # If to install uid modules related tables.

102 # INSTALL_DBUID_TABLES = ask

103

104 # Define what module tables shoshould be installed.

105 # If you use the same s database and want to change the installed tables, then you

106 # must also adjust the STANDARD_TABLES or EXTRA_TABLES variable accordingly in

107 # kamdbctl. base script.

108

109 # Kamailio standard modules

110 # STANDARD_MODULES = "standard acc lcr domain group permissions registrar usrloc msilo

111 # alias_db uri_db speeddial avpops auth_db pdt dialog dispatcher

112 # dialplan"

113

114 # Kamailio extra modules

115 # EXTRA_MODULES = "imc cpl siptrace domainpolicy carrierroute userblacklist htable purple sca"

116

117

118 # type of aliases used: DB-database aliases; UL-usrloc aliases

119 ##-default: none

120 # ALIASES_TYPE = "DB"

121

122 # control engine: FIFO or UNIXSOCK

123 ##-default FIFO

124 # CTLENGINE = "FIFO"

125

126 ## path to FIFO file

127 # export opath = "/var/run/kamailio/kamailio_fifo"

128

129 # check ACL names; default on (1); off (0)

130 # VERIFY_ACL = 1

131

132 # ACL names-if VERIFY_ACL is set, only the ACL names from below list

133 ## are accepted

134 # ACL_GROUPS = "local ld int voicemail free-pstn"

135

136 # verbose-debug purposes-default '0'

137 VERBOSE = 1

138

139 # do (1) or don't (0) store plaintext passwords

140 # in the subscriber table-default '1'

141 # STORE_PLAINTEXT_PW = 0

142

143 ## Kamailio START Options

144 ## PID file path-default is:/var/run/kamailio. pid

145 PID_FILE =/var/run/kamailio. pid

146

147 ## Extra start options-default is: not set

148 # example: start Kamailio with 64 MB share memory: STARTOPTIONS = "-m 64"

149 # STARTOPTIONS =

----------------------------------------------------------------------------------

Then

# Vi/usr/local/etc/kamailio. cfg

Before "####### Defined Values #########", add the following lines:

...

#! Define WITH_MYSQL
#! Define WITH_AUTH

#! Define WITH_USRLOCDB

...

Save and exit!

4. Create a database and add an account

Run the following command to create a supported database:

#/Usr/local/sbin/kamdbctl create

Start the kamailio Service

#/Usr/local/sbin/kamctl start

Enable the kamailio monitoring mode (skipped ..)

#/Usr/local/sbin/kamctl moni

Add User account and password (Register)

# Kamctl add 10001 10001

# Kamctl add 10002 10002

Two accounts are added. The first digit is the account, and the last digit is the password.

The server configuration is basically complete ..

Next, find some Android-based sip client software on the internet, install the configuration, and test the software.

I am using the CSipSimple app.

Test the APP Link on the mobile client (because the attachment cannot be uploaded more than 2 MB, I am posting the online drive link)

Http://yunpan.cn/cHgIvYYPnJ6gx access password e096

Or find the same or similar online.

Possible problems:

-------------------------------------------------

If the registration fails during the test, check whether the mobile phone and PC are in the same LAN.

Does the linux kamailio server Add the account to be registered?

Command:

# Kamctl add account password

After successfully adding an account

Check whether the linux firewall is disabled and whether the mobile phone security settings are correct...

--------------------------------------------------

Attachment and:

---------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.