API
SIP.ReferServerContext
A SIP.ReferServerContext encapsulates the behavior required to receive a refer, as well as handle responses and retransmissions of that request. It is typically used from within a SIP.Session, but can be used on it’s own to send an out of dialog refer.
Construction
Typically, construction of a ReferServerContext is managed by a SIP.Session, through receiving a refer request. However, advanced users may construct ReferServerContexts manually.
new SIP.ReferServerContext(ua, request)
Parameters
| Name | Type | Description |
|---|---|---|
| ua | SIP.UA |
The user agent from which the request will be sent. |
request |
SIP.IncomingRequest |
Instance of the received SIP REFER request. |
Instance Methods
progress()
Send a progress message to the REFER request indicating that processing is happening on the REFER.
accept([options, modifiers])
Accept the REFER. Sends a 202 Accepted SIP message.
| Name | Type | Description |
|---|---|---|
options |
Object |
Optional Object with extra parameters (see below). |
options.inviteOptions |
Object |
Options Object with options to use on the INVITE sent by the referred (see ua.invite(...)). |
options.followRefer |
boolean |
boolean indicating whether SIP.js should try and follow the REFER. Default: true. |
reject([options])
Reject the REEFER. By default sends a 480 status code.
| Name | Type | Description |
|---|---|---|
options |
Object |
Optional Object with extra parameters (see below). |
options.statusCode |
Integer |
The status code to use for the SIP response to the refer. Default: 480. |
Events
referRequestAccepted
Fired after the REFER request is accepted.
on('referRequestAccepted', function (referServerContext) {})
| Name | Type | Description |
|---|---|---|
referServerContext |
SIP.ReferServerContext|This ReferServerContext |
referRequestRejected
Fired after the REFER request is rejected.
on('referRequestRejected', function (referServerContext) {})
| Name | Type | Description |
|---|---|---|
referServerContext |
SIP.ReferServerContext|This ReferServerContext |
referInviteSent
Fired after the INVITE generated by the REFER has been sent to the remote target.
on('referInviteSent', function (referServerContext) {})
| Name | Type | Description |
|---|---|---|
referServerContext |
SIP.ReferServerContext|This ReferServerContext |
referProgress
Fired when the INVITE from the REFER received a 1XX response, and a NOTIFY has been sent to the referrer.
on(referProgress, function(referServerContext) {})
| Name | Type | Description |
|---|---|---|
referServerContext |
SIP.ReferServerContext|This ReferServerContext |
referAccepted
Fired when the INVITE from the REFER has received a 2XX response and a NOTIFY has been sent to the referrer.
on('referAccepted', function (referServerContext) {})
| Name | Type | Description |
|---|---|---|
referServerContext |
SIP.ReferServerContext|This ReferServerContext |
referRejected
Fired when the INVITE from the REFER is rejected and a NOTIFY has been sent to the referrer.
on('referRejected', function (referServerContext) {})
| Name | Type | Description |
|---|---|---|
referServerContext |
SIP.ReferServerContext|This ReferServerContext |