Virtual Agent
Virtual Agent Connection into TCN Operator API
1.
2.
-This uri is determined after authentication and session creation returned in the response from the /api/v1alpha1/asm/asmapi/createsession endpoint. No Pin and passcode would be required. This custom uri will change every login.
3.
4.
Execution Flow
1.
P3Api_GetCurrentAgent
P3Api_GetAgentSkills
2.
Asm_CreateSession
{
"asmSessionSid": "746882",
"voiceSessionSid": "27872376",
"voiceRegistration": {
"username": "668233",
"password": "221235",
"dialUrl": "012148cdb158aa41759af635d7c856c072",
"pstnPhone": "",
"defaultTimeZone": "",
"expirationTimestamp": "1626791817289"
}
}
3.
4.
Agent State stream:
Asm_StreamAgentState
{"asmSessionSid": "746882"} //pulled from the create session response
Agent Status polling:
Acd_AgentGetStatus
/api/v0alpha/acd/agentgetstatus Should be hit every 30 seconds to send the keep alive to keep the agent session active passing this below in the body.
{"sessionSid":"27872376","performKeepAlive":"true"}
P3Api_SaveAgentCallResponses
{"callSid":"10192","agentSessionSid":"7901537","callType":"MANUAL","agentCallResponseDetails":[{"key":"AccountNumber","value":"22123456"},{"key":"Client Number","value":"2345"}]}
Agent Controls:
Acd_AgentDisconnect
{"reason":"Caller Disconnected","sessionSid":{{currentSessionId}}
Acd_AgentSetReady
Example Request:
{"sessionSid":"{{currentSessionId}}"}
1.Re-queue (Most common for this application)
{
"newConfigFolder":"PBX",
"skills":{
"TCN_HG_1024516":true,"1011308":true
},
"sessionSid":33728236
}
P3Api_ListSkills
{
"skills": [
{
"region": "usa",
"p3Id": "TCN_HG_1010795",
"name": "inbound - Softphone",
"description": "inbound - Softphone",
"type": "HUNT_GROUP"
},
{
"region": "usa",
"p3Id": "1011306",
"name": "Span",
"description": "Spanish",
"type": "AGENT_SKILL"
}
]}
{"sessionSid":"{{currentSessionId}}","callerId":"6098378200","destination":"8667451900"}
(to find agent status updates)
{
"agentStatusDetails": [
{
"sid": "11111111",
"currentSessionId": "26247923",
"status": "1",
"statusDesc": "READY",
"userId": "6ffb371f-b7ad-f7da1d35cb1f"
},
{
"sid": "22222222",
"currentSessionId": "26248192",
"status": "2",
"statusDesc": "WARM_OUTBOUND_TRANSFER_STARTED",
"userId": "354211ae-bd38-df6d497227ec"
},
{
"sid": "333333",
"currentSessionId": "26248416",
"status": "1",
"statusDesc": "READY",
"userId": "c687cffc-f416-4ae6-9e4f-c53aae9b25d7"
},
{
"sid": "4444444444",
"currentSessionId": "26248595",
"status": "1",
"statusDesc": "PAUSED",
"userId": "dd0835b3-ad86-a7de5780d8d5"
}
]
3. Agent Transfers (warm/cold/conference availabe): destinationAgentId is the agent sid value.
{"sessionSid":"{{currentSessionId}}", "destinationAgentId":"{{targetagentsid}}" }
Acd_TransferWarmToAgentCancel
Acd_TransferWarmToAgentStart
Acd_TransferWarmToOutboundApprove
Acd_TransferWarmToOutboundCancel
Acd_TransferWarmToOutboundStart
Transfering:
TO get transfer memeber identifiers they are returned on the agent get status response when on a transfer:
{
"status": "2",
"statusDesc": "WARM_OUTBOUND_TRANSFER_STARTED",
"paused": false,
"queue": "13251",
"currentSessionId": "36213283",
"lastStatusChange": "1674162654614",
"monitoring": true,
"callsCount": "3",
"lastSipCode": "200",
"agentPeerIsLostCall": false,
"disabled": false,
"keepAliveSucceeded": false,
"transferMembers": [
{
"identifier": "2264d738-bdab-48e4-aa3d-7ae47ee37491",
"displayLabel": "MANUAL 153828531",
"memberType": "TransferMemberType_CALLER"
},
{
"identifier": "0775b57b368ae449e8c2c140069cf5c50",
"displayLabel": "+16093856895",
"memberType": "TransferMemberType_OUTBOUND"
}
]
}
mutetransferpartymemberAcd_HoldTransferMember
Example Request:
{"sessionSid":"{{currentSessionSid}}","memberIdentifier": "2264d738-bdab-48e4-aa3d-7ae47ee37491"}
Acd_UnholdTransferMember
(use this for conference at intial transfer step)
Example Request:
{"sessionSid":"{{currentSessionSid}}","memberIdentifier": "2264d738-bdab-48e4-aa3d-7ae47ee37491"}
{
"identifier": "2264d738-bdab-48e4-aa3d-7ae47ee37491",
"displayLabel": "MANUAL 153828531",
"memberType": "TransferMemberType_CALLER"
},
/api/v0alpha/acd/agentputcallongold
{"holdType":"MULTI or SIMPLE","sessionSid":"{{currentSessionId}}"}
/api/v0alpha/acd/agentgetcallfromhold
{"sessionSid":"{{currentSessionId}}"}
-Get status
/api/v0alpha/acd/agentgetstatus
{
"status": "2",
"statusDesc": "PEERED",
"paused": false,
"queue": "214",
"currentSessionId": "7904552",
"lastStatusChange": "1646072907118",
"monitoring": true,
"callsCount": "1",
"lastSipCode": "0",
"agentPeerIsLostCall": false,
"disabled": false,
"keepAliveSucceeded": false,
"transferMembers": []
}
StatusDesc table:
PEERED #on a call -can't take another call
PAUSED #Paused -can't take a call
WRAPUP #post call work -can't take a call
{
"callId": "17996",
"callType": "INBOUND"
}
#If there is more information on an inbound call using a datadip/integration/Journey collection we will provide that in this request.
1 OUTBOUND
2 PREVIEW
3 MANUAL
4 MAC
"phoneEnhancedData": {
"timeZone": "America/New_York",
"internationalPrefix": "011",
"longitude": "-74.4239436088619",
"ndc": "609",
"utc": "-5.0",
"usesNdc": "true",
"ssc2": "W",
"type": "M",
"city": "New Jersey",
"iso2": "US",
"carrier": "VERIZON WIRELESS-NJ",
"language": "en",
"regionCode": "NJ",
"ssc1": "C",
"areaCode": "609",
"latitude": "39.36436606196396",
"max": "16093856999",
"min": "16093856000",
"cocType": "PMC",
"prefix": "385",
"ccnsn": "16093856",
"cc": "1",
"nationalPrefix": "1",
"dst": "true",
"regionName": "New Jersey",
"blockId": "6"
},
"dataCollectData": {},
"dataDipData": {},
"callerIdName": "+16093856895",
"linkbackHuntGroup": "JDSoft",
"sipHeaderData": {},
"queuedCallbackData": {},
"journeyRetrievedData": {
"newfield": "Cell Scrubbed",
"Success": "true",
"FName": "Jim",
"Call Type": "OUT",
"AccountNumber": "95",
"_transaction_id": "15dfebf2-b546-48d5-a659-4c7ab335300d",
"Lname": "Cell",
"PhoneNumber": "6093856895",
"Date Test MMDDYYYY": "1/12/"
}
}```
Modified at 2025-03-10 16:45:56