When activating this plugin, and new REFER is received, if you don't implement sip_refer/2 callback function, NkSIP will process the request automatically:
- It will call sip_refer/3 in your callback module, and you must decide to procceed with the REFER or not.
- If you reply
true
, a new INVITE is sent to the referred address, and NkSIP starts calling sip_refer_update/3 in your callback module to make you know about the progress. - All received SUSBSCRIBE and NOTIFY requests belonging to the REFER are replied with a 200 OK automatically
None
None
process(nksip:request(), nksip:call()) ->
nksip:sipreply().
Use this function to process an incoming REFER manually (for example if you implement sip_refer/2).
You can implement any of these callback functions in your Service callback module.
sip_refer(ReferTo::nksip:uri(), Req::nksip:request(), Call::nksip:call()) ->
boolean().
Called when a REFER request arrives. Reply true
to continue the processing of the plugin or false
to reply with a 403 Forbidden
sip_refer_update(SubsId, Status, Call) ->
ok
when SubsId :: nksip:handle(),
Status :: init | active | {notify, binary()} | terminated,
Call :: nksip:call().
Called when a REFER event is received.
See refer_test.erl for examples