> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XblAddServiceCallRoutedHandler

> XblAddServiceCallRoutedHandler

Registers for all service call notifications.

## Syntax

```cpp theme={null}
XblFunctionContext XblAddServiceCallRoutedHandler(  
         XblCallRoutedHandler handler,  
         void* context  
)  
```

### Parameters

*handler*   \_In\_\
Type: [XblCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblcallroutedhandler.md)

The event handler function to call. This parameter must not be null.

*context*   \_In\_opt\_\
Type: void\*

Caller context to be passed back to the handler.

### Return value

Type: XblFunctionContext

A XblFunctionContext that can be used to unregister the event handler.

## Remarks

Call this function after [XblInitialize](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblinitialize.md). If the library isn't initialized or *handler* is null, the function returns 0 and doesn't register a handler.

To unregister the handler, pass the returned token to [XblRemoveServiceCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblremoveservicecallroutedhandler.md).

## Requirements

**Header:** xbox\_live\_global\_c.h

**Library:** Microsoft.Xbox.Services.142.C.lib or Microsoft.Xbox.Services.143.C.lib

## See also

[xbox\_live\_global\_c](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/xbox_live_global_c_members.md)


## Related topics

- [XblCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblcallroutedhandler.md)
- [XblServiceCallRoutedArgs](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/structs/xblservicecallroutedargs.md)
- [xbox_live_global_c (contents)](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/xbox_live_global_c_members.md)
- [HCAddCallRoutedHandler](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hcaddcallroutedhandler.md)
- [XblRemoveServiceCallRoutedHandler](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblremoveservicecallroutedhandler.md)
