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

Function t_set_reason

modules/tm/t_fwd.c:615–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613static int _reason_avp_id = 0;
614
615int t_set_reason(struct sip_msg *msg, str *val)
616{
617 str avp_name = str_init("_reason_avp_internal");
618 int_str reason;
619
620 if (_reason_avp_id==0) {
621 if (parse_avp_spec( &avp_name, &_reason_avp_id) ) {
622 LM_ERR("failed to init the internal AVP\n");
623 return -1;
624 }
625 }
626
627 reason.s = *val;
628 if (add_avp( AVP_VAL_STR, _reason_avp_id, reason)!=0) {
629 LM_ERR("failed to add the internal reason AVP\n");
630 return -1;
631 }
632 return 1;
633}
634
635
636int t_add_reason(struct sip_msg *msg, str *reason)

Callers 2

tm_repl_cancelFunction · 0.85
t_add_reasonFunction · 0.85

Calls 2

parse_avp_specFunction · 0.85
add_avpFunction · 0.85

Tested by

no test coverage detected