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

Function build_cancel

modules/tm/t_cancel.c:151–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149
150
151char *build_cancel(struct cell *Trans,unsigned int branch,
152 unsigned int *len )
153{
154 str method = str_init(CANCEL);
155 str reason = str_init(CANCEL_REASON_200);
156 str *extra = NULL;
157
158 /* add the reason hdr, as per RFC 3326 */
159 if (is_invite(Trans) && Trans->uas.status==200) {
160 extra = &reason;
161 } else if (_extra_cancel_hdrs.s) {
162 extra = &_extra_cancel_hdrs;
163 }
164 return build_local( Trans, branch, &method, extra,
165 NULL /*reply*/ , len );
166 /* ^^^^ when CANCELing, there are 0 chances to have a reply stored into
167 * transaction ; set it NULL to avoid using the temporary stored reply
168 * (by t_should_relay_response) which may lead into races ( building the
169 * cancel versus handling a final response in a different process )*/
170}
171
172

Callers 1

cancel_branchFunction · 0.85

Calls 1

build_localFunction · 0.85

Tested by

no test coverage detected