| 2810 | } |
| 2811 | |
| 2812 | static void engage_close_callback(struct dlg_cell *dlg, int type, |
| 2813 | struct dlg_cb_params *_params) |
| 2814 | { |
| 2815 | int_str value; |
| 2816 | struct rtpp_args args; |
| 2817 | static nh_set_param_t param; |
| 2818 | int val_type; |
| 2819 | |
| 2820 | if (!dlg || !_params) |
| 2821 | return; |
| 2822 | LM_DBG("engage close called\n"); |
| 2823 | |
| 2824 | if (dlg_api.fetch_dlg_value(dlg, ¶m3_name, &val_type, &value, 0) < 0) { |
| 2825 | LM_DBG("third param not found\n"); |
| 2826 | param.v.int_set = default_rtpp_set_no; |
| 2827 | } else { |
| 2828 | param.v.int_set = *(int *)(value.s.s); |
| 2829 | } |
| 2830 | param.t = NH_VAL_SET_UNDEF; |
| 2831 | args.callid = dlg->callid; |
| 2832 | args.from_tag = dlg->legs[DLG_CALLER_LEG].tag; |
| 2833 | args.to_tag = dlg->legs[callee_idx(dlg)].tag; |
| 2834 | |
| 2835 | if (nh_lock) { |
| 2836 | lock_start_read( nh_lock ); |
| 2837 | } |
| 2838 | |
| 2839 | args.set = get_rtpp_set(¶m); |
| 2840 | if (!args.set) { |
| 2841 | LM_ERR("could not find rtpproxy set\n"); |
| 2842 | goto end; |
| 2843 | } |
| 2844 | |
| 2845 | args.node = select_rtpp_node(_params->msg, args.callid, |
| 2846 | args.set, NULL, 1); |
| 2847 | if (!args.node) { |
| 2848 | LM_ERR("no available proxies\n"); |
| 2849 | goto end; |
| 2850 | } |
| 2851 | |
| 2852 | if (unforce_rtpproxy(_params->msg, &args, NULL) < 0) |
| 2853 | LM_ERR("cannot unforce rtp proxy\n"); |
| 2854 | end: |
| 2855 | if (nh_lock) { |
| 2856 | lock_stop_read( nh_lock ); |
| 2857 | } |
| 2858 | } |
| 2859 | |
| 2860 | /* moves parameters from branch avps to dialog values |
| 2861 | * returns the values moved |
nothing calls this directly
no test coverage detected