| | |
| | | //#import "configManager.h" |
| | | |
| | | #import "HDLLinphoneLog.h" |
| | | #import "HDLLinphoneTimerManager.h" |
| | | |
| | | |
| | | #define LINPHONE_LOGS_MAX_ENTRY 5000 |
| | | |
| | |
| | | #define kIAPReady @"IAPReady" // no data |
| | | |
| | | #define IPAD (HDLLinphoneManager.runningOnIpad) |
| | | |
| | | #define RESET_VIDEO_ENABLE_TIMER_NAME @"hdlLinphoneVideoEnableTimer" //é设è§é¢å¼è®¡æ¶å¨åç§° |
| | | #define RESET_VIDEO_DISABLE_TIMER_NAME @"hdlLinphoneVideoDisableTimer" //é设è§é¢å
³è®¡æ¶å¨åç§° |
| | | |
| | | static LinphoneCore *theLinphoneCore = nil; |
| | | static HDLLinphoneManager *theLinphoneManager = nil; |
| | |
| | | |
| | | |
| | | - (void)onCall:(LinphoneCall *)call StateChanged:(LinphoneCallState)state withMessage:(const char *)message { |
| | | NSLog(@"å¼å«ç¶æï¼%u",state); |
| | | NSLog(@"å¼å«ç¶æï¼%u,ä¿¡æ¯ï¼%s",state,message); |
| | | |
| | | HDLLinPhoneSDK.instance.IsIncomingReceivedCallState=false; |
| | | // Handling wrapper |
| | |
| | | speaker_already_enabled = TRUE; |
| | | } |
| | | } |
| | | |
| | | if( state == LinphoneCallConnected ){ |
| | | NSLog(@"è¿æ¥äº"); |
| | | // [self enableVideoPlay:TRUE]; |
| | | } |
| | | |
| | | if (state == LinphoneCallStreamsRunning) { |
| | | if (_speakerBeforePause) { |
| | | _speakerBeforePause = FALSE; |
| | | [self setSpeakerEnabled:TRUE]; |
| | | speaker_already_enabled = TRUE; |
| | | } |
| | | if (!self.isResettingVideoEnable&&self.deviceType==HDLLPType_HDLSR) { |
| | | self.isResettingVideoEnable=YES; |
| | | [self resetVideoEnable]; |
| | | } |
| | | } |
| | | if (state == LinphoneCallConnected && !mCallCenter) { |
| | | /*only register CT call center CB for connected call*/ |
| | |
| | | userInfo:dict]; |
| | | } |
| | | |
| | | /*éæ°æåè§é¢æµï¼è§£å³èªç å¯è§å¯¹è®²å¶å°åºç°è§é¢æµæå徿
¢çé®é¢ï¼ |
| | | */ |
| | | -(void)resetVideoEnable{ |
| | | NSLog(@"éç½®è§é¢å¼å
³"); |
| | | __weak typeof(self) weakSelf = self; |
| | | [self enableVideoPlay:TRUE]; |
| | | // [self enableVideoPlay:FALSE]; |
| | | // [[HDLLinphoneTimerManager sharedInstance] scheduleTimerWithInterval:0.5 timerName:RESET_VIDEO_ENABLE_TIMER_NAME count:^(double count) { |
| | | // |
| | | // } finished:^{ |
| | | // NSLog(@"æå¼è§é¢"); |
| | | // [weakSelf enableVideoPlay:TRUE]; |
| | | // }]; |
| | | } |
| | | |
| | | /*æ¯å¦å
许è§é¢ææ¾ |
| | | */ |
| | | -(void)enableVideoPlay:(bool_t)enable{ |
| | | LinphoneCall *call = linphone_core_get_current_call(LC); |
| | | LinphoneCallParams *call_params = linphone_core_create_call_params(LC,call); |
| | | linphone_call_params_enable_video(call_params, enable); |
| | | linphone_call_update(call, call_params); |
| | | linphone_call_params_unref(call_params); |
| | | } |
| | | |
| | | static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState state, |
| | | const char *message) { |
| | | [(__bridge HDLLinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onCall:call StateChanged:state withMessage:message]; |
| | |
| | | } |
| | | |
| | | - (void)onGlobalStateChanged:(LinphoneGlobalState)state withMessage:(const char *)message { |
| | | // LOGI(@"onGlobalStateChanged: %d (message: %s)", state, message); |
| | | LOGI(@"onGlobalStateChanged: %d (message: %s)", state, message); |
| | | |
| | | NSDictionary *dict = [NSDictionary |
| | | dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:state], @"state", |