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

Function update_msg_branch_dst_uri

dset.c:338–361  ·  view source on GitHub ↗

! \brief * Updates DST_URI of an already appended branch */

Source from the content-addressed store, hash-verified

336 * Updates DST_URI of an already appended branch
337 */
338int update_msg_branch_dst_uri(unsigned int idx, str *val)
339{
340 struct dset_ctx *dsct = get_dset_ctx();
341 struct msg_branch_wrap *br;
342
343 if (!dsct || !dsct->enabled || idx >= dsct->nr_branches)
344 return -1;
345
346 br = dsct->branches + idx;
347
348 if (ZSTRP(val)) {
349 br->branch.dst_uri.s = NULL;
350 br->branch.dst_uri.len = 0;
351 } else {
352 if (val->len > MAX_URI_SIZE - 1) {
353 LM_ERR("too long dst_uri: [%.*s]/%d\n", val->len, val->s,val->len);
354 return -1;
355 }
356 br->branch.dst_uri.s = br->dst_uri; /* internal buffer */
357 br->branch.dst_uri.len = val->len;
358 memcpy( br->branch.dst_uri.s, val->s, val->len);
359 }
360 return 0;
361}
362
363
364

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected