Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-29-2011, 04:53 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 2
marmot is on a distinguished road
Post How to use CoreTelephony monitor Call Event and redail,record.

I could monitor call event now as follow code.But how to monitor when i call a number. Since i call a number from my app,it is in the backgroud. How can i monitor the call event in background? and redail again when the call is disconneted. Use task completion???
Who can show me a way..thanks very much...

Code:
#import <CoreTelephony/CTCall.h>
#import <CoreTelephony/CTCallCenter.h>
#import <CoreTelephony/CTCarrier.h>
#import <CoreTelephony/CTTelephonyNetworkInfo.h>

    CTCallCenter *callCenter = [[CTCallCenter alloc] init];
    callCenter.callEventHandler = ^(CTCall* call)
    {
        if (call.callState == CTCallStateDisconnected)
        { 
            //NSLog(@"Call has been disconnected");
            [self ShowMessage:@"Call has been disconnected"];
        }
        else if (call.callState == CTCallStateConnected) 
        {
            //NSLog(@"Call has just been connected");
            [self ShowMessage:@"Call has just been connected"];
        }
        else if(call.callState == CTCallStateIncoming)
        {
            //NSLog(@"Call is incoming");
            [self ShowMessage:@"Call is incoming"];
        }
        else
        {
            //NSLog(@"None of the conditions");    
        }
    };
marmot is offline   Reply With Quote
Old 01-29-2011, 06:54 AM   #2 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 2
marmot is on a distinguished road
Default

any one can do?
marmot is offline   Reply With Quote
Old 02-14-2011, 04:00 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Location: Stockholm
Posts: 115
longst is on a distinguished road
Send a message via Skype™ to longst
Default if you could relaunch application after "call disconnected" state.

Quote:
Originally Posted by marmot View Post
any one can do?
if someone has idea that how I could relaunch application after "call disconnected" state...

Thank you
longst is offline   Reply With Quote
Old 10-12-2011, 06:32 AM   #4 (permalink)
Registered Member
 
Join Date: Oct 2011
Posts: 3
iphonedev87 is on a distinguished road
Default

Quote:
Originally Posted by longst View Post
if someone has idea that how I could relaunch application after "call disconnected" state...

Thank you

Use WebView to detect the call schema


NSURL *url= [NSURL URLWithString:@"tel:+919886820824"];





NSString *osVersion = [[UIDevice currentDevice] systemVersion];

if ([osVersion floatValue] >= 3.1) {
UIWebView *webview = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
[webview loadRequest:[NSURLRequest requestWithURL:url]];

// Assume we are in a view controller and have access to self.view
[self.view addSubview:webview];
[webview release];
}
else {
// On 3.0 and below, dial as usual
[[UIApplication sharedApplication] openURL: url];
}
iphonedev87 is offline   Reply With Quote
Reply

Bookmarks

Tags
background, coretelephony

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 356
15 members and 341 guests
7twenty7, blasterbr, Clouds, dre, EvilElf, iAppDeveloper, jeroenkeij, jimmyon122, Mah6447, Morrisone, n00b, pungs, Sami Gh, stanny, toon4413
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,121
Posts: 402,900
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:45 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0