web call server - call flow - flashphoner · sip server sip proxy-server, pbx, ims or other sip...

110
© 2017 Flashphoner, LLC Web Call Server 5 - Call Flow

Upload: hakien

Post on 20-Jul-2018

281 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

Web Call Server 5 - Call Flow

Page 2: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow2

© 2017 Flashphoner, LLC

0

Contents

Part I Terms and Definitions 5

Part II Methods and their parameters 7

................................................................................................................................... 71 Method types

................................................................................................................................... 92 The list of methods and their parameters

Part III Establishing and closing connection 22

................................................................................................................................... 221 Method - connect

................................................................................................................................... 222 Object - RestClientConfig

................................................................................................................................... 233 Establishing connection

.......................................................................................................................................................... 23Call flow

.......................................................................................................................................................... 27Error handling

................................................................................................................................... 304 Closing connection

Part IV SIP 34

................................................................................................................................... 341 SIP-status mapping

................................................................................................................................... 352 Calls

.......................................................................................................................................................... 35Outgoing call

......................................................................................................................................................... 35Call f low

......................................................................................................................................................... 41Error handling

.......................................................................................................................................................... 42Incoming call

......................................................................................................................................................... 42Call f low

......................................................................................................................................................... 47Error handling

.......................................................................................................................................................... 48Hanging up a call

.......................................................................................................................................................... 51Holding a call and stopping holding

.......................................................................................................................................................... 55Transferring a call

......................................................................................................................................................... 55Outgoing transfer

......................................................................................................................................................... 60Incoming transfer

......................................................................................................................................... 66Error handling

.......................................................................................................................................................... 67Sending DTMF

................................................................................................................................... 683 Messages

.......................................................................................................................................................... 68Outgoing message

......................................................................................................................................................... 68Call f low

......................................................................................................................................................... 72Error handling

.......................................................................................................................................................... 74Incoming message

......................................................................................................................................................... 74Call f low

......................................................................................................................................................... 77Error handling

.......................................................................................................................................................... 78Receiving messages via MSRP protocol

................................................................................................................................... 814 Subscribing to notifications, SIP subscribe method

.......................................................................................................................................................... 81Creating subscription

.......................................................................................................................................................... 83Terminating subscription

................................................................................................................................... 855 Sending XCAP request

Page 3: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

3

© 2017 Flashphoner, LLC

Part V Streaming video 88

................................................................................................................................... 881 Publishing a stream

.......................................................................................................................................................... 88Call flow

.......................................................................................................................................................... 91Error handling

................................................................................................................................... 932 Playing a stream

.......................................................................................................................................................... 93Call flow

.......................................................................................................................................................... 97Error handling

Part VI Data exchange 100

................................................................................................................................... 1011 Call flow

................................................................................................................................... 1032 Error handling

Part VII Error handling 105

Part VIII Sending bug reports 107

0

Page 4: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

IPart

Page 5: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

5Terms and Definitions

1 Terms and Definitions

Browser Client browsing application interacting with WCS.Synonyms: WCS JavaScript API, client, browser.

Call Flow A sequence of calls.

Media Audio and/or video traffic going through the WCS when connection is established.Synonyms: media, media data, media traffic, media session.

SIP Session Initiation Protocol RFC3261.

SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol.Synonyms: SIP provider, SIP server.

WCS Web Call Server 5.

Web Server The server WCS interacts with by the REST/HTTP protocol.Synonyms: REST, REST API, Web-server.

Method An invocation between Browser and WCS, or between WCS and Web Server.Synonyms: invocation, event, function.

Page 6: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

IIPart

Page 7: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

7Methods and their parameters

2 Methods and their parameters

2.1 Method types

All methods except the 'connect' method are divided onto three types based on the way they handleerrors occurring during interaction with the web-server:

Type I - Direct calls from WCS JavaScript API.Тип || - Events already happened that cannot be canceled by the web-server.Тип ||| - Incoming calls.

The 'connect' method is a special method that establishes connection and define the behavior of allsubsequent calls within the established connection.

Type I - Direct calls from WCS JavaScript API

Such call can be interrupted by the web-server:

call - an outgoing call can be prohibitedanswer - an answer to the call can be prohibitedhangup - a call can be banned from hanguphold - a call can be banned from putting on holdunhold - a call can be banned from unholdingtransfer - a call can be banned from transferringsendDTMF - sending DTMF can be bannedsendMessage - sending outgoing message can be bannedsendIMDN - sending delivery notification can be bannedsubscribe - SIP-subscription can be bannedsendXcapRequest - XCAP request sending can be banned

publishStream - publishing a stream can be bannedunpublishStream - unpublishing a stream can be bannedplayStream - playback of a stream can be bannedstopStream - stopping the playback of a stream can be banned

sendData - sending data can be bannedOnDataEvent - the web-server may not accept data

sendBugReport - bug-reports can be banned

Type II - Events already happened that cannot be canceled by the web-server

These calls cannot be interrupted by the web-server, as the corresponding event already happened onthe WCS side and web-server is merely informed about that.

ConnectionStatusEventRegistrationStatusEventCallStatusEventTransferStatusEvent

Page 8: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

8Methods and their parameters8

MessageStatusEventSubscriptionStatusEventXcapStatusEventStreamStatusEventDataStatusEventBugReportStatusEventStreamKeepAliveEvent

Type III - Incoming calls

Incoming calls can be interrupted by the web-server. If an incoming call was interrupted, WCS notifiesthe initiator of the call.

OnCallEvent - incoming callOnMessageEvent - Incoming messageOnTransferEvent - Incoming transfer

Action taken upon web-server interaction errors

An interaction error is when the web-server returns a status other than 200 OK, or another error thatprevents calling the web-server. Depending on the restOnError parameter in the restClientConfigconfiguration file and the type of the method, the following actions take place:

restOnError | - Direct calls II - Events III - Incoming calls

FAIL

Error is loggedExecution is abortedThe client is informedabout the error usingthe correspondingevent

Error is loggedExecution continuesThe client is informedabout the error usingthe ErrorEvent

Error is loggedExecution is abortedRespond with 403FORBIDDEN status tothe initiator of the callThe client is informedabout the error usingthe correspondingevent

LOGError is loggedExecution continues

Error is loggedExecution continues

Error is loggedExecution continues

Action taken upon other errors

In case SIP statuses 4xx, 5xx, 6xx are received or if other errors not related to REST occur, thecorresponding events are initiated with the FAILED status with the description in the 'info' field. Theseevents are sent to the web-server and then to the client in accordance with the rules of RestClientConfig.

For example, if during an outgoing call the SIP-server returns 403 FORBIDDEN, the web-server and theclient receive CallStatusEvent status='FAILED', info='SIP 403 FORBIDDEN', sipMessageRaw='originalSIP message'.

If the error cannot be categorized to any of the existing events, the ErrorEvent is initiated with thedescription of the error in the 'info' field.

