Application to application information (AAI)
The AAI feature allows two parties to send or receive information on a call. The parties can be applications or live agents. For example, an application can collect information about a caller and forward it to a call center agent or another application for handling. The information is contained in the message sent to the receiving party.
Voice Platform supports AAI on transfers and inbound calls, where the information is available at the start of a call. It also supports sending and receiving AAI while in a call.
Note: You can retrieve information from a User-to-User header (rather than an Aai header) by assigning the value, User-to-User, to the audio.sip.AaiBasedOn service property. See Replacing AAI with User-to-User for more information.
Sending AAI at the beginning of a transfer
To send AAI when initiating a call transfer, set the aai attribute of the <transfer> element to the string containing the information you want to transfer. The string must be in ASCII format. For example:
<transfer name="TransferToAgent" dest="tel:1234567" aai="caller-ID=12345,product-ID=gizmo,tax-code=CT">
The resulting header depends on the type of transfer.
For bridged transfers, the specified AAI string is included in an Aai header in the SIP INVITE message sent to the called party of the bridge. For example:
INVITE sip:batman@10.11.12.13:5062 SIP/2.0
Via: SIP/2.0/ ;branch=z9hG4bK-d8754z-3b12700e6b111a52-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:nvp>
To: <sip:batman@10.11.12.13:5062>
From: <sip:1234@10.3.22.89:5060>;tag=bb16ab56
Call-ID: MjYyYTg2ODRmZjUwZTM0MmNiMDUzZjViNmNjMTdjOWE.
CSeq: 1 INVITE
Session-Expires: 1800
Min-SE: 90
Allow: INVITE, ACK, CANCEL, BYE, REFER, NOTIFY, INFO, OPTIONS
Content-Type: application/sdp
Supported: timer
Aai: caller-ID=12345,product-ID=gizmo,tax-code=CT
P-Nuance-Original-Call-ID: 1904215aceeb214c012f3f9c96ebdbe3@127.0.0.1
Transfer-From: AD6AE5CD042D41C39817E607945B00130x0a03116e;to-tag=a159e76b;from-tag=63801faba4f2
Content-Length: 183
v=0
o=TS 0 0 IN IP4 10.3.20.115
s=TS session
c=IN IP4 10.3.20.115
t=0 0
m=audio 20006 RTP/AVP 0 100
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-11,16
For blind transfers, the specified AAI string is included in an Aai attribute of the Referred-By header in the SIP REFER message sent by Voice Platform. For example:
REFER sip:5149047800@10.3.20.172 SIP/2.0
Via: SIP/2.0/ ;branch=z9hG4bK-d8754z-816f7a70bc4a7338-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:4934@mtl-conn27.nuance.com>
To: "5149047800"<sip:5149047800@10.3.20.172>;tag=as5f6799c4
From: <sip:4934@mtl-conn27.nuance.com>;tag=9d54a231
Call-ID: 28ba87072515b26627a9b44b7b459eb3@10.3.20.172
CSeq: 2 REFER
Supported: norefersub
Refer-To: <sip:2447@mtl-vwg2>
Referred-By: <sip:4934@mtl-conn27.nuance.com;Aai=caller-ID=12345,product-ID=gizmo,tax-code=CT>
Refer-Sub: false
Content-Length: 0
It is possible to define the SIP header into which the AAI will be propagated by TSS for a blind transfer by setting the audio.sip.AaiHeaderOnBlind parameter.
Sending AAI in mid-call
To send AAI information mid-call rather than at the beginning of a transfer, you must use the session.setTelephonyProperties() method within a VoiceXML <script> element:
<script>
session.setTelephonyProperties("nuance.core.tss.outbound-aai=
\"caller-ID=12345,product-ID=gizmo,tax-code=CT\""); </script>
The information is then included in an outbound INFO message like the following:
INFO sip:10.3.17.110 SIP/2.0
Via: SIP/2.0/ ;branch=z9hG4bK-d8754z-f36c5933963d1440-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:nvp@mtl-conn27>
To: "8887579793"<sip:10.3.17.110>;tag=19ea1ecdedca
From: <sip:nvp@mtl-conn27>;tag=e0713a10
Call-ID: 7217931BADAE4A09A3B6008DA1B41CB50x0a03116e
CSeq: 2 INFO
Content-Type: text/plain
Content-Length: 44
caller-ID=12345,product-ID=gizmo,tax-code=CT
Receiving AAI on inbound calls
AAI can be sent to a VoiceXML application by including it in a Aai header in the INVITE message sent to Voice Platform. For example:
INVITE sip:nvp@mtl-conn27 SIP/2.0
Via: SIP/2.0/UDP 10.11.12.13:5062;branch=z9Hg4Bk346777f6-9a65-11df-8e01-9eb13a89fbf7
Max-Forwards: 70
Contact: <sip:batman@10.11.12.13:5062;transport=udp>
To: <sip:nvp@mtl-conn27>
From: <sip:batman@nuance.com>;tag=nu-55e7-a712
Call-ID: 346777f4-9a65-11df-95c7-eec67a7c8331@batman.nuance.com
CSeq: 14476 INVITE
Expires: 118
Allow: INVITE, ACK, BYE, CANCEL, NOTIFY, INFO, OPTIONS
Content-Type: application/sdp
User-Agent: Nuance/2.1.X
Aai: caller-ID=12345
Content-Length: 194
v=0
o=- 1280334530 1280334530 IN IP4 10.11.12.13
s=SIP Call
c=IN IP4 10.11.12.13
t=0 0
m=audio 1600 RTP/AVP 0 101
a=rtpmap:0 pcmu/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
VoiceXML applications receiving an AAI string on an inbound call can extract it using the session.connection.aai variable:
<var name="AAIString" expr="session.connection.aai"/>
See aai for more information.
Receiving AAI in mid-call
Voice Platform is able to accept AAI information from the SIP gateway in mid-call if this information is included in an INFO message. For example, a string of aai information (caller-ID=12345) could appear in an INFO message like the following:
INFO sip:10.3.17.110 SIP/2.0
Via: SIP/2.0/ ;branch=z9hG4bK-d8754z-f36c5933963d1440-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:nvp@mtl-conn27>
To: "8887579793"<sip:10.3.17.110>;tag=19ea1ecdedca
From: <sip:nvp@mtl-conn27>;tag=e0713a10
Call-ID: 7217931BADAE4A09A3B6008DA1B41CB50x0a03116e
CSeq: 2 INFO
Content-Type: text/plain
Content-Length: 15
caller-ID=12345
To accept the AAI information in mid-call, your application must include a <catch> element within the appropriate scope to catch a nuance.interupt.aai event, and extract it:
<catch event="nuance.interrupt.aai">
<var name="received_aai" expr="_event"/>
<log label="trace:?level=MINOR_ALARM"
expr="'caught aai event='+_event"/>
</catch>
Replacing AAI with User-to-User
By default, Voice Platform takes AAI information from the SIP Aai header:
...
Aai: caller-ID=12345
Content-Length: 194
...
You can instead take information from a SIP User-to-User header by assigning the value, User-to-User, to the audio.sip.AaiBasedOn service property in the Management Station:
...
User-to-User: caller-ID=12345
Content-Length: 194
...