Skip to content

Latest commit

 

History

History
79 lines (46 loc) · 1.95 KB

refer.md

File metadata and controls

79 lines (46 loc) · 1.95 KB

REFER Plugin

Name

nksip_refer

Description

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

Dependant Plugins

None

Configuration Values

Service configuration values

None

API functions

process/2

process(nksip:request(), nksip:call()) ->
    nksip:sipreply().

Use this function to process an incoming REFER manually (for example if you implement sip_refer/2).

Callback functions

You can implement any of these callback functions in your Service callback module.

sip_refer/3

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

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.

Examples

See refer_test.erl for examples