INSTALL 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. ==================================================
  2. Kamailio SIP Server Installation Notes
  3. http://www.kamailio.org
  4. ==================================================
  5. Welcome! This is an amazingly flexible, robust and secure SIP server
  6. built on years of experience in several Open Source projects. It's a merge
  7. of the SIP Express Router (SER) and the Kamailio (OpenSER) products produced
  8. by a joint development team. When not explicitely mentioned, SIP server refers
  9. to any of these two applications.
  10. This memo gives you hints on how to set up the SIP server quickly.
  11. You can find a similar tutorial and many more on project's web site:
  12. - http://www.kamailio.org/w/documentation/
  13. - http://www.kamailio.org/wiki/
  14. Table of Contents
  15. =================
  16. 1. SIP Server Flavours
  17. 2. Supported Architectures And Requirements
  18. 3. How-To Build SIP Server From The Source Code Distribution
  19. 3.1 Kamailio Fast Track Installation
  20. 3.2 Details Installing From Source Code
  21. A) Set SIP Server Flavour
  22. B) Build Commands
  23. 4. Quick-Start Installation Guide
  24. A) Getting Help
  25. B) Disclaimers
  26. C) Quick Atart
  27. D) SIP Server With Persistent Data Storage
  28. 5. Troubleshooting
  29. 1. SIP Server Flavours
  30. ----------------------
  31. The two major SIP server flavours are:
  32. - SIP Express Router (aka SER, the initial project name, started in 2001)
  33. - Kamailio (former OpenSER)
  34. Starting with version 3.0.0, the two SIP server flavours are built from
  35. same source code tree. In version 4.0.0 the two source code trees were
  36. merged even more, so a combined module directory is now used.
  37. Kamailio flavor is the one built by default. SER is, historically speaking, the
  38. first open source SIP server started in 2001. Kamailio forked from SER in
  39. 2005 under the initial name OpenSER.
  40. Starting with version 3.1.0 the differences between the two flavours are
  41. very few, Kamailio enabling next compile time flags:
  42. - internal statistics
  43. - application server extensions in tm module
  44. In version 4.0.0 the modules were merged into one set and the merger
  45. between the two products was completed.
  46. Kamailio is now the default flavour. Switching between flavours is a matter
  47. of 'make' command parameters.
  48. Several installation tutorials for Kamailio are available on the web wiki:
  49. - http://www.kamailio.org/wiki/
  50. 2. Supported Architectures And Requirements
  51. -------------------------------------------
  52. Supported operating systems:
  53. - Linux (Debian, Ubuntu, Fedora, RedHat, CentOS, OpenSUSE, Gentoo, a.s.o.)
  54. - FreeBSD, NetBSD, OpenBSD, Dragonfly BSD
  55. - Solaris
  56. - OS/X, Darwin
  57. Partially supported
  58. - Windows+Cygwin (core + static modules only, no IPv6, no
  59. TCP, no dynamic modules)
  60. Supported architectures
  61. - i386, x86_64 (amd64), armv4l, sparc64, powerpc, powerpc64
  62. Experimental architectures:
  63. - mips1, mips2, sparc32, alpha
  64. (for other architectures the Makefiles might need to be edited)
  65. There are various configuration options defined in the Makefile.
  66. Requirements:
  67. - gcc or icc : gcc >= 2.9x; 3.[12] recommended (it will work with older version
  68. but it might require some options tweaking for best performance)
  69. - bison or yacc (Berkley Yacc)
  70. - flex
  71. - GNU make (on Linux this is the standard "make", on *BSD and Solaris it is
  72. called "gmake") version >= 3.80 (recommended 3.81).
  73. - sed and tr (used in the makefiles)
  74. - GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
  75. - GNU install, BSD install or Solaris install if you want "make
  76. install", "make bin", "make sunpkg" to work
  77. - libmysqlclient & libz (zlib) if you want MySQL support (the db_mysql module)
  78. - libxml2 if you want to compile the cpl-c (CPL support) or pa (presence)
  79. modules
  80. - libradiusclient-ng (> 5.0) if you need RADIUS support (the auth_radius,
  81. group_radius, uri_radius and avp_radius modules)
  82. - libpq if you need PostgreSQL support (the db_postgres module)
  83. - libexpat if you want the jabber gateway support (the jabber module) or the
  84. XMPP gateway support
  85. - libxml2 if you want to use the cpl-c (Call Processing Language) or
  86. the presence modules (presence and pua*)
  87. - libradius-ng -libs and devel headers- if you want to use functionalities
  88. with radius support - authentication, accounting, group support, etc
  89. - unixodbc - libs and devel headers - if you want UNIXODBC support as
  90. DB underlayer
  91. - libxmlrpc-c3 - libs and devel headers - if you want to have XML-RPC support
  92. for the management interface (MI)
  93. - libperl - libs and devel headers - if you want the perl connector to support
  94. perl scripting from your config file (perl module)
  95. - libsnmp9 - libs and devel headers - if you want SNMP client functionality
  96. (SNMP AgentX subagent) for Kamailio
  97. - libldap libs and devel headers v2.1 or greater - if you want LDAP support
  98. - libpcre libs and devel headers - if you want to compile the lcr and dialplan
  99. modules
  100. - libsctp devel headers - if you want to compile the SCTP transport in the core
  101. - libssl devel headers (openssl project) - if you want to compile the TLS module
  102. - libunistring - for the WebSocket module
  103. - python and devel headers for the Python module
  104. - jdk and gcj for Java module
  105. OS Notes:
  106. FreeBSD/OpenBSD/NetBSD: make sure gmake, bison or yacc & flex are installed.
  107. FreeBSD 5.4:
  108. ------------
  109. If you want to compile all the modules, you will need the following packages:
  110. - mysql-client-* (any version, install one of the mysql*-client ports) for
  111. libmysqlclient
  112. - postgresql-libpqxx-2.4.2_1 (/usr/ports/databases/postgresql-libpqxx) for
  113. libpq
  114. - expat-1.95.8 (/usr/ports/textproc/expat2) for libexpat
  115. - libxml2-2.6.18 (/usr/ports/textproc/libxml2) for libxml2
  116. - radiusclient-0.4.7 (/usr/ports/net/radiusclient) for libradiusclient-ng
  117. NOTE: you'll need to add radiusclient_ng=4 to the gmake command line if you
  118. use the 0.4.* version.
  119. Compile example (all the modules and SIP server core in a tar.gz):
  120. gmake bin radiusclient_ng=4 include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
  121. OpenBSD 3.7
  122. -----------
  123. - mysql-client-4.0.23 (/usr/ports/databases/mysql) for libmysqlclient
  124. - expat-1.95.6 (/usr/ports/textproc/expat) for libexpat
  125. - libxml-2.6.16p0 (/usr/ports/textproc/libxml) for libxml2
  126. - radiusclient-ng-0.5.1 from
  127. http://download.berlios.de/radiusclient-ng/radiusclient-ng-0.5.1.tar.gz
  128. (you need to download and install it, since there is no "official"
  129. openbsd port for it) for libradiusclient-ng
  130. Compile example (all the modules and SIP server core in a tar.gz):
  131. gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa"
  132. NetBSD 2.0
  133. ----------
  134. - mysql-client-4.1.12 (/usr/pkgsrc/databases/mysql4-client) for libmysqlclient
  135. - expat-1.95.8nb2 (/usr/pkgsrc/textproc/expat) for libexpat
  136. - libxml2-2.6.19 (/usr/pkgsrc/textproc/libxml2) for libxml2
  137. - radiusclient-ng-0.5.1 (see OpenBSD)
  138. Compile example (all the modules and SIP server in a tar.gz):
  139. gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa"
  140. Solaris 10
  141. ----------
  142. As above; you can use Solaris's yacc instead of bison. You might also
  143. need gtar and ginstall. If you don't have ginstall you can use Solaris
  144. install, just make sure it's in the PATH (it's usually in /usr/sbin) and
  145. add INSTALL=install either to the environment or to the make command line
  146. (e.g.: gmake INSTALL=install all).
  147. Needed packages:
  148. [TODO]
  149. Compile example (all the modules and SIP server in a tar.gz):
  150. gmake bin INSTALL=install include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
  151. Linux
  152. -----
  153. Needed packages for compiling all the modules:
  154. * Debian:
  155. - libmysqlclient-dev for libmysqlclient
  156. - libpq-dev for libpq
  157. - libexpat1-dev for libexpat
  158. - libxml2-dev for libxml2
  159. - libradiusclient-ng-dev for libradiusclient
  160. - other libraries are needed for some other modules,
  161. see README of the module you want to use
  162. Both SER and Kamailio flavours have APT deb repositories that allow you to
  163. install the binaries easily - see the web sites for more details:
  164. - http://kamailio.org
  165. Cygwin (alpha state, partial support)
  166. --------------------------------------
  167. make sure make, bison, flex, minires and minires-devel (needed for the
  168. resolver functions) are installed.
  169. Only building SIP server's core and some static modules is supported for now.
  170. Stuff known not to work:
  171. - IPv6 (cygwin doesn't support it yet)
  172. - TCP (the tcp code heavily depends on file descriptor passing
  173. between processes, which is not yet supported by cygwin)
  174. - dynamic modules (non statically linked -- not supported because
  175. backlinking doesn't work in windows by design)
  176. Compile example (all the modules and SIP server in a tar.gz):
  177. make bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
  178. 3. Howto Build SIP Server From Source Code Distribution
  179. -------------------------------------------------------
  180. (NOTE: if make doesn't work try gmake instead)
  181. 3.1 Kamailio Fast Track Installation
  182. ....................................
  183. If you are familiar with Unix/Linux build tools aready and you installed
  184. the required dependencies, then you can just follow this section, otherwise
  185. skip over it.
  186. To get the SIP server installed, in the folder with source code run:
  187. make cfg
  188. make all
  189. make install
  190. If you want to install with additional modules, for example with mysql and
  191. tls, run:
  192. make include_modules="db_mysql tls" cfg
  193. make all
  194. make install
  195. 3.2 Details Installing From Source Code
  196. .......................................
  197. A) Set SIP Server Flavour
  198. If you don't have a clean source tree, first do:
  199. make proper
  200. To build Kamailio flavour, you don't need to do anything special, continue to
  201. read the section 3.B).
  202. To build SER flavour, you have to run first:
  203. make FLAVOUR=ser cfg
  204. The parameter 'FLAVOUR=ser' must be given all the time when make target
  205. is 'cfg'.
  206. B) Build Commands
  207. The SIP server is split in four main parts: The core, the modules, the
  208. utilties, and scripts/examples. When you build, you can decide to build
  209. only the core, the modules, both, or all.
  210. * Compile SIP server core only:
  211. make
  212. Compile modules except some explicitly excepted (see below)
  213. make modules - all modules in the modules/ directory
  214. make modules-all or make every-module - all the modules
  215. * Compile all:
  216. make all
  217. * Explicitly excepted modules:
  218. By default make all will not build modules that require external libraries or
  219. that are considered to be "experimental". For example, modules that have external
  220. dependencies are: db_mysql, jabber, cpl-c, auth_radius, group_radius, uri_radius,
  221. avp_radius, db_postgres, db_berkely, carrierroute, ...
  222. Including groups of modules:
  223. Instead of compiling the default modules only, you can specify groups of
  224. modules to include, according to their status:
  225. - standard - Modules in this group are considered a standard part of SIP server
  226. (due to widespread usage) but they have no dependencies (note that some of
  227. these interplay with external systems. However, they don't have compile
  228. or link dependencies).
  229. - db - Modules in this group use databases and need a database driver to run.
  230. Included are drivers for the text mode db (dbtext) and for dumping
  231. large ammount of data to files (db_flatstore). See also the mysql or
  232. postgres groups.
  233. - standard_dep - Modules in this group are considered a standard part of SIP
  234. server (due to widespread usage) but they have dependencies that must be satisfied
  235. for compilation.
  236. NOTE! All presence modules (dialog, pa, presence_b2b, rls, xcap) have been
  237. included in this group due to interdependencies
  238. - stable - Modules in this group satisfy specific or niche applications,
  239. and are considered stable for production use. They may or may not have dependencies
  240. - experimental - Modules in this group are either not complete, untested, or
  241. without enough reports of usage to allow the module into the stable group.
  242. They may or may not have dependencies.
  243. There is another set of groups mainly used by Kamailio flavour, where modules
  244. are grouped based on Debian packaging rules. For example:
  245. - kstandard - Kamailio flavour's standard modules
  246. - kpresence - Kamailio flavour's SIMPLE presence server modules
  247. * To compile core with standard modules:
  248. make group_include="standard" all
  249. * To compile all modules (provided you have all the required libraries installed) use:
  250. make group_include="standard standard-dep stable experimental" all
  251. There are also in addition some "convenience" groups:
  252. mysql - Include all the db modules dependent and the MySQL db driver
  253. postgres - Include all the db modules and the PostgreSQL db driver
  254. radius - Include all modules on radiusclient
  255. presence - Include all the presence modules
  256. Ex. to make a standard installation with MySQL, use:
  257. make group_include="standard mysql" all
  258. In addition to group_include (or instead), you can use
  259. include_modules="modA modB"
  260. to specify exactly the modules you want to include, ex.
  261. make include_modules="mymodule" modules
  262. You can also explicitly skip modules using skip_modules. Let's say you want all
  263. the standard and standard-dep modules except domain:
  264. make group_include="standard standard-dep" skip_modules="domain" all
  265. NOTE!!! As this mechanism is very powerful, you may be uncertain which
  266. modules that will be included. Just replace all (or modules) with print-modules
  267. and you will see which modules will be included and excluded, ex:
  268. make print-modules
  269. will show which modules are excluded by default.
  270. If you want to install or to build a binary package (a tar.gz with
  271. SIP server core and the modules), substitute "all" in the above command with
  272. "install" or "bin".
  273. * More compile examples:
  274. - compile with profiling
  275. make PROFILE=-pg all
  276. - compile debug mode version
  277. make mode=debug all
  278. - compile debug version with profiling
  279. make mode=debug PROFILE=-pg all
  280. - compile only the print module
  281. make modules=modules/print modules
  282. - compile by default only the print module, in debuging mode and with
  283. profiling:
  284. make cfg modules=modules/print mode=debug PROFILE=-pg
  285. make all
  286. - change & save the modules list without rebuilding the whole config
  287. (so that already compiled modules won't be re-compiled by
  288. make all/make modules):
  289. make modules-cfg include_modules="mysql postgress"
  290. - change only the compile/build options, without changing the modules list:
  291. make cfg-defs CPU=ultrasparc PROFILE=-pg
  292. - compile by default all the usual modules + mysql and postgres, optimized
  293. for pentium-m and for space (saves both the build options and the module
  294. list)
  295. make cfg include_modules="mysql postgres" CPU=pentium-m CC_EXTRA_OPTS=-Os
  296. make all
  297. - compile all the "default" modules except textops and vm
  298. make skip_modules="textops vm" modules
  299. - save the above option in the make config, so that all make commands
  300. will use it by default:
  301. make cfg skip_modules="textops vm"
  302. - compile all default modules and include uri_radius (not compiled by default):
  303. make include_modules="uri_radius" modules
  304. - compile all the modules from the modules subdirectory (even the one excluded
  305. by default):
  306. make exclude_modules="" modules
  307. - compile all the modules from the modules subdirectory excluding vm:
  308. make exclude_modules=vm modules
  309. or
  310. make exclude_modules="" skip_modules=vm modules
  311. - compile with the "tm" module statically linked and with profiling
  312. make static_modules=tm PROFILE=-pg all
  313. - compile with gcc-3.2 instead of gcc
  314. make CC=gcc-3.2 all
  315. or
  316. CC=gcc-3.2 make all
  317. Make targets:
  318. =============
  319. Make Local Build Config:
  320. ------------------------
  321. * make cfg or make config - force config and module list regeneration
  322. Example:
  323. make cfg include_modules=mysql mode=debug
  324. All future make invocations will include the mysql module and will build in debug mode
  325. Note: If config.mak doesn't exist (e.g. initial checkout or after a make
  326. proper) or if Makefile.defs was changed, the config will be re-generated
  327. automatically by the first make command. For example:
  328. make cfg include_modules=db_mysql; make all
  329. is equivalent to
  330. rm config.mak modules.lst; make include_modules=db_mysql.
  331. * make cfg-defs (force config regeneration, but don't touch the module list)
  332. Example:
  333. make cfg-defs CPU=ultrasparc CC_EXTRA_OPTS=-Os PROFILE=-pg
  334. make modules-cfg
  335. or
  336. make modules-list
  337. saves the module list, without regenerating the build config
  338. Example:
  339. make modules-list include_modules="tls" skip_modules="print"
  340. Clean:
  341. ------
  342. * make clean - clean the base and modules too
  343. * make proper - clean also the dependencies and the config, but not the module list
  344. * make distclean - the same as proper
  345. * make maintainer-clean - clean everything, including make's config, saved
  346. module list, auto generated files, tags, *.dbg a.s.o
  347. * make clean-all - clean all the modules in modules/*
  348. * make proper-all - like make proper but for all the modules in modules/*
  349. Config clean:
  350. * make clean-cfg (cleans the compile config)
  351. * make clean-modules-cfg (cleans the modules list)
  352. Reduced" clean:
  353. * make local-clean - cleans only the core, no libs, utils or modules
  354. * make clean-modules - like make clean, but cleans only the modules
  355. * make clean-libs - like make clean, but cleans only the libs
  356. * make clean-utils - like make clean, but cleans only the utils
  357. * make proper-modules - like make proper, but only for modules
  358. * make proper-libs - like make proper, but only for libs
  359. * make proper-utils - like make proper, but only for utils
  360. Compile:
  361. --------
  362. * make proper
  363. optional: make cfg <various cfg. options that should be saved>
  364. * make
  365. or gmake on non-Linux systems
  366. * make modules
  367. or make modules exclude_modules="CVS print" etc.
  368. Other Make Targets:
  369. -------------------
  370. Make tags:
  371. make TAGS
  372. Create a tar.gz with the sources (in ../):
  373. make tar
  374. Create a tar.gz with the binary distribution (in ../):
  375. make bin
  376. Create a gzipped solaris package (in ../):
  377. make sunpkg
  378. Create debian packages (in ../):
  379. make deb
  380. or
  381. dpkg-buildpackage
  382. Documentation:
  383. --------------
  384. Regenerate the README for all the "default" modules (include_modules,
  385. skip_modules a.s.o can be used to alter the module list).
  386. make README
  387. Generates a manpage for all the modules that support it (.xml file in the
  388. module directory).
  389. make man
  390. Generates README file for modules/foo.
  391. make modules=modules/foo modules-readme
  392. Install:
  393. --------
  394. make prefix=/usr/local install
  395. Note: If you use prefix parameter in make install then you also need
  396. to use this parameter in previous make commands, i.e. make, make modules,
  397. or make all. If you fail to do this then SIP server will look for the default
  398. configuration file in a wrong directory, because the directory of the
  399. default configuration file is hardcoded into SIP server during compile time.
  400. When you use a different prefix parameter when installing then the
  401. directory hard coded in SIP server and the directory in which the file will be
  402. installed by make install will not match. (You can specify exact location
  403. of the configuration file using -f parameter of SIP server).
  404. For example, if you do the following:
  405. make all
  406. make prefix=/ install
  407. Then the installation will put the default configuration file into
  408. /etc/ser/ser.cfg or /etc/kamailio/kamailio.cfg (because prefix is /),
  409. but SIP server will look for the file in /usr/local/etc/ser/ser.cfg or
  410. /usr/local/etc/kamailio/kamailio.cfg (because there was no prefix parameter
  411. make all and /usr/local is the default value of prefix).
  412. The workaround is trivial, use the same parameters in all make commands:
  413. make prefix=/ all
  414. make prefix=/ install
  415. or save the desired prefix in the make config (e.g.: make cfg prefix=/).
  416. That applies to other make parameters as well (for example parameters
  417. "modules" or "excluded_modules").
  418. 4. Quick-Start Installation Guide
  419. ---------------------------------
  420. A) Getting Help
  421. This guide gives you instructions on how to set up the SIP server
  422. (SER or Kamailio) on your box quickly. In case the default configuration
  423. does not fly, please check the documentation at the SIP server web site
  424. http://www.kamailio.org to learn how to configure SIP server for your site.
  425. If the documentation does not resolve your problem you may try contacting
  426. our user forum by E-mail at [email protected] -- that is the
  427. mailing list of the SIP server community. To participate in the mailing list,
  428. please subscribe at the following web address:
  429. http://lists.sip-router.org/cgi-bin/mailman/listinfo
  430. B) Disclaimers
  431. Note well the default "quick-start" configuration is very simple in order
  432. to be easily installable. It provides minimum features. Particularly,
  433. authentication is by default disabled, which means anyone can register using
  434. any name with the server. (This is on purpose to avoid installation
  435. dependencies on a database, which is needed for storing user credentials.)
  436. C) Quick Start
  437. The following step-by step guide gives you instructions how to install the
  438. SQL-free distribution of SIP server. If you need persistence and
  439. authentication, then you have to install additional database support --
  440. proceed to section D) after you are finished with C).
  441. 1) Download an RPM or Debian package from the links on the wiki
  442. http://www.kamailio.org/wiki/
  443. If you don't use an rpm or debian based distribution, try our tar.gz'ed
  444. binaries
  445. http://www.kamailio.org/pub/kamailio/latest/src/
  446. If you use Solaris 8 you can try our solaris package.
  447. If you use Gentoo Linux you do not have to download a package.
  448. 2) Install the package
  449. RPM:
  450. rpm -i <package_name>
  451. debian:
  452. dpkg -i <package_name>
  453. gentoo:
  454. emerge ser
  455. or
  456. emerge kamailio
  457. (or if use only stable packets: ACCEPT_KEYWORDS="~x86" emerge ser
  458. or ACCEPT_KEYWORDS="~x86" emerge kamailio)
  459. tar.gz:
  460. cd /; tar zxvf <package_name>_os_arch.tar.gz
  461. (it will install in /usr/local/, and the configuration file in
  462. /usr/local/etc/ser/ser.cfg or /usr/local/etc/kamailio/kamailio.cfg)
  463. Solaris:
  464. gunzip <package_name>.gz ; pkgadd -d <package_name>
  465. *BSD:
  466. pkg_add package_name
  467. 3) Start the server
  468. RPM + gentoo:
  469. /etc/init.d/ser start
  470. or
  471. /etc/init.d/kamailio start
  472. debian:
  473. SER or Kamailio is started automatically after the install
  474. (in case something fails you can start it with '/etc/init.d/ser start'
  475. or '/etc/init.d/kamailio start')
  476. tar.gz:
  477. Solaris:
  478. the tar.gz does not include an init.d script, you'll have to create one of
  479. your own or adapt one from the source distribution (pkg/debian/init.d,
  480. pkg/rpm/ser.init.*, pkg/gentoo/ser.init, pkg/kamailio/rpm/kamailio.init,
  481. pkg/kamailio/deb/debian/kamailio.init, a.s.o.)
  482. You can start SIP server directly with /usr/local/sbin/ser or
  483. /usr/local/sbin/kamailio.
  484. 4) Optionally, watch server's health using the
  485. serctl or kamctl utility
  486. - to do so, first set the environment variable SIP_DOMAIN to your domain
  487. name, e.g., in Bourne shell, call
  488. export SIP_DOMAIN="myserver.foobar.com"
  489. - if you are using other than 'localhost' mysql server for maintaining
  490. subscriber database, change the variable 'SQL_HOST' to the proper
  491. host name in the serctl script
  492. - run the serctl utility
  493. /usr/sbin/serctl moni
  494. or
  495. /usr/sbin/kamctl moni
  496. or
  497. /usr/local/sbin/serctl moni (if you installed SER flavour from a tar.gz
  498. or solaris package)
  499. or
  500. /usr/local/sbin/kamctl moni (if you installed Kamailio flavour from a
  501. tar.gz or solaris package)
  502. 5) Connect SIP phones
  503. Register with the server using your favorite SIP User Agent (phone).
  504. In most cases, you need to set the following options:
  505. Proxy server: host name of your server
  506. Domain: the sip domain your server is configured to handle
  507. User name: the account name for your device
  508. Auth user: the ID used for authentication
  509. Secret/Password: The configured authentication password
  510. D) SIP Server With Persistent Data Storage
  511. ------------------------------------------
  512. The default configuration is very simple and features many simplifications.
  513. In particular, it does not authenticate users and loses User Location database
  514. on reboot. To provide persistence, keep user credentials and remember users'
  515. locations across reboots, Kamailio can be configured to use a database, like MySQL.
  516. Before you proceed, you need to make sure MySQL is installed on your box. Your
  517. MySQL server must be configured to deal with a large number of
  518. connection. To increase it, set the following line in [mysqld] section
  519. of your my.ini configuration file:
  520. set-variable = max_connections=500
  521. 1) Download the package containing mysql support for SIP server from the links
  522. you find on:
  523. http://www.kamailio.org/wiki/
  524. (rpm and deb provided, most of the binary tar.gz distributions and the
  525. solaris package include it; if it is not present you'll have to rebuild
  526. from the source).
  527. For gentoo please include 'mysql' to your USE variable in /etc/make.conf
  528. or give it as variable to the emerge command.
  529. 2) install the package
  530. rpm -i <package_name>
  531. or
  532. dpkg -i <package_name>
  533. or
  534. emerge ser
  535. or
  536. emerge kamailio
  537. (if do not want to put 'mysql' into your USE variable you can type:
  538. USE="mysql" emerge ser)
  539. 3.1) create MySQL tables for SER flavour
  540. - if you have a previously installed SER on your system, use
  541. /usr/sbin/ser_mysql.sh reinstall
  542. to convert your SER database into new structures
  543. - otherwise, if this is your very first installation, use
  544. /usr/sbin/ser_mysql.sh create
  545. to create SER database structures
  546. (you will be prompted for password of MySql "root" user)
  547. 3.2) create MySQL tables for Kamailio flavour
  548. - if you have a previously installed Kamailio on your system, use
  549. /usr/local/sbin/kamdbctl reinstall
  550. to convert your Kamailio database into new structures
  551. - otherwise, if this is your very first installation, use
  552. /usr/local/sbin/kamdbctl create
  553. to create Kamailio database structures
  554. (you will be prompted for password of MySql "root" user)
  555. 4) configure SIP server to use SQL
  556. uncomment all lines in configuration file ser.cfg or kamilio.cfg which are
  557. related to authentication:
  558. - loadmodule "db_mysql.so"
  559. - loadmodule "auth.so"
  560. - loadmodule "auth_db.so"
  561. - modparam("usrloc", "db_mode", 2)
  562. - modparam("auth", "calculate_ha1", yes)
  563. - modparam("auth_db", "password_column", "password")
  564. - if (!www_authorize("sip-router.org", "subscriber")) {
  565. www_challenge("sip-router.org", "0");
  566. break;
  567. }
  568. 5) be sure to replace realm, the first parameter in www_* actions,
  569. with name of your server; some broken UAC implementations don't
  570. authenticate otherwise; the authentication command in your
  571. configuration script should look then like this:
  572. if (!www_authorize("myserver.foobar.com", "subscriber")) {
  573. www_challenge("myserver.foobar.com", "0");
  574. break;
  575. }
  576. 6) restart the server
  577. /etc/init.d/ser restart
  578. or
  579. /etc/init.d/kamailio restart
  580. 7) you can now start managing the server using the serctl or kamctl utility;
  581. you need to first set the environment variable SIP_DOMAIN to your
  582. local SIP realm, e.g.,
  583. export SIP_DOMAIN="myserver.foobar.com"
  584. a) watch the server status using 'serctl moni' or 'kamctl moni'
  585. b) try to login with your SIP client as user 'admin' with password 'heslo'
  586. c) try adding new users using
  587. 'serctl add <name> <password> <email>'
  588. or
  589. 'kamctl add <username> <password>'
  590. 4. Troubleshooting
  591. ------------------
  592. Q: SIP requests are replied by SIP server with "483 Too Many Hops" or
  593. "513 Message Too Large"
  594. A: In both cases, the reason is probably an error in request routing script
  595. which caused an infinite loop. You can easily verify whether this happens
  596. by watching SIP traffic on loopback interface. A typical reason for
  597. misrouting is a failure to match local domain correctly. If a server
  598. fails to recognize a request for itself, it will try to forward it to
  599. current URI in believe it would forward them to a foreign
  600. domain. Alas, it forwards the request to itself again. This continues
  601. to happen until value of max_forwards header field reaches zero or
  602. the request grows too big. Solutions is easy: make sure that domain
  603. matching is correctly configured. A quick way to achieve that is to
  604. introduce a config option to ser.cfg or kamailio.cfg: alias=domainname,
  605. where domainname shall be replaced with name of domain, which you wish to
  606. server and which appears in request-URIs.
  607. Q: Where to report issues?
  608. A: Use bug tracker at: http://sip-router.org/tracker
  609. Q: Any F.A.Q. that could be helpful to check before reporting an issue?
  610. A: See: http://www.kamailio.org/wiki/tutorials/faq/main