• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. MozMobileConnection
  6. MozMobileConnection.getCallForwardingOption()

MozMobileConnection.getCallForwardingOption()

In This Article
  1. Summary
  2. Syntax
    1. Parameters
    2. Return
  3. Example
  4. Specification
  5. See also

This API is available on Firefox OS for internal applications only.

Summary

The getCallForwardingOption method is used to query current options for call forwarding.

Syntax

var request = navigator.mozMobileConnection.getCallForwardingOption(reason);

Parameters

reason
This parameter is a number that indicates the reason the call is being forwarded. It is one of:
  • 0: unconditional
  • 1: mobile busy
  • 2: no reply
  • 3: not reachable
  • 4: forwarding all calls
  • 5: conditionally forwarding all calls
All these values are available as constants in the MozMobileCFInfo interface.

Return

A DOMRequest object to handle the success or failure of the method call.

If the request is successful, the request's result is an array of MozMobileCFInfo objects.

Otherwise, the request's error is one of:

  • RadioNotAvailable
  • RequestNotSupported
  • GenericFailure

Example

var request = navigator.mozMobileConnection.getCallForwardingOption(MozMobileCFInfo.CALL_FORWARD_REASON_NO_REPLY);
request.onsuccess = function () {
  this.result.forEach(function (CFInfo) {
    console.log(CFInfo);
  });
}
request.onerror = function () {
  console.log('operation failed: ' + this.error.name);
}

Specification

Not part of any specification.

See also

  • MozMobileConnection
  • MozMobileCFInfo
  • DOMRequest

Document Tags and Contributors

Tags: 
  • API
  • B2G
  • Firefox OS
  • Method
  • Mobile
  • Non Standard
  • Reference
  • Référence
 Contributors to this page: chrisdavidmills, fscholz, kscarfone, Sheppy, jswisher, Jeremie
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:07:52 AM
See also
  1. Mobile Connection API
  2. Archive
  3. Events
    1. icccardlockerror
    2. cardstatechange
  4. Related pages for Mobile Connection API
    1. CFStateChangeEvent
    2. DataErrorEvent
    3. IccCardLockError
    4. IccCardLockErrorEvent
    5. MozCellBroadcastEvent
    6. MozEmergencyCbModeEvent
    7. MozIccManager
    8. MozMobileCFInfo
    9. MozMobileCellInfo
    10. MozMobileConnection
    11. MozMobileConnectionInfo
    12. MozMobileICCInfo
    13. MozMobileNetworkInfo
    14. MozOtaStatusEvent
    15. MozStkCommandEvent
    16. USSDReceivedEvent