| 3557 | |
| 3558 | |
| 3559 | static int pv_set_msg_branch(struct sip_msg* msg, pv_param_t *param, |
| 3560 | int op, pv_value_t *val) |
| 3561 | { |
| 3562 | struct msg_branch branch; |
| 3563 | |
| 3564 | if (msg==NULL || param==NULL) { |
| 3565 | LM_ERR("bad parameters\n"); |
| 3566 | return -1; |
| 3567 | } |
| 3568 | |
| 3569 | if (!val || !(val->flags&PV_VAL_STR) || val->flags&(PV_VAL_NULL) || |
| 3570 | val->rs.len==0 ) { |
| 3571 | LM_ERR("str value required to create a new branch\n"); |
| 3572 | return -1; |
| 3573 | } |
| 3574 | |
| 3575 | memset( &branch, 0, sizeof branch); |
| 3576 | branch.uri = val->rs; |
| 3577 | branch.q = Q_UNSPECIFIED; |
| 3578 | if (append_msg_branch( &branch )!=1){ |
| 3579 | LM_ERR("failed to append new branch\n"); |
| 3580 | return -1; |
| 3581 | } |
| 3582 | |
| 3583 | return 0; |
| 3584 | } |
| 3585 | |
| 3586 | |
| 3587 | static int _int_pv_set_branch_fields(struct sip_msg* msg, pv_param_t *param, |
nothing calls this directly
no test coverage detected