* init module function */
| 243 | * init module function |
| 244 | */ |
| 245 | static int mod_init(void) |
| 246 | { |
| 247 | bind_presence_t bind_presence; |
| 248 | presence_api_t pres; |
| 249 | bind_pua_t bind_pua; |
| 250 | pua_api_t pua; |
| 251 | bind_libxml_t bind_libxml; |
| 252 | libxml_api_t libxml_api; |
| 253 | bind_xcap_t bind_xcap; |
| 254 | xcap_api_t xcap_api; |
| 255 | bind_xcap_client_t bind_xcap_client; |
| 256 | xcap_client_api_t xcap_client_api; |
| 257 | |
| 258 | LM_DBG("start\n"); |
| 259 | |
| 260 | contact_user.len = strlen(contact_user.s); |
| 261 | |
| 262 | if (presence_server.s) |
| 263 | presence_server.len = strlen(presence_server.s); |
| 264 | |
| 265 | /* load XCAP API */ |
| 266 | bind_xcap = (bind_xcap_t)find_export("bind_xcap", 0); |
| 267 | if (!bind_xcap) |
| 268 | { |
| 269 | LM_ERR("Can't bind xcap\n"); |
| 270 | return -1; |
| 271 | } |
| 272 | |
| 273 | if (bind_xcap(&xcap_api) < 0) |
| 274 | { |
| 275 | LM_ERR("Can't bind xcap\n"); |
| 276 | return -1; |
| 277 | } |
| 278 | rls_integrated_xcap_server = xcap_api.integrated_server; |
| 279 | db_url = xcap_api.db_url; |
| 280 | rls_xcap_table = xcap_api.xcap_table; |
| 281 | normalizeSipUri = xcap_api.normalize_sip_uri; |
| 282 | xcapParseUri = xcap_api.parse_xcap_uri; |
| 283 | xcapDbGetDoc = xcap_api.get_xcap_doc; |
| 284 | |
| 285 | if(!rls_integrated_xcap_server) |
| 286 | { |
| 287 | if(xcap_root== NULL) |
| 288 | { |
| 289 | LM_ERR("xcap_root parameter not set\n"); |
| 290 | return -1; |
| 291 | } |
| 292 | if(parse_xcap_root() < 0) |
| 293 | { |
| 294 | LM_ERR("wrong format for xcap_root parameter\n"); |
| 295 | return -1; |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | /* load SIGNALING API */ |
| 300 | if(load_sig_api(&rls_sigb)< 0) |
| 301 | { |
| 302 | LM_ERR("can't load signaling functions\n"); |
nothing calls this directly
no test coverage detected