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

Function ops_sql_api_replace

modules/sqlops/sqlops_impl.c:940–961  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

938
939
940int ops_sql_api_replace(struct db_url *url, struct sip_msg* msg, str *table,
941 str *cols)
942{
943 cJSON *Jcols = NULL, *Jfilter;
944 int ret;
945
946 ret = _parse_json_col_and_filter( cols, NULL, &Jcols, &Jfilter);
947 if (ret<0) {
948 LM_ERR("failed to JSON parse cols and filter\n");
949 } else {
950 ret = sql_api_replace( url, msg, table, Jcols);
951 if (ret<0) {
952 LM_ERR("failed to perform DB replace query\n");
953 } else {
954 ret =1;
955 }
956 }
957
958 if (Jcols) cJSON_Delete(Jcols);
959 if (Jfilter) cJSON_Delete(Jfilter);
960 return ret;
961}
962
963
964int ops_async_sql_query(struct sip_msg* msg, async_ctx *ctx,

Callers 1

w_sql_replaceFunction · 0.85

Calls 3

sql_api_replaceFunction · 0.85
cJSON_DeleteFunction · 0.50

Tested by

no test coverage detected