VertoHelpers

class VertoHelpers

This class helps to format well-formatted JSON-RPC in order to communicate with Verto protocol.

  • Undocumented

    Declaration

    Swift

    static var REMOTE_NUMBER: String
  • Encrypt string to md5.

    Declaration

    Swift

    static func toMd5(value: String) -> String

    Parameters

    value

    The string to encrypt.

    Return Value

    MD5-encrypted string.

  • Generic method that convert a string into a swift dictionary. This helps to parse messages from the Verto websocket.

    Declaration

    Swift

    static func convertStringToDictionary(_ message: String) -> [String : AnyObject]?

    Parameters

    message

    String to converto to dictionary.

    Return Value

    A swift dictionary based on the given message.

  • Format a RPC-JSON to log user on Verto.

    Declaration

    Swift

    static func getLoginRPC(ccLogin: String, ccPassword: String) -> JSON

    Parameters

    ccLogin

    Agent’s ccLogin.

    ccPassword

    Agent’s ccPassword.

    Return Value

    A JSON value that will be used to log the agent on Verto.

  • Format a RPC-JSON to initiate either a call creation (verto.invite) or answer a call (verto.answer) on Verto.

    Declaration

    Swift

    static func createCallRPC(method: String, agentEmail: String, sdp: String, sessId: String, callID: String) -> JSON

    Parameters

    method

    Should be invite for call creation or answer for call answer.

    agentEmail

    The email of the agent that send this message to Verto.

    sdp

    SDP of the current agent.

    sessId

    Session ID of the Verto websocket.

    callID

    ID of the call.

    Return Value

    A JSON value that will be used to create or accept a Verto call.

  • Format a RPC-JSON to hold or unhold a call.

    Declaration

    Swift

    static func createHoldAction(agentEmail: String, sessId: String, callID: String, isOn: Bool) -> JSON

    Parameters

    agentEmail

    The email of the agent that send this message to Verto.

    sessId

    Session ID of the Verto websocket.

    callID

    ID of the call.

    isOn

    Boolean that set the call on hold (true) or unhold (false).

    Return Value

    A JSON value that will be used to handle a hold state of a call.

  • Format a RPC-JSON to send a digit to the Verto protocol via a call.

    Declaration

    Swift

    static func sendDigit(agentEmail: String, sessId: String, callID: String, number: String) -> JSON

    Parameters

    agentEmail

    The email of the agent that send this message to Verto.

    sessId

    Session ID of the Verto websocket.

    callID

    ID of the call.

    number

    Digit that can be sent. (0 to 9, # and *)

    Return Value

    A JSON value that will be used to send a digit to a Verto call.

  • Format a RPC-JSON to transfer a call without attendance.

    Declaration

    Swift

    static func blindTransfer(agentEmail: String, sessId: String, callID: String, number: String) -> JSON

    Parameters

    agentEmail

    The email of the agent that send this message to Verto.

    sessId

    Session ID of the Verto websocket.

    callID

    ID of the call.

    number

    The targeted number where the call will be transfered.

    Return Value

    A JSON value that will be used to transfer a call without attendance.

  • Format a RPC-JSON to indicate the Verto protocol that the agent has accepted the call.

    Declaration

    Swift

    static func callAnswer(id: Int, method: String) -> JSON

    Parameters

    id

    ID of the call.

    method

    Method sent to Verto protocol.

    Return Value

    A JSON value that will be used to communicate with Verto protocol.

  • Format a RPC-JSON to terminate the call.

    Declaration

    Swift

    static func hangupCall(agentEmail: String, callID: String, sessId: String) -> JSON

    Parameters

    agentEmail

    The email of the agent that send this message to Verto.

    callID

    ID of the call.

    sessId

    Session ID of the Verto websocket.

    Return Value

    A JSON value that will be used to hangup.