! \brief moves the uri to destination for all branches and * all uris are set to given uri */
| 583 | /*! \brief moves the uri to destination for all branches and |
| 584 | * all uris are set to given uri */ |
| 585 | int 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 | |
| 615 | static inline int _branch_2_msg(struct dset_ctx *dsct, |