语言

Menu
Sites
Language
Privileges to call (dial the phone number)

If the application provides a telephone number (reference), what privileges to dial the phone number you need. And how is a function?

响应

6 回复
daniel kim

Hi,

You need below two privileges to dial the number and can use ApplicationControl to dial up.

   <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
    <tizen:privilege name="http://tizen.org/privilege/call"/>

 

var appControl = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/call',
             'tel:' + telnum);
  tizen.application.launchAppControl(appControl, null, function(){console.log("launch appControl succeeded");}, function(e){console.log("launch appControl failed ", e);},  null);
 
 

I wish this will help you.

Anand Rudrakshi

Hi,

For Native 3rd party app, you can do it using app_control api's

You would need the below privileges.

appmanager.launch

call

You can launch the call app by doing the following.

app_control_h service;
app_control_create(&service);
app_control_set_app_id(service, "com.samsung.call");

app_control_add_extra_data(service, "number", "Number you wish to dial");

app_control_add_extra_data(service, "launch-type", "MO");

app_control_send_launch_request(service, NULL,NULL );
app_control_destroy(service);

Hope this helps :)

Seoghyun Kang

Hello,

 

I think the following code will be useful to you.

Please refer it.

 

function makeCall(phoneNumber) {
  var self = this,
      appControl = new tizen.ApplicationControl(
          'http://tizen.org/appcontrol/operation/call',
          'tel:' + phoneNumber
      );

  tizen.application.launchAppControl(
      appControl,
      null,
      function onCallSuccess() {
          // TODO : Success
      },
      function onCallError(e) {
          // TODO : Error
      },
      {
          onsuccess: function onCallSuccess() {
              
          },
          onfailure: function onCallError(e) {
             
          }
      }
  );
}

 

AVSukhov

Hello,

Also you can use tel: scheme

<a href="tel:123456789">call</a>

 

Palitsyna

Hello,

if you want to show the dailer UI and dial a number you can use following code:

try {    			
	var appControl = new tizen.ApplicationControl(
		"http://tizen.org/appcontrol/operation/dial",
		"tel:" + number,
		null,
		null,
		null
		);

	var appControlReplyCallback = {
		onfailure: function() {
			console.log("The launch application control failed");
		}
	}
	
	tizen.application.launchAppControl(
	appControl,
	null,
	function() {console.log("launch application control succeed"); },
	function(e) {console.log("launch application control failed. reason: " + e.message); },
	appControlReplyCallback );
} catch (e) {
	alert("Error " + e.name + " : " + e.message);
}

The URI scheme must be tel: or set to NULL. If the URI scheme is NULL, the dialer UI is shown without a phone number.

AVSukhov

Hello,

just fyi, mor info about AppControl functionality you can find in documentation:

Guide:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.guides/html/web/tizen/application/application_w.htm

Tutorial:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.tutorials/html/web/tizen/application/application_tutorial_w.htm#launch

API References:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.web.apireference/html/device_api/mobile/tizen/application.html