Make a phone call ?

Hello all,

Is there a function to make a phone call ?
I mean when i’m pressing a button it makes a phone call.
( and without using a web popup)

Thanks for your help ! [import]uid: 3638 topic_id: 2079 reply_id: 302079[/import]

Sunny

Look at our API

system.openURL( url )

Phone links: tel:415-867-5309

Non tested example follows:

function Button:tap(event)  
system.openURL( tel:415-867-5309)  
end  

C [import]uid: 24 topic_id: 2079 reply_id: 6233[/import]

Thanks a lot !

I checked the API before asking, but I didnt think that a phone number could be some kind of URL :slight_smile:
Thanks again for your help ! [import]uid: 3638 topic_id: 2079 reply_id: 6237[/import]

This is a fundamental operational mode of these devices. Is anyone at anscamobile addressing this question??? If not I see no need to continue to learn lua and use this platform.

I too am trying to initiate and monitor call’s and status. Can anyone tell me how to do this?? I have tried using system.openURL( “tel:415-NNN-NNNN” ) and set up a build.settings file like this:
settings =
{
androidPermissions =
{
“android.permission.INTERNET”,
“android.permission.CALL_PHONE”,
“android.permission.CALL_PRIVILEGED”,
“android.permission.PROCESS_OUTGOING_CALLS”,
“android.permission.READ_PHONE_STATE”,
“android.permission.RECORD_AUDIO”
},
}

and the simulator reports WARNING: url( tel:415-NNN-NNNN ) is not supported by the simulator, but when I build and run on my mytouch it does nothing.

Can someone tell me, or direct me to documentation, how to place a call, and if possible how to monitor the audio, and then respond to connect/disconnect information???
[import]uid: 21509 topic_id: 2079 reply_id: 21771[/import]

I haven’t tried 'Droid but this works on iPhone, hope it helps…

[blockcode]

– Phone

local btnPhone = display.newImageRect(“btnPhone.png”, 278, 45)
btnPhone.x = display.contentWidth*0.5
btnPhone.y = 160

function btnPhoneTouch ( event )

if event.phase == “ended” then

local function onComplete( event )
if “clicked” == event.action then
local i = event.index
if 1 == i then
– Do nothing; dialog will simply dismiss
elseif 2 == i then
system.openURL(“tel:+44-1647-24139”)
end
end
end
end

– Show alert with five buttons

local alert = native.showAlert( “Call?”, “+44-1647-24139”,
{ “Cancel”, “Call” }, onComplete )

end

btnPhone:addEventListener(“touch”,btnPhoneTouch)

[/blockcode]

Sorry the layout sucks I cannot be bothered to ‘fight’ the forum editor! But notice I ask if they want to make a call first.

I’m not too sure what you mean by monitoring the call as the phone handles the call natively. [import]uid: 9371 topic_id: 2079 reply_id: 21774[/import]

I have just tried that on my mytouch using the build.settings file I mention above, and still it does not place a call.

By monitoring, I mean notification when the connection is established, when it has been disconnected, etc… But at this point I would be happy being able to call my home number with my test app…

Thanks for your response though.
[import]uid: 21509 topic_id: 2079 reply_id: 21780[/import]

can’t monitor call and status from corona.

what version of android os?

C. [import]uid: 24 topic_id: 2079 reply_id: 21782[/import]

mytouch, android version 2.2.1

[import]uid: 21509 topic_id: 2079 reply_id: 21793[/import]

look at this thread for further discussions of my problem:
http://developer.anscamobile.com/forum/2011/01/14/phone-call-events#comment-22040

Anyone have any ideas for me? [import]uid: 21509 topic_id: 2079 reply_id: 22041[/import]