Can I intercept phone dialing? - objective-c

I would like to listen on the user's phone dialing. If I recognize that the dialed number is something that my app defined as a non-real-call (like starting with #####) I would like to cancel the call and start my own application. This is doable in Android. Can it be done on iPhone?
Thanks,
Simon

I can see why you would want to to this. Eg dialing a special number to direct the call through an internet service instead of the main network.
It is not however possible on standard (ie non-jail-broken) iOS. You can get something similar with URL schemes.

Related

Sonos API sends too short auth code in return?

Turning to all you smart people out there for help, tips and trix :)
I want to connect my NodeRed instance to the Sonos API to control my speakers in various ways. During the OAUTH process however, after logging in with my username and password for my account, the auth code being sent back to me through my redirect_uri seems to be too short? In the developers' guide the example auth code looks like this:
f10072fa6-2134-4fe1-93fd-ca5b9cffa738
where in my case, I just receive the first part up until the first dash sign. Eg.:f10072fa6
At first I ran the connection through a NetScaler, then I changed to using a Nginx Reverse Proxy thinking that the Netscaler might have truncated the URL (for some very odd reason), but the result turned out the same..
Ideas anyone?
The Authorization code you received is correct. The Authorization code format was recently changed and the documentation needs to be updated to reflect this. This question was also answered in Authorization code has different structure than example code.
Thanks!
-Mark
You can also use nodered-sonos to control your speakers. No need to setup oauth2 and using the cloud based api, if you can also have super fast local control of your speakers.
I'm using a combination of the following tools for total control of the speakers:
MQTT server of your choice in Docker (I'm using emqx)
Sonos2mqtt, my own app to connect sonos to mqtt in docker
Node red with normal mqtt in/out flows.
My Favorite flows:
Join playbar to group if group starts playing
Pause group is playbar leaves group (it leaves if I turn on the TV, that should stop the music)
Play ring sound (on all speakers) if someone presses the doorbell
Announce (text-to-speech) when the backdoor is opened

Voice call connection routing React-Native

I am trying to build an application which works this way: I as a user want to start a call with another user. The way I want the connection be made is by random. So it will connect to one of the many clients out there by random. Also when other clients try to make a call, it should connect to another random client and so on. I want those phone calls be made via application(such as WhatsApp) not as a phone call.
Now, the question is; is Twilio a good approach for this purpose?
If yes can you tell me which of their feature would fit my app the best?
Thanks for any suggestions!
Twilio developer evangelist here.
I can answer that Twilio would be a good approach for you to do this within your own application. I'd recommend using Twilio Video to build this as it allows cross platform communication via audio or video (in your case, you may not need the video, but this will give you the best audio quality).
As an example, my colleague Dominik built a video roulette application. It is the case that the interface was built in JavaScript for the web, but the idea would be the same for a native app. The code for the server side part of the application should give some insight into how to connect random pairings.
It's also possible to integrate Twilio Video with CallKit and Connection Services so that you can make outbound calls to other devices that ring like a real incoming call.

iOS - Record the Voice while phone call in Objective c

Is it possible for an app which records the voice of the user while a phone call?
I searched for it and the AVFoundation Framework seems to stop recording when a phone call is incoming. I don't want to record the whole call, I am just interested in record what the user of the iPhone is saying.
I know that this possibility might be a safety risk, but it would be nice for e.g an interview.
In case of no possibility to do it like i want, i have to create my own VoIP connection and then i can record it, am i right?
There is no direct way or API from Apple to achieve your need of recording voice while phone call. AVAudioRecorder wont support it as well. Because it will be stopped once the call begin.
But there are work around like hook AudioUnitProcess in order to access phone call's audio streams and save it as m4a. This will work without jailbreak but not sure this will be accepted by Apple app store review team.
For more info on the work around check this SO accepted answer.
Also creating your own VoIP connection method work for recording during phone call.
There are Cydia tweaks which are able to do that. For example CallRecorder.

Turn iPhone into a server programmatically?

I want to make my iPhone app display on a Mac's screen, kind of like AirPlay does with other machines. The only way I have heard to do this is, although I do not like it, turn the iPhone into a server. Unfortunately, I cannot figure out how to do so. I also wanted to set it up in such a way that my Mac automatically detects it. I have seen a similar setup in the game Chopper 2. My Mac app will have a simple timer that fires every few seconds to look for the iPhone, in the same way that Chopper 2's "Find iPhone" button does.
Is there a simple way to turn the iPhone into a server, or start a "session" like Game Center does?
One last thing: I know it is somehow possible, because another app I have actually gives my iPhone a web address at the click of a button. It is called the Dicenomicon, if you want proof.
First there is no easy way to redirect your display to Mac, even if you made it a server of some kind.
Second, to discover or publish customized services on WLAN, you may want to refer to the samples on Bonjour:
CocoaHTTPServer: a simple TCP/HTTP server.
WiTap: an app that discovers and connects to services of the same kind on WLAN by Bonjour.
I'm not really sure what you mean by "server", because there is no way to share the screen of an iPhone using the official SDK, although this is possible by jailbreaking.
It would be possible, however, to send data back and forth between the Mac and iPhone, and display the data on the iPhone, on a Mac. Using that data, you could try to recreate the interface on the Mac. All of this could be accomplished using sockets. A class that might help with that would be cocoaAsyncSocket, which makes network programming a lot easier.
The auto-discovery of iPhones on the local network is achievable with Bonjour. Without getting into too many details, NSNetService would allow you to publish a service for your app from an iPhone, and NSNetServiceBrowser would allow you to find that service on the local network from the Mac. From the NSNetServiceBrowser, you could establish a socket connection with the iPhone.
Good luck!
You might want to take a look at the GameKit APIs, I know they do something similar between two iOS devices.
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html

SMS API that allows you to specify FROM?

I'm wanting to move away from using $phonenumber#$provider domain because it is too limited in usability.
Is there a SMS service with a good API (prefer HTTP/s, XML, JSON) that allows you to send from a specific phone number?
The reason I want it to come from a specific phone number is because I have a Google Voice number I use for my business...
Since you want to use your google voice phone number maybe you just want to send the SMS though google voice. One way to connect w/ google voice is to use the Asterisk software. You would use Asterisk to talk to google voice over the SIP protocal - documented here:
http://michigantelephone.wordpress.com/2010/05/21/how-to-use-google-voice-for-free-outgoing-calls-on-an-asteriskfreepbx-system-the-easy-way/
and
http://eggie5.com/10-installing-asterisk-on-osx
For example I did this and then I interface asterisk from ruby code and can make calls, sms, etc.
Twilio will let you set the FROM number to any Twilio number that you own. Of course, you'd have to give up your Google Voice phone number. I'm pretty sure you won't find any SMS service that allows you to set the FROM number to an arbitrary number (just think of the mess it would cause).
See comment below indicating that the Google Voice number could be ported to Twilio.