mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-27 16:09:20 +00:00
Add support for sending DTMF without an active call
This commit is contained in:
parent
fbcebff975
commit
daa81941b2
4 changed files with 21 additions and 1 deletions
|
|
@ -36,6 +36,8 @@
|
|||
UIToggleButton* mute;
|
||||
UIDigitButton* lights;
|
||||
UIDigitButton* openDoor;
|
||||
|
||||
LinphoneChatRoom * chatRoom;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIView* videoView;
|
||||
|
|
|
|||
|
|
@ -106,6 +106,16 @@
|
|||
[LinphoneManager set:videoView hidden:YES withName:"VIDEO_VIEW" andReason:__FUNCTION__];
|
||||
|
||||
linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView);
|
||||
|
||||
if (!chatRoom) {
|
||||
NSString* s = [NSString stringWithFormat:@"sip:100000001@%@", [[NSUserDefaults standardUserDefaults] stringForKey:@"adapter_ip_preference"]];
|
||||
const char* adapter = [s cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
chatRoom = linphone_core_create_chat_room([LinphoneManager getLc], adapter);
|
||||
|
||||
lights->chatRoom = chatRoom;
|
||||
openDoor->chatRoom = chatRoom;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void) displayCall:(LinphoneCall *)call InProgressFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@
|
|||
UITextField* mAddress;
|
||||
|
||||
bool_t sendDtmfDuringCall;
|
||||
|
||||
@public
|
||||
LinphoneChatRoom* chatRoom;
|
||||
|
||||
}
|
||||
-(void) initWithNumber:(char)digit ;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,12 @@
|
|||
|
||||
|
||||
-(void) touchDown:(id) sender {
|
||||
linphone_core_send_dtmf([LinphoneManager getLc],mDigit);
|
||||
if (linphone_core_get_current_call([LinphoneManager getLc])) {
|
||||
linphone_core_send_dtmf([LinphoneManager getLc],mDigit);
|
||||
} else if (chatRoom) {
|
||||
char msg[] = {mDigit, '\0'};
|
||||
linphone_chat_room_send_message(chatRoom, msg);
|
||||
}
|
||||
}
|
||||
|
||||
-(void) touchUp:(id) sender {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue