123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
- <section id="ser-howto" xmlns:xi="http://www.w3.org/2001/XInclude">
- <sectioninfo>
- <authorgroup>
- <author>
- <firstname>Dan</firstname>
- <surname>Austin</surname>
- </author>
- <editor>
- <firstname>Nils</firstname>
- <surname>Ohlmeier</surname>
- <address>
- <email>[email protected]</email>
- </address>
- </editor>
- </authorgroup>
- <copyright>
- <year>2002-2003</year>
- <holder>NSI Ltd.</holder>
- </copyright>
- <revhistory>
- <revision>
- <revnumber>$Revision$</revnumber>
- <date>$Date$</date>
- </revision>
- </revhistory>
- </sectioninfo>
- <title>SER Howto</title>
- <section id="introduction">
- <title>Introduction</title>
- <section>
- <title>Why SER</title>
- <para>
- SER is an open-source project that aims to make available a
- fully functional and scalable Session Initiated Protocol
- server. Call processing is described with a concise scripting
- language that offers the flexibility of regular expressions and
- the ability to interface with 3rd party applications for the
- purposes of call accounting and authorization.
- </para>
- </section>
- <section>
- <title>Where to get SER</title>
- <para>
- SER is available for download from <ulink
- url="ftp://ftp.berlios.de/pub/ser"></ulink>
- </para>
- <para>
- The newest release may be found in the folder /latest
- </para>
- </section>
- </section>
- <section id="installation">
- <title>Installation</title>
- <section id="installation_notes">
- <title>Installation Notes</title>
- <para>
- Supported architectures:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Linux/i386
- </para>
- </listitem>
- <listitem>
- <para>
- Linux/armv4l
- </para>
- </listitem>
- <listitem>
- <para>
- FreeBSD/i386
- </para>
- </listitem>
- <listitem>
- <para>
- OpenBSD/i386
- </para>
- </listitem>
- <listitem>
- <para>
- Solaris/sparc64
- </para>
- </listitem>
- <listitem>
- <para>
- NetBSD/sparc64
- </para>
- </listitem>
- </itemizedlist>
- <para>
- (For other architectures the Makefiles might need to be edited) There are various
- configuration options defined in the Makefile and Makefile.defs.
- </para>
- </section>
- <section id="requirements">
- <title>Requirements</title>
- <itemizedlist>
- <listitem>
- <para>
- gcc or icc : gcc >= 2.9x; >=3.1 recommended (it
- will work with older version but it might require some
- options tweaking for best performance)
- </para>
- </listitem>
- <listitem>
- <para>
- bison or yacc (Berkley yacc)
- </para>
- </listitem>
- <listitem>
- <para>
- flex
- </para>
- </listitem>
- <listitem>
- <para>
- <acronym>GNU</acronym> make (on Linux this is the standard
- "make", on FreeBSD and Solaris is called "gmake")
- </para>
- </listitem>
- <listitem>
- <para>
- sed and tr (used in the make files)
- </para>
- </listitem>
- <listitem>
- <para>
- <acronym>GNU</acronym> tar ("gtar" on Solaris) and gzip if you
- want "make tar" to work.
- </para>
- </listitem>
- <listitem>
- <para>
- <acronym>GNU</acronym> install or BSD install (on Solaris
- "ginstall") if you want "make install",
- "make bin", "make sunpkg" to work.
- </para>
- </listitem>
- <listitem>
- <para>
- mysql if you need MySQL support.
- </para>
- </listitem>
- <listitem>
- <para>
- Apache (httpd) if you want serweb support
- </para>
- </listitem>
- <listitem>
- <para>
- PHP, MySQL-PHP for serweb support
- </para>
- </listitem>
- <listitem>
- <para>
- libmysqlclient and libz (zlib) if you want mysql support (the mysql module)
- </para>
- </listitem>
- <listitem>
- <para>
- libexpat if you want the jabber gateway support (the jabber module)
- </para>
- </listitem>
- </itemizedlist>
- <para>
- Installing SER on a RedHat Linux distribution for example, is a
- simple matter of unzipping the downloaded file and using your
- favorite package manager.
- </para>
- </section>
- <section id="install_package">
- <title>Install the package</title>
- <para>
- Example:
- </para>
- <screen>
- /root>rpm -i ser-08.11-1.i386.rpm
- </screen>
- <para>
- Packages for other popular distributions are available, and can be installed using
- the appropriate package manager for that distribution.
- </para>
- <para>
- On many platforms you can start the service with:
- </para>
- <screen>
- /etc/init.d/ser start
- </screen>
- <para>
- RedHat systems will use:
- </para>
- <screen>
- /etc/rc.d/init.d/ser start
- </screen>
- <para>
- You now have a functioning SIP server, but what can you do with it? At this point
- not very much. With an SIP client, such as Microsoft MSN Messenger 4.6, you can
- register with the server, send Instant Messages to other logged on clients of the
- same server, and even have voice conversations with them.
- </para>
- <para>
- That sounds pretty good, but maybe you'd like to add a little more security, or make
- you server accessible to others.
- </para>
- </section>
- <section id="serctl_utility">
- <title>Serctl Utility</title>
- <para>
- To do so, first set the environment variable SIP_DOMAIN to your domain name, e.g.,
- in Bourne shell (bash), call:
- </para>
- <screen>
- export SIP_DOMAIN="foo.bar"
- </screen>
- <para>
- If you wont the system to created this variable automatically, you need to add the
- line
- </para>
- <screen>
- export SIP_DOMAIN="foo.bar"
- </screen>
- <para>
- in the end of file /etc/profile.
- </para>
- <para>
- If you are using other than 'localhost' mysql server for maintaining subscriber
- database, change the variable 'SQL_HOST' to the proper host name in the serctl
- script.
- </para>
- <para>
- Run the serctl utility
- </para>
- <screen>
- /usr/sbin/serctl monitor
- </screen>
- <para>
- If you installed from a tar.gz or Solaris package:
- </para>
- <screen>
- /usr/local/sbin/serctl monitor
- </screen>
- </section>
- <section id="dns_srv">
- <title>DNS SVR Resource Records</title>
- <para>
- It is important that your SIP clients can connect to your
- server for purposes of registration and call control. You
- might even want to have a redundant server to handle calls if
- your primary server is unavailable.
- </para>
- <para>
- These requirements can be meet by using <acronym>DNS</acronym>
- <acronym>SVR</acronym> Resource Records, available in BIND 8.X and up releases.
- </para>
- <para>
- The format for a <acronym>SVR RR</acronym> is this:
- </para>
- <screen>
- _service._protocol SVR Priority Weight Port hostname
- </screen>
- <para>
- In this case we want to establish an entry for our primary SIP server,
- gateway.mydomain.com, that will listen on UDP port 5060. The entry will look like
- this:
- </para>
- <screen>
- _sip._udp SRV 0 0 5060 gateway.mydomain.com
- </screen>
- <para>
- Placement of the new resource record is important. Here is a sample zone file:
- </para>
- <para>
- <screen>
- ; zone 'mydomain.com' last serial 1998071308
- $ORIGIN com.
- mydomain 86400 IN SOA gateway.mydomain.com. postmaster.mydomain.com. (
- 1998111908 ; Serial
- 36000 ; Refresh
- 900 ; Retry
- 36000 ; Expire
- 28800 ); Minimum
- IN NS gateway.mydomain.com.
- IN NS ns3.backupdomain.com.
- IN MX 1 gateway.mydomain.com.
- IN A 192.168.0.1
- ;If we place the SRV record above the next line it fails to load
- $ORIGIN fitawi.com.
- _sip._udp SRV 0 0 5060 gateway.mydomain.com.
- gateway IN A 192.168.0.1
- www IN CNAME gateway.mydomain.com.
- </screen>
- </para>
- <para>
- After reloading your zone file you can verify that the entry is working by using dig.
- </para>
- <screen>
- dig -t SRV _sip._udp.mydomain.com
- </screen>
- <para>
- The results should look something like this:
- </para>
- <para>
- <screen>
- <![CDATA[
- ; <<>> DiG 9.1.0 <<>> -t SRV _sip._udp.mydomain.com
- ;; global options: printcmd
- ;; Got answer:
- ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32654
- ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
- ;; QUESTION SECTION:
- ;_sip._udp.mydomain.com. IN SRV
- ;; ANSWER SECTION:
- _sip._udp.mydomain.com. 86400 IN SRV 0 0 5060 gateway.mydomain.com.
- ;; AUTHORITY SECTION:
- mydomain.com. 86400 IN NS ns3.elsewhere.com.
- mydomain..com 86400 IN NS gateway. mydomain.com.
- ;; ADDITIONAL SECTION:
- gateway. mydomain.com. 86400 IN A 192.168.0.150
- ;; Query time: 6 msec
- ;; SERVER: 192.168.0.150#53(192.168.0.150)
- ;; WHEN: Tue Dec 3 08:34:17 2002
- ;; MSG SIZE rcvd: 132
- ]]>
- </screen>
- </para>
- </section>
- <section>
- <title>Adding a database for client information</title>
- <para>
- By leveraging a MySQL database, we can provide support for user credentials, and
- keeping track of where the clients are logged on during server restarts.
- </para>
- </section>
- <section>
- <title>MySQL setup</title>
- <para>
- To install support for a MySQL database you will need to download the package
- ser-mysql, which is available from the same download location that you retrieved
- SER. This package has scripts to create the required database and establish
- permissions for the accounts needed. A recent release of MySQL is recommended.
- Earlier versions may have problems with the syntax required to set permissions on
- the database.
- </para>
- <para>
- If you do not already have a copy of MySQL installed, download it from your <ulink
- url="http://www.mysql.com"></ulink>
- </para>
- <para>
- Once you have MySQL installed and started, execute
- </para>
- <screen>
- /usr/sbin/ser_mysql.sh
- </screen>
- <para>
- You can verify that the database has been created, and correct permissions assigned
- by using the mysql management tool and these steps:
- </para>
- <para>
- <screen>
- Mysql> select * from user;
- | Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv |
- | % | ser | 4e633cf914a735a0 | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
- | localhost | ser | 4e633cf914a735a0 | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | Y | Y | Y |
- | % | serro | 7cb73a267cb7bd5f | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
- | localhost | serro | 7cb73a267cb7bd5f | Y | N | N | N | N | N | N | N | N | N | N | N | N | N |
- </screen>
- </para>
- <para>
- The above results show that the two user, ser and serro, have been created and
- granted the permissions needed to access the database. Note that in the above
- example the permissions have been modified to deny access to these accounts from any
- system(%) other than local host.
- </para>
- <para>
- <screen>
- mysql> connect ser;
- Connection id: 294
- Current database: ser
- mysql> show tables;
- +-----------------+
- | Tables_in_ser |
- +-----------------+
- | acc |
- | active_sessions |
- | aliases |
- | config |
- | event |
- | grp |
- | location |
- | missed_calls |
- | pending |
- | phonebook |
- | reserved |
- | silo |
- | subscriber |
- | version |
- +-----------------+
- 14 rows in set (0.00 sec)
- mysql> select * from subscriber;
- | phplib_id | USERNAME | PASSWORD | FIRST_NAME | LAST_NAME | PHONE | EMAIL_ADDRESS | DATETIME_CREATED | DATETIME_MODIFIED | confirmation | flag | SendNotification | Greeting | HA1 | REALM | ha1b | perms | allow_find | timezone |
- | 4cefa7a4d3c8c2dbf6328520bd873a19 | admin | heslo | first | admin | 557-8469 | [email protected] | 2002-12-02 19:20:41 | 2002-12-02 20:29:46 | 80e0f273b2067d40277b49ff842bb9e3 | o | | | c79a8f8f08596baa84bb02c88884426d | iptel.org | f322c94b8b2fbe557d43ab3ac9e05b3a | admin | 1 | America/Los_Angeles |
- </screen>
- </para>
- <para>
- This last query shows that you have one user account defined and it has
- administrator privileges.
- </para>
- <para>
- We'll need to add another account to be the administrator for your realm, which we
- will do after the next section.
- </para>
- </section>
- </section>
- <section id="configuration">
- <title>Configuration</title>
- <section>
- <title>Modify SER configuration</title>
- <para>
- Now that we have a working MySQL database, we need to modify the configuration file
- for ser, located on a RedHat, installed in /etc/ser/ser.cfg. The following changes
- need to be made:
- </para>
- <para>
- To enable support for the new MySQL database we need to load the appropriate module.
- That is accomplished by uncomment this line:
- </para>
- <screen>
- loadmodule "/usr/lib/ser/modules/mysql.so
- </screen>
- <para>
- Next we need to set SER to use the database and write changes instead of just
- caching them in memory. This is done by means of commenting this line:
- </para>
- <screen>
- modparam ("usrloc", "db_mode", 0)
- </screen>
- <para>
- And uncomment this line:
- </para>
- <screen>
- modparam ("usrloc", "db_mode", 2)
- </screen>
- <para>
- Note on db_modes:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Mode 0
- </para>
- <para>
- Disables writes to the database. Contact information will not be
- preserved if the server is restarted.
- </para>
- </listitem>
- <listitem>
- <para>
- Mode 1
- </para>
- <para>
- 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.
- </para>
- </listitem>
- <listitem>
- <para>
- Mode 2
- </para>
- <para>
- Periodically writes contact information to the database based in the in
- memory cache.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- To enable digest authentication we additionally need to uncomment the following two lines:
- </para>
- <screen>
- loadmodule "/usr/lib/ser/modules/auth.so"
- loadmodule "/usr/lib/ser/modules/auth_db.so"
- </screen>
- <para>
- We have the option of storing passwords in our database in plain text. This allows
- for password recovery and makes the initial setup and testing easier. To enable
- this feature uncomment these lines:
- </para>
- <screen>
- modparam ("auth_db", "calculate_ha1", yes)
- modparam ("auth_db", "password_column", "password")
- </screen>
- <para>
- These lines work together. The first tells SER to generate a hash based on
- username, password and realm. The second tells SER where to look for the plain-text
- password in the database.
- </para>
- <para>
- Uncomment these lines and change all instances of iptel.org to your domain
- </para>
- <para>
- <screen>
- if (!www_authorize("mydomain.com", "subscriber")) {
- www_challenge("mydomain.com", "0");
- break;
- };
- </screen>
- </para>
- <para>
- We're now ready to restart ser. On RedHat use
- </para>
- <screen>
- /etc/rc.d/init.d/ser restart
- </screen>
- </section>
- <section>
- <title>Adding an admin for your realm</title>
- <para>
- Now that we have a working database and ser is configured to use it, we need to add
- some users and at least one of them should have administrator privileges. The
- administrator role becomes important if you want to use a web management tool such
- as serweb.
- </para>
- <para>
- Basic account manipulation can be performed with the serctl script, located in
- /usr/sbin.
- </para>
- <para>
- To add a user use these commands
- </para>
- <screen>
- serctl add JoeUser qwerty [email protected]
- </screen>
- <para>
- The system notify for "Type MySQL Password", the default password is
- "heslo"
- </para>
- <para>
- To make JoeUser an administrator, we need to login to MySQL and modify the database.
- </para>
- <para>
- <screen>
- mysql> connect ser;
- mysql> update subscriber set perms=?admin? where USER_ID=?JoeUser?;
- Query OK, 1 row affected (0.00 sec)
- Rows matched: 1 Changed: 1 Warnings: 0
- mysql> select * from subscriber;
- | 4cefa7a4d3c8c2dbf6328520bd873a19 | JoeUser | qwerty | | | | [email protected] | 2002-12-02 19:20:41 | 2002-12-02 20:29:46 | 80e0f273b2067d40277b49ff842bb9e3 | o | | | c79a8f8f08596baa84bb02c88884426d | mydomain.com | f322c94b8b2fbe557d43ab3ac9e05b3a | admin | 1 | America/Los_Angeles |
- </screen>
- </para>
- <para>
- The third from last field shows that Joe has been assigned admin privileges.
- </para>
- <para>
- At this point Joe can login to our server, but since he is the only user, there is
- not much he can do. We can now add additional users using the serctl script, or now
- is a good time to look at installing serweb, which will allow users to subscribe to
- our service.
- </para>
- </section>
- <section>
- <title>More on serctl</title>
- <para>
- The script serctl can be used to manage users, access control lists, in memory
- contacts, and to monitor server health. Executing serctl with no arguments will
- produce this output:
- </para>
- <para>
- <screen>
- usage:
- * subscribers *
- 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
- * access control lists *
- acl show [<username>] .............. show user membership
- acl grant <username> <group> ....... grant user membership (*)
- acl revoke <username> [<group>] .... grant user membership(s) (*)
- * usrloc *
- ul show [<username>]................ show in-RAM online users
- ul rm <username> ................... delete user's UsrLoc entries
- ul add <username> <uri> ............ introduce a permanent UsrLoc entry
- showdb [<username>] ................ show online users flushed in DB
- * control and diagnostic *
- moni ... show internal status start .... start ser
- ps ..... show running 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.
- If the variable PW is set, the password will not be prompted.
- ACL privileges are: local ld int voicemail free-pstn
- </screen>
- </para>
- </section>
- <section>
- <title>Adding and deleting users with serctl</title>
- <para>
- User account management is performed with these commands:
- </para>
- <screen>
- serctl add
- serctl password
- serctl rm
- </screen>
- <para>
- The contents of the in memory cache can be managed with the ul argument. Care must
- be taken to with these commands. For example:
- </para>
- <screen>
- serctl ul rm joe
- </screen>
- <para>
- Will remove the current contact information about Joe from memory
- </para>
- <para>
- Whereas "serctl rm joe" will delete joe's account.
- </para>
- </section>
- <section>
- <title>Examining in memory cache with serctl</title>
- <para>
- The command "serctl ul show" will list any currently registered
- clients. The output will look like this:
- </para>
- <para>
- <screen>
- ===Domain list===
- ---Domain---
- name : 'location'
- size : 512
- table: 0x402ee6d0
- d_ll {
- n : 2
- first: 0x402f1a74
- last : 0x402f089c
- }
- lock : 0
- ...Record(0x402f1a74)...
- domain: 'location'
- aor : 'test'
- ~~~Contact(0x402f708c)~~~
- domain : 'location'
- aor : 'test'
- Contact: 'sip:[email protected]:5060'
- Expires: 2501
- q : 0.00
- Call-ID: '[email protected]'
- CSeq : 101
- State : CS_SYNC
- next : (nil)
- prev : (nil)
- ~~~/Contact~~~~
- .../Record...
- ...Record(0x402f089c)...
- domain: 'location'
- aor : 'joe'
- ~~~Contact(0x402f0924)~~~
- domain : 'location'
- aor : 'joe'
- Contact: 'sip:192.168.0.101:14354'
- Expires: 432
- q : 0.00
- Call-ID: '[email protected]'
- CSeq : 11
- State : CS_SYNC
- next : (nil)
- prev : (nil)
- ~~~/Contact~~~~
- .../Record...
- ---/Domain---
- ===/Domain list===
- </screen>
- </para>
- </section>
- <section>
- <title>Examining server status</title>
- <para>
- Two commands can be used to check the health of the server. The first command
- serctl ps returns a list of all SER related processes, the ip address and the port
- they are listening on. For example:
- </para>
- <para>
- <screen>
- [root@gateway /root]# serctl ps
- 0 31029 attendant
- 1 31033 receiver child=0 sock=0 @ 127.0.0.1::5060
- 2 31034 receiver child=1 sock=0 @ 127.0.0.1::5060
- 3 31035 receiver child=2 sock=0 @ 127.0.0.1::5060
- 4 31036 receiver child=3 sock=0 @ 127.0.0.1::5060
- 5 31037 receiver child=0 sock=1 @ 192.168.0.1::5060
- 6 31038 receiver child=1 sock=1 @ 192.168.0.1::5060
- 7 31039 receiver child=2 sock=1 @ 192.168.0.1::5060
- 8 31040 receiver child=3 sock=1 @ 192.168.0.1::5060
- 9 31049 fifo server
- 10 31072 timer
- </screen>
- </para>
- <para>
- The second command, serctl monitor, shows the server version, uptime, pending and
- completed transactions, and the number of major category responses the server has
- sent. Another example:
- </para>
- <para>
- <screen>
- [cycle #: 1; if constant make sure server lives and fifo is on]
- Server: Sip EXpress router (0.8.11 (i386/linux)
- Now: Wed Dec 4 10:13:02 2002
- Up Since: Mon Dec 2 21:21:11 2002
- Up time: 132711 [sec]
- Transaction Statistics
- Current: 0 (2 waiting) Total: 46 (0 local)
- Replied localy: 37
- Completion status 6xx: 0, 5xx: 0, 4xx: 23, 3xx: 0,2xx: 22
- Stateless Server Statistics
- 200: 101 202: 0 2xx: 0
- 300: 0 301: 0 302: 0 3xx: 0
- 400: 0 401: 0 403: 0 404: 132 407: 0 408: 0 483: 1 4xx: 0
- 500: 0 5xx: 0
- 6xx: 0
- xxx: 0
- failures: 0
- UsrLoc Stats
- Domain Registered Expired
- 'location' 2 2
- </screen>
- </para>
- </section>
- </section>
- <section>
- <title>Installing SERWeb</title>
- <para>
- The SERweb package can be downloaded from <ulink
- url="ftp://ftp.berlios.de/ser/latest/serweb"></ulink>
- </para>
- <para>
- The pages associated with SERweb provide a starting point to customize your SIP user
- account management tools.
- </para>
- <section>
- <title><acronym>PHP</acronym> configuration</title>
- <para>
- Go to <acronym>PHP</acronym> configuration file in /etc/php.ini and change
- "register_globals = Off" to "On"
- </para>
- </section>
- <section>
- <title>Installing SERweb default configuration</title>
- <para>
- If you are installing this package on a server that does not host any other web
- pages, you can simply extract the files to the document directory of your web
- server. This presumes that you have a working Web Server.
- </para>
- </section>
- <section>
- <title>Installing SERweb custom file locations</title>
- <para>
- In case your server performs multiple functions, and you want to just add the SERweb
- tools to an existing web site, we will need to make changes to a number of the php
- files. The following examples are from an Apache 2.0 on RedHat.
- </para>
- <para>
- Unzip the files into a temporary directory, such as /root/serweb. The directory
- will contain these files:
- </para>
- <para>
- <screen>
- -rw-rw-r-- 1 827 2020 18561 Sep 25 16:31 COPYING
- drwxr-xr-x 2 827 2020 1024 Nov 27 16:43 CVS
- -rw-rw-r-- 1 827 2020 529 Sep 25 16:29 README
- drwxr-xr-x 7 827 2020 1024 Nov 27 22:24 html
- drwxr-xr-x 3 827 2020 2048 Sep 26 10:26 phplib
- </screen>
- </para>
- <para>
- On the Linux RedHat Version 8 root directory on web server is /var/www/html/
- </para>
- <para>
- Move the html directory to the root of your web server:
- </para>
- <screen>
- mv html /var/www/html/htdocs/serweb
- </screen>
- <para>
- Move the phplib directory to your web server application directory:
- </para>
- <screen>
- mv phplib /var/www/html/phplib
- </screen>
- <para>
- Following files must be updated with this "new" path to the libraries:
- </para>
- <screen>
- ./admin/prepend.php
- ./user_interface/prepend.php
- ./user_interface/reg/prepend.php
- </screen>
- <para>
- For these files the variable: $_PHPLIB["libdir"] =
- "../../phplib/"; becomes $_PHPLIB["libdir"] =
- "../../../phplib/";
- </para>
- <para>
- In the ./admin directory edit the files acl.php, index.php, and users.php will need
- their path to the forms library updated. For this example, add ../ to the existing
- line
- </para>
- <screen>
- :require "../../../phplib/oohforms.inc";
- </screen>
- <para>
- In the ./user_interface directory the following files need the same change:
- </para>
- <para>
- accounting.php, find_user.php, index.php, missed_calls.php, my_account.php,
- phonebook.php, send_im.php, notification_subscription.php
- </para>
- <para>
- Next these files in ./user_interface/reg need the same change, with an additional
- ../:
- </para>
- <para>
- Finish.php, get_pass.php, index.php
- </para>
- <para>
- The last changes occur in the config.php file to provide the
- location for graphic files, style sheets and time zone
- information. Update the following variables:
- </para>
- <screen>
- $this->root_path="/serweb/";
- $this->fifo_server = "/tmp/ser_fifo";
- $this->zonetab_file = "/usr/share/zoneinfo/zone.tab";
- //TZ zone descriptions file, usually: /usr/share/zoneinfo/zone.tab
- </screen>
- <para>
- Find two variables: "$this->mail_forgot_pass=","
- $this->mail_register=" and change line
- http://oook/~iptel/user_interface/reg/confirmation.php?nr=#confirm#\n\n
- </para>
- <para>
- with line
- </para>
- <para>
- http://".$_SERVER['HTTP_HOST']."/htdocs/serweb/user_interface/reg/confirmation.php?nr=#confirm#\n\n
- </para>
- <para>
- This will insure sending a registration feedback mail to SIP server using its IP
- address
- </para>
- </section>
- <section>
- <title>Modifying SERweb configuration general</title>
- <para>
- We need to update /usr/local/apache/htdocs/serweb/config.php to represent our realm.
- The following variables need to be changed to our domain:
- </para>
- <para>
- <screen>
- $this->realm="mydomain.com";
- $this->domainname=" mydomain.com";
- $this->web_contact="sip:JoeUser@ mydomain.com";
- //address of pseudo sender
- </screen>
- </para>
- <screen>
- $this->default_domain=" mydomain.com";
- $this->mail_header_from="Registration@ mydomain.com";
- </screen>
- <para>
- </para>
- <para>
- Additionally we will want to modify the section for Terms and Conditions, either
- replacing it with appropriate language for our services, or at least replacing
- iptel.org with our domain information.
- </para>
- </section>
- </section>
- <section id="issues_and_limitation">
- <title>Issues And Limitation</title>
- <para>
- Since one of the design goals behind SIP is to decentralize the intelligence in
- communications handling, a basic tenant is that SIP clients need to be able to
- communicate directly with each other. The problem is that many clients find themselves
- either behind a firewall or in a NAT fronted address space. When a client registers
- with the SIP server, it tells the server what it is using for an IP address, and that
- address may not be accessible to the public.
- </para>
- <section>
- <title>More on NAT</title>
- <para>
- There are a couple of ways that we can overcome the problem that NAT introduces.
- Some SIP client providers are building in options into their products that allow the
- user to identify the IP address that their phone will appear as to the public. This
- is a nice simple approach, but presumes that the person installing the client knows
- what that IP address is, and that it doesn't change. Cisco has built this feature
- into their 79XX series SIP phones.
- </para>
- <para>
- A second solution that is working its way through the standards process is called
- <quote>Simple Traversal of UDP through NAT</quote>, or <acronym>STUN</acronym>.
- A <acronym>STUN</acronym> equipped client is configured to send a who-am-I packet to
- a known server on the public network. That server will respond with the IP
- address that the client appears to be communicating from, and the client can then
- use that address to register with the SIP server. Phones that leverage
- <acronym>STUN</acronym> include: Snom 100, kphone, and sipc .
- </para>
- </section>
- <section>
- <title>Firewalls</title>
- <para>
- SIP clients also present an interesting challenge to configuring a firewall. During
- registration the SIP client will be assigned a UDP port in the range of 16384 to
- 32768. Our firewall administrators will not happily open up all of those ports to
- all of the internal systems, on the chance that a SIP connection may be needed.
- </para>
- <para>
- This is where the concept of a Firewall Control Protocol, or <acronym>FCP</acronym>,
- comes into play. The design idea is that when a SIP client registers, a
- <acronym>FCP</acronym> agent, or server if you prefer, will dynamically insert a new
- rule into the firewall policy to permit that client to participate in SIP
- conversations.
- </para>
- </section>
- </section>
- <section id="diagnostics">
- <title>Diagnostics And Tools</title>
- <para>
- Detailed information about the communications between clients and the SIP server is
- needed to isolate problems. Two tools that can be used to gather such information are
- sipsak and ngrep.
- </para>
- <section>
- <title>ngrep</title>
- <para>
- Ngrep is a capable of listening in on network traffic and filtering it in much the
- same way as grep can locate patterns in files. To monitor the communications
- between a client, joe, and the server the following command would be run on the
- server:
- </para>
- <screen>
- ngrep -n 5060 -d eth0 joe
- </screen>
- <para>
- Since SIP communications are <acronym>ASCII</acronym> based, all events such as
- REGISTER, INVITE, SUBSCRIBE, etc. are captured. The output of ngrep can identify
- problems with SIP addresses, or client identity.
- </para>
- <para>
- Ngrep should be part of most modern distributions, or can be downloaded from <ulink
- url="http://sourceforge.net/projects/ngrep/"></ulink>
- </para>
- </section>
- <section>
- <title>Sipsak</title>
- <para>
- Sipsak can be used to determine if your server is responding to requests, and provide information on
- how your server would route SIP connections. Sipsak and basic documentation on its use can be
- downloaded from <ulink url="http://sipsak.berlios.de"></ulink>
- </para>
- </section>
- </section>
- <section id="client_configuration">
- <title>Client Configuration</title>
- <section>
- <title>Microsoft Messenger 4.6</title>
- <para>
- Microsoft Messenger 4.6 can be configured as a SIP client by selecting Tools\Options\Accounts and
- selecting Communications Service for the account sign in. Clear the check boxes for .NET Passport
- and Exchange Account. Check the Communications Service account and enter your SIP account name.
- Click on Advanced and select Configure settings. Enter the IP address of your server, or hostname
- and choose UDP.
- </para>
- </section>
- <section>
- <title>Cisco 79XX phones</title>
- <para>
- Cisco has complete documentation on how to convert a 79XX series phone to use SIP.
- The basic steps are:
- </para>
- <section>
- <title>Configure a <acronym>DHCP</acronym> service that provides</title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- IP address
- </para>
- </listitem>
- <listitem>
- <para>
- Subnet mask
- </para>
- </listitem>
- <listitem>
- <para>
- Default gateway
- </para>
- </listitem>
- <listitem>
- <para>
- <acronym>DNS</acronym> server addresses
- </para>
- </listitem>
- <listitem>
- <para>
- <acronym>TFTP</acronym> server address
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>On the <acronym>TFTP</acronym> server load these files</title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- OS79XX - Identifies which firmware the phone should load with no
- extension. Example: P0S3-04-1-00
- </para>
- </listitem>
- <listitem>
- <para>
- P0S3-04-1-00.bin - The firmware image
- </para>
- </listitem>
- <listitem>
- <para>
- SIPDefault.cnf - Site wide configuration options
- </para>
- </listitem>
- <listitem>
- <para>
- SIPmacaddress.cnf - Phone specific settings, including login name
- and password. Example: SIP000A8A93D466.cnf
- </para>
- </listitem>
- <listitem>
- <para>
- RINGLIST.DAT, ringer1.pcm, ringer2.pcm - ring tones
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Each time the phone is powered on it will tftp download OS79XX and determine if
- it needs a firmware update. If no update is needed the next step is to download
- SIPDefault.cnf, SIPmacaddress.cnf, and optionally a dial plan, ringlist and ring
- tones.
- </para>
- <para>
- Calls can be placed to other registered SIP clients, or to a PSTN number
- provided there is PSTN gateway identified in the SER configuration file.
- </para>
- </section>
- </section>
- </section>
- <section id="pstn_connectivity">
- <title>PSTN Connectivity</title>
- <para>
- Passing calls that originate from a SIP client to the PSTN is a simple matter of
- permitting SER to relay the session to an established PSTN gateway. Calls that start
- out on the PSTN and need to be directed to a SIP client requires that the PSTN gateway
- be aware of where to direct the call.
- </para>
- <section>
- <title>Cisco Dial-peer</title>
- <para>
- The Cisco gateway needs to have a PSTN interface, such as FXO ports or a VXB-2TE1+
- card, and depending on the model of Cisco device an upgraded IOS revision. The
- dial-peer itself is simple:
- </para>
- <para>
- dial-peer voice 999 voip
- </para>
- <para>
- destination-pattern 555999. ** Associate the number range 555-9990 to 9999 with our
- SIP server
- </para>
- <para>
- session protocol sipv2 ** Set this dial-peer to use SIP instead of Cisco protocols
- </para>
- <para>
- session target sip-server ** Send the call to our SIP server. See SIP-UA below
- </para>
- <para>
- codec g711ulaw ** Set the default codec to 711-Ulaw (common codec between clients)
- </para>
- <para>
- !
- </para>
- <para>
- sip-ua
- </para>
- <para>
- sip-server ipv4:192.168.0.1 ** IP address of our SIP server
- </para>
- </section>
- <section>
- <title>Relaying PSTN in ser.cfg</title>
- <para>
- The following is an extremely simple sample of how to relay a call from a SIP client
- to the PSTN
- </para>
- <para>
- <screen>
- # attempt handoff to PSTN
- if (uri=~<quote>^sip:9[0-9]*@mydomain.com</quote>) { ## This assumes that the caller is
- log(<quote>Forwarding to PSTN\n</quote>); ## registered in our realm
- t_relay_to( <quote>192.168.0.2</quote>, <quote>5060</quote>); ## Our Cisco router
- break;
- };
- </screen>
- </para>
- </section>
- </section>
-
- <section id="sip_status_codes">
- <title>SIP Status Codes</title>
- <para>
- The following are the SIP status codes as of RFC3261;
- </para>
-
- <para>
- <table><title>1XX-2XX Informational</title>
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>
- 100
- </entry>
- <entry>
- Trying
- </entry>
- </row>
- <row>
- <entry>
- 180
- </entry>
- <entry>
- Ringing
- </entry>
- </row>
- <row>
- <entry>
- 181
- </entry>
- <entry>
- Call Is Being Forwarded
- </entry>
- </row>
- <row>
- <entry>
- 182
- </entry>
- <entry>
- Queued
- </entry>
- </row>
- <row>
- <entry>
- 183
- </entry>
- <entry>
- Session Progress
- </entry>
- </row>
- <row>
- <entry>
- 200
- </entry>
- <entry>
- OK
- </entry>
- </row>
- <row>
- <entry>
- 202
- </entry>
- <entry>
- OK
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
-
- <para>
- <table><title>3XX Redirection</title>
- <tgroup cols='2'>
- <tbody>
- <row>
- <entry>
- 300
- </entry>
- <entry>
- Multiple Choices
- </entry>
- </row>
- <row>
- <entry>
- 301
- </entry>
- <entry>
- Moved Permanently
- </entry>
- </row>
- <row>
- <entry>
- 303
- </entry>
- <entry>
- See Other
- </entry>
- </row>
- <row>
- <entry>
- 305
- </entry>
- <entry>
- Use Proxy
- </entry>
- </row>
- <row>
- <entry>
- 380
- </entry>
- <entry>
- Alternative Service
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
-
- <para>
- <table><title>4XX Client-Error</title>
- <tgroup cols='2'>
- <tbody>
- <row>
- <entry>
- 400
- </entry>
- <entry>
- Bad Request
- </entry>
- </row>
- <row>
- <entry>
- 401
- </entry>
- <entry>
- Unauthorized
- </entry>
- </row>
- <row>
- <entry>
- 402
- </entry>
- <entry>
- Payment Required
- </entry>
- </row>
- <row>
- <entry>
- 403
- </entry>
- <entry>
- Forbidden
- </entry>
- </row>
- <row>
- <entry>
- 404
- </entry>
- <entry>
- Not Found
- </entry>
- </row>
- <row>
- <entry>
- 405
- </entry>
- <entry>
- Method Not Allowed
- </entry>
- </row>
- <row>
- <entry>
- 406
- </entry>
- <entry>
- Not Acceptable
- </entry>
- </row>
- <row>
- <entry>
- 407
- </entry>
- <entry>
- Proxy Authentication Required
- </entry>
- </row>
- <row>
- <entry>
- 408
- </entry>
- <entry>
- Request Timeout
- </entry>
- </row>
- <row>
- <entry>
- 409
- </entry>
- <entry>
- Conflict
- </entry>
- </row>
- <row>
- <entry>
- 410
- </entry>
- <entry>
- Gone
- </entry>
- </row>
- <row>
- <entry>
- 411
- </entry>
- <entry>
- Length Required
- </entry>
- </row>
- <row>
- <entry>
- 413
- </entry>
- <entry>
- Request Entity Too Large
- </entry>
- </row>
- <row>
- <entry>
- 414
- </entry>
- <entry>
- Request-URI Too Large
- </entry>
- </row>
- <row>
- <entry>
- 415
- </entry>
- <entry>
- Unsupported Media Type
- </entry>
- </row>
- <row>
- <entry>
- 420
- </entry>
- <entry>
- Bad Extension
- </entry>
- </row>
- <row>
- <entry>
- 480
- </entry>
- <entry>
- Temporarily not available
- </entry>
- </row>
- <row>
- <entry>
- 481
- </entry>
- <entry>
- Call Leg/Transaction does not exist
- </entry>
- </row>
- <row>
- <entry>
- 482
- </entry>
- <entry>
- Loop Detected
- </entry>
- </row>
- <row>
- <entry>
- 483
- </entry>
- <entry>
- Too Many Hops
- </entry>
- </row>
- <row>
- <entry>
- 484
- </entry>
- <entry>
- Address Incomplete
- </entry>
- </row>
- <row>
- <entry>
- 485
- </entry>
- <entry>
- Ambiguous
- </entry>
- </row>
- <row>
- <entry>
- 486
- </entry>
- <entry>
- Busy Here
- </entry>
- </row>
- <row>
- <entry>
- 487
- </entry>
- <entry>
- Request Terminated
- </entry>
- </row>
- <row>
- <entry>
- 488
- </entry>
- <entry>
- Not Acceptable Here
- </entry>
- </row>
- <row>
- <entry>
- 489
- </entry>
- <entry>
- Bad Event
- </entry>
- </row>
- <row>
- <entry>
- 491
- </entry>
- <entry>
- Request Pending
- </entry>
- </row>
- <row>
- <entry>
- 493
- </entry>
- <entry>
- Undecipherable
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
-
- <para>
- <table><title>5XX Server-Error</title>
- <tgroup cols='2'>
- <tbody>
- <row>
- <entry>
- 500
- </entry>
- <entry>
- Internal Server Error
- </entry>
- </row>
- <row>
- <entry>
- 501
- </entry>
- <entry>
- Not Implemented
- </entry>
- </row>
- <row>
- <entry>
- 502
- </entry>
- <entry>
- Bad Gateway
- </entry>
- </row>
- <row>
- <entry>
- 503
- </entry>
- <entry>
- Service Unavailable
- </entry>
- </row>
- <row>
- <entry>
- 504
- </entry>
- <entry>
- Gateway Time-out
- </entry>
- </row>
- <row>
- <entry>
- 505
- </entry>
- <entry>
- SIP Version not supported
- </entry>
- </row>
- <row>
- <entry>
- 513
- </entry>
- <entry>
- Message Too Large
- </entry>
- </row>
- <row>
- <entry>
- 580
- </entry>
- <entry>
- Precondition Failure
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
-
- <para>
- <table><title>6XX Global-Failure</title>
- <tgroup cols='2'>
- <tbody>
- <row>
- <entry>
- 600
- </entry>
- <entry>
- Busy Everywhere
- </entry>
- </row>
- <row>
- <entry>
- 603
- </entry>
- <entry>
- Decline
- </entry>
- </row>
- <row>
- <entry>
- 604
- </entry>
- <entry>
- Does Note Exist Anywhere
- </entry>
- </row>
- <row>
- <entry>
- 606
- </entry>
- <entry>
- Not Acceptable
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- </section>
- </section>
|