MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / ops_sql_api_delete

Function ops_sql_api_delete

modules/sqlops/sqlops_impl.c:916–937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

914
915
916int ops_sql_api_delete(struct db_url *url, struct sip_msg* msg,
917 str *table, str *filter)
918{
919 cJSON *Jcols = NULL, *Jfilter;
920 int ret;
921
922 ret = _parse_json_col_and_filter( NULL, filter, &Jcols, &Jfilter);
923 if (ret<0) {
924 LM_ERR("failed to JSON parse cols and filter\n");
925 } else {
926 ret = sql_api_delete( url, msg, table, Jfilter);
927 if (ret<0) {
928 LM_ERR("failed to perform DB insert query\n");
929 } else {
930 ret =1;
931 }
932 }
933
934 if (Jcols) cJSON_Delete(Jcols);
935 if (Jfilter) cJSON_Delete(Jfilter);
936 return ret;
937}
938
939
940int ops_sql_api_replace(struct db_url *url, struct sip_msg* msg, str *table,

Callers 1

w_sql_deleteFunction · 0.85

Calls 3

sql_api_deleteFunction · 0.85
cJSON_DeleteFunction · 0.50

Tested by

no test coverage detected