add: if ((_d->hooks.request_uri) && (_d->hooks.request_uri->s) && (_d->hooks.request_uri->len)) { _d->hooks.ru.s = _d->hooks.request_uri->s; _d->hooks.ru.len = _d->hooks.request_uri->len; _d->hooks.request_uri = &_d->hooks.ru; get_raw_uri(_d->hooks.request_uri); } if ((_d->hooks.next_hop) && (_d->hooks.next_hop->s) && (_d->hooks.next_hop->len)) { _d->hooks.nh.s = _d->hooks.next_hop->s; _d->hooks.nh.len = _d->hooks.next_hop->len; _d->hooks.next_hop = &_d->hooks.nh; get_raw_uri(_d->hooks.next_hop); }
context: static inline int calculate_hooks(dlg_t* _d){	str* uri;	struct sip_uri puri;	param_hooks_t hooks;	param_t* params;	if (_d->route_set) {		uri = &_d->route_set->nameaddr.uri;		if (parse_uri(uri->s, uri->len, &puri) < 0) {			LOG(L_ERR, "calculate_hooks(): Error while parsing URI\n");			return -1;		}		if (parse_params(&puri.params, CLASS_URI, &hooks, &params) < 0) {			LOG(L_ERR, "calculate_hooks(): Error while parsing parameters\n");			return -2;		}		free_params(params);				if (hooks.uri.lr) {			if (_d->rem_target.s) _d->hooks.request_uri = &_d->rem_target;			else _d->hooks.request_uri = &_d->rem_uri;			_d->hooks.next_hop = &_d->route_set->nameaddr.uri;			_d->hooks.first_route = _d->route_set;		} else {			_d->hooks.request_uri = &_d->route_set->nameaddr.uri;			_d->hooks.next_hop = _d->hooks.request_uri;			_d->hooks.first_route = _d->route_set->next;			_d->hooks.last_route = &_d->rem_target;		}	} else {		if (_d->rem_target.s) _d->hooks.request_uri = &_d->rem_target;		else _d->hooks.request_uri = &_d->rem_uri;		_d->hooks.next_hop = _d->hooks.request_uri;	}	return 0;}