Large model application management
This document explains how to create and configure a large model application for outbound and inbound calls. This includes associating a large model gateway and configuring settings such as scripts, opening prompts, calling voices, Inbound Call Configuration, and conversation attributes.
Step 1: Create a large model application
In the . Click Create Large Model Application. In the dialog box, configure the basic information and click Submit to create the application.
Parameters
Parameter | Description | Example |
Application name | Enter a custom name. | Test Application |
Model name | Select a deployed large model gateway. | - |
Base model version | Select a base model version. | - |
Maximum concurrency | The default value is 100. To adjust this value, contact your account manager. | - |
Qualification | Select an approved qualification. You can view your qualifications on the Qualification Management page in Voice Service. | - |
Script | Select an approved script. You can manage scripts under Script Management in Voice Service. | - |
Opening prompt |
| Text: Hello, are you ${param}? |
Prompt | Customize the prompt content. You can use variables in the format ${param}. Note A prompt is an instruction you provide to the large model. | You are Xiaomei, a professional Alibaba Cloud customer service agent who handles pre-sales inquiries. You must strictly follow these rules: 1. If a customer asks about ${problem}, guide them to view the details in ${document}. 2. If a customer asks about ${other}, guide them to view the details in ${answer}. |
Calling voice | In the dialog box, select a voice style for calls. You can audition different voices online. | - |
Calling voice configuration
You can select the voice type and style, customize the speech rate and volume, and audition the voice online.
In the Calling Voice dialog box, for Voice Type, you can select options such as the pre-set system voices from Alibaba Cloud Cosyvoice. You can filter voices by Voice Name, Suggested Use, and Gender. The table displays information such as voice characteristics, sub-scenarios, and language. For each voice, you can click Audition. You can set the speech rate from -200 to 200 and the volume from 0 to 100. You can also configure whether to Enable Audio Mixing and Enable Background Music. In the Content Audition area, enter the text to audition (up to 100 characters), select whether to Audition with Synthesized Opening, and click Audition Audio to listen. After you are satisfied, click OK.
Step 2: Configure inbound calls (optional)
After creating the large model application, you can configure its inbound call settings.
On the to open the configuration page.
Choose to use an Alibaba Cloud number or a customer-provided line number. Click Add Number. One inbound number can only be configured for one application.
Alibaba Cloud number: A number you have applied for in Voice Service.
ImportantNumber types include Inbound, Outbound, and Inbound + Outbound. You must select a number that supports inbound calls, such as an Inbound or Inbound + Outbound number. If you do not have a number that supports inbound calls, go to the page to apply for one. For details, see Real Number Application.
In the Add Alibaba Cloud Number dialog box, select the checkboxes of the numbers you want to add, and then click OK.
Customer-provided line number: Use a number from your own line.
NoteThe customer-provided line feature is currently available by invitation only. Before using it, contact your account manager to add your account to the allowlist. For more details, see Customer-Provided Lines.
In the Add Customer-provided Line Number dialog box, select a Line Name, enter the inbound numbers in the Line Number input box. You can enter up to 10 numbers. Only digits are supported. Separate multiple numbers with line breaks. Then, click Add.
Callback configuration: When a user calls in, you can retrieve opening prompt variables based on the calling and called numbers.
Turn on the Callback configuration, configure the parameters, and then click Enable.
HTTP request URL: Required. Must start with http or https and be no more than 200 characters long.
When AICCS initiates a callback to the configured HTTP request URL, the request header carries the following authentication parameters. The LLM gateway server can use these to verify the legitimacy of the request source:
Parameter
Description
timestamp
Current timestamp in milliseconds.
auth
MD5 signature value, computed as MD5(caller + uid + timestamp), formatted as a lowercase hexadecimal string.
uidis the Alibaba Cloud account UID.On the LLM gateway server, read the
timestampandauthfields from the HTTP request header, recalculate the signature using the same formula, and compare it with theauthvalue to verify whether the request source is trustworthy.The following is a complete call example for LLM gateway server integration.
Call example (request)
curl -X POST "${URL}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "timestamp: ${TIMESTAMP}" \ -H "auth: ${AUTH}" \ -d '{ "caller": "<caller_number>", "callee": "<callee_number>", "callId": "<callId>", "applicationCode": "<application_code>" }'Where:
${TIMESTAMP}: Current timestamp in milliseconds.${AUTH}: MD5 signature value, computed as MD5(caller + uid + timestamp), formatted as a lowercase hexadecimal string. Useauthto verify request legitimacy andtimestampto prevent replay attacks.uidis the Alibaba Cloud account UID.
Response format
Your callback service returns variable values based on the opening greeting configuration. The following scenarios apply:
No variables: When the opening greeting contains no variables, return:
{"code":"OK"}With variables (for example, variables named
nameandcity): Return the corresponding variable values:{"name":"Mr. Zhang","city":"Shanghai"}Pass values to the model: To pass business parameters to the LLM, include a
bizParamfield with a JSON string value:{"name":"Mr. Zhang","city":"Shanghai","bizParam":"{\"bizId\": \"1234qwer876\"}"}
Response Variable Configuration: The application automatically reads variables from its text-based opening prompt. You can click Re-identify to fetch the latest variables.
NoteThis feature can also be used without any variables, primarily to pass information such as the incoming line number.
In the application creation form, the Opening prompt type supports both Text and Recording options. If you select Text, a tip below the input box indicates that the opening prompt supports variables in the format
${param}, for example: Hello, are you${param}?. The Prompt input box also supports this variable format. At the bottom of the form, you can click the Select Calling Voice button to configure the voice.Example: Fill in the fields as shown in the example, click the Test button, and enter the calling number and called number in the dialog box.
Timeout Setting: Required. Configure the timeout period for reading variables. If a timeout occurs, the default variable values are used.
Step 3: Configure transfer to human agent (optional)
Before you configure transfer to a manual agent, submit an agent line connection application and ensure that it is approved. For more information, see Manual agent line.
After you create a large model application, you can configure transfer to a manual agent for the large model application based on your business requirements, so that calls can be transferred to manual agents.
Click Large Model Application Management > Transfer to Manual Agent to open the Transfer to Manual Agent dialog box.
Click to enable Transfer to a Manual Agent.
Configuration item description
Configuration item | Description |
Transfer Prompt | This prompt is played after a transfer instruction is received. The system transfers the call to the agent platform after playback is complete. If the agent platform plays a prompt, we recommend that you do not configure this prompt to avoid conflicts. |
Transfer Failure Prompt | This prompt is played when the transfer to the agent platform fails. The call ends after playback is complete. |
Agent Line Name | Select the name of an approved manual agent line. |
Transfer Destination Number | This value is automatically populated after you select an agent line name. |
Custom SIP Headers | This value is automatically populated after you select an agent line name. |
Variable Retrieval Method | Select a variable retrieval method if the transfer destination number or a Custom SIP Headers value contains variables. |
Transfer to Manual Agent HTTP Call Record | Use this setting to obtain the conversation that occurred before the transfer succeeds. For more information, see API reference for communication engine conversation-record push after transfer to a manual agent. |
Variable Retrieval Method (choose one of three)
Method | Description |
Configure Fixed Value | Set a fixed value for a variable. The transfer uses that value. |
API Callback | Before the transfer, use calling and called party information to call an API and retrieve variable values. For more information, see API reference for transfer variable callbacks. |
Agent Tag | Pass variable values by using MSML tags. |
When a variable contains
outId, regardless of letter case, the system automatically transparently passes the business parameter to the agent platform.When you pass variables by using MSML tags, see MSML tag language.
Click Confirm.
HTTP service API reference for transfer variable callbacks
1. API overview
When the variable assignment mode of the transfer configuration is callback mode (CALLBACK), the system initiates an HTTP POST request to the customer-configured callbackUrl before the transfer to retrieve transfer variables, such as the called number and skill group ID. Implement the callback service as described in this document.
Item | Description |
Request method |
|
Content-Type |
|
Accept |
|
URL | The |
Timeout | The |
2. Request description
2.1 Request headers
Header | Type | Required | Description |
| String | Yes | Fixed value: |
| String | Yes | Fixed value: |
| String | Yes | The current timestamp in milliseconds, used for signature verification. |
| String | Yes | The authentication signature. |
2.2 Request body
Field name | Type | Required | Description |
| String | Yes | The unique call identifier. |
| String | No | The external business ID on the customer side. This field is not sent when it is empty. |
| String | Yes | The calling number. |
| String | Yes | The called number. |
Request body example:
{
"callId": "100025530001^105980150002",
"outId": "biz-order-20260831001",
"caller": "18612345678",
"callee": "4006007006"
}
Request body example without outId:
{
"callId": "100025530001^105980150002",
"caller": "18612345678",
"callee": "4006007006"
}
3. Response description
3.1 Response requirements
The HTTP status code must be 200.
The response body must not be empty and must be in JSON format.
3.2 Response body
Field name | Type | Required | Description |
| Boolean | Yes | Indicates whether transfer is allowed. This field must be a JSON Boolean ( |
| String | No | All fields except |
3.3 Variable value constraints
Constraint | Limit | Handling |
Maximum length of a single variable value | 150 characters | The excess is truncated and a warning log is written. |
Maximum total length of all variable values | 150 characters | The whole response is invalidated and treated as a callback failure if this limit is exceeded. |
Fields with | — | Automatically skipped and not added to the variable map. |
3.4 Response examples
Allow transfer:
{
"canTransfer": true,
"calledNumber": "057188889999",
"transferType": "SKILL_GROUP",
"transferBizId": "9000",
"customerId": "C20260831"
}
In this response, calledNumber, transferType, transferBizId, and customerId are injected as transfer variables. You can reference them in SIP Headers or a called-number template by using ${calledNumber}, ${transferType}, and similar placeholders.
Reject transfer:
{
"canTransfer": false
}
4. Authentication signature
The system passes timestamp and auth in HTTP headers. Use the following algorithm to verify that the request source is valid.
Signature algorithm:
auth = MD5Hex( aliyunUid + callId + timestamp )
Parameter | Source | Description |
| Customer | The Alibaba Cloud account UID. |
| Request body | The unique call identifier. |
| Request header | A timestamp in milliseconds. |
Java verification example:
import org.apache.commons.codec.digest.DigestUtils;
public boolean verifyAuth(String auth, Long aliyunUid, String callId, String timestamp) {
String expected = DigestUtils.md5Hex(String.valueOf(aliyunUid) + callId + timestamp);
return expected.equals(auth);
}
5. curl examples
5.1 Request that includes outId
curl -X POST 'https://your-callback-server.com/transfer/variables' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'timestamp: 1725091200000' \
-H 'auth: a3f5b8c2d1e4f6a7b9c0d2e3f5a6b8c9' \
-d '{
"callId": "100025530001^105980150002",
"outId": "biz-order-20260831001",
"caller": "18612345678",
"callee": "4006007006"
}'
5.2 Request that does not include outId
curl -X POST 'https://your-callback-server.com/transfer/variables' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'timestamp: 1725091200000' \
-H 'auth: e7d2a1b3c5f8e0d4a6b9c2f1e3d5a7b0' \
-d '{
"callId": "100025530001^105980150002",
"caller": "18612345678",
"callee": "4006007006"
}'
5.3 Expected responses
Allow transfer (HTTP 200):
{
"canTransfer": true,
"calledNumber": "057188889999",
"transferType": "SKILL_GROUP",
"transferBizId": "9000"
}
Reject transfer (HTTP 200):
{
"canTransfer": false
}
6. Exception handling
The system treats the following conditions as callback failures and rejects the transfer. The AI continues the conversation with the customer.
Scenario | Description |
HTTP status code is not 200 | The response returns any non-200 status code, such as 4xx or 5xx. |
Response body is empty | The response returns an empty string or has no body. |
| The JSON does not contain |
| The value is the string |
Request times out | The request exceeds the configured timeout. The default is 500 ms. |
Total variable length exceeds the limit | The total length of all variable values still exceeds 150 characters after truncation. |
7. Notes
Response time: Return from the callback service within 500 ms whenever possible. A timeout causes the transfer to fail.
Idempotence: The same call can trigger multiple callbacks because of retries or other reasons. We recommend that the server implement idempotence.
canTransfertype: This field must be a native JSON Boolean (trueorfalse). String values are not accepted.Variable names: Variable names must match the
${variable}placeholders in the SIP Headers and called-number templates of the transfer configuration.Network Security: The callback URL cannot point to an internal network address unless the address is included in a whitelist. Otherwise, SSRF protection blocks the request.
HTTP service API reference for communication engine conversation-record push after transfer to a manual agent
API overview
After an intelligent voice AI call successfully initiates a transfer-to-manual-agent request, the system immediately pushes the complete conversation history between the AI and the user to the callback URL that the customer configured in advance by using HTTP POST. This lets the agent understand the conversation context before taking over the call. The agent might not yet be ringing or have answered the call.
Item | Description |
Request method |
|
Content-Type |
|
Accept |
|
URL | The |
Timeout | Fixed at 3000 ms (3 seconds). |
Trigger conditions
The push is triggered only when both of the following conditions are met:
The transfer request is successfully initiated, rather than the agent having answered the call.
The callback address in the transfer configuration is not empty.
Request description
Request headers
Header | Type | Required | Description |
| String | Yes | Fixed value: |
| String | Yes | Fixed value: |
| String | Yes | The current timestamp in milliseconds, used for signature verification. |
| String | Yes | The authentication signature. |
Request body
Field name | Type | Required | Description |
| String | Yes | The unique call identifier. |
| String | No | The external business ID on the customer side. This field is not sent when it is empty. Its value is the original value that the customer passed when calling the API. |
| String | Yes | The calling number. |
| String | Yes | The called number. |
| JSONArray | Yes | The conversation record list. It can be an empty array |
conversationHistory array elements
Field name | Type | Required | Description |
| String | Yes | The role identifier. |
| String | Yes | The conversation text. |
Request body example
{
"callId": "1693456789012^1693454989012",
"outId": "biz-order-20260831001",
"caller": "18612345678",
"callee": "4006007006",
"conversationHistory": [
{
"role": "assistant",
"content": "Hello, how can I help you?"
},
{
"role": "user",
"content": "I want to check the status of my order."
},
{
"role": "assistant",
"content": "Sure. Please provide your order number."
},
{
"role": "user",
"content": "I want to speak to a manual agent."
},
{
"role": "assistant",
"content": "Sure. I am transferring you to a manual agent. Please wait."
}
]
}
Request body example without outId
{
"callId": "1693456789012^1693454989012",
"caller": "18612345678",
"callee": "4006007006",
"conversationHistory": []
}
Response description
Item | Description |
Expected HTTP status code |
|
Response body | No requirements. The system checks only the HTTP status code and does not parse the response body. You can return any content. |
Response example (recommended format)
{
"code": 0,
"msg": "success"
}
Authentication signature
The system passes timestamp and auth in HTTP headers. Use the following algorithm to verify that the request source is valid.
Signature algorithm
auth = MD5Hex( aliyunUid + callId + timestamp )
Parameter | Source | Description |
| Customer | The Alibaba Cloud account UID, converted from Long to String. |
| Request body | The unique call identifier. |
| Request header | A timestamp in milliseconds. |
Concatenate the three parameters directly without separators, then calculate the MD5 hash and output a 32-character lowercase hexadecimal string.
Java verification example
import org.apache.commons.codec.digest.DigestUtils;
public boolean verifyAuth(String auth, Long aliyunUid, String callId, String timestamp) {
String expected = DigestUtils.md5Hex(String.valueOf(aliyunUid) + callId + timestamp);
return expected.equals(auth);
}
curl examples
Complete request that includes the conversation history
curl -X POST 'https://your-server.com/dialog-push' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'timestamp: 1725091200000' \
-H 'auth: a3f5b8c2d1e4f6a7b9c0d2e3f5a6b8c9' \
-d '{
"callId": "1693456789012^1693454989012",
"outId": "biz-order-20260831001",
"caller": "18612345678",
"callee": "4006007006",
"conversationHistory": [
{
"role": "assistant",
"content": "Hello, how can I help you?"
},
{
"role": "user",
"content": "I want to check my order status."
},
{
"role": "assistant",
"content": "Sure. Please provide your order number."
},
{
"role": "user",
"content": "I want to speak to a manual agent."
},
{
"role": "assistant",
"content": "Sure. I am transferring you to a manual agent. Please wait."
}
]
}'
Request without a conversation history
curl -X POST 'https://your-server.com/dialog-push' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'timestamp: 1725091200000' \
-H 'auth: e7d2a1b3c5f8e0d4a6b9c2f1e3d5a7b0' \
-d '{
"callId": "1693456789012^1693454989012",
"caller": "18612345678",
"callee": "4006007006",
"conversationHistory": []
}'
Expected response (HTTP 200)
{
"code": 0,
"msg": "success"
}
Retries and exception handling
Retry policy
Configuration item | Value | Description |
Maximum retry count | 1 | At most two executions in total: the first attempt and one retry. |
Failure scenarios
Scenario | Handling |
HTTP status code is not 200 | Retry once. If it still fails, record a log and return a failure. |
Request timeout, exceeding 3 seconds | Retry once. |
Network exception | Retry once. If it still fails, return a failure. |
Notes
Push timing: The push occurs after the transfer request is successfully initiated. The agent might not yet be ringing or have answered the call. If the agent ultimately does not answer because of a timeout or rejection, the conversation record is still pushed.
Response time: We recommend that you return HTTP 200 within 500 ms. A timeout triggers a retry.
Status code only: The system checks only whether the HTTP status code is 200 and does not parse the response body. You can return any content.
Reduced conversation record: The pushed conversation record contains only the
roleandcontentfields.outIdvalue: The pushedoutIdis the original value that the customer passed when calling the API.Asynchronous push: The push is performed asynchronously and does not block the transfer process.
Callback URL: The URL must be a publicly accessible HTTPS address.
Signature algorithm: This interface uses the same
MD5(aliyunUid + callId + timestamp)signature algorithm as the transfer variable callback interface.
Step 4: Configure conversation attributes
On the . In the dialog box that appears, configure the conversation attributes and click OK.
Parameters
Parameter | Description | Recommended configuration |
Silence duration | Specifies the wait time (in seconds) when neither party is speaking before the silence-triggered model is triggered. The range is 3 to 15 seconds. | 5 |
Silence-triggered model | When the customer is silent, this feature proactively calls the model. The application inputs a fixed phrase to the model: User did not speak. For custom content, contact technical support for personalized configuration. Values:
| Yes |
Hang up on silence configuration | Configure the number of silence events that trigger an automatic hang-up. The range is 1 to 5 times. | 3 |
Smart answering detection | Enabled by default. Automatically detects voice assistants or mailboxes and returns a smart status code via the LlmSmartCallReport-Call Record Message. | - |
Hang up immediately | When smart answering detection identifies a voice assistant or mailbox, you can choose whether to terminate the call. The default is No. You can enable immediate hang-up based on your business needs. | - |
Maximum call duration | The valid range is 300 to 3,600 seconds. The call automatically hangs up when this limit is reached. | - |
Morse code playback configuration | If enabled, an AI-generated Morse code declaration plays at the end of the conversation. | - |
Uninterruptible opening prompt | If enabled, the large model will ignore any interruptions for a specified period during the opening. This is useful for scenarios where an identity or important notice must be fully delivered, preventing the opening prompt from being interrupted by the customer or background noise. Two options are available:
| - |
Prevent consecutive interruptions | When the number of interruptions exceeds a threshold, the large model ignores further interruptions for a configured duration and completes its speech to ensure a smooth conversation. You can configure the system to disallow interruptions for X seconds if the number of consecutive interruptions exceeds X. | - |
Acknowledgement phrases | If enabled, when a customer interrupts the large model, it may first respond with natural-sounding acknowledgement phrases like "Go ahead" or "Mm-hmm" to yield the floor to the customer. This reduces the robotic feel and improves the naturalness of the interaction. | - |
Step 5: Associate a summary agent (optional)
Prerequisites: You have created a Xiaoji Agent. See Xiaoji Agent.
Go to the Artificial Intelligence Cloud Call Service console. In the navigation bar, choose .
Find your application and click Xiaoji Agent Configuration in the Actions column.
Set Associate Xiaoji Agent to Yes and select the corresponding Xiaoji Agent.
Associating a Xiaoji Agent incurs additional fees. See Billing Details for pricing. If you don’t have a suitable Xiaoji Agent, click Create Xiaoji Agent to create one.
Step 6: View large model application details
After configuring the conversation attributes, you can view the application's details. On the Large Model Application Management tab, click Details for the created application to view its details in a dialog box.
The details page consists of two parts: Basic Information (Application name, Application code, Model name, Model code, Qualification, Script, Use case, Scenario, Opening prompt, Prompt, Calling voice, Volume, Speech rate, Base model version, Maximum concurrency, Hotword library) and Conversation Attributes (Silence-triggered model, Silence duration, Hang up on silence configuration, Smart answering detection, Maximum call duration).
Interruption events
During a conversation with the large model application, an interruption event may occur. When an interruption event occurs, the application predicts the point of interruption and passes the content, truncated at the point of interruption, to the large model.
For example, if the agent is saying This is a test opening prompt and you say Who are you? after it has said This is a, an interruption event occurs. The application predicts the interruption point. The content passed to the large model is not:
[
{
"role": "assistant",
"content": "This is a test opening prompt"
},
{
"role": "user",
"content": "Who are you?"
}
]but instead:
[
{
"role": "assistant",
"content": "This is a"
},
{
"role": "user",
"content": "Who are you?"
}
]