0

Maybe I am pushing the limits here, but I wonder: If we have an address book application, with phone numbers and since today most apps (Web2Py included) run quite well in browsers (NOT as native app but HTML) then can user just click on the number and the "smart"phone will make the call ? Like a native app ?

I know W2P can send emails and SMS - but what about making a phone call from Web2Py ?

Kara
  • 6,115
  • 16
  • 50
  • 57
Toren
  • 442
  • 3
  • 13
  • Are you talking about on a cell phone? In android if there is a telephone number on any web page, I can just click it and it will almost always bring up the dialer for me to call it. Or do you mean something different? – User Feb 18 '14 at 20:23

2 Answers2

0

Thank you Derek (from Web2Py google user group)!

You are right -making a phone call from Web2Py - it is as simple as you've mentioned... One has to make bring it up as a regular HTML link. Just tried it and it works like charm from a mobile device (like a native app !) and it will work from a desktop as well - if you install a third-party dialer (and use a phone line or a VOIP service) If you do not mind I am going to quote your solution on StackOverflow.

On Tuesday, February 18, 2014 4:33:16 PM UTC-5, Derek wrote:

<a href="tel:555-555-5555">555-555-5555</a>

that will bring up the dialer with the phone number already filled out.

Toren
  • 442
  • 3
  • 13
  • Note as I mentioned, at least in android, you do not even need to do this. The stock android browser can recognize a phone number with no special markup (at least US-based numbers) and clicking on the number in the browser will bring up the dialer. Although it may be better to use tel to ensure it works. – User Feb 20 '14 at 22:03
0

Here are two approaches. One is to rely on the browser to recognize the telephone hunger via markup -- see How to mark-up phone numbers? -- which is very easy, but does nothing if the browser is incapable. The other way is to add the logic to your web2py app to initiate the phone call, using a telephony API like Twilio on the back end -- this approach is more complicated, but doesn't have any special expectations for the browser.

Community
  • 1
  • 1
Chris Johnson
  • 20,650
  • 6
  • 81
  • 80