Updated on 2025-11-13 GMT+08:00

Receiving and Processing MO Messages Sent on 5G CSP

Function

This interface is invoked to receive and process MO messages sent on 5G CSP.

Usage Description

  • Prerequisites

    The 5G channel has been correctly created in the AICC.

Interface Authentication

Authorization in the 5G request header is used for authentication.

For comparison, extract the values of appId and appSecret from the character string in Authorization and those of appId and appSecret from the channel configuration.

private boolean checkPostFromCsp(HttpServletRequest request, ChannelConfig channelConfig) {
        if (StringUtils.isEmpty(request.getHeader(CommonConstants.CSP_AUTHORIZATION_NAME))) {
            log.error("Authorization is null, tenantId:{}, channelId:{}", channelConfig.getTenantId(), channelConfig.getId());
            return false;
        }
        String authorization = request.getHeader(CommonConstants.CSP_AUTHORIZATION_NAME);
        String[] authorizations = authorization.split(",");
        String username = authorizations[0].substring(authorizations[0].indexOf("\"") + 1, authorizations[0].lastIndexOf("\""));
        String password = authorizations[1].substring(authorizations[1].indexOf("\"") + 1, authorizations[1].lastIndexOf("\""));
        if (!username.equals(channelConfig.getAppId()) || !password.equals(channelConfig.getAppSecret())) {
            log.error("Authorization is not match, tenantId:{}, channelId:{}", channelConfig.getTenantId(), channelConfig.getId());
            return false;
        }
        return true;
    }

Interface Prototype

Table 1 Interface prototype description

Method

POST

URL

https://{IP address}:{Port number}/social/on/5G/{channelId}

{IP address}:{Port number} indicates the IP address and port number of the NSLB exposed externally.

{channelId} indicates the channel ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory or Not

Type

Default Value

Description

Content-Type

Yes

String

None

The value is fixed at application/json; charset=UTF-8.

Authorization

Yes

String

None

Authentication parameter in the request headers.

Tid

No

String

None

Media review results. For details, see Table 3.

Authstatus

Yes when a TID exists

String

None

Media review results. For details, see Table 3.

Address

No

String

None

This parameter is mandatory when 5G messages are received. For details, see Table 6.

Table 3 Media review result parameter (XML format, Authstatus = 0)

Parameter

Mandatory or Not

Type

Default Value

Description

file-info

Yes

JSON array

None

Multimedia file details.

Table 4 file-info parameters

Parameter

Mandatory or Not

Type

Default Value

Description

type

Yes

String

None

Multimedia file details.

file-size

Yes

String

None

File size.

file-name

No

String

None

File name. This parameter is available when type is set to file.

content-type

Yes

String

None

File response format.

data

Yes

JSON array

None

File details. For details, see Table 5.

Table 5 data parameters

Parameter

Mandatory or Not

Type

Default Value

Description

url

Yes

String

None

Multimedia file details.

until

No

String

None

Validity period of a file. This parameter is available when type is set to file.

Table 6 5G message parameter (XML format)

Parameter

Mandatory or Not

Type

Default Value

Description

inboundMessage

Yes

JSON array

None

Message list.

Table 7 inboundMessage parameters

Parameter

Mandatory or Not

Type

Default Value

Description

senderAddress

Yes

String

None

Message callback URL.

sender

Yes

JSON object

None

Level-3 sender of the messaging event.

Example

  • Request
    POST /social/on/5G/{channelId} HTTP/1.1
    ****************
    Accept: */*
    Content-Type: application/xml;charset=UTF-8
    {
    	"file_info": [
    		"type" : "mp4",
    		"file-size" :"2M",
    		"file-name" : "1.mp4",
    		"content-type": "",
    		"data": [
    			"url" : "https://www.5G/xxxx",
    			"util": ""	]
    		],
    	"inboundMessage" : [
    		"senderAddress": "",
    		"sender": ""				
    	]
    }