We have created a WebRTC phone that you can use for just about any call center application. You can set up the phone to use our cloud based service or you can install this at your premise. There are several interface points that you can use to create just about any call center application.
Interfacing to your MS SQL Server Database
You will need to supply us with the connection string to your database. In addition, we need from you either a stored procedure or a SQL statements for the following events:
- Agent Login
- Agent Logout
- Call Start
- Call End
The phone will have stored in it’s config file an appId that we have assigned you. The phone has a login button that will allow the agent to enter a username and password. The phone will then call into our REST service and execute your AgentLogin statement using your connection string.
Agent Login
You supply us a SELECT statement or SPROC. We will use that select statement to generate a select statement with the data from the variables (denoted by {} brackets) filled in.
We have the following data in our application:
- {Username} (varchar)
- {Password} (varchar)
We need the following data to be returned:
- AgentId (int)
- CallerID (varchar)
- CallerIDName (varchar) (up to 15 characters)
- AgentSkills (varchar) (comma separated list of skills the agent has)
- PhoneExtension assigned to Agent (varchar)
- UserLevel of this agent (int). 1=Agent 2=Supervisor
Example Statement
- select AgentId, CallerId, CallerIdName, AgentSkills, PhoneExtension, UserLevel FROM [user] where Username = ‘{USERNAME}’ and Password = ‘{PASSWORD}’
The statement would become:
- select AgentId, CallerId, CallerIdName, AgentSkills, PhoneExtension, UserLevel FROM [user] where Username = ‘joe’ and Password = ‘smith’
If you were to use a stored procedure, you give us the stored procedure name. Example:
- usp_AgentLogin
We would pass to your stored procedure @Username, @Password. You should return a row set with the above column names.
Behind the scenes, the phone will also receive a GUID token which is passed over the websocket to the server side code. The server side code will authenticate against the valid login to allow the phone to be used.
Agent Logout
You would supply us with an INSERT statement or SPROC. You can use the following variables as part of your statement:
- {LoginDateTime} (datetime)
- {LogoutDateTime} (datetime)
- {AwayTime} (int) – The amount of time (in seconds) spent in an away status.
- {BusyTime} (int) – The amount of time (in seconds) spent in an idle status.
- {OnPhoneTime} (int) – The amount of time (in seconds) spent on the phone.
- {ReadyTime} (int) – The amount of time (in seconds) spent in a ready status.
- {AgentId} (int) – The unique id of the agent.
Example Statement
INSERT INTO AgentStats (LoginDateTime, LogoutDateTime, AwayTime, IdleTime, OnPhoneTime, ReadyTime, AgentId, UserName, Extension) VALUES (‘{LoginDateTime}’, ‘{LogoutDateTime}’,{AwayTime},{BusyTime}, {OnPhoneTime}, {ReadyTime}, {AgentId})
Sample Stored Procedure — usp_AgentLogout
We will pass to your stored procedure, @LoginDateTime,@LogoutDateTime,@AwayTime,@BusyTime,@OnPhoneTime,@ReadyTime,@AgentId
We do not expect anything back from your SQL Statement or Stored Procedure
Call Start
Every time we initiate a call we would call the select statement that you provide.
You would supply us with a SQL statement or SPROC using the following variables:
- {Dnis} (varchar)
- {Ani} (varchar)
- {CallerIdName} (varchar) (not always available)
- {CallType} – (int) 1 for inbound 2 for outbound
- {AgentId} (int) Only available for outbound calls only. 0 for inbound calls
We would expect back the following data:
- Url – (varchar) – Your URL can contain replacement variable (i.e. /callstart?dnis={Dnis}&ani={Ani}&calleridname={CallerIdName}&callid={CallId}&calltype={CallType}&agentid={AgentId}
- CallId – (varchar) – If you use an integer, just convert it to a varchar.
- Record (char(1)) – Set to Y if you would like to record the duration of the call. It will be named with the call ID.
- DefaultTransferNumber (varchar) – This is the number that will show in the dial pad so the agent can easily transfer the call to a default phone number
- Skills (varchar) – This would indicate the skills that you would like the agent to have for this call. It should be a comma separated list.
- CustomData – Customized features on a call start such as launching a RemoteApp.
Example Statement
INSERT INTO CallStart (Dnis, Ani, CallerIdName, CallType, AgentId) VALUES (‘{Dnis}’, ‘{Ani}’, ‘{CallerIdName}’, ‘{CallType}’, AgentId)
Alternatively, it would be a good idea to put this logic in a stored procedure, that way you could perform the insert and have logic to return back the Url and return back the CallId.
Sample Stored Procedure — usp_CallStart
We will pass to your stored procedure the above variables.
Call End
You would supply us with an INSERT statement or SPROC. You can use the following variables as part of your statement:
- {Segment} (int) – Each segment of the call.
- {TalkTime} (int) – The amount of time (seconds) that the agent spoke with the user.
- {HoldTime} (int) – The amount of time (seconds) that a user was on hold.
- {CallType} (int) – 1 – Inbound 2 – Outbound
- {StartDateTime} (DateTime) – The Date/Time that the call started.
- {ConnectDateTime} (DateTime) – The Date/Time that the call connected.
- {EndDateTime} (DateTime) – The Date/Time that the call end
- {AgentId} (int) – The Id of the agent
- {TrueDuration} (int) – The time in seconds that the call lasted.
- {Ani} (varchar) – The ani of the caller
- {Dnis} (varchar) – The dnis of the caller
- {CallId} (varchar) – The assigned call id. It can be created from the CallStart event, or we generate a GUID. If you use an integer, you will need to take care of the conversion in your INSERT statement.
Example Statement
INSERT INTO CallLog (Segment, TalkTime, HoldTime, CallType, StartDateTime, EndDateTime, AgentId, TrueDuration, ANI, DNIS, CallId) VALUES ({SEGMENT}, {TALKTIME}, {HOLDTIME}, {CALLTYPE}, {STARTDATETIME}, {ENDDATETIME}, {AGENTID}, {TRUEDURATION}, {ANI}, {DNIS}, {CALLID})
Sample Stored Procedure — usp_CallStart
We will pass to your stored procedure the above variables.
Sip Headers
A call could be transferred in from an IVR and the original call data passed. These are the items passed in via SIP Headers:
- Dnis
- Ani
- callerId (Caller ID Name)
- URL
- Transfer (default transfer)
- CallId
- CallCenter (overflow call center if not agents available)
- Skills
- Record – (Y) means true
Dial
- TBD