Page 9: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

9Methods and their parameters

2.2 The list of methods and their parameters

The complete list of methods and parameters

Grey denotes parameters described above or below in the table.

Depending on the direction and destination of the call, different subsets of parameters for the sameinvocation can be used. For example, in case of the invocation of ConnectionStatusEvent, sipLogin,sipPassword, and othe corresponding parameters are passed. In case of an error, the same eventConnectionStatusEvent will have only two parameters: status and info when sending to a client, andstatus, info, nodeId, sessionId, appKey when sending to the Web-server.

connect Establishes connection with the WCS Server

urlServer This parameter is used by WCS JavaScript API to connect to theserver.

appKey This parameter passes the REST - URL for the given application toWCS. To view and add applications use the command lineinterface (CLI).

sipRegisterRequired If this parameter is true, registration on the SIP server is performedby invoking SIP REGISTER. If the parameter is false, registrationon the SIP server is not performed. In this case, a web pagecannot accept incoming SIP calls, but still can make outgoingcalls if the SIP server allows outgoing calls without SIPregistration.

sipLogin SIP login of a user

sipAuthenticationName SIP name of a user used for SIP authentication. Can be differentfrom sipLogin.

sipPassword SIP password. Used for SIP authentication.

sipVisibleName SIP user name displayed to other users receiving an incoming callfrom this user.

sipDomain SIP domain. FQDN or IP address.

sipOutboundProxy SIP proxy server. FQDN or IP address. Can be different fromsipDomain.

sipPort SIP port the SIP server uses to handle SIP traffic.

sipContactParams A string of custom parameters added to the SIP Connect header ofthe REGISTER query.

status

mediaProviders Array of available types of media on WCS JavaScript API:['WebRTC','Flash'].

restClientConfig A JSON-object describing web-server interaction controlconfiguration. If the object isn't passed, the default values are used.See also: RestClientConfig.

width Maximal video width, in pixels

Page 10: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

10Methods and their parameters10

height Maximal video height, in pixels

disconnect Disconnects from the WCS server

ConnectionStatusEvent Connection status change

sipRegisterRequired

sipLogin

sipPassword

sipVisibleName

sipDomain

sipOutboundProxy

sipPort

sipContactParams

status WCS Server connection status: PENDING, ESTABLISHED,FAILED, DISCONNECTED.

info Additional information can be added to this field. For example, ifstatus==FAILED, the info contains the description of the reason.

authToken A key being used in WCS JavaScript API for connection of Flashimplementation to WCS server using RTMFP protocol.

mediaProviders

nodeId

sessionId

appKey

RegistrationStatusEvent SIP registration status change

status Registration statuses: REGISTERED, UNREGISTERED, FAILED.

info

sipMessageRaw Original SIP-message with headers. SIP Response to theREGISTER Request.

nodeId

sessionId

appKey

call Outgoing call

callId Unique id of the call.

callee A callee in the SIP URI format, tel URI or a telephone number.

caller A caller in the SIP URI format.

Page 11: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

11Methods and their parameters

visibleName A label displayed to the callee.

hasVideo If true, this is a video call.

inviteParameters Parameters added to the SIP INVITE Request URI.

isMsrp If true, this is not a voice call, but establishing of MSRP-connectionto transmit data.

status

incoming If true, it is an incoming call from SIP side.

mediaProvider Media technology used on WCS JavaScript API, possible values:"WebRTC", "Flash".

sdp SDP, created on WCS JavaScript API side, will be placed whenmediaProvider is WebRTC

OnCallEvent Incoming call

