更新時間:2019-11-20
描述
用戶創(chuàng)建預約會議。
前提是鑒權登錄成功和會議環(huán)境參數已設置。
業(yè)務流程
-(BOOL)tsdkConfctrlBookConf:(NSArray *)attendeeArray mediaType:(EC_CONF_MEDIATYPE)mediaType startTime:(NSDate *)startTime confLen:(int)confLen subject:(NSString *)subject { TSDK_S_BOOK_CONF_INFO *bookConfInfoUportal = (TSDK_S_BOOK_CONF_INFO *)malloc(sizeof(TSDK_S_BOOK_CONF_INFO)); memset_s(bookConfInfoUportal, sizeof(TSDK_S_BOOK_CONF_INFO), 0, sizeof(TSDK_S_BOOK_CONF_INFO)); if (subject.length > 0 && subject != nil) { strcpy(bookConfInfoUportal->subject, [subject UTF8String]); } bookConfInfoUportal->conf_type = TSDK_E_CONF_INSTANT; if (startTime != nil) { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; NSString *startTimeStr = [dateFormatter stringFromDate:startTime]; NSString *utcStr = [self getUTCFormateLocalDate:startTimeStr]; DDLogInfo(@"start time : %@, utc time: %@",startTimeStr,utcStr); strcpy(bookConfInfoUportal->start_time, [utcStr UTF8String]); bookConfInfoUportal->duration = confLen; bookConfInfoUportal->conf_type = TSDK_E_CONF_RESERVED; } if (attendeeArray.count == 0) { bookConfInfoUportal->size = 5; bookConfInfoUportal->attendee_num = 0; bookConfInfoUportal->attendee_list = NULL; }else{ bookConfInfoUportal->size = (TSDK_UINT32)attendeeArray.count * 2; bookConfInfoUportal->attendee_num = (TSDK_UINT32)attendeeArray.count; bookConfInfoUportal->attendee_list = [self returnAttendeeWithArray:attendeeArray]; } bookConfInfoUportal->conf_media_type = (TSDK_E_CONF_MEDIA_TYPE)mediaType; bookConfInfoUportal->is_hd_conf = TSDK_FALSE; bookConfInfoUportal->is_multi_stream_conf = TSDK_FALSE; bookConfInfoUportal->is_auto_record = TSDK_FALSE; bookConfInfoUportal->is_auto_prolong = TSDK_TRUE; bookConfInfoUportal->is_auto_mute = TSDK_FALSE; bookConfInfoUportal->welcome_prompt = TSDK_E_CONF_WARNING_DEFAULT; bookConfInfoUportal->enter_prompt = TSDK_E_CONF_WARNING_DEFAULT; bookConfInfoUportal->leave_prompt = TSDK_E_CONF_WARNING_DEFAULT; bookConfInfoUportal->reminder = TSDK_E_CONF_REMINDER_NONE; bookConfInfoUportal->language = TSDK_E_CONF_LANGUAGE_ZH_CN; TSDK_RESULT ret = tsdk_book_conference(bookConfInfoUportal); DDLogInfo(@"tsdk_book_conference result : %d",ret); free(bookConfInfoUportal); return ret == TSDK_SUCCESS ? YES : NO; }
如果會議成功預約,其他用戶可以通過“查詢會議列表”或其他第三方方式獲取該會議的信息:
case TSDK_E_CONF_EVT_BOOK_CONF_RESULT: { DDLogInfo(@"TSDK_E_CONF_EVT_BOOK_CONF_RESULT"); BOOL result = notify.param1 == TSDK_SUCCESS; if (!result) { DDLogError(@"TSDK_E_CONF_EVT_BOOK_CONF_RESULT,error:%@",[NSString stringWithUTF8String:(TSDK_CHAR *)notify.data]); return; } TSDK_S_CONF_BASE_INFO *confListInfo = (TSDK_S_CONF_BASE_INFO *)notify.data; }
注意事項
無。
描述
用戶創(chuàng)建立即會議。
立即會議創(chuàng)建成功后,用戶的SIP號碼自動入會,用戶作為會議主席召集其他與會者加入會議。
前提條件
業(yè)務流程
在創(chuàng)建即時會議時,會議方數(size)、會議類型(conf_type),媒體類型(conf_media_type)和與會者信息(attendee_num&attendee_list)必選,其他參數可選。
-(BOOL)tsdkConfctrlBookConf:(NSArray *)attendeeArray mediaType:(EC_CONF_MEDIATYPE)mediaType startTime:(NSDate *)startTime confLen:(int)confLen subject:(NSString *)subject { TSDK_S_BOOK_CONF_INFO *bookConfInfoUportal = (TSDK_S_BOOK_CONF_INFO *)malloc(sizeof(TSDK_S_BOOK_CONF_INFO)); memset_s(bookConfInfoUportal, sizeof(TSDK_S_BOOK_CONF_INFO), 0, sizeof(TSDK_S_BOOK_CONF_INFO)); if (subject.length > 0 && subject != nil) { strcpy(bookConfInfoUportal->subject, [subject UTF8String]); } bookConfInfoUportal->conf_type = TSDK_E_CONF_INSTANT; if (startTime != nil) { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; NSString *startTimeStr = [dateFormatter stringFromDate:startTime]; NSString *utcStr = [self getUTCFormateLocalDate:startTimeStr]; DDLogInfo(@"start time : %@, utc time: %@",startTimeStr,utcStr); strcpy(bookConfInfoUportal->start_time, [utcStr UTF8String]); bookConfInfoUportal->duration = confLen; bookConfInfoUportal->conf_type = TSDK_E_CONF_RESERVED; } if (attendeeArray.count == 0) { bookConfInfoUportal->size = 5; bookConfInfoUportal->attendee_num = 0; bookConfInfoUportal->attendee_list = NULL; }else{ bookConfInfoUportal->size = (TSDK_UINT32)attendeeArray.count * 2; bookConfInfoUportal->attendee_num = (TSDK_UINT32)attendeeArray.count; bookConfInfoUportal->attendee_list = [self returnAttendeeWithArray:attendeeArray]; } bookConfInfoUportal->conf_media_type = (TSDK_E_CONF_MEDIA_TYPE)mediaType; bookConfInfoUportal->is_hd_conf = TSDK_FALSE; bookConfInfoUportal->is_multi_stream_conf = TSDK_FALSE; bookConfInfoUportal->is_auto_record = TSDK_FALSE; bookConfInfoUportal->is_auto_prolong = TSDK_TRUE; bookConfInfoUportal->is_auto_mute = TSDK_FALSE; bookConfInfoUportal->welcome_prompt = TSDK_E_CONF_WARNING_DEFAULT; bookConfInfoUportal->enter_prompt = TSDK_E_CONF_WARNING_DEFAULT; bookConfInfoUportal->leave_prompt = TSDK_E_CONF_WARNING_DEFAULT; bookConfInfoUportal->reminder = TSDK_E_CONF_REMINDER_NONE; bookConfInfoUportal->language = TSDK_E_CONF_LANGUAGE_ZH_CN; TSDK_RESULT ret = tsdk_book_conference(bookConfInfoUportal); DDLogInfo(@"tsdk_book_conference result : %d",ret); free(bookConfInfoUportal); return ret == TSDK_SUCCESS ? YES : NO; }
case TSDK_E_CONF_EVT_BOOK_CONF_RESULT: { DDLogInfo(@"TSDK_E_CONF_EVT_BOOK_CONF_RESULT"); BOOL result = notify.param1 == TSDK_SUCCESS; if (!result) { DDLogError(@"TSDK_E_CONF_EVT_BOOK_CONF_RESULT,error:%@",[NSString stringWithUTF8String:(TSDK_CHAR *)notify.data]); return; } TSDK_S_CONF_BASE_INFO *confListInfo = (TSDK_S_CONF_BASE_INFO *)notify.data; }
case TSDK_E_CONF_EVT_JOIN_CONF_RESULT: { DDLogInfo(@"TSDK_E_CONF_EVT_JOIN_CONF_RESULT"); BOOL result = notify.param2 == TSDK_SUCCESS; if (!result) { DDLogError(@"TSDK_E_CONF_EVT_JOIN_CONF_RESULT,error:%@",[NSString stringWithUTF8String:(TSDK_CHAR *)notify.data]); return; } _confHandle = notify.param1; TSDK_S_JOIN_CONF_IND_INFO *confInfo = (TSDK_S_JOIN_CONF_IND_INFO *)notify.data; _currentCallId = confInfo->call_id; dispatch_async(dispatch_get_main_queue(), ^{ // go conference [self goConferenceRunView:nil]; [self respondsECConferenceDelegateWithType:CONF_E_CONNECT result:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:TUP_CALL_REMOVE_CALL_VIEW_NOTIFY object:nil]; }); } break;
case TSDK_E_CONF_EVT_INFO_AND_STATUS_UPDATE: { DDLogInfo(@"TSDK_E_CONF_EVT_INFO_AND_STATUS_UPDATE"); [self handleAttendeeUpdateNotify:notify]; } break;
case TSDK_E_CONF_EVT_GET_DATACONF_PARAM_RESULT: { DDLogInfo(@"TSDK_E_CONF_EVT_GET_DATACONF_PARAM_RESULT"); BOOL result = notify.param2 == TSDK_SUCCESS; if (!result) { DDLogError(@"TSDK_E_CONF_EVT_GET_DATACONF_PARAM_RESULT,error:%@",[NSString stringWithUTF8String:(TSDK_CHAR *)notify.data]); return; } dispatch_async(dispatch_get_main_queue(), ^{ [self joinDataConference]; [self startHeartBeatTimer]; }); } break;
-(void)joinDataConference { TSDK_RESULT result = tsdk_join_data_conference(_confHandle); DDLogInfo(@"tsdk_join_data_conference ret: %d", result); }
在加入數據會議后,會向UI上報會議信息及狀態(tài)更新事件TSDK_E_CONF_EVT_INFO_AND_STATUS_UPDATE,UI刷新會議成員列表和會議信息。
case TSDK_E_CONF_EVT_JOIN_DATA_CONF_RESULT: { DDLogInfo(@"TSDK_E_CONF_EVT_JOIN_DATA_CONF_RESULT"); NSDictionary *resultInfo = nil; BOOL isSuccess = notify.param2 == TSDK_SUCCESS; resultInfo = @{ UCCONF_RESULT_KEY :[NSNumber numberWithBool:isSuccess] }; [self respondsECConferenceDelegateWithType:DATA_CONF_JOIN_RESOULT result:resultInfo]; } break;
注意事項
無。
描述
用戶查詢自己“創(chuàng)建”的和“待參加”的預約會議信息。
前提條件
業(yè)務流程
1、會議權限(conf_right)用于指定要查詢的會議權限類型,包含查詢創(chuàng)建的會議、待參加的會議或創(chuàng)建和待參加的會議,可選填;
2、請求會議列表頁索引(page_index),取值從1開始,建議與應用程序與會議列表的頁簽對應,必須要有明確值;
3、會議列表每頁的會議個數(page_size),建議與應用程序會議列表個數相同,必須要有明確值。
4、返回來的時間為UTC時間,UI進行頁面呈現之前需要將UTC時間轉換為本地時間。
-(BOOL)obtainConferenceListWithPageIndex:(int)pageIndex pageSize:(int)pageSize { TSDK_S_QUERY_CONF_LIST_REQ conflistInfo; memset(&conflistInfo, 0, sizeof(TSDK_S_QUERY_CONF_LIST_REQ)); conflistInfo.conf_right = TSDK_E_CONF_RIGHT_CREATE_JOIN; conflistInfo.is_include_end = TSDK_FALSE; conflistInfo.page_index = pageIndex; conflistInfo.page_size = pageSize; int result = tsdk_query_conference_list(&conflistInfo); DDLogInfo(@"tsdk_query_conference_list result: %d",result); return result == TSDK_SUCCESS ? YES : NO; }
case TSDK_E_CONF_EVT_QUERY_CONF_LIST_RESULT: { DDLogInfo(@"TSDK_E_CONF_EVT_QUERY_CONF_LIST_RESULT"); BOOL result = notify.param1 == TSDK_SUCCESS; if (!result) { DDLogError(@"TSDK_E_CONF_EVT_QUERY_CONF_LIST_RESULT,error:%@",[NSString stringWithUTF8String:(TSDK_CHAR *)notify.data]); return; } [self handleGetConfListResult:notify]; } break;
注意事項
無。
描述
用戶查詢指定會議的詳細信息。
前提條件
業(yè)務流程
請求消息結構TSDK_S_QUERY_CONF_DETAIL_REQ中,
-(BOOL)obtainConferenceDetailInfoWithConfId:(NSString *)confId Page:(int)pageIndex pageSize:(int)pageSize { if (confId.length == 0) { DDLogInfo(@"current confId is nil"); return NO; } TSDK_S_QUERY_CONF_DETAIL_REQ confInfo; memset(&confInfo, 0, sizeof(TSDK_S_QUERY_CONF_LIST_REQ)); if (confId.length > 0 && confId != nil) { strcpy(confInfo.conf_id, [confId UTF8String]); } confInfo.page_size = pageSize; confInfo.page_index = pageIndex; int getConfInfoRestult = tsdk_query_conference_detail(&confInfo); DDLogInfo(@"tsdk_query_conference_detail result: %d",getConfInfoRestult); return getConfInfoRestult == TSDK_SUCCESS ? YES : NO; }
case TSDK_E_CONF_EVT_QUERY_CONF_DETAIL_RESULT: { DDLogInfo(@"TSDK_E_CONF_EVT_QUERY_CONF_DETAIL_RESULT"); BOOL result = notify.param1 == TSDK_SUCCESS; if (!result) { DDLogError(@"TSDK_E_CONF_EVT_QUERY_CONF_DETAIL_RESULT,error:%@",[NSString stringWithUTF8String:(TSDK_CHAR *)notify.data]); return; } [self handleGetConfInfoResult:notify]; } break;
注意事項
無。