call context - Avaya-CXI/virtual-agent-public GitHub Wiki

HOME / REFERENCE DOCUMENTATION / CALL CONTEXT

Any call that hits Virtual Agent will have a call context that gets created for that call. However, if the call goes to Dialogflow then the call context stops being updated. This context keeps track of the following information:

Basic Call Info

  • Calling Party
  • Called Party
  • Call SID
  • Did it come through CPaaS via Sip Domain?

Example

{
    "CallSid": "CA777c3e32c91d1e4a42db42f29d8f6803",
    "SipDomain": null,
    "CalledParty": "+13433041234",
    "isSipDomain": false,
    "CallingParty": "+16106571234"
}

Default language info linked to call

{
"id": 1,
    "Say": "en",
    "Name": "English-US",
    "Gather": "en-US",
    "Dialogflow": "en-US",
    "GoogleTranslate": "en"
}

User Input

  • Did the user input DTMF or Speech? Did they provide and input at all?
  • They type field will either have the value of dtmf or speech.

DTMF gives you the value of whatever keys were pressed.

Speech gives you whatever speech was collected.

  • Which IVR option was hit?
  • If no input was given, no keys pressed, no speech give, then a property named NO_INPUT is added to the User Input JSON with the value of true.

Example


{
    "type": "dtmf",
    "value": "1",
    "option": {
      "id": 0,
      "name": "payment ivr",
      "leg_id": 6,
      "repeat": false,
      "to_ivr_leg": null,
      "menu_option": false
} }

No input example

{
    "type": "dtmf",
    "value": "",
    "NO_INPUT": true,
    "option": {
      "id": 0,
      "name": "payment ivr",
      "leg_id": 6,
      "repeat": false,
"to_ivr_leg": null,
    "menu_option": false
  }
}

User Input History

A collection of all of the User Input entries from the call. First element in the collection is the fire User Input entry for the call, the last entry is the most recent input that is NOT the current User Input. The current User Input is not stored in the User Input History.

Example

[
{
### User Input History
o A collection of all of the User Input entries from the call. First element in the collection is the fire User Input entry for the call, the last entry is the most recent input that is NOT the current User Input. The current User Input is not stored in the User Input History.
o Example below
"type": "dtmf",
"option": {
  "id": 0,
  "name": "ROOT",
  "leg_id": 0,
  "to_ivr_leg": "0"
} },
{
  "type": "dtmf",
  "value": "1",
  "option": {
    "id": 6,
    "name": "menu1",
    "leg_id": 0,
    "repeat": false,
    "to_ivr_leg": "5",
"menu_option": true
  }
}, {
"type": "dtmf",
"value": "1",
"option": {
  "id": 1,
  "name": "menu1_1",
  "leg_id": 5,
  "repeat": false,
  "to_ivr_leg": "6",
  "menu_option": true
} }
]

UUI Headers

A collection of the SipHeaders that came over into CPaaS

Example

{
  "SipHeader_X-cid": "GDZl02Wg73uMf75NQSLIbK93xSp0jS1." ,
   "SipHeader_User-to-User": "","SipHeader_X-Zang-Domain":
   "andrew-sip-oct2020-test","SipHeader_X-TelAPI-Client-
   Params": ""
}

Fullfilment Responses

  • Virtual Agent gives the ability to perform fulfillment/webhook cals on configured options/menus.
  • The responses of these fulfillment calls are stored in the Call Context if the response is meant to be saved. These responses could then be used throughout the rest of the call.
  • Only stores JSON response.

Example (assumes fulfillment was called on an option named menu1

"menu1": {
    "FAQ2": "Virtual Agent Faq2",
    "FAQMenu": "bill from Virtual Agent",
    "MainPrompt": "Thanks for calling the Virtual Agent"
}

<a name=/"full">

Full Call Conext

{
"menu1": {
    "FAQ2": "Virtual Agent Faq2",
    "FAQMenu": "bill from Virtual Agent",
    "MainPrompt": "Thanks for calling the Virtual Agent"
  },
  "CallInfo": {
    "CallSid": "CA777c3e32c91d1e4a42db42f29d8f6803",
    "SipDomain": null,
    "CalledParty": "+13433041234",
    "isSipDomain": false,
    "CallingParty": "+16106571234"
  },
  "Language": {
    "id": 1,
  "Say": "en",
  "Name": "English-US",
  "Gather": "en-US",
  "Dialogflow": "en-US",
  "GoogleTranslate": "en"
},
"UserInput": {
  "type": "dtmf",
  "value": "1",
  "option": {
    "id": 0,
    "name": "payment ivr",
    "leg_id": 6,
    "repeat": false,
    "to_ivr_leg": null,
    "menu_option": false
} },
"UUI_Headers": {},
"UserInputHistory": [
  {
    "type": "dtmf",
    "option": {
      "id": 0,
      "name": "ROOT",
      "leg_id": 0,
      "to_ivr_leg": "0"
}

}, {
"type": "dtmf",
"value": "1",
"option": {
  "id": 6,
  "name": "menu1",
  "leg_id": 0,
  "repeat": false,
  "to_ivr_leg": "5",
  "menu_option": true
} },
    {
      "type": "dtmf",
      "value": "1",
      "option": {
        "id": 1,
        "name": "menu1_1",
        "leg_id": 5,
        "repeat": false,
        "to_ivr_leg": "6",
        "menu_option": true
} }
] }