| 392 | |
| 393 | |
| 394 | int update_presentity(struct sip_msg* msg, presentity_t* presentity, |
| 395 | int* sent_reply) |
| 396 | { |
| 397 | // static db_ps_t my_ps_insert = NULL, my_ps_update_no_body = NULL, |
| 398 | // my_ps_update_body = NULL; |
| 399 | // static db_ps_t my_ps_delete = NULL, my_ps_query = NULL; |
| 400 | db_key_t query_cols[13], update_keys[8], result_cols[1]; |
| 401 | db_op_t query_ops[13]; |
| 402 | db_val_t query_vals[13], update_vals[8]; |
| 403 | int n_query_cols = 0; |
| 404 | int n_update_cols = 0; |
| 405 | str notify_body = {NULL, 0}; |
| 406 | str* rules_doc= NULL; |
| 407 | str pres_uri= {NULL, 0}; |
| 408 | pres_entry_t* p= NULL; |
| 409 | unsigned int hash_code; |
| 410 | unsigned int turn; |
| 411 | str body = presentity->body; |
| 412 | str *extra_hdrs = presentity->extra_hdrs; |
| 413 | db_res_t *result= NULL; |
| 414 | |
| 415 | *sent_reply= 0; |
| 416 | if(presentity->event->req_auth) |
| 417 | { |
| 418 | /* get rules_document */ |
| 419 | if(presentity->event->get_rules_doc(&presentity->user, |
| 420 | &presentity->domain, &rules_doc)) |
| 421 | { |
| 422 | LM_ERR("getting rules doc\n"); |
| 423 | goto error; |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | if(uandd_to_uri(presentity->user, presentity->domain, &pres_uri)< 0) |
| 428 | { |
| 429 | LM_ERR("constructing uri from user and domain\n"); |
| 430 | goto error; |
| 431 | } |
| 432 | |
| 433 | query_cols[n_query_cols] = &str_domain_col; |
| 434 | query_ops[n_query_cols] = OP_EQ; |
| 435 | query_vals[n_query_cols].type = DB_STR; |
| 436 | query_vals[n_query_cols].nul = 0; |
| 437 | query_vals[n_query_cols].val.str_val = presentity->domain; |
| 438 | n_query_cols++; |
| 439 | |
| 440 | query_cols[n_query_cols] = &str_username_col; |
| 441 | query_ops[n_query_cols] = OP_EQ; |
| 442 | query_vals[n_query_cols].type = DB_STR; |
| 443 | query_vals[n_query_cols].nul = 0; |
| 444 | query_vals[n_query_cols].val.str_val = presentity->user; |
| 445 | n_query_cols++; |
| 446 | |
| 447 | query_cols[n_query_cols] = &str_event_col; |
| 448 | query_ops[n_query_cols] = OP_EQ; |
| 449 | query_vals[n_query_cols].type = DB_STR; |
| 450 | query_vals[n_query_cols].nul = 0; |
| 451 | query_vals[n_query_cols].val.str_val = presentity->event->name; |
no test coverage detected