# Diagnostics

> Reference the Vivox Core SDK API.

## Classes

|        | Name                                                                                                                                                                                                |
| ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| struct | **[vx\_req\_aux\_connectivity\_info](./structvx__req__aux__connectivity__info.md)** Perform a network test.                                                                                         |
| struct | **[vx\_req\_account\_post\_crash\_dump](./structvx__req__account__post__crash__dump.md)** Post crash dump data to the server.                                                                       |
| struct | **[vx\_resp\_aux\_connectivity\_info](./structvx__resp__aux__connectivity__info.md)** The response for [vx\_req\_aux\_connectivity\_info](./structvx__req__aux__connectivity__info.md).             |
| struct | **[vx\_resp\_account\_post\_crash\_dump](./structvx__resp__account__post__crash__dump.md)** The response for [vx\_req\_account\_post\_crash\_dump](./structvx__req__account__post__crash__dump.md). |

## Types

|                                                                                                        | Name                                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| typedef struct [vx\_req\_aux\_connectivity\_info](./structvx__req__aux__connectivity__info.md)         | **[vx\_req\_aux\_connectivity\_info\_t](./group__diagnostics.md#typedef-vx_req_aux_connectivity_info_t)** Perform a network test.                                                                                        |
| typedef struct [vx\_req\_account\_post\_crash\_dump](./structvx__req__account__post__crash__dump.md)   | **[vx\_req\_account\_post\_crash\_dump\_t](./group__diagnostics.md#typedef-vx_req_account_post_crash_dump_t)** Post crash dump data to the server.                                                                       |
| typedef struct [vx\_resp\_aux\_connectivity\_info](./structvx__resp__aux__connectivity__info.md)       | **[vx\_resp\_aux\_connectivity\_info\_t](./group__diagnostics.md#typedef-vx_resp_aux_connectivity_info_t)** The response for [vx\_req\_aux\_connectivity\_info](./structvx__req__aux__connectivity__info.md).            |
| typedef struct [vx\_resp\_account\_post\_crash\_dump](./structvx__resp__account__post__crash__dump.md) | **[vx\_resp\_account\_post\_crash\_dump\_t](./group__diagnostics.md#typedef-vx_resp_account_post_crash_dump_t)** The response for [vx\_req\_account\_post\_crash\_dump](./structvx__req__account__post__crash__dump.md). |

## Functions

|                                   | Name                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_register\_logging\_initialization](./group__diagnostics.md#function-vx_register_logging_initialization)**([vx\_log\_type](./_vxc_8h.md#enum-vx_log_type) log\_type, const char \* log\_folder, const char \* log\_filename\_prefix, const char \* log\_filename\_suffix, int log\_level, void(\*)(const char \*source, const char \*level, const char \*message) pf\_handler)Register a callback that is called to initialize logging. |
| VIVOXSDK\_DLLEXPORT char \*       | **[vx\_get\_log\_file\_path](./group__diagnostics.md#function-vx_get_log_file_path)**(void )                                                                                                                                                                                                                                                                                                                                                  |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_unregister\_logging\_handler](./group__diagnostics.md#function-vx_unregister_logging_handler)**(void(\*)(void \*) pf\_handler, void \* cookie)Unregister the logging callback notification handler.                                                                                                                                                                                                                                    |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_get\_crash\_dump\_count](./group__diagnostics.md#function-vx_get_crash_dump_count)**(void )The number of crash dumps stored on disk.                                                                                                                                                                                                                                                                                                   |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_set\_crash\_dump\_generation\_enabled](./group__diagnostics.md#function-vx_set_crash_dump_generation_enabled)**(int value)Enable crash dump generation.                                                                                                                                                                                                                                                                                |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_get\_crash\_dump\_generation](./group__diagnostics.md#function-vx_get_crash_dump_generation)**(void )Determine if crash dump generation is enabled.                                                                                                                                                                                                                                                                                    |
| VIVOXSDK\_DLLEXPORT char \*       | **[vx\_read\_crash\_dump](./group__diagnostics.md#function-vx_read_crash_dump)**(int index)Get the Base64-encoded crash dump information.                                                                                                                                                                                                                                                                                                     |
| VIVOXSDK\_DLLEXPORT time\_t       | **[vx\_get\_crash\_dump\_timestamp](./group__diagnostics.md#function-vx_get_crash_dump_timestamp)**(int index)Get the timestamp of a crash.                                                                                                                                                                                                                                                                                                   |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_delete\_crash\_dump](./group__diagnostics.md#function-vx_delete_crash_dump)**(int index)Delete the crash dump.                                                                                                                                                                                                                                                                                                                         |
| VIVOXSDK\_DLLEXPORT const char \* | **[vx\_get\_sdk\_version\_info](./group__diagnostics.md#function-vx_get_sdk_version_info)**(void )Get the SDK version info.                                                                                                                                                                                                                                                                                                                   |
| VIVOXSDK\_DLLEXPORT const char \* | **[vx\_get\_sdk\_version\_info\_ex](./group__diagnostics.md#function-vx_get_sdk_version_info_ex)**(void )Get the SDK extended version info.                                                                                                                                                                                                                                                                                                   |
| VIVOXSDK\_DLLEXPORT char \*       | **[vx\_get\_random\_user\_id](./group__diagnostics.md#function-vx_get_random_user_id)**(const char \* prefix)Get a random guest user ID with the given prefix.                                                                                                                                                                                                                                                                                |
| VIVOXSDK\_DLLEXPORT char \*       | **[vx\_get\_random\_user\_id\_ex](./group__diagnostics.md#function-vx_get_random_user_id_ex)**(const char \* prefix, const char \* issuer)Get a random guest user ID for the given issuer with the given prefix.                                                                                                                                                                                                                              |
| VIVOXSDK\_DLLEXPORT char \*       | **[vx\_get\_random\_channel\_uri](./group__diagnostics.md#function-vx_get_random_channel_uri)**(const char \* prefix, const char \* realm)Get a random ephemeral channel ID with the given prefix for the specific realm.                                                                                                                                                                                                                     |
| VIVOXSDK\_DLLEXPORT char \*       | **[vx\_get\_random\_channel\_uri\_ex](./group__diagnostics.md#function-vx_get_random_channel_uri_ex)**(const char \* prefix, const char \* realm, const char \* issuer)Get a random ephemeral channel ID for the given issuer with the given prefix for the specific realm.                                                                                                                                                                   |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_crash\_test](./group__diagnostics.md#function-vx_crash_test)**([vx\_crash\_test\_type\_t](./_vxc_8h.md#typedef-vx_crash_test_type_t) crash\_type)Crash the program.                                                                                                                                                                                                                                                                    |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_set\_message\_rate\_params](./group__diagnostics.md#function-vx_set_message_rate_params)**(unsigned bucketSize, float messageSpeed, int fillBucket)Change the API message rate parameters.                                                                                                                                                                                                                                             |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_set\_default\_message\_rate\_params](./group__diagnostics.md#function-vx_set_default_message_rate_params)**(void )Return the API message rate parameters to their default state.                                                                                                                                                                                                                                                       |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_android\_set\_mic\_mute](./group__diagnostics.md#function-vx_android_set_mic_mute)**(int mute)Mute or unmute the mic on Android.                                                                                                                                                                                                                                                                                                       |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_internal\_enable\_debug\_mode\_disable\_strict\_checks](./group__diagnostics.md#function-vx_internal_enable_debug_mode_disable_strict_checks)**(void )Internal: enable debug mode and disable the strict parameter check of some requests.                                                                                                                                                                                             |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_internal\_disable\_debug\_mode\_enable\_strict\_checks](./group__diagnostics.md#function-vx_internal_disable_debug_mode_enable_strict_checks)**(void )Internal: disable the debug mode enabled by vx\_internal\_enable\_debug\_mode\_disable\_strict\_checks.                                                                                                                                                                          |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_req\_aux\_connectivity\_info\_create](./group__diagnostics.md#function-vx_req_aux_connectivity_info_create)**([vx\_req\_aux\_connectivity\_info\_t](./group__diagnostics.md#typedef-vx_req_aux_connectivity_info_t) \*\* req)Allocate and initialize a [vx\_req\_aux\_connectivity\_info](./structvx__req__aux__connectivity__info.md) object.                                                                                         |
| VIVOXSDK\_DLLEXPORT int           | **[vx\_req\_account\_post\_crash\_dump\_create](./group__diagnostics.md#function-vx_req_account_post_crash_dump_create)**([vx\_req\_account\_post\_crash\_dump\_t](./group__diagnostics.md#typedef-vx_req_account_post_crash_dump_t) \*\* req)Allocate and initialize a [vx\_req\_account\_post\_crash\_dump](./structvx__req__account__post__crash__dump.md) object.                                                                         |
| VIVOXSDK\_DLLEXPORT const char \* | **[vx\_get\_error\_string](./group__diagnostics.md#function-vx_get_error_string)**(int errorCode)Get an error string for a particular error code.                                                                                                                                                                                                                                                                                             |

## Types Documentation

### typedef vx\_req\_aux\_connectivity\_info\_t

```text
typedef struct vx_req_aux_connectivity_info vx_req_aux_connectivity_info_t;
```

Perform a network test.

**See**: [vx\_resp\_aux\_connectivity\_info](./structvx__resp__aux__connectivity__info.md)

**Note**: The SDK ships with a sample Network Troubleshooter that can be used as is or as a reference to create a custom Network Troubleshooter.

This command probes the network and performs tests to determine if the application will have the connectivity required to perform the tasks needed to send and receive presence, IM, and media information. This call tests network connectivity issues, such as creating a "Network Troubleshooter" tool that can be standalone or integrated into an application. This single call returns results for all of the tests that are performed, and the data can be displayed to the user.

### typedef vx\_req\_account\_post\_crash\_dump\_t

```text
typedef struct vx_req_account_post_crash_dump vx_req_account_post_crash_dump_t;
```

Post crash dump data to the server.

**See**: [vx\_resp\_account\_post\_crash\_dump](./structvx__resp__account__post__crash__dump.md)

**Note**: This command is not an application to the XML interface.

**Attention**: This is not supported on the iPhone platform.

### typedef vx\_resp\_aux\_connectivity\_info\_t

```text
typedef struct vx_resp_aux_connectivity_info vx_resp_aux_connectivity_info_t;
```

The response for [vx\_req\_aux\_connectivity\_info](./structvx__req__aux__connectivity__info.md).

**See**: [vx\_req\_aux\_connectivity\_info](./structvx__req__aux__connectivity__info.md)

### typedef vx\_resp\_account\_post\_crash\_dump\_t

```text
typedef struct vx_resp_account_post_crash_dump vx_resp_account_post_crash_dump_t;
```

The response for [vx\_req\_account\_post\_crash\_dump](./structvx__req__account__post__crash__dump.md).

**See**: [vx\_req\_account\_post\_crash\_dump](./structvx__req__account__post__crash__dump.md)

**Note**: This response is not applicable to the XML interface.

## Functions Documentation

### function vx\_register\_logging\_initialization

```text
VIVOXSDK_DLLEXPORT int vx_register_logging_initialization(
    vx_log_type log_type,
    const char * log_folder,
    const char * log_filename_prefix,
    const char * log_filename_suffix,
    int log_level,
    void(*)(const char *source, const char *level, const char *message) pf_handler
)
```

Register a callback that is called to initialize logging.

The application should use this to signal the main application thread that will then wakeup and call vx\_get\_message;

### function vx\_get\_log\_file\_path

```text
VIVOXSDK_DLLEXPORT char * vx_get_log_file_path(
    void 
)
```

**Deprecated**:

File logging is not supported. Get the SDK log file path.

### function vx\_unregister\_logging\_handler

```text
VIVOXSDK_DLLEXPORT int vx_unregister_logging_handler(
    void(*)(void *) pf_handler,
    void * cookie
)
```

Unregister the logging callback notification handler.

**Parameters**:

* **pf\_handler** - OBSOLETE AND UNUSED
* **cookie** - OBSOLETE AND UNUSED

Because the parameters are reserved for future use, pass NULL for each of the parameters (for example: vx\_unregister\_logging\_handler(0, 0);). If a logging handler is registered, then it must be unregistered before shutting down the SDK.

### function vx\_get\_crash\_dump\_count

```text
VIVOXSDK_DLLEXPORT int vx_get_crash_dump_count(
    void 
)
```

The number of crash dumps stored on disk.

**Note**: Not supported on mobile or console platforms.

### function vx\_set\_crash\_dump\_generation\_enabled

```text
VIVOXSDK_DLLEXPORT int vx_set_crash_dump_generation_enabled(
    int value
)
```

Enable crash dump generation.

**Note**: Not supported on mobile or console platforms.

### function vx\_get\_crash\_dump\_generation

```text
VIVOXSDK_DLLEXPORT int vx_get_crash_dump_generation(
    void 
)
```

Determine if crash dump generation is enabled.

**Note**: Not supported on mobile or console platforms.

### function vx\_read\_crash\_dump

```text
VIVOXSDK_DLLEXPORT char * vx_read_crash_dump(
    int index
)
```

Get the Base64-encoded crash dump information.

**Note**: Not supported on mobile or console platforms.

### function vx\_get\_crash\_dump\_timestamp

```text
VIVOXSDK_DLLEXPORT time_t vx_get_crash_dump_timestamp(
    int index
)
```

Get the timestamp of a crash.

**Note**: Not supported on mobile or console platforms.

### function vx\_delete\_crash\_dump

```text
VIVOXSDK_DLLEXPORT int vx_delete_crash_dump(
    int index
)
```

Delete the crash dump.

**Note**: Not supported on mobile or console platforms.

### function vx\_get\_sdk\_version\_info

```text
VIVOXSDK_DLLEXPORT const char * vx_get_sdk_version_info(
    void 
)
```

Get the SDK version info.

### function vx\_get\_sdk\_version\_info\_ex

```text
VIVOXSDK_DLLEXPORT const char * vx_get_sdk_version_info_ex(
    void 
)
```

Get the SDK extended version info.

### function vx\_get\_random\_user\_id

```text
VIVOXSDK_DLLEXPORT char * vx_get_random_user_id(
    const char * prefix
)
```

Get a random guest user ID with the given prefix.

**Parameters**:

* **-** \[in] prefix The prefix for the user.

**Note**: This must be deallocated with [vx\_free()](./group__memorymanagement.md#function-vx_free);

The returned ID always starts and ends with the '.' character.

### function vx\_get\_random\_user\_id\_ex

```text
VIVOXSDK_DLLEXPORT char * vx_get_random_user_id_ex(
    const char * prefix,
    const char * issuer
)
```

Get a random guest user ID for the given issuer with the given prefix.

**Parameters**:

* **prefix** - \[in] The prefix for the user.
* **issuer** - \[in, optional] The issuer. If NULL or an empty string is passed, the generated user ID is the same as what is generated by [vx\_get\_random\_user\_id()](./group__diagnostics.md#function-vx_get_random_user_id).

**Note**: This must be deallocated with [vx\_free()](./group__memorymanagement.md#function-vx_free);

The returned ID always starts and ends with the '.' character.

### function vx\_get\_random\_channel\_uri

```text
VIVOXSDK_DLLEXPORT char * vx_get_random_channel_uri(
    const char * prefix,
    const char * realm
)
```

Get a random ephemeral channel ID with the given prefix for the specific realm.

**Parameters**:

* **prefix** - \[in] The prefix for the channel.
* **realm** - \[in] The realm for that channel (for example, mt1s.vivox.com).

**Note**: This must be deallocated with [vx\_free()](./group__memorymanagement.md#function-vx_free);

The prefix should start with one of the following options: confctl-g- for general non-positional channels confctl-e- for echo channels confctl-d- for positional channels

### function vx\_get\_random\_channel\_uri\_ex

```text
VIVOXSDK_DLLEXPORT char * vx_get_random_channel_uri_ex(
    const char * prefix,
    const char * realm,
    const char * issuer
)
```

Get a random ephemeral channel ID for the given issuer with the given prefix for the specific realm.

**Parameters**:

* **prefix** - \[in] The prefix for the channel.
* **realm** - \[in] The realm for that channel (for example, mt1s.vivox.com).
* **issuer** - \[in, optional] The issuer. If NULL or an empty string is passed, the generated channel ID is the same as what is generated by [vx\_get\_random\_channel\_uri()](./group__diagnostics.md#function-vx_get_random_channel_uri).

**Note**: This must be deallocated with [vx\_free()](./group__memorymanagement.md#function-vx_free);

The prefix should start with one of the following options: confctl-g- for general non-positional channels confctl-e- for echo channels confctl-d- for positional channels

### function vx\_crash\_test

```text
VIVOXSDK_DLLEXPORT int vx_crash_test(
    vx_crash_test_type_t crash_type
)
```

Crash the program.

**Parameters**:

* **crash\_type** - The type of crash (see vx\_crash\_test\_type).

### function vx\_set\_message\_rate\_params

```text
VIVOXSDK_DLLEXPORT int vx_set_message_rate_params(
    unsigned bucketSize,
    float messageSpeed,
    int fillBucket
)
```

Change the API message rate parameters.

**Parameters**:

* **messageSpeed** - Messages per second.
* **fillBucket** - is bool

### function vx\_set\_default\_message\_rate\_params

```text
VIVOXSDK_DLLEXPORT int vx_set_default_message_rate_params(
    void 
)
```

Return the API message rate parameters to their default state.

### function vx\_android\_set\_mic\_mute

```text
VIVOXSDK_DLLEXPORT int vx_android_set_mic_mute(
    int mute
)
```

Mute or unmute the mic on Android.

**Parameters**:

* **mute** - Non-zero mutes the microphone; 0 unmutes.

**Return**: - Non-zero if previous state was muted, 0 if previous state was unmuted.

**Note**: Android platform only. Does nothing on other platforms.

### function vx\_internal\_enable\_debug\_mode\_disable\_strict\_checks

```text
VIVOXSDK_DLLEXPORT int vx_internal_enable_debug_mode_disable_strict_checks(
    void 
)
```

Internal: enable debug mode and disable the strict parameter check of some requests.

**Attention**: Do not call this function if you are not completely sure of what are you doing!

### function vx\_internal\_disable\_debug\_mode\_enable\_strict\_checks

```text
VIVOXSDK_DLLEXPORT int vx_internal_disable_debug_mode_enable_strict_checks(
    void 
)
```

Internal: disable the debug mode enabled by vx\_internal\_enable\_debug\_mode\_disable\_strict\_checks.

**Attention**: Do not call this function if you are not completely sure of what are you doing!

### function vx\_req\_aux\_connectivity\_info\_create

```text
VIVOXSDK_DLLEXPORT int vx_req_aux_connectivity_info_create(
    vx_req_aux_connectivity_info_t ** req
)
```

Allocate and initialize a [vx\_req\_aux\_connectivity\_info](./structvx__req__aux__connectivity__info.md) object.

### function vx\_req\_account\_post\_crash\_dump\_create

```text
VIVOXSDK_DLLEXPORT int vx_req_account_post_crash_dump_create(
    vx_req_account_post_crash_dump_t ** req
)
```

Allocate and initialize a [vx\_req\_account\_post\_crash\_dump](./structvx__req__account__post__crash__dump.md) object.

**Attention**: This is not supported on the iPhone platform.

### function vx\_get\_error\_string

```text
VIVOXSDK_DLLEXPORT const char * vx_get_error_string(
    int errorCode
)
```

Get an error string for a particular error code.
