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

Function mi_script_handle_sync_response

modules/mi_script/mi_script.c:461–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461static int mi_script_handle_sync_response(struct sip_msg *msg,
462 mi_response_t *resp, pv_spec_p r)
463{
464 int ret, release;
465 char *res = NULL;
466
467 ret = mi_script_handle_response(resp, (r?&res:NULL), &release);
468
469 if (r) {
470 pv_value_t val;
471
472 if (res) {
473 val.rs.s = res;
474 val.rs.len = strlen(res);
475 val.flags = PV_VAL_STR;
476 } else {
477 val.rs.s = NULL;
478 val.rs.len = 0;
479 val.flags = PV_VAL_NULL;
480 }
481
482 if (pv_set_value(msg, r, 0, &val) < 0)
483 ret = -3;
484 }
485
486 if (release)
487 cJSON_PurgeString(res);
488 return ret;
489}
490
491static int mi_script_func(struct sip_msg *msg, str *m,
492 pv_spec_p r, pv_spec_p p, pv_spec_p v)

Callers 1

mi_script_funcFunction · 0.85

Calls 3

pv_set_valueFunction · 0.85
cJSON_PurgeStringFunction · 0.85

Tested by

no test coverage detected