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

Function msg_branch_uri2dset

dset.c:585–612  ·  view source on GitHub ↗

! \brief moves the uri to destination for all branches and * all uris are set to given uri */

Source from the content-addressed store, hash-verified

583/*! \brief moves the uri to destination for all branches and
584 * all uris are set to given uri */
585int msg_branch_uri2dset( str *new_uri )
586{
587 struct dset_ctx *dsct = get_dset_ctx();
588 struct msg_branch *branch;
589 unsigned int b;
590
591 /* no branches have been added yet */
592 if (!dsct)
593 return 0;
594
595 if (new_uri->len+1 > MAX_URI_SIZE) {
596 LM_ERR("new uri too long (%d)\n",new_uri->len);
597 return -1;
598 }
599
600 for (b = 0; b < dsct->nr_branches; b++) {
601 branch = &(dsct->branches[b].branch);
602 /* move uri to dst */
603 memcpy(branch->dst_uri.s, branch->uri.s, branch->uri.len + 1);
604 branch->dst_uri.len = branch->uri.len;
605 /* set new uri */
606 memcpy(branch->uri.s, new_uri->s, new_uri->len);
607 branch->uri.len = new_uri->len;
608 branch->uri.s[new_uri->len] = '\0';
609 }
610
611 return 0;
612}
613
614
615static inline int _branch_2_msg(struct dset_ctx *dsct,

Callers 1

t_replicateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected