forked from mirrors/linphone-iphone
use new multi call version of liblinphone
This commit is contained in:
parent
1220efaed1
commit
a12e2ae8c3
10 changed files with 191 additions and 156 deletions
|
|
@ -37,11 +37,11 @@
|
|||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
UIBarButtonItem* clear = [[UIBarButtonItem alloc]
|
||||
initWithBarButtonSystemItem:UIBarButtonSystemItemTrash
|
||||
target:self
|
||||
action:@selector(doAction:)];
|
||||
[self.navigationItem setRightBarButtonItem:clear];
|
||||
UIBarButtonItem* clearButton = [[UIBarButtonItem alloc]
|
||||
initWithBarButtonSystemItem:UIBarButtonSystemItemTrash
|
||||
target:self
|
||||
action:@selector(doAction:)];
|
||||
[self.navigationItem setRightBarButtonItem:clearButton];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -106,8 +106,7 @@
|
|||
/*
|
||||
* Handle call state change from linphone
|
||||
*/
|
||||
-(void) callStateChange:(LinphoneGeneralState*) state;
|
||||
|
||||
-(void) onCall:(LinphoneCall*) call StateChanged: (LinphoneCallState) state withMessage: (const char *) message;
|
||||
-(void) setLinphoneCore:(LinphoneCore*) lc;
|
||||
|
||||
/********************
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@
|
|||
linphone_address_destroy(tmpAddress);
|
||||
}
|
||||
} else if (linphone_core_inc_invite_pending(mCore)) {
|
||||
linphone_core_accept_call(mCore,NULL);
|
||||
linphone_core_accept_call(mCore,linphone_core_get_current_call(mCore));
|
||||
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_None;
|
||||
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute
|
||||
, sizeof (audioRouteOverride)
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
//Cancel audio route redirection
|
||||
|
||||
} else if (sender == hangup) {
|
||||
linphone_core_terminate_call(mCore,NULL);
|
||||
linphone_core_terminate_call(mCore,linphone_core_get_current_call(mCore));
|
||||
} else if (sender == mute) {
|
||||
[self muteAction:!isMuted];
|
||||
|
||||
|
|
@ -168,7 +168,7 @@
|
|||
newAddress = [address.text substringToIndex: [address.text length]-1];
|
||||
}
|
||||
} else {
|
||||
ms_message(@"unknown event from diad pad");
|
||||
ms_message("unknown event from diad pad");
|
||||
return;
|
||||
}
|
||||
if (newAddress != nil) {
|
||||
|
|
@ -201,7 +201,7 @@
|
|||
} else if (sender == hash) {
|
||||
linphone_core_send_dtmf(mCore,'#');
|
||||
} else if (sender == hangup) {
|
||||
linphone_core_terminate_call(mCore,NULL);
|
||||
linphone_core_terminate_call(mCore,linphone_core_get_current_call(mCore));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -214,7 +214,7 @@
|
|||
selector:@selector(doKeyZeroLongPress)
|
||||
object:nil];
|
||||
} else {
|
||||
ms_message(@"unknown up event from dial pad");
|
||||
ms_message("unknown up event from dial pad");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -312,45 +312,44 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
-(void) callStateChange:(LinphoneGeneralState*) state {
|
||||
// /* states for GSTATE_GROUP_POWER */
|
||||
// GSTATE_POWER_OFF = 0, /* initial state */
|
||||
// GSTATE_POWER_STARTUP,
|
||||
// GSTATE_POWER_ON,
|
||||
// GSTATE_POWER_SHUTDOWN,
|
||||
// /* states for GSTATE_GROUP_REG */
|
||||
// GSTATE_REG_NONE = 10, /* initial state */
|
||||
// GSTATE_REG_OK,
|
||||
// GSTATE_REG_FAILED,
|
||||
// /* states for GSTATE_GROUP_CALL */
|
||||
// GSTATE_CALL_IDLE = 20, /* initial state */
|
||||
// GSTATE_CALL_OUT_INVITE,
|
||||
// GSTATE_CALL_OUT_CONNECTED,
|
||||
// GSTATE_CALL_IN_INVITE,
|
||||
// GSTATE_CALL_IN_CONNECTED,
|
||||
// GSTATE_CALL_END,
|
||||
// GSTATE_CALL_ERROR,
|
||||
// GSTATE_INVALID
|
||||
switch (state->new_state) {
|
||||
case GSTATE_CALL_IN_INVITE:
|
||||
case GSTATE_CALL_OUT_INVITE: {
|
||||
-(void) onCall:(LinphoneCall*) currentCall StateChanged: (LinphoneCallState) new_state withMessage: (const char *) message {
|
||||
/*
|
||||
LinphoneCallIdle,
|
||||
LinphoneCallIncomingReceived,
|
||||
LinphoneCallOutgoingInit,
|
||||
LinphoneCallOutgoingProgress,
|
||||
LinphoneCallOutgoingRinging,
|
||||
LinphoneCallOutgoingEarlyMedia,
|
||||
LinphoneCallConnected,
|
||||
LinphoneCallStreamsRunning,
|
||||
LinphoneCallPausing,
|
||||
LinphoneCallPaused,
|
||||
LinphoneCallResuming,
|
||||
LinphoneCallRefered,
|
||||
LinphoneCallError,
|
||||
LinphoneCallEnd,
|
||||
LinphoneCallPausedByRemote
|
||||
*/
|
||||
switch (new_state) {
|
||||
case LinphoneCallOutgoingInit:
|
||||
case LinphoneCallIncomingReceived: {
|
||||
[hangup setEnabled:true];
|
||||
break;
|
||||
}
|
||||
|
||||
case GSTATE_CALL_ERROR: {
|
||||
case LinphoneCallError: {
|
||||
/*
|
||||
NSString* lTitle= state->message!=nil?[NSString stringWithCString:state->message length:strlen(state->message)]: @"Error";
|
||||
NSString* lMessage=lTitle;
|
||||
*/
|
||||
NSString* lMessage;
|
||||
NSString* lTitle;
|
||||
const char *errormsg=state->message;
|
||||
|
||||
|
||||
lMessage=@"Please make sure your device is connected to the internet and double check your SIP account configuration in the settings.";
|
||||
|
||||
if (errormsg!=nil){
|
||||
lMessage=[NSString stringWithFormat : @"%@\nReason was: %s",lMessage, errormsg];
|
||||
if (message!=nil){
|
||||
lMessage=[NSString stringWithFormat : @"%@\nReason was: %s",lMessage, message];
|
||||
}
|
||||
lTitle=@"Call failed";
|
||||
|
||||
|
|
@ -365,20 +364,20 @@
|
|||
|
||||
}
|
||||
break;
|
||||
case GSTATE_CALL_IN_CONNECTED:
|
||||
case GSTATE_CALL_OUT_CONNECTED: {
|
||||
|
||||
case LinphoneCallConnected: {
|
||||
[self muteAction:false];
|
||||
// test if speaker must be unactivated after ring tone
|
||||
if (!isSpeaker) [self speakerAction:false];
|
||||
|
||||
const LinphoneAddress* callAddress = linphone_core_get_remote_uri(mCore);
|
||||
const LinphoneAddress* callAddress = linphone_call_get_remote_address(linphone_core_get_current_call(mCore));
|
||||
const char* callDisplayName = linphone_address_get_display_name(callAddress)?linphone_address_get_display_name(callAddress):"";
|
||||
if (callDisplayName && callDisplayName[0] != '\000') {
|
||||
|
||||
[peerLabel setText:[NSString stringWithCString:callDisplayName length:strlen(callDisplayName)]];
|
||||
[peerLabel setText:[NSString stringWithCString:callDisplayName encoding:[NSString defaultCStringEncoding]]];
|
||||
} else {
|
||||
const char* username = linphone_address_get_username(callAddress)!=0?linphone_address_get_username(callAddress):"";
|
||||
[peerLabel setText:[NSString stringWithCString:username length:strlen(username)]];
|
||||
[peerLabel setText:[NSString stringWithCString:username encoding:[NSString defaultCStringEncoding]]];
|
||||
}
|
||||
// start scheduler
|
||||
durationRefreasher = [NSTimer scheduledTimerWithTimeInterval:1
|
||||
|
|
@ -393,7 +392,7 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case GSTATE_CALL_END: {
|
||||
case LinphoneCallEnd: {
|
||||
[address setHidden:false];
|
||||
[incallView setHidden:true];
|
||||
[call setEnabled:true];
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
bool isDebug;
|
||||
bool isStarted;
|
||||
bool backgroundSupported;
|
||||
bool isbackgroundModeEnabled;
|
||||
|
||||
LinphoneCore* myLinphoneCore;
|
||||
SCNetworkReachabilityContext proxyReachabilityContext;
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@
|
|||
|
||||
|
||||
extern void ms_au_register_card();
|
||||
void linphone_iphone_keepAliveHandler () {
|
||||
ms_message("keepalive handler invoked");
|
||||
};
|
||||
|
||||
//generic log handler for debug version
|
||||
void linphone_iphone_log_handler(int lev, const char *fmt, va_list args){
|
||||
|
|
@ -48,7 +45,7 @@ void linphone_iphone_log_handler(int lev, const char *fmt, va_list args){
|
|||
|
||||
//Error/warning log handler
|
||||
void linphone_iphone_log(struct _LinphoneCore * lc, const char * message) {
|
||||
NSString* log = [NSString stringWithCString:message length:strlen(message)];
|
||||
NSString* log = [NSString stringWithCString:message encoding:[NSString defaultCStringEncoding]];
|
||||
NSLog(log);
|
||||
[ConsoleViewController addLog:log];
|
||||
}
|
||||
|
|
@ -56,27 +53,48 @@ void linphone_iphone_log(struct _LinphoneCore * lc, const char * message) {
|
|||
//status
|
||||
void linphone_iphone_display_status(struct _LinphoneCore * lc, const char * message) {
|
||||
PhoneViewController* lPhone = ((linphoneAppDelegate*) linphone_core_get_user_data(lc)).myPhoneViewController;
|
||||
[lPhone displayStatus:[NSString stringWithCString:message length:strlen(message)]];
|
||||
[lPhone displayStatus:[NSString stringWithCString:message encoding:[NSString defaultCStringEncoding]]];
|
||||
}
|
||||
|
||||
void linphone_iphone_show(struct _LinphoneCore * lc) {
|
||||
//nop
|
||||
void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall* call, LinphoneCallState state,const char* message) {
|
||||
linphoneAppDelegate* lAppDelegate = (linphoneAppDelegate*) linphone_core_get_user_data(lc);
|
||||
if (state == LinphoneCallIncomingReceived) {
|
||||
[lAppDelegate newIncomingCall:[[NSString alloc] initWithCString:linphone_address_get_username(linphone_call_get_remote_address(call))]];
|
||||
}
|
||||
PhoneViewController* lPhone = lAppDelegate.myPhoneViewController;
|
||||
[lPhone onCall:call StateChanged:state withMessage:message];
|
||||
}
|
||||
void linphone_iphone_call_received(LinphoneCore *lc, const char *from){
|
||||
LinphoneAddress* fromAddr = linphone_address_new(from);
|
||||
[((linphoneAppDelegate*) linphone_core_get_user_data(lc)) newIncomingCall:[[NSString alloc] initWithCString:linphone_address_get_username(fromAddr) encoding:[NSString defaultCStringEncoding]]];
|
||||
linphone_address_destroy(fromAddr);
|
||||
|
||||
void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyConfig* cfg, LinphoneRegistrationState state,const char* message) {
|
||||
linphoneAppDelegate* lAppDelegate = (linphoneAppDelegate*) linphone_core_get_user_data(lc);
|
||||
if (state == LinphoneRegistrationFailed ) {
|
||||
|
||||
NSString* lErrorMessage;
|
||||
if (linphone_proxy_config_get_error(cfg) == LinphoneErrorBadCredentials) {
|
||||
lErrorMessage = @"Bad credentials, check your account settings";
|
||||
} else if (linphone_proxy_config_get_error(cfg) == LinphoneErrorNoResponse) {
|
||||
lErrorMessage = @"SIP server unreachable";
|
||||
}
|
||||
if (lErrorMessage != nil) {
|
||||
|
||||
|
||||
UIAlertView* error = [[UIAlertView alloc] initWithTitle:@"Registration failure"
|
||||
message:lErrorMessage
|
||||
delegate:lAppDelegate
|
||||
cancelButtonTitle:@"Continue"
|
||||
otherButtonTitles:nil ,nil];
|
||||
[error show];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
void linphone_iphone_general_state(LinphoneCore *lc, LinphoneGeneralState *gstate) {
|
||||
PhoneViewController* lPhone = ((linphoneAppDelegate*) linphone_core_get_user_data(lc)).myPhoneViewController;
|
||||
[lPhone callStateChange:gstate];
|
||||
}
|
||||
|
||||
|
||||
LinphoneCoreVTable linphonec_vtable = {
|
||||
.show =(ShowInterfaceCb) linphone_iphone_show,
|
||||
.inv_recv = linphone_iphone_call_received,
|
||||
.bye_recv = NULL,
|
||||
.show =NULL,
|
||||
.call_state_changed =(LinphoneCallStateCb)linphone_iphone_call_state,
|
||||
.registration_state_changed = linphone_iphone_registration_state,
|
||||
.notify_recv = NULL,
|
||||
.new_unknown_subscriber = NULL,
|
||||
.auth_info_requested = NULL,
|
||||
|
|
@ -84,9 +102,7 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
.display_message=linphone_iphone_log,
|
||||
.display_warning=linphone_iphone_log,
|
||||
.display_url=NULL,
|
||||
.display_question=(DisplayQuestionCb)NULL,
|
||||
.text_received=NULL,
|
||||
.general_state=(GeneralStateChange)linphone_iphone_general_state,
|
||||
.dtmf_received=NULL
|
||||
};
|
||||
|
||||
|
|
@ -116,76 +132,85 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
if (backgroundSupported && proxyCfg) {
|
||||
|
||||
|
||||
//register
|
||||
linphone_core_set_network_reachable(myLinphoneCore,false);
|
||||
linphone_core_iterate(myLinphoneCore);
|
||||
linphone_core_set_network_reachable(myLinphoneCore,true);
|
||||
|
||||
int i=0;
|
||||
while (!linphone_proxy_config_is_registered(proxyCfg) && i++<40 ) {
|
||||
if (isbackgroundModeEnabled) {
|
||||
//register
|
||||
linphone_core_set_network_reachable(myLinphoneCore,false);
|
||||
linphone_core_iterate(myLinphoneCore);
|
||||
usleep(100000);
|
||||
linphone_core_set_network_reachable(myLinphoneCore,true);
|
||||
|
||||
int i=0;
|
||||
while (!linphone_proxy_config_is_registered(proxyCfg) && i++<40 ) {
|
||||
linphone_core_iterate(myLinphoneCore);
|
||||
usleep(100000);
|
||||
}
|
||||
if ([[UIApplication sharedApplication] setKeepAliveTimeout:600/*(NSTimeInterval)linphone_proxy_config_get_expires(proxyCfg)*/
|
||||
handler:^{
|
||||
ms_warning("keepalive handler");
|
||||
//kick up network cnx, just in case
|
||||
linphone_core_set_network_reachable(myLinphoneCore,false);
|
||||
linphone_core_iterate(myLinphoneCore);
|
||||
[self kickOffNetworkConnection];
|
||||
linphone_core_set_network_reachable(myLinphoneCore,true);
|
||||
linphone_core_iterate(myLinphoneCore);
|
||||
}
|
||||
]) {
|
||||
|
||||
|
||||
ms_warning("keepalive handler succesfully registered");
|
||||
} else {
|
||||
ms_warning("keepalive handler cannot be registered");
|
||||
}
|
||||
LCSipTransports transportValue;
|
||||
if (linphone_core_get_sip_transports(myLinphoneCore, &transportValue)) {
|
||||
ms_error("cannot get current transport");
|
||||
}
|
||||
|
||||
if (mReadStream == nil && transportValue.udp_port>0) { //only for udp
|
||||
const char *port;
|
||||
addr=linphone_address_new(linphone_proxy_config_get_addr(proxyCfg));
|
||||
memset(&hints,0,sizeof(hints));
|
||||
hints.ai_family=linphone_core_ipv6_enabled(myLinphoneCore) ? AF_INET6 : AF_INET;
|
||||
port=linphone_address_get_port(addr);
|
||||
if (port==NULL) port="5060";
|
||||
err=getaddrinfo(linphone_address_get_domain(addr),port,&hints,&res);
|
||||
if (err!=0){
|
||||
ms_error("getaddrinfo() failed for %s: %s",linphone_address_get_domain(addr),gai_strerror(err));
|
||||
linphone_address_destroy(addr);
|
||||
return;
|
||||
}
|
||||
err=connect(sipsock,res->ai_addr,res->ai_addrlen);
|
||||
if (err==-1){
|
||||
ms_error("Connect failed: %s",strerror(errno));
|
||||
}
|
||||
freeaddrinfo(res);
|
||||
|
||||
CFStreamCreatePairWithSocket(NULL, (CFSocketNativeHandle)sipsock, &mReadStream,nil);
|
||||
|
||||
if (!CFReadStreamSetProperty(mReadStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP)) {
|
||||
ms_error("cannot set service type to voip for read stream");
|
||||
}
|
||||
|
||||
|
||||
if (!CFReadStreamOpen(mReadStream)) {
|
||||
ms_error("cannot open read stream");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ([[UIApplication sharedApplication] setKeepAliveTimeout:600/*(NSTimeInterval)linphone_proxy_config_get_expires(proxyCfg)*/
|
||||
handler:^{
|
||||
ms_warning("keepalive handler");
|
||||
//kick up network cnx, just in case
|
||||
linphone_core_set_network_reachable(myLinphoneCore,false);
|
||||
linphone_core_iterate(myLinphoneCore);
|
||||
[self kickOffNetworkConnection];
|
||||
linphone_core_set_network_reachable(myLinphoneCore,true);
|
||||
linphone_core_iterate(myLinphoneCore);
|
||||
}
|
||||
]) {
|
||||
else {
|
||||
//only unregister
|
||||
//register
|
||||
linphone_proxy_config_edit(proxyCfg); //force unregister
|
||||
linphone_core_iterate(myLinphoneCore);
|
||||
ms_warning("Entering lite bg mode");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ms_warning("keepalive handler succesfully registered");
|
||||
} else {
|
||||
ms_warning("keepalive handler cannot be registered");
|
||||
}
|
||||
LCSipTransports transportValue;
|
||||
if (linphone_core_get_sip_transports(myLinphoneCore, &transportValue)) {
|
||||
ms_error("cannot get current transport");
|
||||
}
|
||||
|
||||
if (mReadStream == nil && transportValue.udp_port>0) { //only for udp
|
||||
const char *port;
|
||||
addr=linphone_address_new(linphone_proxy_config_get_addr(proxyCfg));
|
||||
memset(&hints,0,sizeof(hints));
|
||||
hints.ai_family=linphone_core_ipv6_enabled(myLinphoneCore) ? AF_INET6 : AF_INET;
|
||||
port=linphone_address_get_port(addr);
|
||||
if (port==NULL) port="5060";
|
||||
err=getaddrinfo(linphone_address_get_domain(addr),port,&hints,&res);
|
||||
if (err!=0){
|
||||
ms_error("getaddrinfo() failed for %s: %s",linphone_address_get_domain(addr),gai_strerror(err));
|
||||
linphone_address_destroy(addr);
|
||||
return;
|
||||
}
|
||||
err=connect(sipsock,res->ai_addr,res->ai_addrlen);
|
||||
if (err==-1){
|
||||
ms_error("Connect failed: %s",strerror(errno));
|
||||
}
|
||||
freeaddrinfo(res);
|
||||
|
||||
CFStreamCreatePairWithSocket(NULL, (CFSocketNativeHandle)sipsock, &mReadStream,nil);
|
||||
|
||||
if (!CFReadStreamSetProperty(mReadStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP)) {
|
||||
ms_error("cannot set service type to voip for read stream");
|
||||
}
|
||||
|
||||
|
||||
if (!CFReadStreamOpen(mReadStream)) {
|
||||
ms_error("cannot open read stream");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
|
||||
|
||||
//as defined in PhoneMainView.xib
|
||||
#define DIALER_TAB_INDEX 1
|
||||
|
|
@ -271,9 +296,9 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
|
||||
//unconnect
|
||||
int socket = linphone_core_get_sip_socket(myLinphoneCore);
|
||||
struct addrinfo hints;
|
||||
struct sockaddr hints;
|
||||
memset(&hints,0,sizeof(hints));
|
||||
hints.ai_family=AF_UNSPEC;
|
||||
hints.sa_family=AF_UNSPEC;
|
||||
connect(socket,&hints,sizeof(hints));
|
||||
CFReadStreamClose(mReadStream);
|
||||
CFRelease(mReadStream);
|
||||
|
|
@ -342,7 +367,6 @@ extern void libmsilbc_init();
|
|||
userInfo:nil
|
||||
repeats:YES];
|
||||
//init audio session
|
||||
NSError *setError = nil;
|
||||
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
|
||||
BOOL bAudioInputAvailable= [audioSession inputIsAvailable];
|
||||
|
||||
|
|
@ -547,6 +571,8 @@ extern void libmsilbc_init();
|
|||
}
|
||||
}
|
||||
|
||||
isbackgroundModeEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"backgroundmode_preference"];
|
||||
|
||||
}
|
||||
|
||||
// no proxy configured alert
|
||||
|
|
@ -573,31 +599,35 @@ extern void libmsilbc_init();
|
|||
{
|
||||
notif.repeatInterval = 0;
|
||||
notif.alertBody =[NSString stringWithFormat:@" %@ is calling you",from];
|
||||
notif.soundName = UILocalNotificationDefaultSoundName;
|
||||
notif.alertAction = @"Answer";
|
||||
notif.soundName = @"oldphone-mono-30s.wav";
|
||||
|
||||
[[UIApplication sharedApplication] presentLocalNotificationNow:notif];
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
{
|
||||
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:@" %@ is calling you",from]
|
||||
delegate:self cancelButtonTitle:@"Decline" destructiveButtonTitle:@"Answer" otherButtonTitles:nil];
|
||||
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
|
||||
[actionSheet showFromTabBar:myTabBarController.tabBar];
|
||||
[actionSheet release];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
|
||||
if (buttonIndex == 0 ) {
|
||||
linphone_core_accept_call(myLinphoneCore,NULL);
|
||||
linphone_core_accept_call(myLinphoneCore,linphone_core_get_current_call(myLinphoneCore));
|
||||
} else {
|
||||
linphone_core_terminate_call (myLinphoneCore,NULL);
|
||||
linphone_core_terminate_call (myLinphoneCore,linphone_core_get_current_call(myLinphoneCore));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
|
||||
linphone_core_accept_call(myLinphoneCore,linphone_core_get_current_call(myLinphoneCore));
|
||||
}
|
||||
//scheduling loop
|
||||
-(void) iterate {
|
||||
linphone_core_iterate(myLinphoneCore);
|
||||
|
|
@ -608,7 +638,7 @@ extern void libmsilbc_init();
|
|||
const MSList *elem;
|
||||
for(elem=list;elem!=NULL;elem=elem->next){
|
||||
PayloadType *pt=(PayloadType*)elem->data;
|
||||
if ([type isEqualToString:[NSString stringWithCString:payload_type_get_mime(pt) length:strlen(payload_type_get_mime(pt))]] && rate==pt->clock_rate) {
|
||||
if ([type isEqualToString:[NSString stringWithCString:payload_type_get_mime(pt) encoding:[NSString defaultCStringEncoding]]] && rate==pt->clock_rate) {
|
||||
return pt;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -214,6 +214,16 @@
|
|||
<key>DefaultValue</key>
|
||||
<string>udp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Background mode</string>
|
||||
<key>Key</key>
|
||||
<string>backgroundmode_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
2245671D107699F700F10948 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2245671C107699F700F10948 /* Settings.bundle */; };
|
||||
224567C2107B968500F10948 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 224567C1107B968500F10948 /* AVFoundation.framework */; };
|
||||
2245F78A1201D38000C4179D /* MoreViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22E0A81B111C44E100B04932 /* MoreViewController.xib */; };
|
||||
224E7F4D124CB00900113C4A /* oldphone-mono-30s.wav in Resources */ = {isa = PBXBuildFile; fileRef = 224E7F4C124CB00900113C4A /* oldphone-mono-30s.wav */; };
|
||||
225CB2EA11ABB51000628906 /* clavier-01-106px.png in Resources */ = {isa = PBXBuildFile; fileRef = 225CB2E811ABB51000628906 /* clavier-01-106px.png */; };
|
||||
225CB2EB11ABB51000628906 /* clavier-01-108px.png in Resources */ = {isa = PBXBuildFile; fileRef = 225CB2E911ABB51000628906 /* clavier-01-108px.png */; };
|
||||
225CB2EE11ABB65D00628906 /* clavier-01-160px.png in Resources */ = {isa = PBXBuildFile; fileRef = 225CB2ED11ABB65D00628906 /* clavier-01-160px.png */; };
|
||||
|
|
@ -46,9 +47,9 @@
|
|||
227BCDC210D4004600FBFD76 /* CallHistoryTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 227BCDC010D4004600FBFD76 /* CallHistoryTableViewController.m */; };
|
||||
227BCDC310D4004600FBFD76 /* CallHistoryTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 227BCDC110D4004600FBFD76 /* CallHistoryTableViewController.xib */; };
|
||||
228697C411AC29B800E9E0CA /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 228697C311AC29B800E9E0CA /* CFNetwork.framework */; };
|
||||
22A10F3911F8960300373793 /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2A10765B400068D98F /* liblinphone.a */; };
|
||||
22A10F3A11F8960300373793 /* libmediastreamer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2B10765B400068D98F /* libmediastreamer.a */; };
|
||||
22A10F3B11F8960300373793 /* libortp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2C10765B400068D98F /* libortp.a */; };
|
||||
22A805C3124D021E005E4D90 /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2A10765B400068D98F /* liblinphone.a */; };
|
||||
22B5EFA310CE50BD00777D97 /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */; };
|
||||
22B5EFE510CE5E5800777D97 /* ContactPickerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 22B5EFE410CE5E5800777D97 /* ContactPickerDelegate.m */; };
|
||||
22B5F03510CE6B2F00777D97 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22B5F03410CE6B2F00777D97 /* AddressBook.framework */; };
|
||||
|
|
@ -215,6 +216,7 @@
|
|||
2245671C107699F700F10948 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
|
||||
224567C1107B968500F10948 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
||||
2245F77E1201D2AF00C4179D /* linphone-Info copy.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "linphone-Info copy.plist"; sourceTree = "<group>"; };
|
||||
224E7F4C124CB00900113C4A /* oldphone-mono-30s.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = "oldphone-mono-30s.wav"; path = "liblinphone-sdk/apple-darwin/share/sounds/linphone/rings/oldphone-mono-30s.wav"; sourceTree = "<group>"; };
|
||||
2258633C11410BAC00C5A737 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
|
||||
225CB2E811ABB51000628906 /* clavier-01-106px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "clavier-01-106px.png"; path = "Resources/clavier-01-106px.png"; sourceTree = "<group>"; };
|
||||
225CB2E911ABB51000628906 /* clavier-01-108px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "clavier-01-108px.png"; path = "Resources/clavier-01-108px.png"; sourceTree = "<group>"; };
|
||||
|
|
@ -277,9 +279,9 @@
|
|||
223148E41178A08200637D6A /* libilbc.a in Frameworks */,
|
||||
223148E61178A09900637D6A /* libmsilbc.a in Frameworks */,
|
||||
228697C411AC29B800E9E0CA /* CFNetwork.framework in Frameworks */,
|
||||
22A10F3911F8960300373793 /* liblinphone.a in Frameworks */,
|
||||
22A10F3A11F8960300373793 /* libmediastreamer.a in Frameworks */,
|
||||
22A10F3B11F8960300373793 /* libortp.a in Frameworks */,
|
||||
22A805C3124D021E005E4D90 /* liblinphone.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -563,6 +565,7 @@
|
|||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
224E7F4C124CB00900113C4A /* oldphone-mono-30s.wav */,
|
||||
225CB2F911ABB76400628906 /* linphone-banner.png */,
|
||||
225CB2ED11ABB65D00628906 /* clavier-01-160px.png */,
|
||||
225CB2E811ABB51000628906 /* clavier-01-106px.png */,
|
||||
|
|
@ -683,6 +686,7 @@
|
|||
225CB2EE11ABB65D00628906 /* clavier-01-160px.png in Resources */,
|
||||
225CB2FA11ABB76400628906 /* linphone-banner.png in Resources */,
|
||||
2245F78A1201D38000C4179D /* MoreViewController.xib in Resources */,
|
||||
224E7F4D124CB00900113C4A /* oldphone-mono-30s.wav in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
|||
2
submodules/externals/exosip
vendored
2
submodules/externals/exosip
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit eae75d6c7d7c0e6278eeb71738efc297ad4c2816
|
||||
Subproject commit dce0ae082f81a1da6209f21d174f83f808645095
|
||||
|
|
@ -130,7 +130,6 @@
|
|||
222CA76911F6CFB100621220 /* enum.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA73311F6CFB100621220 /* enum.c */; };
|
||||
222CA76A11F6CFB100621220 /* enum.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA73411F6CFB100621220 /* enum.h */; };
|
||||
222CA76E11F6CFB100621220 /* friend.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA73811F6CFB100621220 /* friend.c */; };
|
||||
222CA76F11F6CFB100621220 /* general_state.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA73911F6CFB100621220 /* general_state.c */; };
|
||||
222CA77011F6CFB100621220 /* linphonecore.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA73F11F6CFB100621220 /* linphonecore.c */; };
|
||||
222CA77111F6CFB100621220 /* linphonecore.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA74011F6CFB100621220 /* linphonecore.h */; };
|
||||
222CA77311F6CFB100621220 /* lpconfig.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA74211F6CFB100621220 /* lpconfig.c */; };
|
||||
|
|
@ -147,11 +146,10 @@
|
|||
222CA77F11F6CFB100621220 /* sal_eXosip2.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA75D11F6CFB100621220 /* sal_eXosip2.h */; };
|
||||
222CA78011F6CFB100621220 /* sal_eXosip2_presence.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA75E11F6CFB100621220 /* sal_eXosip2_presence.c */; };
|
||||
222CA78111F6CFB100621220 /* sal_eXosip2_sdp.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA75F11F6CFB100621220 /* sal_eXosip2_sdp.c */; };
|
||||
222CA78211F6CFB100621220 /* sdphandler.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA76011F6CFB100621220 /* sdphandler.c */; };
|
||||
222CA78311F6CFB100621220 /* sdphandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA76111F6CFB100621220 /* sdphandler.h */; };
|
||||
222CA78411F6CFB100621220 /* siplogin.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA76211F6CFB100621220 /* siplogin.c */; };
|
||||
222CA78511F6CFB100621220 /* sipsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA76311F6CFB100621220 /* sipsetup.c */; };
|
||||
222CA78611F6CFB100621220 /* sipsetup.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA76411F6CFB100621220 /* sipsetup.h */; };
|
||||
225D355A124B1FF60008581C /* linphonecall.c in Sources */ = {isa = PBXBuildFile; fileRef = 225D3559124B1FF60008581C /* linphonecall.c */; };
|
||||
22A10B5611F84E2D00373793 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A10B4F11F84E2D00373793 /* config.h */; };
|
||||
22A10B5711F84E2D00373793 /* gsm.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A10B5011F84E2D00373793 /* gsm.h */; };
|
||||
22A10B5811F84E2D00373793 /* private.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A10B5211F84E2D00373793 /* private.h */; };
|
||||
|
|
@ -308,7 +306,6 @@
|
|||
222CA73311F6CFB100621220 /* enum.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = enum.c; sourceTree = "<group>"; };
|
||||
222CA73411F6CFB100621220 /* enum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = enum.h; sourceTree = "<group>"; };
|
||||
222CA73811F6CFB100621220 /* friend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = friend.c; sourceTree = "<group>"; };
|
||||
222CA73911F6CFB100621220 /* general_state.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = general_state.c; sourceTree = "<group>"; };
|
||||
222CA73B11F6CFB100621220 /* Doxyfile.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Doxyfile.in; sourceTree = "<group>"; };
|
||||
222CA73C11F6CFB100621220 /* doxygen.dox.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = doxygen.dox.in; sourceTree = "<group>"; };
|
||||
222CA73D11F6CFB100621220 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
|
||||
|
|
@ -331,11 +328,10 @@
|
|||
222CA75D11F6CFB100621220 /* sal_eXosip2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sal_eXosip2.h; sourceTree = "<group>"; };
|
||||
222CA75E11F6CFB100621220 /* sal_eXosip2_presence.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sal_eXosip2_presence.c; sourceTree = "<group>"; };
|
||||
222CA75F11F6CFB100621220 /* sal_eXosip2_sdp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sal_eXosip2_sdp.c; sourceTree = "<group>"; };
|
||||
222CA76011F6CFB100621220 /* sdphandler.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sdphandler.c; sourceTree = "<group>"; };
|
||||
222CA76111F6CFB100621220 /* sdphandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdphandler.h; sourceTree = "<group>"; };
|
||||
222CA76211F6CFB100621220 /* siplogin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = siplogin.c; sourceTree = "<group>"; };
|
||||
222CA76311F6CFB100621220 /* sipsetup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sipsetup.c; sourceTree = "<group>"; };
|
||||
222CA76411F6CFB100621220 /* sipsetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sipsetup.h; sourceTree = "<group>"; };
|
||||
225D3559124B1FF60008581C /* linphonecall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = linphonecall.c; sourceTree = "<group>"; };
|
||||
22A10B4F11F84E2D00373793 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
|
||||
22A10B5011F84E2D00373793 /* gsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gsm.h; sourceTree = "<group>"; };
|
||||
22A10B5111F84E2D00373793 /* gsm.h.orig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = gsm.h.orig; sourceTree = "<group>"; };
|
||||
|
|
@ -610,6 +606,7 @@
|
|||
222CA72D11F6CFB100621220 /* coreapi */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
225D3559124B1FF60008581C /* linphonecall.c */,
|
||||
22A10EE711F8920F00373793 /* mswebcam.c */,
|
||||
222CA72E11F6CFB100621220 /* .gitignore */,
|
||||
222CA72F11F6CFB100621220 /* address.c */,
|
||||
|
|
@ -619,7 +616,6 @@
|
|||
222CA73311F6CFB100621220 /* enum.c */,
|
||||
222CA73411F6CFB100621220 /* enum.h */,
|
||||
222CA73811F6CFB100621220 /* friend.c */,
|
||||
222CA73911F6CFB100621220 /* general_state.c */,
|
||||
222CA73A11F6CFB100621220 /* help */,
|
||||
222CA73F11F6CFB100621220 /* linphonecore.c */,
|
||||
222CA74011F6CFB100621220 /* linphonecore.h */,
|
||||
|
|
@ -639,8 +635,6 @@
|
|||
222CA75D11F6CFB100621220 /* sal_eXosip2.h */,
|
||||
222CA75E11F6CFB100621220 /* sal_eXosip2_presence.c */,
|
||||
222CA75F11F6CFB100621220 /* sal_eXosip2_sdp.c */,
|
||||
222CA76011F6CFB100621220 /* sdphandler.c */,
|
||||
222CA76111F6CFB100621220 /* sdphandler.h */,
|
||||
222CA76211F6CFB100621220 /* siplogin.c */,
|
||||
222CA76311F6CFB100621220 /* sipsetup.c */,
|
||||
222CA76411F6CFB100621220 /* sipsetup.h */,
|
||||
|
|
@ -770,7 +764,6 @@
|
|||
222CA77A11F6CFB100621220 /* private.h in Headers */,
|
||||
222CA77D11F6CFB100621220 /* sal.h in Headers */,
|
||||
222CA77F11F6CFB100621220 /* sal_eXosip2.h in Headers */,
|
||||
222CA78311F6CFB100621220 /* sdphandler.h in Headers */,
|
||||
222CA78611F6CFB100621220 /* sipsetup.h in Headers */,
|
||||
22A10B5611F84E2D00373793 /* config.h in Headers */,
|
||||
22A10B5711F84E2D00373793 /* gsm.h in Headers */,
|
||||
|
|
@ -889,7 +882,6 @@
|
|||
222CA76811F6CFB100621220 /* chat.c in Sources */,
|
||||
222CA76911F6CFB100621220 /* enum.c in Sources */,
|
||||
222CA76E11F6CFB100621220 /* friend.c in Sources */,
|
||||
222CA76F11F6CFB100621220 /* general_state.c in Sources */,
|
||||
222CA77011F6CFB100621220 /* linphonecore.c in Sources */,
|
||||
222CA77311F6CFB100621220 /* lpconfig.c in Sources */,
|
||||
222CA77511F6CFB100621220 /* misc.c in Sources */,
|
||||
|
|
@ -900,10 +892,10 @@
|
|||
222CA77E11F6CFB100621220 /* sal_eXosip2.c in Sources */,
|
||||
222CA78011F6CFB100621220 /* sal_eXosip2_presence.c in Sources */,
|
||||
222CA78111F6CFB100621220 /* sal_eXosip2_sdp.c in Sources */,
|
||||
222CA78211F6CFB100621220 /* sdphandler.c in Sources */,
|
||||
222CA78411F6CFB100621220 /* siplogin.c in Sources */,
|
||||
222CA78511F6CFB100621220 /* sipsetup.c in Sources */,
|
||||
22A10EE811F8920F00373793 /* mswebcam.c in Sources */,
|
||||
225D355A124B1FF60008581C /* linphonecall.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit a5bd31ea57b16eabb0039566cba3148b176a2f5a
|
||||
Subproject commit 6757edcdeedfd57545e66a3e373d51f5e21c2823
|
||||
Loading…
Add table
Reference in a new issue