check_rroute_fun() = fun((ersip_hdr_route:route()) -> boolean())
context_request_map() = #{ersip_branch:branch_key() => request_context()}
internal_trans_id() = any()
options() = #{no_validate => boolean(), allow => ersip_hdr_allow:allow(), supported => ersip_hdr_opttag_list:option_tag_list(), check_rroute_fun => check_rroute_fun(), record_route_uri => ersip_uri:uri(), timer_c => non_neg_integer(), pass_503 => boolean(), cancel_timeout => non_neg_integer()}
params() = ersip_proxy_common:proxy_params()
request_context() = #request_context{key = ersip_branch:branch_key(), req = ersip_request:request(), timer_c = reference() | undefined, resp = ersip_sipmsg:sipmsg() | undefined, timer_c_fired = boolean(), cancel_sent = boolean(), trans_finished = boolean(), pending_cancel = boolean()}
stateful() = #stateful{phase = stateful_phase(), options = params(), orig_sipmsg = ersip_sipmsg:sipmsg(), fwd_sipmsg = ersip_sipmsg:sipmsg() | undefined, req_map = context_request_map(), final_forwarded = boolean()}
stateful_phase() = init | select_target | collect | cancelled
stateful_result() = {stateful(), [ersip_proxy_se:side_effect()]}
cancel/1 | |
forward_to/2 | Forward request to selected target. |
new_stateful/2 | New stateful proxy request. |
timer_fired/2 | |
trans_finished/2 | |
trans_result/3 |
cancel(Stateful::stateful()) -> stateful_result()
forward_to(Target::Target | [Target], Stateful::stateful()) -> stateful_result()
Target = ersip_uri:uri() | {ersip_uri:uri(), ersip_branch:branch()}
Forward request to selected target. If list of URIs is specified then all requests are forwarded simultaneously (forked). Caller may specify branch for each target by using tuple {URI, Branch}.
If branch is not specified then it is selected randomly generated from ?DEFAULT_BRANCH_ENTROPY random bytes.
new_stateful(SipMsg::ersip_sipmsg:sipmsg(), ProxyOptions::options()) -> stateful_result()
New stateful proxy request.
timer_fired(X1::ersip_proxy_se:timer_event(), Stateful::stateful()) -> stateful_result()
trans_finished(BranchKey::internal_trans_id(), Stateful::stateful()) -> stateful_result()
trans_result(BranchKey::internal_trans_id(), SipMsg0::ersip_sipmsg:sipmsg(), Stateful::stateful()) -> stateful_result()