From 855fb81d25eb0f4532fa81cd15ef9c979eaa47ec Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 4 Apr 2012 16:02:07 +0200 Subject: [PATCH] uses SIP messages out of calls to switch on light or open door do not pre-render icon --- Classes/LinphoneUI/UIDigitButton.m | 3 ++- Classes/UILightButton.h | 5 +++++ Classes/UILightButton.m | 13 +++++++++++-- linphone-Info.plist | 4 ++-- linphone.xcodeproj/project.pbxproj | 6 +++--- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Classes/LinphoneUI/UIDigitButton.m b/Classes/LinphoneUI/UIDigitButton.m index e8926605e..7d73893da 100644 --- a/Classes/LinphoneUI/UIDigitButton.m +++ b/Classes/LinphoneUI/UIDigitButton.m @@ -28,7 +28,8 @@ -(void) touchDown:(id) sender { - if (linphone_core_get_current_call([LinphoneManager getLc])) { + LinphoneCall *call=linphone_core_get_current_call([LinphoneManager getLc]); + if (call && linphone_call_get_state(call)==LinphoneCallStreamsRunning) { linphone_core_send_dtmf([LinphoneManager getLc],mDigit); } else if (chatRoom) { char msg[] = {mDigit, '\0'}; diff --git a/Classes/UILightButton.h b/Classes/UILightButton.h index eb5a284b8..0da7a635b 100644 --- a/Classes/UILightButton.h +++ b/Classes/UILightButton.h @@ -7,11 +7,16 @@ // #import "UIToggleButton.h" +#include "linphonecore.h" @interface UILightButton : UIToggleButton { +@public + LinphoneChatRoom* chatRoom; } +-(void) send; + @end diff --git a/Classes/UILightButton.m b/Classes/UILightButton.m index a491b1249..e9ecea283 100644 --- a/Classes/UILightButton.m +++ b/Classes/UILightButton.m @@ -11,12 +11,21 @@ @implementation UILightButton +-(void) send{ + LinphoneCall *call=linphone_core_get_current_call([LinphoneManager getLc]); + if (call && linphone_call_get_state(call)==LinphoneCallStreamsRunning) { + linphone_core_send_dtmf([LinphoneManager getLc],'2'); + } else if (chatRoom) { + linphone_chat_room_send_message(chatRoom, "2"); + } +} + -(void) onOn { - linphone_core_send_dtmf([LinphoneManager getLc],'2'); + [self send]; } -(void) onOff { - linphone_core_send_dtmf([LinphoneManager getLc],'2'); + [self send]; } -(bool) isInitialStateOn { diff --git a/linphone-Info.plist b/linphone-Info.plist index 43dda7980..3bead8349 100644 --- a/linphone-Info.plist +++ b/linphone-Info.plist @@ -23,11 +23,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.1.3 + 0.1.4 CFBundleSignature ???? CFBundleVersion - 0.1.3 + 0.1.4 NSMainNibFile BuschJaegerMainView UIApplicationExitsOnSuspend diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index fed1f65d5..9f0799fc0 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -1685,7 +1685,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 3.1; LIBRARY_SEARCH_PATHS = ""; LINK_WITH_STANDARD_LIBRARIES = YES; - PROVISIONING_PROFILE = "7EBE410C-11B9-4346-9977-2C3BEE43ED16"; + PROVISIONING_PROFILE = "B9B5980F-5156-43AD-841D-0502B5818325"; SDKROOT = iphoneos; }; name = DistributionAdhoc; @@ -1734,7 +1734,7 @@ ORDER_FILE = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = linphone; - PROVISIONING_PROFILE = "0FCDB3A2-9170-48DC-B1EE-58DF9948B0C7"; + PROVISIONING_PROFILE = "B9B5980F-5156-43AD-841D-0502B5818325"; SDKROOT = iphoneos; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; TARGETED_DEVICE_FAMILY = 1; @@ -2030,7 +2030,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 3.1; LIBRARY_SEARCH_PATHS = ""; LINK_WITH_STANDARD_LIBRARIES = YES; - PROVISIONING_PROFILE = "075921BC-C7D8-42E1-B864-F05FD9BF841C"; + PROVISIONING_PROFILE = "B9B5980F-5156-43AD-841D-0502B5818325"; SDKROOT = iphoneos; }; name = Distribution;