# Request service domain preference

This sample application demonstrates how to request current service domain preference.

1. Get phone factory and serving system manager instances

auto &phoneFactory = telux::tel::PhoneFactory::getInstance();
    auto servingSystemMgr
       = phoneFactory.getServingSystemManager(DEFAULT_SLOT_ID);
    Copy to clipboard

2. Wait for the serving subsystem initialization

bool subSystemStatus = servingSystemMgr->isSubsystemReady();
    Copy to clipboard

2.1 If serving subsystem is not ready, wait for it to be ready

if(!subSystemsStatus) {
       std::cout << "Serving subsystem is not ready" << std::endl;
       std::cout << "wait unconditionally for it to be ready " << std::endl;
       std::future<bool> f = servingSystemMgr->onSubsystemReady();
       subSystemsStatus = f.get();
    }
    Copy to clipboard

3. Exit the application, if serving subsystem can not be initialized

if(subSystemsStatus) {
       std::cout << " *** Serving subsystem ready *** " << std::endl;
    } else {
       std::cout << " *** ERROR - Unable to initialize serving subsystem"
                 << std::endl;
       return 1;
    }
    Copy to clipboard

6. Implement response callback to receive response for request service domain preference

class ServiceDomainResponseCallback {
    public:
       void serviceDomainResponse(telux::tel::ServiceDomainPreference preference,
                                  telux::common::ErrorCode errorCode) {
          if(errorCode == telux::common::ErrorCode::SUCCESS) {
             std::cout << "Service domain preference: "
                       << static_cast<int>(preference)
                       << std::endl;
          } else {
             std::cout << "\n setServiceDomainPreference failed, ErrorCode: "
                       << static_cast<int>(errorCode)
                       << std::endl;
          }
       }
    };
    Copy to clipboard

7. Send request service domain preference request along with required function object

if(servingSystemMgr) {
       servingSystemMgr->requestServiceDomainPreference(
          ServiceDomainResponseCallback::serviceDomainResponse);
       std::cout << static_cast<int>(status) <<std::endl;
    }
    Copy to clipboard

Now serviceDomainResponse() method will be invoked with current service domain preference.

Last Published: Apr 14, 2026

[Previous Topic
Request and set operating mode](https://docs.qualcomm.com/bundle/publicresource/80-PF458-1/topics/request_set_operating_mode.md) [Next Topic
Get network subscription information](https://docs.qualcomm.com/bundle/publicresource/80-PF458-1/topics/get_subscription.md)