Tropo WebAPI Development Guide Home  |  Frameset Home


{"session":}  object


The payload sent as an HTTP POST to your web application when a new session arrives.


usage

{ "session": {
    "accountId": string,
    "from": Object,
    "headers": Object,
    "id": String,
    "initialText": String,
    "timestamp": String,
    "to": Object,
    "userType": String } }


fields

accountId Data Type: string Default: "" (undefined) Optional
Contains the user account ID that this session started with.
from Data Type: Object Default: (none) Optional
Contains the elements that identity the origination of the session. There are two keys present within this object:

  • "id" - The identifier of the user that initiated the session. In the case of a "VOICE" channel this will be their Caller ID, in the case of a "TEXT" session their username
  • "channel" - Indicates whether this is a phone call with the value of "VOICE", an instant message or SMS with a value of "TEXT"
  • "name" - The name of the user that initiated the session
  • "network" - The name of the network being used for this session:
    • For voice this may be 'PSTN" or "VOIP"
    • For text this may be "AIM", "GTALK", "JABBER", "MSN", "SMS" or "YAHOO"

Example:

"from":{"id":"john@gmail.com","name":"unknown","channel":"TEXT","network":"JABBER"}
headers Data Type: Object Default: "" (undefined) Optional
Contains the Session Initiation Protocol (SIP) Headers for the current session. This is advanced network information.
id Data Type: String Default: "" (undefined) Optional
A GUID representing the unique session identifier.
initialText Data Type: String Default: "" (undefined) Optional
When the channel is of a type "TEXT" this field contains the initial text of the message from the SMS or instant message that the user sent when initiating the session.

Note that the initialText field will be saved and used for the first ask object.
To have your text application disregard this field, you can use the following code to store the initialText (and remove it from the queue) {"tropo":[{"ask":{"choices":{"value":"[ANY]"},"name":"initial_text_capture"}}]}
timestamp Data Type: String Default: "" (undefined) Optional
The time that the session was started.
to Data Type: Object Default: (none) Optional
Contains the elements that identity of the destination of the session. There are two keys present within this object:

  • "id" - The identifier of the user that initiated the session. In the case of a "VOICE" channel this will be their Caller ID, in the case of a "TEXT" session their username.
  • "channel" - Indicates whether this is a phone call with the value of "VOICE", an instant message or SMS with a value of "TEXT"
  • "name" - The name of the user that initiated the session
  • "network" - The name of the network being used for this session:
    • For voice this may be 'PSTN" or "VOIP"
    • For text this may be "AIM", "GTALK", "JABBER", "MSN", "SMS" or "YAHOO"

Example:

"to":{"id":"jane@bot.im","name":"unknown","channel":"TEXT","network":"JABBER"}
userType Data Type: String Default: "" (undefined) Optional
The type of user that is on the other end of the session. May be 'HUMAN', 'MACHINE' or 'FAX'.



code samples

An example of a JSON payload for a session.
{
   "session":{
      "id":"1aa06515183223ec0894039c2af433f2",
      "accountId":"33932",
      "timestamp":"2010-02-18T19:07:36.375Z",
      "userType":"HUMAN",
      "initialText":null,
      "to":{
         "id":"9991427645",
         "name":"unknown",
         "channel":"VOICE",
         "network":"PSTN"
      },
      "from":{
         "id":"jsgoecke",
         "name":"unknown",
         "channel":"VOICE",
         "network":"PSTN"
      },
      "headers":{
         "x-sbc-from":"\"jsgoecke\"<sip:0000123456@192.168.34.202>;tag=2a648c6e",
         "x-sbc-allow":"BYE",
         "x-sbc-user-agent":"sipgw-1.0",
         "x-voxeo-sbc-name":"10.6.63.104",
         "x-sbc-contact":"<sip:0000123456@192.168.34.202:16000>",
         "Content-Length":"247",
         "To":"<sip:9991427645@10.6.61.101:5060>",
         "x-voxeo-sbc":"true",
         "Contact":"<sip:jsgoecke@10.6.63.104:5060>",
         "x-voxeo-to":"<sip:990009369991427645@66.193.54.18:5060>",
         "x-sbc-request-uri":"sip:990009369991427645@66.193.54.18:5060",
         "x-sbc-call-id":"OWE0OGFkMTE1ZGY4NTI1MmUzMjc1M2Y3Y2ExMzc2YjE.",
         "x-sid":"39f4688b8896f024f3a3aebd0cfb40b2",
         "x-sbc-cseq":"1 INVITE",
         "x-sbc-max-forwards":"70",
         "x-voxeo-sbc-session-id":"39f4688b8896f024f3a3aebd0cfb40b2",
         "CSeq":"2 INVITE",
         "Via":"SIP/2.0/UDP 66.193.54.18:5060;received=10.6.63.104",
         "x-sbc-record-route":"<sip:195.46.253.237:5061;r2=on;lr;ftag=2a648c6e>",
         "Call-ID":"0-13c4-4b7d8ff7-1c3c1b82-7935-1d10b080",
         "Content-Type":"application/sdp",
         "x-sbc-to":"<sip:990009369991427645@66.193.54.18:5060>",
         "From":"<sip:jsgoecke@10.6.63.104:5060>;tag=0-13c4-4b7d8ff7-1c3c1b82-5d8c"
      }
   }
}



additional links

none


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



© 2010 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site