static int w_pres_auth_status(struct sip_msg *_msg, char *_sp1, char *_sp2) { str watcher_uri, presentity_uri; if(fixup_get_svalue(_msg, (gparam_t *)_sp1, &watcher_uri) != 0) { LM_ERR("invalid watcher uri parameter"); return -1; } if(fixup_get_svalue(_msg, (gparam_t *)_sp2, &presentity_uri) != 0) { LM_ERR("invalid presentity uri parameter"); return -1; } if(watcher_uri.len == 0 || watcher_uri.s == NULL) { LM_ERR("missing watcher uri\n"); return -1; } if(presentity_uri.len == 0 || presentity_uri.s == NULL) { LM_DBG("missing presentity uri\n"); return -1; } return pres_auth_status(_msg, watcher_uri, presentity_uri); }
int ki_pres_auth_status(sip_msg_t* msg, str* watcher_uri, str* presentity_uri) { if(watcher_uri==NULL || presentity_uri==NULL) { LM_ERR("invalid parameters\n"); return -1; } return pres_auth_status(msg, *watcher_uri, *presentity_uri); }
static int w_pres_auth_status(struct sip_msg* _msg, char* _sp1, char* _sp2) { pv_spec_t *sp; pv_value_t pv_val; str watcher_uri, presentity_uri; sp = (pv_spec_t *)_sp1; if (sp && (pv_get_spec_value(_msg, sp, &pv_val) == 0)) { if (pv_val.flags & PV_VAL_STR) { watcher_uri = pv_val.rs; if (watcher_uri.len == 0 || watcher_uri.s == NULL) { LM_ERR("missing watcher uri\n"); return -1; } } else { LM_ERR("watcher pseudo variable value is not string\n"); return -1; } } else { LM_ERR("cannot get watcher pseudo variable value\n"); return -1; } sp = (pv_spec_t *)_sp2; if (sp && (pv_get_spec_value(_msg, sp, &pv_val) == 0)) { if (pv_val.flags & PV_VAL_STR) { presentity_uri = pv_val.rs; if (presentity_uri.len == 0 || presentity_uri.s == NULL) { LM_DBG("missing presentity uri\n"); return -1; } } else { LM_ERR("presentity pseudo variable value is not string\n"); return -1; } } else { LM_ERR("cannot get presentity pseudo variable value\n"); return -1; } return pres_auth_status(_msg, watcher_uri, presentity_uri); }