Updated on 2025-07-28 GMT+08:00

Starting an Instant Meeting

startP2PConf

API Description

This API is used to start an instant meeting.

Precautions

The actual service processing result is returned in the callback.

Method Definition

- (void)startP2PConf:(HWMUISDKStartCallInfoModel *)param callback:(_Nonnull HWMSDKCreateConfCompleteHandler)callback;
Table 1 HWMUISDKStartCallInfoModel description

Parameter

Mandatory

Type

Description

calleeInfo

Yes

HWMUISDKCalleeInfoModel*

Called participant information.

callerInfo

Yes

HWMUISDKCallerInfoModel*

Caller information.

mediaType

Yes

HWMUISDKMediaType

Definition

Media type.

Constraints

N/A

Default Value

HWMUISDKMediaTypeAudio: voice.

isGuestJoinConfWithoutPwd

No

BOOL

Definition

Whether guests can join the meeting without a password.

Constraints

N/A

Default Value

NO: A password is required.

confAllowJoinUser

No

HWMUISDKConfAllowJoinUserType

Definition

Types of users allowed to join the meeting.

Constraints

N/A

Default Value

HWMUISDKConfAllowJoinAnyone: everyone.

Table 2 HWMUISDKCallerInfoModel description

Parameter

Mandatory

Type

Description

nickName

No

NSString *

Definition

Name of the caller.

Constraints

N/A

Range

0 to 256 characters.

Default Value

N/A

Table 3 HWMUISDKCalleeInfoModel description

Parameter

Mandatory

Type

Description

nickName

No

NSString *

Definition

Name of the called participant.

Constraints

N/A

Range

0 to 256 characters.

Default Value

N/A

number

Yes

NSString *

Definition

Called number.

Constraints

If this parameter is set to the SIP number (for example, +99111244216210249) allocated to the account, the Huawei Cloud Meeting app is called. If this parameter is set to a PSTN number (for example, 18700000000), the number is called through the VoIP gateway if the enterprise has enabled PSTN call. This parameter is used for account and password authentication. Either this parameter or thirdUserId must be set.

Range

0 to 128 characters.

Default Value

N/A

thirdUserId

Yes

NSString *

Definition

Third-party user ID.

Constraints

For app ID authentication. Either this parameter or number must be set.

Range

0 to 128 characters.

Default Value

N/A

corpId

No

NSString *

Definition

Enterprise ID.

Constraints

N/A

Range

0 to 32 characters.

Default Value

N/A

Table 4 Enumerated values of HWMUISDKMediaType

Enumerated Value

Description

HWMUISDKMediaTypeAudio

Voice.

HWMUISDKMediaTypeVideo

Video.

Table 5 Enumerated values of HWMUISDKConfAllowJoinUserType

Enumeration Name

Enumerated Value

Description

HWMUISDKConfAllowJoinAnyone

0

Everyone.

HWMUISDKConfAllowJoinLoginedUser

1

Logged-in users.

HWMUISDKConfAllowJoinInCompanyUser

2

Corporate users only.

HWMUISDKConfAllowJoinInvitedUser

3

Invited users only.

Return Values

None

Sample Code
- (void)startP2PConf {
    // Set the information about the called participant.
    HWMUISDKCalleeInfo *calleeInfo = [[HWMUISDKCalleeInfo alloc] init];
    calleeInfo.nickName = @"Called participant name";
    calleeInfo.number = @"123456";
    calleeInfo.thirdUserId = @"123456";
    
    // Set the caller information.
    HWMUISDKCallerInfo *callerInfo = [[HWMUISDKCallerInfo alloc] init];
    callerInfo.nickName = @"Caller name";
    
    HWMUISDKStartCallInfoModel *param = [[HWMUISDKStartCallInfoModel alloc] init];
    // Set the media type.
    param.mediaType = HWMUISDKMediaTypeVideo;
    param.calleeInfo = calleeInfo;
    param.callerInfo = callerInfo;
    // Call the SDK API.
    [[HWMSdk getOpenApi] startP2PConf:param callback:^(NSError * _Nullable error, HWMCreateConfResult * _Nullable result) {
        if (error) {
            NSLog(@"Start instant meeting failed.:%@", error.localizedDescription);
        } else {
            NSLog(@"Instant meeting started.");
        }
    }];
}