int alias_db_find(struct sip_msg* _msg, str table, char* _in, char* _out, char* flags) { pv_value_t val; struct sip_uri puri; /* get the input value */ if (pv_get_spec_value(_msg, (pv_spec_t*)_in, &val)!=0) { LM_ERR("failed to get PV value\n"); return -1; } if ( (val.flags&PV_VAL_STR)==0 ) { LM_ERR("PV vals is not string\n"); return -1; } if (parse_uri(val.rs.s, val.rs.len, &puri)<0) { LM_ERR("failed to parse uri %.*s\n",val.rs.len,val.rs.s); return -1; } return alias_db_query(_msg, table, &puri, (unsigned long)flags, set_alias_to_pvar, _out); }
int alias_db_lookup_ex(struct sip_msg* _msg, str table, unsigned long flags) { if (parse_sip_msg_uri(_msg) < 0) return -1; return alias_db_query(_msg, table, &_msg->parsed_uri, flags, set_alias_to_ruri, NULL); }
int alias_db_lookup(struct sip_msg* _msg, char* _table, char *flags) { if (parse_sip_msg_uri(_msg) < 0) return -1; return alias_db_query(_msg, _table, &_msg->parsed_uri,(unsigned long)flags, set_alias_to_ruri, NULL); }