RFC5411 - A Hitchhiker's Guide to the Session Initiation Protocol (SIP) Offer/Answer Sessions Registration Scalability Interoperability Presence Capabilities IM
greatly facilitates the development of robust and scalable server-side SIP applications like proxy, registrar, redirect or outbound servers, B2BUAs, SBCs or load generators. NkSIP takes care of much of the SIP complexity, while allowing full access to requests and responses.
sip_route(_scheme, _user, @domain, req, _call) do {:ok, ruri} = :nksip_request.meta(:ruri, req) case :nksip_gruu.registrar_find(:router, ruri) do [] -> {:reply, :temporarily_unavailable} uriList -> {:proxy, uriList, [:record_route]} end end def sip_route(_scheme, _user, _domain, req, _call) do case :nksip_request.is_local_ruri(req) do true -> :process false -> {:proxy, :ruri, [:record_route]} end end
method do :REGISTER -> case :lists.member(:dialog, auth) || :lists.member(:register, auth) do true -> :ok false -> case :nksip_lib.get_value({:digest, @domain}, auth) do true -> :ok # Password is valid false -> :forbidden # User has failed authentication :undefined -> {:proxy_authenticate, @domain} end end _ -> :ok end end def sip_get_user_pass(_user, @domain, _req, _call) do "1234" end
App Server 2.Client requests temporary credentials from App Server 3.App Server provides client with temporary credentials 4.Client uses temporary credentials to connect with Third-party Service 5.Third-party service confirms the credentials and allows the connection 1. 2. 3. 4. 5.