Configuration
Version 12 (Adrian Georgescu, 04/24/2010 10:04 am)
| 1 | 1 | Adrian Georgescu | = Configuration = |
|---|---|---|---|
| 2 | 1 | Adrian Georgescu | |
| 3 | 8 | Adrian Georgescu | [[TOC(Configuration*, depth=2)]] |
| 4 | 8 | Adrian Georgescu | |
| 5 | 5 | Adrian Georgescu | == Database == |
| 6 | 5 | Adrian Georgescu | |
| 7 | 5 | Adrian Georgescu | Both OpenXCAP backends (Database and OpenSIPS) depend on a database engine to store service subscribers |
| 8 | 5 | Adrian Georgescu | and XCAP resources. The database creation scripts are found in the scripts/ directory |
| 9 | 5 | Adrian Georgescu | |
| 10 | 9 | Adrian Georgescu | === Create Tables === |
| 11 | 5 | Adrian Georgescu | |
| 12 | 5 | Adrian Georgescu | If you use OpenSIPS backend, you do not need to create any tables and configure OpenXCAP to use the same database as OpenSIPS. If you want to setup OpenXCAP to use its own database, create the tables using |
| 13 | 5 | Adrian Georgescu | |
| 14 | 11 | Adrian Georgescu | [browser:setup/mysql-create-tables.sql] |
| 15 | 5 | Adrian Georgescu | |
| 16 | 5 | Adrian Georgescu | This script creates two tables: |
| 17 | 5 | Adrian Georgescu | 1. subscriber, which is used to authenticate XCAP requests |
| 18 | 5 | Adrian Georgescu | 1. xcap, where the XCAP documents are actually stored |
| 19 | 5 | Adrian Georgescu | |
| 20 | 5 | Adrian Georgescu | The subscriber table is a subset of the subscriber table from OpenSIPS, xcap table is the same as the one from OpenSIPS. |
| 21 | 5 | Adrian Georgescu | |
| 22 | 5 | Adrian Georgescu | === Add MySQL user === |
| 23 | 5 | Adrian Georgescu | |
| 24 | 5 | Adrian Georgescu | Use the following script as template, edit it first and run it against on your database: |
| 25 | 5 | Adrian Georgescu | |
| 26 | 5 | Adrian Georgescu | {{{ |
| 27 | 5 | Adrian Georgescu | setup/mysql-create-user.sql |
| 28 | 5 | Adrian Georgescu | }}} |
| 29 | 5 | Adrian Georgescu | |
| 30 | 1 | Adrian Georgescu | == OpenXCAP == |
| 31 | 3 | Adrian Georgescu | |
| 32 | 3 | Adrian Georgescu | If you have installed the debian package copy /etc/openxcap/config.ini.sample to /etc/openxcap/config.ini. For other Linux OS copy config.ini.sample from the tar archive to the same directory. Edit config.ini with your settings. |
| 33 | 1 | Adrian Georgescu | |
| 34 | 1 | Adrian Georgescu | [source:config.ini.sample Sample OpenXCAP configuration file] |
| 35 | 1 | Adrian Georgescu | |
| 36 | 1 | Adrian Georgescu | The specific settings for an installation must be set from the configuration file, which is split in several configuration sections. |
| 37 | 1 | Adrian Georgescu | |
| 38 | 1 | Adrian Georgescu | The [Server] section contains global settings: the IP address and port where OpenXCAP listens for client requests. |
| 39 | 1 | Adrian Georgescu | |
| 40 | 1 | Adrian Georgescu | The XCAP root is the context that contains all the documents across all applications and users that |
| 41 | 1 | Adrian Georgescu | are managed by the server. Only the client requests that address the root defined here are accepted. |
| 42 | 2 | Adrian Georgescu | If the root URI has the "https" scheme, the server will listen for requests in TLS mode. The X509 |
| 43 | 1 | Adrian Georgescu | certificate and private key that will identify the server are loaded using the values in the [TLS] section. |
| 44 | 1 | Adrian Georgescu | |
| 45 | 4 | Adrian Georgescu | OpenXCAP support multiple, interchangeable backend modules. Each backend knows where and how to |
| 46 | 4 | Adrian Georgescu | authorize and authenticate XCAP users and where to store the XCAP documents. Currently, supported values |
| 47 | 4 | Adrian Georgescu | are "Database" and "OpenSIPS", the specific settings will be taken the corresponding sections, [Database] or |
| 48 | 4 | Adrian Georgescu | [OpenSIPS]. |
| 49 | 4 | Adrian Georgescu | |
| 50 | 1 | Adrian Georgescu | An XCAP request must be authenticated before it's handled, and the various settings are found in the |
| 51 | 5 | Adrian Georgescu | [Authentication] section. |
| 52 | 5 | Adrian Georgescu | |
| 53 | 1 | Adrian Georgescu | A trusted peer IP list can be defined, requests matching this list will be accepted without authentication. |
| 54 | 4 | Adrian Georgescu | |
| 55 | 5 | Adrian Georgescu | Client requests must be authenticated in the context of a realm that is the same as the SIP domain. This realm is derived in real time for each request using the following logic: |
| 56 | 5 | Adrian Georgescu | |
| 57 | 4 | Adrian Georgescu | * if the user section of the XCAP URI (the section following the "users" path segment) is in the form of username@domain, the realm is taken from the domain part |
| 58 | 4 | Adrian Georgescu | * some XCAP clients (e.g. CounterPath's Eyebeam), only put the username in the XCAP URI, so there is the need for a convention to determine the realm: it must be included in the XCAP root URI on the client side. For example, if the XCAP root of the server is http://example.com/xcap-root, the client should be provisioned with http://example.com/xcap-root@domain/ |
| 59 | 4 | Adrian Georgescu | * if the above logic does not provide the realm, the realm will be taken from the default_realm setting of [Authentication] |
| 60 | 4 | Adrian Georgescu | |
| 61 | 4 | Adrian Georgescu | There are separate configuration settings for each backend. The current supported back-ends are Database |
| 62 | 1 | Adrian Georgescu | and OpenSIPS. |
| 63 | 4 | Adrian Georgescu | |
| 64 | 4 | Adrian Georgescu | The Database section contains the database connection URI to the database where the service subscribers |
| 65 | 4 | Adrian Georgescu | are kept (authentication_db_uri) and the database connection URI to the database where XCAP documents are |
| 66 | 5 | Adrian Georgescu | stored. Currently, only MySQL database engine has been implemented. |
| 67 | 4 | Adrian Georgescu | |
| 68 | 4 | Adrian Georgescu | The OpenSIPS section contains all the settings of the Database section, plus the URL where OpenSIPS's XMLRPC |
| 69 | 4 | Adrian Georgescu | management interface is listening for commands. The refreshWatchers command is sent to OpenSIPS management |
| 70 | 4 | Adrian Georgescu | interface to inform the server that the XCAP documents have been changed for a user so that OpenSIPS can send notifications out according to the new policy in real-time. |
| 71 | 4 | Adrian Georgescu | |
| 72 | 4 | Adrian Georgescu | When using TLS you must generate an X.509 certificate and a key. Consult Internet resources for how to do this. The procedure is the same as for any other TLS server like Apache web server. |
| 73 | 1 | Adrian Georgescu | |
| 74 | 2 | Adrian Georgescu | == opensips-mi-proxy == |
| 75 | 1 | Adrian Georgescu | |
| 76 | 1 | Adrian Georgescu | If you have installed the debian package copy /etc/opensips-mi-proxy/config.ini.sample to /etc/opensips-mi-proxy/config.ini. For other Linux OS copy config.ini.sample from the tar archive to the same directory. Edit config.ini with your settings. |
| 77 | 1 | Adrian Georgescu | |
| 78 | 1 | Adrian Georgescu | {{{ |
| 79 | 1 | Adrian Georgescu | [OpenSIPS] |
| 80 | 1 | Adrian Georgescu | socket = /var/run/opensips/socket |
| 81 | 1 | Adrian Georgescu | |
| 82 | 1 | Adrian Georgescu | [MIProxy] |
| 83 | 1 | Adrian Georgescu | ;listen_url = http://<defaultIPAddress>:8080 |
| 84 | 1 | Adrian Georgescu | ;trusted = any |
| 85 | 1 | Adrian Georgescu | }}} |
| 86 | 1 | Adrian Georgescu | |
| 87 | 1 | Adrian Georgescu | For more information see the README and INSTALL files that come together with the tar archive. |
| 88 | 1 | Adrian Georgescu | |
| 89 | 2 | Adrian Georgescu | == soap-simple-proxy == |
| 90 | 1 | Adrian Georgescu | |
| 91 | 1 | Adrian Georgescu | If you have installed the debian package copy /etc/soap-simple-proxy/config.ini.sample to /etc/soap-simple-proxy/config.ini. For other Linux OS copy config.ini.sample from the tar archive to the same directory. Edit config.ini with your settings. |
| 92 | 1 | Adrian Georgescu | |
| 93 | 1 | Adrian Georgescu | {{{ |
| 94 | 1 | Adrian Georgescu | [SOAP Server] |
| 95 | 1 | Adrian Georgescu | address = 0.0.0.0 |
| 96 | 1 | Adrian Georgescu | port = 9300 |
| 97 | 1 | Adrian Georgescu | log_requests = Yes |
| 98 | 1 | Adrian Georgescu | |
| 99 | 1 | Adrian Georgescu | [WSDL] |
| 100 | 1 | Adrian Georgescu | public_service_url = https://example.com/soap-simple-proxy/ |
| 101 | 1 | Adrian Georgescu | internal_service_url = http://private-address:9200/ |
| 102 | 1 | Adrian Georgescu | |
| 103 | 1 | Adrian Georgescu | [XCAP] |
| 104 | 1 | Adrian Georgescu | root_uri = http://xcap.example.com/xcap-root |
| 105 | 1 | Adrian Georgescu | }}} |
| 106 | 1 | Adrian Georgescu | |
| 107 | 1 | Adrian Georgescu | For more information see the README and INSTALL files that come together with the tar archive. |
| 108 | 1 | Adrian Georgescu | |
| 109 | 2 | Adrian Georgescu | == OpenSIPS == |
| 110 | 1 | Adrian Georgescu | |
| 111 | 1 | Adrian Georgescu | The following OpenSIPS configuration example enables OpenSIPS to act like a dedicated SIP Presence server that accepts messages from a trusted SIP Proxy with XCAP authorization enabled using OpenXCAP as policy server. The SIP Proxies defined as trusted peers must be configured to authenticate and authorize the PUBLISH and SUBSCRIBE methods. |
| 112 | 1 | Adrian Georgescu | |
| 113 | 1 | Adrian Georgescu | Is advisable to consult http://opensips.org web site, documentation section for the up to date configuration and settings. |
| 114 | 1 | Adrian Georgescu | |
| 115 | 1 | Adrian Georgescu | {{{ |
| 116 | 1 | Adrian Georgescu | |
| 117 | 1 | Adrian Georgescu | listen = 10.0.0.1:5060 |
| 118 | 1 | Adrian Georgescu | |
| 119 | 1 | Adrian Georgescu | # --- module loading --- |
| 120 | 1 | Adrian Georgescu | |
| 121 | 1 | Adrian Georgescu | mpath = "/usr/lib/opensips/modules" |
| 122 | 1 | Adrian Georgescu | loadmodule "mi_fifo.so" |
| 123 | 1 | Adrian Georgescu | loadmodule "mi_datagram.so" |
| 124 | 1 | Adrian Georgescu | loadmodule "mysql.so" |
| 125 | 1 | Adrian Georgescu | loadmodule "sl.so" |
| 126 | 1 | Adrian Georgescu | loadmodule "maxfwd.so" |
| 127 | 1 | Adrian Georgescu | loadmodule "tm.so" |
| 128 | 1 | Adrian Georgescu | loadmodule "rr.so" |
| 129 | 1 | Adrian Georgescu | loadmodule "xlog.so" |
| 130 | 1 | Adrian Georgescu | |
| 131 | 1 | Adrian Georgescu | loadmodule "presence.so" |
| 132 | 1 | Adrian Georgescu | loadmodule "presence_xml.so" |
| 133 | 1 | Adrian Georgescu | loadmodule "presence_mwi.so" |
| 134 | 1 | Adrian Georgescu | loadmodule "presence_xcapdiff.so" |
| 135 | 1 | Adrian Georgescu | loadmodule "pua.so" |
| 136 | 1 | Adrian Georgescu | loadmodule "pua_mi.so" |
| 137 | 1 | Adrian Georgescu | loadmodule "rls.so" |
| 138 | 1 | Adrian Georgescu | |
| 139 | 1 | Adrian Georgescu | |
| 140 | 1 | Adrian Georgescu | # ----------------- setting module-specific parameters --------------- |
| 141 | 1 | Adrian Georgescu | |
| 142 | 1 | Adrian Georgescu | # -- rr params -- |
| 143 | 1 | Adrian Georgescu | # add value to ;lr param to make some broken UAs happy |
| 144 | 1 | Adrian Georgescu | modparam("rr", "enable_full_lr", 1) |
| 145 | 1 | Adrian Georgescu | |
| 146 | 1 | Adrian Georgescu | modparam("mi_datagram", "socket_name", "/var/run/opensips/socket") |
| 147 | 1 | Adrian Georgescu | modparam("mi_datagram", "unix_socket_user", "opensips") |
| 148 | 1 | Adrian Georgescu | modparam("mi_datagram", "unix_socket_group", "opensips") |
| 149 | 1 | Adrian Georgescu | |
| 150 | 1 | Adrian Georgescu | modparam("mi_fifo", "fifo_name", "/var/run/opensips/fifo") |
| 151 | 1 | Adrian Georgescu | modparam("mi_fifo", "fifo_user", "opensips") |
| 152 | 1 | Adrian Georgescu | modparam("mi_fifo", "fifo_group", "opensips") |
| 153 | 1 | Adrian Georgescu | |
| 154 | 1 | Adrian Georgescu | # -- presence params -- |
| 155 | 1 | Adrian Georgescu | modparam("presence", "db_url", "mysql://opensips:password@db/opensips") |
| 156 | 1 | Adrian Georgescu | modparam("presence", "server_address", "sip:presence@10.0.0.1") |
| 157 | 1 | Adrian Georgescu | modparam("presence", "fallback2db", 1) |
| 158 | 1 | Adrian Georgescu | modparam("presence", "clean_period", 30) |
| 159 | 1 | Adrian Georgescu | |
| 160 | 1 | Adrian Georgescu | # -- xcap params -- |
| 161 | 1 | Adrian Georgescu | modparam("presence_xml", "db_url", "mysql://opensips:password@db/opensips") |
| 162 | 1 | Adrian Georgescu | modparam("presence_xml", "force_active", 0) |
| 163 | 1 | Adrian Georgescu | modparam("presence_xml", "pidf_manipulation", 1) |
| 164 | 1 | Adrian Georgescu | modparam("presence_xml", "integrated_xcap_server", 1) |
| 165 | 1 | Adrian Georgescu | |
| 166 | 1 | Adrian Georgescu | # -- rls params -- |
| 167 | 1 | Adrian Georgescu | |
| 168 | 1 | Adrian Georgescu | modparam("rls", "db_url", "mysql://opensips:password@db/opensips") |
| 169 | 1 | Adrian Georgescu | modparam("rls", "server_address", "sip:rls@10.0.0.1") |
| 170 | 1 | Adrian Georgescu | modparam("rls", "to_presence_code", 5) |
| 171 | 1 | Adrian Georgescu | modparam("rls", "integrated_xcap_server", 1) |
| 172 | 1 | Adrian Georgescu | |
| 173 | 1 | Adrian Georgescu | |
| 174 | 1 | Adrian Georgescu | # ------------------------- request routing logic ------------------- |
| 175 | 1 | Adrian Georgescu | |
| 176 | 1 | Adrian Georgescu | # main routing logic |
| 177 | 1 | Adrian Georgescu | |
| 178 | 1 | Adrian Georgescu | route { |
| 179 | 1 | Adrian Georgescu | xlog("L_INFO", "----- Start routing"); |
| 180 | 1 | Adrian Georgescu | |
| 181 | 1 | Adrian Georgescu | if ((method=="PUBLISH" || method=="SUBSCRIBE" || method=="NOTIFY")) { |
| 182 | 1 | Adrian Georgescu | xlog("L_INFO", "Presence event: $hdr(Event)\n"); |
| 183 | 1 | Adrian Georgescu | } |
| 184 | 1 | Adrian Georgescu | |
| 185 | 1 | Adrian Georgescu | if(is_method("PUBLISH")) { |
| 186 | 1 | Adrian Georgescu | if ((src_ip==10.0.0.1 && src_port==5060)) { |
| 187 | 1 | Adrian Georgescu | sl_send_reply("404", "Domain not served here"); |
| 188 | 1 | Adrian Georgescu | return; |
| 189 | 1 | Adrian Georgescu | } |
| 190 | 1 | Adrian Georgescu | if (is_from_local()) { |
| 191 | 1 | Adrian Georgescu | if (avp_check("$hdr(Event)", "fm/presence*/i") && ($au != $rU || $ar != $rd)) { |
| 192 | 1 | Adrian Georgescu | xlog("L_WARN", "Account $au@$ar tried to publish $hdr(Event) event for $ru\n"); |
| 193 | 1 | Adrian Georgescu | sl_send_reply("403", "Publishing $hdr(Event) events for others is forbidden"); |
| 194 | 1 | Adrian Georgescu | return; |
| 195 | 1 | Adrian Georgescu | } |
| 196 | 1 | Adrian Georgescu | } else { |
| 197 | 1 | Adrian Georgescu | sl_send_reply("403", "PUBLISH forbidden for outside domains"); |
| 198 | 1 | Adrian Georgescu | return; |
| 199 | 1 | Adrian Georgescu | } |
| 200 | 1 | Adrian Georgescu | |
| 201 | 1 | Adrian Georgescu | if (t_newtran()) { |
| 202 | 1 | Adrian Georgescu | handle_publish(); |
| 203 | 1 | Adrian Georgescu | t_release(); |
| 204 | 1 | Adrian Georgescu | } else { |
| 205 | 1 | Adrian Georgescu | sl_reply_error(); |
| 206 | 1 | Adrian Georgescu | } |
| 207 | 1 | Adrian Georgescu | exit; |
| 208 | 1 | Adrian Georgescu | } else if( is_method("NOTIFY")) |
| 209 | 1 | Adrian Georgescu | if (has_totag()) { |
| 210 | 1 | Adrian Georgescu | if (!loose_route()) { |
| 211 | 1 | Adrian Georgescu | if (!t_newtran()) { |
| 212 | 1 | Adrian Georgescu | sl_reply_error(); |
| 213 | 1 | Adrian Georgescu | exit; |
| 214 | 1 | Adrian Georgescu | } |
| 215 | 1 | Adrian Georgescu | rls_handle_notify(); |
| 216 | 1 | Adrian Georgescu | switch ($retcode) { |
| 217 | 1 | Adrian Georgescu | case 1: |
| 218 | 1 | Adrian Georgescu | # Notify processed by rls |
| 219 | 1 | Adrian Georgescu | xlog("L_INFO", "$rm processed by RLS\n"); |
| 220 | 1 | Adrian Georgescu | t_release(); |
| 221 | 1 | Adrian Georgescu | exit; |
| 222 | 1 | Adrian Georgescu | break; |
| 223 | 1 | Adrian Georgescu | case -1: |
| 224 | 1 | Adrian Georgescu | # Error |
| 225 | 1 | Adrian Georgescu | xlog("L_INFO", "$rm processed by RLS but has error\n"); |
| 226 | 1 | Adrian Georgescu | t_reply("500", "Server error while processing RLS NOTIFY"); |
| 227 | 1 | Adrian Georgescu | exit; |
| 228 | 1 | Adrian Georgescu | break; |
| 229 | 1 | Adrian Georgescu | default: |
| 230 | 1 | Adrian Georgescu | if (uri == "sip:rls@10.0.0.1") { |
| 231 | 1 | Adrian Georgescu | xlog("L_ERR", "$rm should be processed by RLS but was not recognized\n"); |
| 232 | 1 | Adrian Georgescu | xlog("L_INFO", "Dropping $rm because it will loop\n"); |
| 233 | 1 | Adrian Georgescu | t_reply("500", "Server error while processing RLS NOTIFY"); |
| 234 | 1 | Adrian Georgescu | exit; |
| 235 | 1 | Adrian Georgescu | } else { |
| 236 | 1 | Adrian Georgescu | xlog("L_INFO", "$rm handled by presence\n"); |
| 237 | 1 | Adrian Georgescu | t_release(); |
| 238 | 1 | Adrian Georgescu | } |
| 239 | 1 | Adrian Georgescu | } |
| 240 | 1 | Adrian Georgescu | } |
| 241 | 1 | Adrian Georgescu | } else { |
| 242 | 1 | Adrian Georgescu | # Out-of-dialog NOTIFY |
| 243 | 1 | Adrian Georgescu | sl_send_reply("405", "Method Not Allowed"); |
| 244 | 1 | Adrian Georgescu | exit; |
| 245 | 1 | Adrian Georgescu | } |
| 246 | 1 | Adrian Georgescu | |
| 247 | 1 | Adrian Georgescu | } else if( is_method("SUBSCRIBE")) { |
| 248 | 1 | Adrian Georgescu | if (!has_totag()) { |
| 249 | 1 | Adrian Georgescu | if (loose_route()) { |
| 250 | 1 | Adrian Georgescu | xlog("L_ERR", "Incorrectly formatted $rm request. Rejected.\n"); |
| 251 | 1 | Adrian Georgescu | sl_send_reply("400", "Incorrectly formatted request"); |
| 252 | 1 | Adrian Georgescu | return; |
| 253 | 1 | Adrian Georgescu | } |
| 254 | 1 | Adrian Georgescu | |
| 255 | 1 | Adrian Georgescu | if ((src_ip==10.0.0.1 && src_port==5060) && is_present_hf("Record-Route")) { |
| 256 | 1 | Adrian Georgescu | sl_send_reply("404", "Domain not served here"); |
| 257 | 1 | Adrian Georgescu | return; |
| 258 | 1 | Adrian Georgescu | } |
| 259 | 1 | Adrian Georgescu | |
| 260 | 1 | Adrian Georgescu | if (is_from_local()) { |
| 261 | 1 | Adrian Georgescu | if (!(src_ip==10.0.0.1 && src_port==5060)) { |
| 262 | 1 | Adrian Georgescu | xlog("L_INFO", "Request came directly from the subscriber\n"); |
| 263 | 1 | Adrian Georgescu | setflag(18); |
| 264 | 1 | Adrian Georgescu | } |
| 265 | 1 | Adrian Georgescu | |
| 266 | 1 | Adrian Georgescu | if ((avp_check("$hdr(Event)", "fm/*.winfo/i") || avp_check("$hdr(Event)", "eq/message-summary/i")) && |
| 267 | 1 | Adrian Georgescu | ($au != $rU || $ar != $rd)) { |
| 268 | 1 | Adrian Georgescu | xlog("L_WARN", "Account $au@$ar tried to subscribe to $ru for $hdr(Event)\n"); |
| 269 | 1 | Adrian Georgescu | sl_send_reply("403", "Subscription to others $hdr(Event) is forbidden"); |
| 270 | 1 | Adrian Georgescu | return; |
| 271 | 1 | Adrian Georgescu | } |
| 272 | 1 | Adrian Georgescu | } |
| 273 | 1 | Adrian Georgescu | } |
| 274 | 1 | Adrian Georgescu | |
| 275 | 1 | Adrian Georgescu | # Internal presence handling |
| 276 | 1 | Adrian Georgescu | if (!t_newtran()) { |
| 277 | 1 | Adrian Georgescu | sl_reply_error(); |
| 278 | 1 | Adrian Georgescu | exit; |
| 279 | 1 | Adrian Georgescu | } |
| 280 | 1 | Adrian Georgescu | |
| 281 | 1 | Adrian Georgescu | rls_handle_subscribe(); |
| 282 | 1 | Adrian Georgescu | |
| 283 | 1 | Adrian Georgescu | switch ($retcode) { |
| 284 | 1 | Adrian Georgescu | case 5: |
| 285 | 1 | Adrian Georgescu | # RLS indicated that message should be processed by presence |
| 286 | 1 | Adrian Georgescu | |
| 287 | 1 | Adrian Georgescu | if (is_uri_host_local()) { |
| 288 | 1 | Adrian Georgescu | if (does_uri_exist()) { |
| 289 | 1 | Adrian Georgescu | handle_subscribe(); |
| 290 | 1 | Adrian Georgescu | t_release(); |
| 291 | 1 | Adrian Georgescu | } else { |
| 292 | 1 | Adrian Georgescu | t_reply("404", "User not found"); |
| 293 | 1 | Adrian Georgescu | } |
| 294 | 1 | Adrian Georgescu | exit; |
| 295 | 1 | Adrian Georgescu | } |
| 296 | 1 | Adrian Georgescu | break; |
| 297 | 1 | Adrian Georgescu | default: |
| 298 | 1 | Adrian Georgescu | t_release(); |
| 299 | 1 | Adrian Georgescu | exit; |
| 300 | 1 | Adrian Georgescu | } |
| 301 | 1 | Adrian Georgescu | } else { |
| 302 | 1 | Adrian Georgescu | # In-dialog SUBSCRIBE |
| 303 | 1 | Adrian Georgescu | if (uri=="sip:presence@10.0.0.1" || uri=="sip:rls@10.0.0.1" || !loose_route()) { |
| 304 | 1 | Adrian Georgescu | # Internal presence handling |
| 305 | 1 | Adrian Georgescu | if (t_newtran()) { |
| 306 | 1 | Adrian Georgescu | rls_handle_subscribe(); |
| 307 | 1 | Adrian Georgescu | if ($retcode==5) { |
| 308 | 1 | Adrian Georgescu | handle_subscribe(); |
| 309 | 1 | Adrian Georgescu | } |
| 310 | 1 | Adrian Georgescu | t_release(); |
| 311 | 1 | Adrian Georgescu | } else { |
| 312 | 1 | Adrian Georgescu | sl_reply_error(); |
| 313 | 1 | Adrian Georgescu | } |
| 314 | 1 | Adrian Georgescu | exit; |
| 315 | 1 | Adrian Georgescu | } |
| 316 | 1 | Adrian Georgescu | } |
| 317 | 1 | Adrian Georgescu | } else { |
| 318 | 1 | Adrian Georgescu | xlog("L_INFO", "Method $rm Not Acceptable Here"); |
| 319 | 1 | Adrian Georgescu | sl_send_reply("488", "Not Acceptable Here"); |
| 320 | 1 | Adrian Georgescu | exit; |
| 321 | 1 | Adrian Georgescu | }; |
| 322 | 1 | Adrian Georgescu | } |
| 323 | 1 | Adrian Georgescu | }}} |
| 324 | 1 | Adrian Georgescu | |
| 325 | 9 | Adrian Georgescu | = Starting the server = |
| 326 | 1 | Adrian Georgescu | |
| 327 | 1 | Adrian Georgescu | For non Debian systems copy openxcap, soap-simple-proxy and opensips-mi-proxy startup scripts from their debian directory present in each tar file to /etc/init.d/ and edit them to match your system. |
| 328 | 1 | Adrian Georgescu | |
| 329 | 1 | Adrian Georgescu | Start OpenXCAP server: |
| 330 | 1 | Adrian Georgescu | |
| 331 | 1 | Adrian Georgescu | {{{ |
| 332 | 1 | Adrian Georgescu | /etc/init.d/openxcap start |
| 333 | 1 | Adrian Georgescu | }}} |
| 334 | 1 | Adrian Georgescu | |
| 335 | 6 | Adrian Georgescu | You can also start OpenXCAP in no fork mode, which is useful to debug the configuration. This will not put the server in the background and will log its messages in the console where it was started: |
| 336 | 6 | Adrian Georgescu | |
| 337 | 6 | Adrian Georgescu | {{{ |
| 338 | 6 | Adrian Georgescu | adigeo@ag-imac3:~/work/openxcap$sudo ./openxcap --no-fork |
| 339 | 6 | Adrian Georgescu | Starting OpenXCAP 1.2.0 |
| 340 | 6 | Adrian Georgescu | Listening on: 0.0.0.0:80 |
| 341 | 6 | Adrian Georgescu | XCAP root: http://xcap.example.com/xcap-root |
| 342 | 6 | Adrian Georgescu | xcap.server.HTTPFactory starting on 80 |
| 343 | 6 | Adrian Georgescu | }}} |
| 344 | 6 | Adrian Georgescu | |
| 345 | 1 | Adrian Georgescu | Start opensips-mi-proxy: |
| 346 | 1 | Adrian Georgescu | |
| 347 | 1 | Adrian Georgescu | {{{ |
| 348 | 1 | Adrian Georgescu | /etc/init.d/opensips-mi-proxy start |
| 349 | 1 | Adrian Georgescu | }}} |
| 350 | 1 | Adrian Georgescu | |
| 351 | 1 | Adrian Georgescu | Start soap-simple-proxy: |
| 352 | 1 | Adrian Georgescu | |
| 353 | 1 | Adrian Georgescu | {{{ |
| 354 | 1 | Adrian Georgescu | /etc/init.d/soap-simple-proxy start |
| 355 | 1 | Adrian Georgescu | }}} |
| 356 | 1 | Adrian Georgescu | |
| 357 | 12 | Adrian Georgescu | Start opensips-mi-proxy |
| 358 | 12 | Adrian Georgescu | |
| 359 | 12 | Adrian Georgescu | {{{ |
| 360 | 12 | Adrian Georgescu | /etc/init.d/opensips-mi-proxy start |
| 361 | 12 | Adrian Georgescu | }}} |
| 362 | 12 | Adrian Georgescu | |
| 363 | 1 | Adrian Georgescu | OpenXCAP logs its messages to /var/log/openxcap/. All other servers log their messages to the system syslog. Check the log files for any startup or runtime errors. |
| 364 | 1 | Adrian Georgescu | |
| 365 | 10 | Adrian Georgescu | = Accounts = |
| 366 | 1 | Adrian Georgescu | |
| 367 | 1 | Adrian Georgescu | The accounts used for authentication of XCAP requests are stored in OpenSIPS subscriber table. You can add subscribers by using your favorite OpenSIPS subscriber management tool. Check the following script that can be used to add manually account to opensips subscriber table: |
| 368 | 7 | Adrian Georgescu | |
| 369 | 11 | Adrian Georgescu | [browser:scripts/add-openxcap-user.py] |