| 2579 | } |
| 2580 | |
| 2581 | static int |
| 2582 | unforce_rtp_proxy_f(struct sip_msg* msg, nh_set_param_t *pset, pv_spec_t *var) |
| 2583 | { |
| 2584 | int ret = -1; |
| 2585 | struct rtpp_args args; |
| 2586 | |
| 2587 | if (!msg || msg == FAKED_REPLY) |
| 2588 | return 1; |
| 2589 | |
| 2590 | memset(&args, 0, sizeof args); |
| 2591 | |
| 2592 | if (get_callid(msg, &args.callid) == -1 || args.callid.len == 0) { |
| 2593 | LM_ERR("can't get Call-Id field\n"); |
| 2594 | return -1; |
| 2595 | } |
| 2596 | args.to_tag.s = 0; |
| 2597 | if (get_to_tag(msg, &args.to_tag) == -1) { |
| 2598 | LM_ERR("can't get To tag\n"); |
| 2599 | return -1; |
| 2600 | } |
| 2601 | if (get_from_tag(msg, &args.from_tag) == -1 || args.from_tag.len == 0) { |
| 2602 | LM_ERR("can't get From tag\n"); |
| 2603 | return -1; |
| 2604 | } |
| 2605 | |
| 2606 | if (nh_lock) { |
| 2607 | lock_start_read( nh_lock ); |
| 2608 | } |
| 2609 | |
| 2610 | args.set = get_rtpp_set(pset); |
| 2611 | if (!args.set) { |
| 2612 | LM_ERR("could not find rtpproxy set\n"); |
| 2613 | goto end; |
| 2614 | } |
| 2615 | |
| 2616 | args.node = select_rtpp_node(msg, args.callid, args.set, var, 1); |
| 2617 | if (!args.node) { |
| 2618 | LM_ERR("no available proxies\n"); |
| 2619 | goto end; |
| 2620 | } |
| 2621 | |
| 2622 | ret = unforce_rtpproxy(msg, &args, var); |
| 2623 | |
| 2624 | end: |
| 2625 | if (nh_lock) { |
| 2626 | lock_stop_read( nh_lock ); |
| 2627 | } |
| 2628 | |
| 2629 | return ret; |
| 2630 | } |
| 2631 | |
| 2632 | static int unforce_rtpproxy(struct sip_msg* msg, struct rtpp_args *args, pv_spec_t *var) |
| 2633 | { |
nothing calls this directly
no test coverage detected