Updated on 2024-09-13 GMT+08:00

Creating a Meeting

1
HWMSdk.getOpenApi.createConf(CreateConfParam, HwmCancelableCallBack)

API Description

This API is used to create an instant meeting and join the meeting immediately.

Precautions

This API applies for the audio and camera permissions of the application.

Method Definition

1
2
3
4
5
6
 /**
     * Creates a meeting.
     * @param createConfParam Indicates the createConfParam object.
     * @param hwmCallback Indicates the result callback.
     */
   void createConf(CreateConfParam createConfParam , HwmCancelableCallBack <ConfInfo> hwmCallback);

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

createConfParam

Yes

CreateConfParam

createConfParam object.

hwmCallback

Yes

HwmCancelableCallBack

Callback object.

Return Values

None

Parameter Extension

Table 2 CreateConfParam description

Parameter

Mandatory

Type

Description

subject

Yes

String

Meeting topic.

confType

Yes

ConfType

CONF_AUDIO(0, "Voice meeting"),

CONF_VIDEO(1, "Video meeting"),

needPassword

Yes

boolean

Whether a password is required.

NOTE:

This parameter is valid only for meetings with a random ID.

guestPwd

No

String

Guest password. If this parameter is left blank, the guest password is generated by the server.

NOTE:

This parameter is valid only for meetings with a random ID.

attendeeMembers

No

List<AttendeeModel>

Participant list.

isCameraOn

No

boolean

Whether to enable the camera.

isMicOn

No

boolean

Whether to enable the microphone.

isRecordOn

No

boolean

Whether to enable meeting recording.

NOTE:

This parameter is valid only for cloud recording, not for local recording on clients.

isAutoRecord

No

boolean

Whether to automatically start recording after the meeting starts. The default value is false. Meeting recording must be enabled if automatic recording is enabled.

NOTE:

This parameter is valid only for cloud recording, not for local recording on clients.

vmrId

No

String

Cloud meeting room ID.

joinConfRestrictionType

No

JoinConfPermissionType

PERMIT_EVERYONE("PERMIT_EVERYONE", 0, "Everyone can join the meeting.")

PERMIT_ENTERPRISE_USER(The "PERMIT_ENTERPRISE_USER", 2, "Only corporate users are allowed to join the meeting.")

PERMIT_INVITED_USER("PERMIT_INVITED_USER", 3, "Only invited users are allowed to join the meeting.");

customInfo

No

String

User-defined data on the device side. The server is unaware of the data.

isSpeakerOff

No

boolean

Whether to disable the speakers. By default, the speakers are enabled.

concurrentParticipants

No

int

Maximum number of participants in the meeting.

If this parameter is left blank, there is no restriction.

confResType

No

ConfResType

Meeting resource type. This parameter is mandatory only for a shared cloud meeting room (set the value to ConfResType.CONF_RESTYPE_SHARE_VMR).

autoMuteMode

No

AutoMuteType

Whether to automatically mute personal client users when they join the meeting.

hardTerminalAutoMuteMode

No

AutoMuteType

Whether to automatically mute meeting room device users when they join the meeting.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    List<AttendeeModel> attendeeList = new ArrayList<>();
        // The following three methods are available:
	    String name = getName();
       	    String number = getNumber();
	    String thirdAccountId = getThirdAccountId();
            if (!TextUtils.isEmpty(thirdAccount)) {
                if (LoginStatusCache.getsLoginAccountInfo() instanceof AppIdAuthParam) {
                    // An app ID is used for login.
                    attendeeList.add(AttendeeModel.buildAttendeeByThirdAccountId(thirdAccount,name));
                }
            } else if(number.startsWith("+99")){
                // A SIP number is used to join the meeting.
                attendeeList.add(AttendeeModel.buildAttendeeBySipNumber(number, name));
            } else {
                // A mobile number or a fixed-line phone number is used to join the meeting.
                attendeeList.add(AttendeeModel.buildAttendeeByPhone(number, name));
            }

CreateConfParam createConfParam = new CreateConfParam()                             
     .setSubject(getSubject())                             // Set the meeting topic.
     .setConfType(ConfType.CONF_AUDIO)                        // Set the meeting type.
     .setVmrId(getVmrId())         // (Optional) Set the cloud meeting room ID.
     .setJoinConfRestrictionType(JoinConfPermissionType.PERMIT_EVERYONE)   // Specify the scope of users who are allowed to join the meeting.
     .setNeedPassword(true)                  // Specify whether to create a password.
     .setCameraOn(true)           // Specify whether to enable the camera.
     .setMicOn(true)              // Specify whether to enable the microphone.
     .setRecordOn(true)    // Specify whether to enable meeting recording.
     .setAttendeeMembers(attendeeList);    // Add participant information.

HWMSdk.getOpenApi(getActivity()).createConf(createConfParam, new HwmCancelableCallBack<ConfInfo>() {  

     // Callback invoked when a meeting is created.
     @Override              
     public void onSuccess(ConfInfo confInfo) {                    
         Log.i(TAG, "Meeting created: Meeting ID: "+ confInfo.getConfId() +
              ";Meeting password:" + confInfo.getConfPwd());              
     }
         
     // Callback invoked when a meeting fails to be created.
     @Override              
     public void onFailed(int retCode, String desc) {                             
         dismissLoading();                   
         String err = ErrorMessageFactory.create(Utils.getApp(), retCode);                   
         if (TextUtils.isEmpty(err)) {                       
            err = Utils.getApp().getString(com.huawei.hwmmobileconfui.R.string.conf_create_error);                   
         }                  
         Log.e(TAG, "Create meeting failed.: "+ err);
     }         
    @Override
    public void onCancel() {
        
    }
});