callId `

callee

caller

visibleName

hasVideo

inviteParameters

sipMessageRaw SIP INVITE message the incoming call even is based upon.

incoming

status

mediaProvider

sdp

nodeId

sessionId

appKey

CallStatusEvent Call status change

callId

incoming If true, the call is incoming

status Call statuses: TRYING, RING, SESSION_PROGRESS, BUSY,ESTABLISHED, HOLD, FINISH, FAILED

info

sipMessageRaw Original message corresponding to the message being sent. Forexample, in case of TRYING, this would be SIP 100 TRYINGResponse, in case of ESTABLISHED this would SIP 200 OK

Page 12: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

12Methods and their parameters12

Response, and in case of HOLD this would be SIP 200 OKResponse to re-INVITE, and so on.

sipStatus Response status received from SIP side

caller

callee

hasVideo

visibleName

mediaProvider

nodeId

sessionId

appKey

answer Answer incoming call

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sdp

status

nodeId

sessionId

appKey

hangup Hangs up the call

callId

hasVideo

nodeId

sessionId

appKey

hold Puts the call on hold

callId

Page 13: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

13Methods and their parameters

hasVideo

nodeId

sessionId

appKey

unhold Unhold the call

callId

hasVideo

nodeId

sessionId

appKey

transfer Transfer the call

callId

target The number or the SIP URI of the subscriber the call is transferredto.

nodeId

sessionId

appKey

TransferStatusEvent Call transfer status change

callId

incoming If true, the transfer was initiated by the other side.

status Call transfer statuses: ACCEPTED, TRYING, COMPLETED,FAILED. If the status is not recognized, then status received fromSIP side will be passed.

info

sipMessageRaw

hasVideo

nodeId

sessionId

appKey

sendDTMF Sends DTMF signal

callId

dtmf A symbol to pass in DTMF as text: 1-16, *, #.

type The type of the DTMF signal: INFO, INFO_RELAY, RFC2833.

Page 14: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

14Methods and their parameters14

nodeId

sessionId

appKey

sendMessage Sends a message

id The unique id of the message.

from The number of the SIP URI of the sender.

to The number, the login or the SIP URI of the recipient.

body The text of the message.

contentType text/plain - the message is sent as SIP MESSAGE with the'Content-Type : text/plain' header and with text in the body of themessage.

message/cpim - the message is sent as SIP MESSAGE with the'Content-Type:message/cpim' header and a text/plain message inthe body of the CPIM-message.

multipart/mixed - the message is sent as SIP MESSAGE withthe 'Content-Type:multipart/mixed' header and CPIM messages inthe body, each one containing one text/plain message.

isImdnRequired If the flag is set to true, for message/cpim and multipart/mixedmessage types, the information asking for a delivery notification viaIMDN will be added to the body of the CPIM message.

recipients The list of recipients separated by commas. SIP URI, tel URI orSIP logins of recipients must be specified and separated bycommas. The field is used only if ContentType is set to multipart/mixed. This field works correctly only when the SIP-server supportssending messages to multiple subscribers based on multipart/mixed. WCS sends a multipart/mixed message with multiplerecipients to the SIP-server. If your SIP-server doesn't support suchsending, leave this field blank and try sending several individualmessages.

nodeId

sessionId

appKey

OnMessageEvent Incoming message

id

from

to

body

contentType

Page 15: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

15Methods and their parameters

isImdnRequired If the incoming message has this flag, an IMDN delivery notificationwill be sent.

sipMessageRaw A SIP MESSAGE message that corresponds to theOnMessageEvent event of the incoming message.

status

nodeId

sessionId

appKey

MessageStatusEvent Message status change

id

from

to

contentType

isImdnRequired

body

status Message statuses: RECEIVED, ACCEPTED, FAILED,IMDN_DELIVERED, IMDN_FAILED,IMDN_NOTIFICATION_SENT

info

sipMessageRaw SIP message corresponding to the status:

ACCEPTED - SIP 200 OK Response to SIP MESSAGE Request.

FAILED - SIP 4xx Response from the SIP-server.

DELIVERED - received a SIP MESSAGE delivery notification withthe status 'Delivered'.

DELIVERY_FAILED - received a delivery notification with thestatus 'Delivery Failed'.

nodeId

sessionId

appKey

sendIMDN Sends IMDN delivery notification

messageId

nodeId

sessionId

Page 16: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

16Methods and their parameters16

appKey

subscribe SIP subscribe - subscribe to notification of the SIP-server.RFC3265.

event Event type: reg

expires Time interval in seconds. During this interval the WCS-serverperforms re-SUBSCRIBE.

terminate

nodeId

sessionId

appKey

SubscriptionStatusEvent SIP-subscription status change

event

expires

terminate If true, the subscription should be deactivated

requestBody XML received from SIP side

status Subscription statuses: Active, Terminated

info

sipMessageRaw SIP message changing the status of the subscription:

Active - SIP 200 OK Response on SUBSCRIBE Request.

Terminated - SIP 200 OK Response on SUBSCRIBE Requestwith expires:0.

Terminated - SIP NOTIFY Request with the 'terminated' status inthe body of the NOTIFY message.

nodeId

sessionId

appKey

sendXcapRequest Send an XCAP request

url URL for the XCAP request

nodeId

sessionId

appKey

XcapStatusEvent Receiving XCAP response

url

Page 17: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

17Methods and their parameters

xcapResponse The body of the XCAP response

publishStream Publishing the stream to the server

name The name of the published stream. Must be unique. If a streamwith such name already published, the publishing of the stream isprohibited.

mediaSessionId Identifier of media session

published If true, the stream is being published

hasVideo If true, the stream has video

status

sdp SDP received from client

nodeId

sessionId

appKey

record If true, the published stream is being recorded

unpublishStream Unpublishing the stream

name

mediaSessionId

published

hasVideo

status

sdp

nodeId

sessionId

appKey

record

playStream Play the stream

name The name of the played stream.

mediaSession

published

hasVideo

status

sdp

nodeId

Page 18: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

18Methods and their parameters18

sessionId

appKey

stopStream Stop playback of the stream

name

mediaSessionId

published

hasVideo

status

sdp

nodeId

sessionId

appKey

StreamStatusEvent Stream status change

name

status Stream status: PUBLISHING, UNPUBLISHED, PLAYING,STOPPED

mediaSessionId

published

hasVideo

sdp

info

nodeId

sessionId

appKey

record

StreamKeepAliveEvent Stream keep-alive REST request

nodeId

appKey

sessionId

mediaSessionId

name

published

hasVideo

Page 19: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

19Methods and their parameters

status Stream status: PLAYING, PUBLISHING

info

mediaProvider Media technology used on WCS JavaScript API, possible values:"WebRTC", "Flash"

record

sendData Sends data

operationId Unique id of the data to send.

payload JSON object containing data.

nodeId

sessionId

appKey

OnDataEvent Receiving of input data

operationId

payload

nodeId

sessionId

appKey

DataStatusEvent Sent data status change

operationId

status ACCEPTED, FAILED

info

nodeId

sessionId

appKey

ErrorEvent Unclassified error

info Additional information about the error.

sendBugReport Sends an error report to save on the server

text Brief custom description of the error.

type If the type is no_media, the server enables traffic dump beforecreating a bug report to make sure the traffic goes properly for thatuser. Sending bug reports of this type can help diagnose problemswith sound going one side only.

nodeId

sessionId

Page 20: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

20Methods and their parameters20

appKey

BugReportStatusEvent Error report sending confirmation with the name of the saved file asthe output

filename The name of the file on the server where the bug report was saved.

nodeId

sessionId

appKey

Context Parameters Context parameters. Used for all calls from WCS to the Web-server.

nodeId Unique id of the WCS server instance.

sessionId Unique id of the client connect in that instance.

appKey Application id on the WCS server the user has establishedconnection with.

Page 21: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

IIIPart

Page 22: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

22Establishing and closing connection22

3 Establishing and closing connection

3.1 Method - connect

The 'connect' method works as follows:

When sending data to the web-server all fields are enabled.When a status other then 200 ОК is received from the web-server, or when an internal error occurs, anevent with the description of the error is sent to the client. The connection will be closed.The web-server rewrites the data received from WCS with its response.Rewriting the data involves the following fields: sipRegisterRequired, sipLogin, sipAuthenticationName,sipPassword, sipVisibleName, sipDomain, sipOutboundProxy, sipPort, sipContactParams, restClientConfig.

3.2 Object - RestClientConfig

During connection establishment the 200 OK response to the 'connect' method contains the JSONobject restClientConfig that defines behavior of all subsequent invocations regarding error handling,parameter overwrite and building the set of passed fields. If restClientConfig wasn't passed, the defaultvalues from the below table are used.

Name Description Default

clientExcludeThe list of parameter names divided by commas. Parametersin this list will not be passed to the client.

empty

restExcludeThe list of parameter names divided by commas. Parametersin this list will not be passed to the web-server.

empty

restOnErrorLOG, FAIL

See the detailed description in the Method types section.LOG

restPolicy

OVERWRITE, NOTIFY, DISABLED

OVERWRITE - fields listed in the restOverwrite field will beoverwritten by the response of the web-server.

NOTIFY - Sending of the request to the web-server isperformed too, but no fields is overwritten.

DISABLED - The web-server isn't invoked, only data sent fromthe client are used.

NOTIFY

restOverwriteThe list of fields separated by commas. Fields from this listwill be overwritten if the restPolicy:'OVERWRITE' is enabled.

empty

Here is an example of the restClientConfig. In this example, the config has only the'ConnectionStatusEvent' method. The same way other method can be described in the config. If amethod isn't described, the default values are used.

Page 23: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

23Establishing and closing connection

"restClientConfig":

{

"ConnectionStatusEvent":

{

"restExclude":"",

"clientExclude":"",

"restOnError":"LOG",

"restPolicy":"NOTIFY",

"restOverwrite":""

}

}

Interpreting the example:For the ConnectionStatusEvent method, the following settings are defined: restExclude, clientExclude,restOnError, restPolicy, restOverwrite.When this method is invoked, all fields are delivered to the Web-server, because restExclude="".When this method is invoked, all fields are delivered to the client as well, because clientExclude="".In case of errors when invoking the web-server, these error are logged, but not passed to the client. Atthe same time, a normal event ConnectionStatusEvent is passed to the client, because this event isType II. (see Method types).Even if the web-server returns new parameters, they are not overwritten, because ofrestPolicy:"NOTIFY".The restOverwrite field does not work here, because overwriting is disabled in restPolicy.

The same way restClientConfig can describe configuration of other invocations, such as: call,OnCallEvent, CallStatusEvent, sendMessage, OnMessageEvent, MessageStatusEvent, and so on.

3.3 Establishing connection

3.3.1 Call flow

Establishing connection with the WCS server and SIP registration (optionally)

This sequence starts with the WCS JavaScript API 'connect' method.

Page 24: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

24Establishing and closing connection24

Operations 7-11 are invoked only if the SIP is on and sipRegisterRequired=true. To enable SIP, at leastthe following three parameters must be passed : sipLogin, sipPassword, sipDomain. If at least one ofthese parameters wasn't passed, a connected user will work with WCS as with a stream video server,that is all SIP functions will be unavailable.

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. connect

urlServer

appKey

sipRegisterRequired

sipLogin

sipVisibleName

sipAuthenticationName

sipPassw ord

sipDomain

sipOutboundProxy

sipPort

sipContactParams

mediaProviders

Page 25: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

25Establishing and closing connection

status

2. connect

urlServer

sipRegisterRequired

sipLogin

sipVisibleName

sipAuthenticationName

sipPassw ord

sipDomain

sipOutboundProxy

sipPort

sipContactParams

mediaProviders

status

nodeId

sessionId

appKey

3. 200 OK

sipRegisterRequired

sipLogin

sipVisibleName

sipAuthenticationName

sipPassw ord

sipDomain

sipOutboundProxy

sipPort

sipContactParams

mediaProviders

status

restClientConfig

4.

ConnectionStatusEvent -

ESTABLISHED

sipRegisterRequired

sipLogin

sipVisibleName

sipAuthenticationName

sipPassw ord

sipDomain

sipOutboundProxy

sipPort

sipContactParams

mediaProviders

status

info

authToken

nodeId

sessionId

appKey

Page 26: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

26Establishing and closing connection26

5. 200 OK

sipRegisterRequired

sipLogin

sipVisibleName

sipAuthenticationName

sipPassw ord

sipDomain

sipOutboundProxy

sipPort

sipContactParams

mediaProviders

status

info

authToken

6.

ConnectionStatusEve

nt - ESTABLISHED

sipRegisterRequired

sipLogin

sipVisibleName

sipAuthenticationName

sipPassw ord

sipDomain

sipOutboundProxy

sipPort

sipContactParams

mediaProviders

status

info

authToken

9.

RegistrationStatusEvent

- REGISTERED

sipMessageRaw

status

info

nodeId

sessionId

appKey

10. 200 OK

sipMessageRaw

status

info

11.

RegistrationStatusEv

ent - REGISTERED

Page 27: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

27Establishing and closing connection

sipMessageRaw

status

info

3.3.2 Error handling

Web-server prohibits connection and sends back the 403 FORBIDDEN status

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. connect

urlServer

appKey

sipRegisterRequired

sipLogin

sipVisibleName

sipAuthenticationName

sipPassw ord

sipDomain

sipOutboundProxy

sipPort

sipContactParams

mediaProviders

status

Page 28: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

28Establishing and closing connection28

2. connect

urlServer

sipRegisterRequired

sipLogin

sipVisibleName

sipAuthenticationName

sipPassw ord

sipDomain

sipOutboundProxy

sipPort

sipContactParams

mediaProviders

status

nodeId

sessionId

appKey

3. 403 FORBIDDEN

4.

ConnectionStatusEvent -

FAILED

status

info

nodeId

sessionId

appKey

5. 200 OK

status

info

6.

ConnectionStatusEve

nt - FAILED

status

info

7.

ConnectionStatusEvent -

DISCONNECTED

status

info

nodeId

sessionId

appKey

8. 200 OK

status

info

Page 29: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

29Establishing and closing connection

9.

ConnectionStatusEve

nt - DISCONNECTED

status

info

An error occurs on the server preventing continuation of connection establishing

For example, if a non-existing application appKey is passed, WCS is unable to locate a correspondingapplication and returns ConnectionStatusEvent with the description of the error and the FAILED status.The same happens in case of other unpredictable errors occur while connecting.

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. connect

urlServer

appKey

sipRegisterRequired

sipLogin

sipVisibleName

sipAuthenticationName

sipPassw ord

sipDomain

sipOutboundProxy

sipPort

sipContactParams

mediaProviders

status

EXCEPTION

2. ConnectionStatusEvent -

FAILED

status

info

Page 30: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

30Establishing and closing connection30

3. ConnectionStatusEvent -

DISCONNECTED

status

info

3.4 Closing connection

The call flow when closing connection, or when connection is lost by a browser

A browser can close connection using WCS JavaScript API, for example if a user clicks the 'Logout'button. Also, a user can just close the browser window. Besides, a connection might be lost from user'sside. In such cases a disconnect is initiated on the WCS side and the session of this user is terminatedwith subsequent finishing actions on the side of the WCS server. Finishing actions are UNREGISTER(REGISTER with expires:0) and UNSUBSCRIBE (SUBSCRIBE with expires:0) if a user was registeredon the SIP server before or had SIP-subscription respectively.

Page 31: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

31Establishing and closing connection

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. disconnect

2. ConnectionStatusEvent

- DISCONNECTED

status

nodeId

sessionId

appKey

3. 200 OK

Page 32: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

32Establishing and closing connection32

6. RegistrationStatusEvent

- UNREGISTERED

status

sipMessageRaw

nodeId

sessionId

appKey

7. 200 OK

10.

SubscriptionStatusEvent -

TERMINATED - reg

event

expires

status

sipMessageRaw

nodeId

sessionId

appKey

11. 200 OK

14.

SubscriptionStatusEvent -

TERMINATED - presence

event

expires

status

sipMessageRaw

nodeId

sessionId

appKey

15. 200 OK

Page 33: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

IVPart

Page 34: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

34SIP34

4 SIP

This subsection describes all available functions to work with SIP: calls, messages, holding, transferring,DTMF and so on. To enable SIP, SIP parameters must be passed at the WCS server connectionestablishing step.

4.1 SIP-status mapping

The below table shows mapping of SIP-statuses and statuses the WCS server sends to a client in thecorresponding events.

Event SIP Status WCS Status

RegistrationStatusEvent

100 TRYING TRYING

200 OK on REGISTER with Expires> 0

REGISTERED

200 OK on REGISTER with Expires== 0

UNREGISTERED

4xx, 5xx, 6xx FAILED

CallStatusEvent

100 TRYING TRYING

180 RINGING RING

183 SESSION PROGRESS SESSION_PROGRESS

200 OK on INVITE ESTABLISHED

486 BUSY on INVITE BUSY

4xx, 5xx, 6xx FAILED

TransferStatusEvent

202 ACCEPTED on REFER ACCEPTED

200 OK on NOTIFY 100 TRYING TRYING

200 OK on NOTIFY 200 OK COMPLETED

4xx, 5xx, 6xx FAILED

MessageStatusEvent

100 TRYING TRYING

202 ACCEPTED on MESSAGE ACCEPTED

4xx, 5xx, 6xx FAILED

Inbound IMDN MESSAGE withDELIVERED

IMDN_DELIVERED

Inbound IMDN MESSAGE withDELIVERY FAILED

IMDN_FAILED

SubscriptionStatusEvent

100 TRYING TRYING

200 OK on SUBSCRIBE with Expires> 0

Active

Page 35: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

35SIP

Event SIP Status WCS Status

200 OK on SUBSCRIBE with Expires== 0

Terminated

4xx, 5xx, 6xx FAILED

4.2 Calls

4.2.1 Outgoing call

4.2.1.1 Call flow

Steps 5 - 16 are optional and depend on a SIP-server or a SIP-provider. Red denotes places wheretransmission of media data can start. An outgoing call starts from invoking the 'call' function on the sideof the WCS JavaScript API.

Page 36: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

36SIP36

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. call

callId

callee

caller

visibleName

status

incoming

mediaProvider

sdp

hasVideo

inviteParameters

Page 37: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

37SIP

isMsrp

2. call

callId

callee

caller

visibleName

status

incoming

mediaProvider

sdp

hasVideo

inviteParameters

isMsrp

nodeId

sessionId

appKey

3. 200 OK

callId

callee

caller

visibleName

status

incoming

mediaProvider

sdp

hasVideo

inviteParameters

isMsrp

6. CallStatusEvent - TRYING

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

7. 200 OK

callId

incoming

sipStatus

caller

callee

Page 38: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

38SIP38

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

8. CallStatusEvent -

TRYING

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

10. CallStatusEvent - RING

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

11. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

12. CallStatusEvent -

RING

Page 39: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

39SIP

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

14. CallStatusEvent -

SESSION_PROGRESS

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

15. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

16. CallStatusEvent -

SESSION_PROGRESS

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

Page 40: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

40SIP40

mediaProvider

sipMessageRaw

status

info

18. CallStatusEvent -

ESTABLISHED

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

19. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

20. CallStatusEvent -

ESTABLISHED

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

Page 41: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

41SIP

4.2.1.2 Error handling

Web-server prohibits continuing the call and returns the 403 FORBIDDEN status (restOnError =FAIL)

An error occurs while querying the web-server that doesn't allow to continue the call(restOnError = FAIL)

SIP-server returns an error status

Page 42: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

42SIP42

4.2.2 Incoming call

4.2.2.1 Call flow

An incoming call starts when SIP INVITE is received from the SIP-server. The OnCallEvent is passed toWCS JavaScript API. The user interface should display an incoming call with a sound signal. When theuser answers the call, WCS JavaScript API invokes the 'answer' method. This results in establishing thecall and sending of media traffic.

Page 43: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

43SIP

Parameters of the Call flow

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

2. OnCallEvent

callId

callee

caller

visibleName

status

incoming

mediaProvider

sdp

hasVideo

Page 44: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

44SIP44

nodeId

sessionId

appKey

3. 200 OK

callId

callee

caller

visibleName

status

incoming

mediaProvider

sdp

hasVideo

4. OnCallEvent

callId

callee

caller

visibleName

status

incoming

mediaProvider

sdp

hasVideo

6. CallStatusEvent - RING

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

7. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

Page 45: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

45SIP

status

info

8. CallStatusEvent -

RING

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

9. answer

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sdp

status

10. answer

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sdp

status

nodeId

sessionId

appKey

11. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

Page 46: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

46SIP46

mediaProvider

sdp

status

14. CallStatusEvent -

ESTABLISHED

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sdp

sipMessageRaw

status

info

nodeId

sessionId

appKey

15. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sdp

sipMessageRaw

status

info

16. CallStatusEvent -

ESTABLISHED

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sdp

sipMessageRaw

status

info

Page 47: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

47SIP

4.2.2.2 Error handling

Web-server prohibits the incoming call and returns the 403 FORBIDDEN status (restOnError =FAIL)

In this case WCS return the 403 FORBIDDEN status to the initiator of the call via the SIP protocol andinterrupts the incoming call.

An error occurs while querying the web-server that doesn't allow to accept the incoming call(restOnError = FAIL)

In this case the 403 FORBIDDEN status is returned to the SIP server.

Page 48: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

48SIP48

WCS returns the 4xx status, for instance, 486 BUSY HERE to the SIP server and does not allowto accept the incoming call

Example of this situation is when two users are talking, and another incoming call to one of them comesto the WCS server. WCS declines such a call as SIP 486 BUSY HERE. An even informing the clientabout the incoming call declined with the BUSY status is sent to the client.

4.2.3 Hanging up a call

A call ends with the execution of the hangup method on the side of WCS JavaScript API

B

R

O

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B1. hangup

Page 49: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

49SIP

W

S

E

R

S

E

R

V

E

R

2. hangup

callId

hasVideo

nodeId

sessionId

appKey

3. 200 OK

callId

hasVideo

6. CallStatusEvent - FINISH

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

7. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

8. CallStatusEvent -

FINISH

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

Page 50: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

50SIP50

status

info

nodeId

sessionId

appKey

A call can also hang up on the initiative of the SIP-server

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

3. CallStatusEvent - FINISH

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

4. 200 OK

Page 51: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

51SIP

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

5. CallStatusEvent -

FINISH

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

4.2.4 Holding a call and stopping holding

The call flow when putting a SIP call on hold and stopping holding the call.

We assume the call is successfully established and media traffic already goes. To put a call on hold,the 'hold' method is used on the side of WCS JavaScript API. Steps 1 - 8 describe the process of puttinga call on hold. Steps 9 - 16 describe releasing the call from hold and returning to the previous state whenthe call is established and media traffic goes.

Page 52: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

52SIP52

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. hold

callId

2. hold

callId

hasVideo

nodeId

sessionId

appKey

3. 200 OK

callId

Page 53: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

53SIP

hasVideo

6. CallStatusEvent - HOLD

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

7. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

8. CallStatusEvent -

HOLD

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

9. unhold

callId

10. unhold

callId

hasVideo

Page 54: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

54SIP54

nodeId

sessionId

appKey

11. 200 OK

callId

hasVideo

14. CallStatusEvent -

ESTABLISHED

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

15. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

16. CallStatusEvent -

ESTABLISHED

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

Page 55: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

55SIP

4.2.5 Transferring a call

4.2.5.1 Outgoing transfer

The call flow when transferring a SIP-call to another SIP client initiated by the browser (outtransfer)

A call must be put on hold before transferring. In the below example, a call is already in the HOLD statusand is ready for transfer. The example reviews a transfer of the call between three participants: Browser,SIP Client, SIP Client Transfer Target. Browser and SIP Client have a call established between them.Browser requests a transfer of the call. The aim of the transfer is to establish a call between SIP Clientand SIP Client Transfer Target. Therefore, Browser disconnects from the call and says the call must berouted bypassing it between SIP Client and SIP Client Transfer Target. There can be other WCS clientsin place of SIP Client and SIP Client Transfer Target.

Page 56: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

56SIP56

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. transfer

callId

target

2. transfer

callId

target

nodeId

sessionId

Page 57: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

57SIP

appKey

3. 200 OK

callId

target

6. TransferStatusEvent -

ACCEPTED

callId

incoming

hasVideo

status

info

sipMessageRaw

nodeId

sessionId

appKey

7. 200 OK

callId

incoming

hasVideo

status

info

sipMessageRaw

8.

TransferStatusEvent

- ACCEPTED

callId

incoming

hasVideo

status

info

sipMessageRaw

11. TransferStatusEvent -

TRYING

callId

incoming

hasVideo

status

info

sipMessageRaw

Page 58: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

58SIP58

nodeId

sessionId

appKey

12. 200 OK

callId

incoming

hasVideo

status

info

sipMessageRaw

13.

TransferStatusEvent

- TRYING

callId

incoming

hasVideo

status

info

sipMessageRaw

19. TransferStatusEvent -

COMPLETED

callId

incoming

hasVideo

status

info

sipMessageRaw

nodeId

sessionId

appKey

20. 200 OK

callId

incoming

hasVideo

status

info

sipMessageRaw

21.

TransferStatusEvent

- COMPLETED

Page 59: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

59SIP

callId

incoming

hasVideo

status

info

sipMessageRaw

24. CallStatusEvent - FINISH

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

25. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

26. CallStatusEvent -

FINISH

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

Page 60: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

60SIP60

4.2.5.2 Incoming transfer

The call flow when transferring a SIP call by initiative of the SIP client the call is establishedwith (in transfer)

In this case, the transfer of the call is initiated by the SIP Client, a browser established the call with.Directly before the transfer, a call is put on hold. After that, a request from the SIP Client to the transferof the call to the third subscriber, SIP Client Transfer Target, comes. As a result, the browserestablishes the call with SIP Client Transfer Target, and the call between Browser and SIP Сlient ends.Therefore this layout involves two different calls. The first one is callId = 'AAA' - the call that was in theHOLD state in the beginning. The second is callId='BBB' - a new call to SIP Client Transfer Target that iscreated as the result of transfer.

Page 61: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

61SIP

Page 62: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

62SIP62

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

2. OnTransferEvent -

PENDING

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

nodeId

sessionId

appKey

3. 200 OK

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

4. OnTransferEvent -

PENDING

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

6. TransferStatusEvent -

ACCEPTED

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

nodeId

sessionId

appKey

7. 200 OK

callId - 'AAA'

incoming - 'true'

hasVideo

target

Page 63: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

63SIP

status

info

8.

TransferStatusEvent

- ACCEPTED

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

11. TransferStatusEvent -

TRYING

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

nodeId

sessionId

appKey

12. 200 OK

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

13.

TransferStatusEvent

- TRYING

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

14. OnCallEvent

callId = 'BBB'

parentCallId = 'AAA'

callee

caller

visibleName

Page 64: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

64SIP64

status

incoming = 'false'

mediaProvider

hasVideo

nodeId

sessionId

appKey

15. 200 OK

callId = 'BBB'

parentCallId = 'AAA'

callee

caller

visibleName

status

incoming

mediaProvider

hasVideo

16. OnCallEvent

callId = 'BBB'

parentCallId = 'AAA'

callee

caller

visibleName

status

incoming

mediaProvider

hasVideo

20. CallStatusEvent -

ESTABLISHED

callId = 'BBB'

parentCallId = 'AAA'

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

nodeId

sessionId

appKey

21. 200 OK

callId = 'BBB'

parentCallId = 'AAA'

incoming

sipStatus

Page 65: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

65SIP

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

22. CallStatusEvent -

ESTABLISHED

callId = 'BBB'

parentCallId = 'AAA'

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

status

info

25. TransferStatusEvent -

COMPLETED

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

nodeId

sessionId

appKey

26. 200 OK

callId - 'AAA'

incoming - 'true'

hasVideo

target

status

info

27.

TransferStatusEvent

- COMPLETED

callId - 'AAA'

incoming - 'true'

hasVideo

target

Page 66: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

66SIP66

status

info

30. CallStatusEvent - FINISH

callId = 'BBB'

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

status

info

nodeId

sessionId

appKey

31. 200 OK

callId = 'BBB'

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

status

info

32. CallStatusEvent -

FINISH

callId = 'BBB'

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

status

info

4.2.5.2.1 Error handling

Web-server prohibits incoming transfer and returns SIP status 406 Not acceptable (restOnError= FAIL)

In this case WCS return 406 NOT ACCEPTABLE status to the initiator of the transfer via the SIPprotocol and interrupts the incoming transfer.

Page 67: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

67SIP

4.2.6 Sending DTMF

The call flow when sending a DTMF message from the browser

A DTMF message can be sent after the call is established. On the SIP-side, either SIP INFO orRFC2833 is used to send DTMF depending on the value of the 'type' parameter.

B

R

O

W

S

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

1. sendDTMF

callId

Page 68: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

68SIP68

E

R

dtmf R

V

E

R

2. sendDTMF

callId

dtmf

nodeId

sessionId

appKey

3. 200 OK

callId

dtmf

4.3 Messages

4.3.1 Outgoing message

4.3.1.1 Call flow

Sending a text message from a browser to SIP

Sending a message starts from invoking the sendMessage function at the side of the WCS JavaScriptAPI. Steps 9-13 are executed only if the flag message.isImdnRequired=true. In this case if the SIP-sidesupports the IMDN RFC 5438 specification, a special SIP delivery message comes. This message ispassed to the client as the MessageStatusEvent event with the DELIVERED status. If delivery wasproblematic, the MessageStatusEvent event is passed with the IMDN_FAILED status.

Page 69: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

69SIP

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. sendMessage

id

from

to

contentType

isImdnRequired

body

2. sendMessage

id

from

to

contentType

isImdnRequired

body

Page 70: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

70SIP70

nodeId

sessionId

appKey

3. 200 OK

id

from

to

contentType

isImdnRequired

body

5. MessageStatusEvent -

SENT

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

nodeId

sessionId

appKey

6. 200 OK

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

7.

MessageStatusEven

t - SENT

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

9. MessageStatusEvent -

Page 71: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

71SIP

ACCEPTED

id

isImdnRequired

sipMessageRaw

status

info

nodeId

sessionId

appKey

10. 200 OK

id

isImdnRequired

sipMessageRaw

status

info

11.

MessageStatusEven

t - ACCEPTED

id

isImdnRequired

sipMessageRaw

status

info

status

info

14. MessageStatusEvent -

IMDN_DELIVERED

id

from

to

contentType

isImdnRequired

sipMessageRaw

status

info

nodeId

sessionId

appKey

15. 200 OK

id

from

to

contentType

Page 72: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

72SIP72

isImdnRequired

sipMessageRaw

status

info

16.

MessageStatusEven

t - IMDN_DELIVERED

id

from

to

contentType

isImdnRequired

sipMessageRaw

status

info

4.3.1.2 Error handling

Web-server prohibits sending an outgoing message (restOnError = FAIL)

An error occurs when accessing the web-server that prevents sending an outgoing message

Page 73: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

73SIP

The SIP server returns an error status

The message wasn't delivered

Page 74: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

74SIP74

4.3.2 Incoming message

4.3.2.1 Call flow

An incoming message translates to the OnMessageEvent event. On steps 6-13 a delivery confirmationvia the sendIMDN method is performed.

Page 75: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

75SIP

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

2. OnMessageEvent -

RECEIVED

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

nodeId

sessionId

appKey

3. 200 OK

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

Page 76: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

76SIP76

status

info

4. OnMessageEvent

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

7. MessageStatusEvent -

IMDN_NOTIFICATION_SENT

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

nodeId

sessionId

appKey

8. 200 OK

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

9.

MessageStatusEven

t -

IMDN_NOTIFICATION_S

ENT

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

Page 77: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

77SIP

status

info

11. MessageStatusEvent -

ACCEPTED

id

isImdnRequired

sipMessageRaw

status

info

nodeId

sessionId

appKey

12. 200 OK

id

isImdnRequired

sipMessageRaw

status

info

13.

MessageStatusEven

t - ACCEPTED

id

isImdnRequired

sipMessageRaw

status

info

4.3.2.2 Error handling

Web-server prohibits acceptance of the incoming message (restOnError = FAIL)

Page 78: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

78SIP78

An error occurs on the WCS-server that doesn't allow to accept the incoming message(restOnError = FAIL)

4.3.3 Receiving messages via MSRP protocol

The call flow to receive incoming text messages to a browser from the SIP-side via MSRP

The MSRP protocol can be used to send long messages or a set of messages as a multipart/mixedmessage. A browser initiates a SIP call using the special flag isMSRP=true. WCS creates a SIP /MSRP session, accepts and parses messages and sends these messages to the client inOnMessageEvent.

Page 79: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

79SIP

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. call

callId

callee

hasVideo

visibleName

inviteParameters

isMsrp

2. call

callId

callee

hasVideo

visibleName

inviteParameters

isMsrp

nodeId

sessionId

Page 80: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

80SIP80

appKey

3. 200 OK

callId

callee

hasVideo

visibleName

inviteParameters

isMsrp

6. CallStatusEvent -

ESTABLISHED

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

isMsrp

status

info

nodeId

sessionId

appKey

7. 200 OK

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

isMsrp

status

info

8. CallStatusEvent

callId

incoming

sipStatus

caller

callee

hasVideo

visibleName

mediaProvider

sipMessageRaw

isMsrp

Page 81: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

81SIP

status

info

10. OnMessageEvent -

RECEIVED

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

nodeId

sessionId

appKey

11. 200 OK

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

12. OnMessageEvent

id

from

to

contentType

isImdnRequired

body

sipMessageRaw

status

info

4.4 Subscribing to notifications, SIP subscribe method

4.4.1 Creating subscription

The call flow to create a SIP subscription

This is subscription to events using the SIP subscribe method described in RFC 3265. Subscriptionstarts from invoking the 'subscribe' method on the side of the WCS JavaScript API.

Page 82: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

82SIP82

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. subscribe

event

expires

2. subscribe

event

expires

terminate

nodeId

sessionId

appKey

3. 200 OK

event

expires

terminate

6.

SubscriptionStatusEvent -

Active

event

expires

terminate

requestBody

sipMessageRaw

Page 83: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

83SIP

status

info

nodeId

sessionId

appKey

7. 200 OK

event

expires

terminate

requestBody

sipMessageRaw

status

info

8.

SubscriptionStatusE

vent - Active

event

expires

terminate

requestBody

sipMessageRaw

status

info

4.4.2 Terminating subscription

The call flow to terminate SIP subscribe subscription from the side of the SIP-server with theNOTIFY request

The SIP-server can initiate termination of SIP-subscription by sending the special SIP NOTIFY message.The way WCS reacts to such a message is shown below. WCS then terminates the subscription.Besides, the subscription can be terminated upon user disconnect.

Page 84: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

84SIP84

Parameters of the Call flow

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

3.

SubscriptionStatusEvent -

Terminated

event

expires

terminate

requestBody

sipMessageRaw

status

info

nodeId

sessionId

appKey

4. 200 OK

event

expires

terminate

requestBody

sipMessageRaw

status

info

5.

SubscriptionStatusE

vent - Terminated

Page 85: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

85SIP

event

expires

terminate

requestBody

sipMessageRaw

status

info

4.5 Sending XCAP request

The call flow when sending an XCAP request

An XCAP request can be used to retrieve additional information from a third-party HTTP server. Forexample, a third-party HTTP-server can return information about deferred messages that should befetched from the server via the MSRP protocol. For authentication of the XCAP request, SIP login andpassword passed during establishing of a connection are used. The XCAP request is executed on theside of the WCS server. The XCAP request supports DIGEST authentication. The response is sent to theclient in the XcapStatusEvent event. The client parses this response and retrieves the requestedinformation.

B

R

<<< IN OUT >>> W

C

<<< IN OUT >>> W

E

Page 86: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

86SIP86

O

W

S

E

R

1. sendXcapRequest

url

S B

S

E

R

V

E

R

2. sendXcapRequest

url

nodeId

sessionId

appKey

3. 200 OK

url

8. XcapStatusEvent - OK

url

responseBody

status

info

nodeId

sessionId

appKey

9. 200 OK

url

responseBody

status

info

10. XcapStatusEvent

- OK

url

responseBody

status

info

Page 87: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

VPart

Page 88: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

88Streaming video88

5 Streaming video

5.1 Publishing a stream

5.1.1 Call flow

Steps 1-6 show the process of publishing a video stream from a browser to the WCS-server. Steps 7-12show how to terminate publishing of this video stream.

B

R

O

W

S

E

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

1. publishStream

name

mediaSessionId

Page 89: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

89Streaming video

R published

hasVideo

status

sdp

record

R

V

E

R

2. publishStream

name

mediaSessionId

published

hasVideo

status

sdp

record

nodeId

sessionId

appKey

3. 200 OK

name

mediaSessionId

published

hasVideo

status

sdp

record

4. StreamStatusEvent -

PUBLISHING

name

mediaSessionId

published

hasVideo

sdp

record

status

info

nodeId

sessionId

appKey

5. 200 OK

name

mediaSessionId

published

hasVideo

sdp

record

status

info

6.

Page 90: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

90Streaming video90

StreamStatusEvent -

PUBLISHING

name

mediaSessionId

published

hasVideo

sdp

record

status

info

7. unpublishStream

name

8. unpublishStream

name

mediaSessionId

published

hasVideo

status

sdp

record

nodeId

sessionId

appKey

9. 200 OK

name

mediaSessionId

published

hasVideo

status

sdp

record

10. StreamStatusEvent -

UNPUBLISHED

name

mediaSessionId

published

hasVideo

sdp

record

status

info

nodeId

sessionId

appKey

11. 200 OK

Page 91: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

91Streaming video

name

mediaSessionId

published

hasVideo

sdp

record

status

info

12.

StreamStatusEvent -

UNPUBLISHED

name

mediaSessionId

published

hasVideo

sdp

record

status

info

5.1.2 Error handling

Web-server prohibits publication of the stream and returns the 403 FORBIDDEN status(restOnError = FAIL)

Page 92: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

92Streaming video92

An error occurs on the server that prevents publishing the stream (restOnError = FAIL)

Page 93: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

93Streaming video

Web-server prohibits publication of the stream in response to stream keep-alive request andreturns the 403 FORBIDDEN status (restOnError = FAIL)

5.2 Playing a stream

5.2.1 Call flow

Playing a stream is described with steps 1-6. Stopping the playback is described with steps 7-12. IfRTSP URL was passed as the name of the stream, a connection with the RTSP-server or the IP-camerais established, and the stream from this RTSP-server or camera is played in the browser.

Page 94: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

94Streaming video94

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. playStream

name

mediaSessionId

published

hasVideo

status

sdp

2. playStream

name

mediaSessionId

published

hasVideo

status

sdp

nodeId

sessionId

appKey

3. 200 OK

name

mediaSessionId

Page 95: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

95Streaming video

published

hasVideo

status

sdp

4. StreamStatusEvent -

PLAYING

name

mediaSessionId

published

hasVideo

sdp

status

info

nodeId

sessionId

appKey

5. 200 OK

name

mediaSessionId

published

hasVideo

sdp

status

info

6.

StreamStatusEvent -

PLAYING

name

mediaSessionId

published

hasVideo

sdp

status

info

7. stopStream

name

8. stopStream

name

mediaSessionId

published

hasVideo

status

sdp

nodeId

sessionId

Page 96: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

96Streaming video96

appKey

9. 200 OK

name

mediaSessionId

published

hasVideo

status

sdp

10. StreamStatusEvent -

STOPPED

name

mediaSessionId

published

hasVideo

sdp

status

info

nodeId

sessionId

appKey

11. 200 OK

name

mediaSessionId

published

hasVideo

sdp

status

info

12.

StreamStatusEvent -

STOPPED

name

mediaSessionId

published

hasVideo

sdp

status

info

Page 97: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

97Streaming video

5.2.2 Error handling

Web-server prohibits playing the stream and returns the 403 FORBIDDEN status (restOnError =FAIL)

An error occurs on the server that prevents to play the stream (restOnError = FAIL)

Page 98: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

98Streaming video98

Web-server prohibits playing the stream in response to stream keep-alive request and returnsthe 403 FORBIDDEN status (restOnError = FAIL)

Page 99: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

VIPart

Page 100: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

100Data exchange100

6 Data exchange

The call flow when doing data exchange

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. sendData

operationId

payload

2. OnDataEvent

operationId

payload

nodeId

sessionId

appKey

3. 200 OK

operationId

payload

4. DataStatusEvent -

ACCEPTED

Page 101: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

101Data exchange

operationId

status

info

5. sendData

operationId

payload

nodeId

sessionId

6. OnDataEvent

operationId

payload

7. 200 OK

8. DataStatusEvent -

ACCEPTED

operationId

status

info

9. DataStatusEvent -

ACCEPTED

operationId

status

info

nodeId

sessionId

10. 200 OK

6.1 Call flow

Steps 1-4 illustrate sending data to the web-server. Steps 5-10 illustrate receiving data from the web-server.

Page 102: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

102Data exchange102

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. sendData

operationId

payload

2. OnDataEvent

operationId

payload

nodeId

sessionId

appKey

3. 200 OK

operationId

payload

4. DataStatusEvent -

ACCEPTED

operationId

status

info

Page 103: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

103Data exchange

5. sendData

operationId

payload

nodeId

sessionId

6. OnDataEvent

operationId

payload

7. 200 OK

8. DataStatusEvent -

ACCEPTED

operationId

status

info

9. DataStatusEvent -

ACCEPTED

operationId

status

info

nodeId

sessionId

10. 200 OK

6.2 Error handling

Web-server prohibits sending data and returns the 403 FORBIDDEN status (restOnError = FAIL)

Page 104: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

VIIPart

Page 105: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

105Error handling

7 Error handling

The sequence of handling an unclassified ErrorEvent error

When an error occurs, this error is delivered via the corresponding event. For example, if an erroroccured while establishing connection, the event is ConnectionStatusEvent. If an error occurred whilecalling, the CallStatusEvent event holds the status=FAILED and the description of the error in the 'info'field. If an error cannot be categorized, it is passed to a client as ErrorEvent with the description of theerror in the 'info' field.

The same way ErrorEvent is passed to a client in case of errors during interaction with theweb-server for Type II event calls

Page 106: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

VIIIPart

Page 107: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

107Sending bug reports

8 Sending bug reports

The call flow when sending bug reports

Sending of a bug report is performed using the sendBugReport function on the side of the WCSJavaScript API. A confirmation comes on the step 6.

B

R

O

W

S

E

R

<<< IN OUT >>> W

C

S

<<< IN OUT >>> W

E

B

S

E

R

V

E

R

1. sendBugReport

text

type

2. sendBugReport

text

type

nodeId

sessionId

appKey

3. 200 OK

text

type

4. BugReportStatusEvent -

COMPLETE

filename

status

info

nodeId

sessionId

Page 108: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

Web Call Server 5 - Call Flow

© 2017 Flashphoner, LLC

108Sending bug reports108

appKey

5. 200 OK

f ilename

status

info

6.

BugReportStatusEve

nt - COMPLETE

filename

status

info

Page 109: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC

Page 110: Web Call Server - Call Flow - Flashphoner · SIP Server SIP proxy-server, PBX, IMS or other SIP equipment with the support for SIP-protocol. Synonyms: SIP provider, SIP server. WCS

© 2017 Flashphoner, LLC