Skip to content

Latest commit

 

History

History
177 lines (89 loc) · 5.7 KB

ersip_proxy.md

File metadata and controls

177 lines (89 loc) · 5.7 KB

Module ersip_proxy

Data Types


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()}

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()]}

Function Index

cancel/1
forward_to/2Forward request to selected target.
new_stateful/2New stateful proxy request.
timer_fired/2
trans_finished/2
trans_result/3

Function Details

cancel/1


cancel(Stateful::stateful()) -> stateful_result()

forward_to/2


forward_to(Target::Target | [Target], Stateful::stateful()) -> stateful_result()

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/2


new_stateful(SipMsg::ersip_sipmsg:sipmsg(), ProxyOptions::options()) -> stateful_result()

New stateful proxy request.

timer_fired/2


trans_finished/2


trans_finished(BranchKey::internal_trans_id(), Stateful::stateful()) -> stateful_result()

trans_result/3


trans_result(BranchKey::internal_trans_id(), SipMsg0::ersip_sipmsg:sipmsg(), Stateful::stateful()) -> stateful_result()