Add support for sending DTMF without an active call

This commit is contained in:
Pierre-Eric Pelloux-Prayer 2012-02-07 11:41:46 +01:00
parent fbcebff975
commit daa81941b2
4 changed files with 21 additions and 1 deletions

View file

@ -36,6 +36,8 @@
UIToggleButton* mute;
UIDigitButton* lights;
UIDigitButton* openDoor;
LinphoneChatRoom * chatRoom;
}
@property (nonatomic, retain) IBOutlet UIView* videoView;

View file

@ -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 {

View file

@ -25,6 +25,9 @@
UITextField* mAddress;
bool_t sendDtmfDuringCall;
@public
LinphoneChatRoom* chatRoom;
}
-(void) initWithNumber:(char)digit ;

View file

@ -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 {