---
name: "eXosip2_authentication"
section: "3"
platform: "linux"
package: "libexosip2-dev"
version: "4.1.0-2.1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/eXosip2_authentication"
---

# eXosip2\_authentication(3)

eXosip2 authentication API

## NAME

eXosip2\_authentication - eXosip2 authentication API

### Functions

int **eXosip\_add\_authentication\_info** (struct eXosip\_t \*excontext, const char \*username, const char \*userid, const char \*passwd, const char \*ha1, const char \*realm)\
 int **eXosip\_remove\_authentication\_info** (struct eXosip\_t \*excontext, const char \*username, const char \*realm)\
 int **eXosip\_clear\_authentication\_info** (struct eXosip\_t \*excontext)\
 int **eXosip\_default\_action** (struct eXosip\_t \*excontext, **eXosip\_event\_t** \*je)\
 void **eXosip\_automatic\_refresh** (struct eXosip\_t \*excontext)\
 void **eXosip\_automatic\_action** (struct eXosip\_t \*excontext)\
 int **eXosip\_insubscription\_automatic** (struct eXosip\_t \*excontext, **eXosip\_event\_t** \*evt)\
 int **eXosip\_generate\_random** (char \*buf, int buf\_size)\

## Detailed Description

## Function Documentation

### int eXosip\_add\_authentication\_info (struct eXosip\_t \* excontext, const char \* username, const char \* userid, const char \* passwd, const char \* ha1, const char \* realm)

Add authentication credentials. These are used when an outgoing request comes back with an authorization required response.

**Parameters:**

*excontext* eXosip\_t instance. \
 *username* username \
 *userid* login (usually equals the username) \
 *passwd* password \
 *ha1* currently ignored \
 *realm* realm within which credentials apply, or NULL to apply credentials to unrecognized realms

### int eXosip\_remove\_authentication\_info (struct eXosip\_t \* excontext, const char \* username, const char \* realm)

Remove authentication credentials.

**Parameters:**

*excontext* eXosip\_t instance. \
 *username* username \
 *realm* realm must be exact same arg as for eXosip\_add\_authentication\_info

### int eXosip\_clear\_authentication\_info (struct eXosip\_t \* excontext)

Clear all authentication credentials stored in eXosip

**Parameters:**

*excontext* eXosip\_t instance.

### int eXosip\_default\_action (struct eXosip\_t \* excontext, eXosip\_event\_t \* je)

Initiate some default actions:

Retry with credentials upon reception of 401/407. Retry with Contact header upon reception of 3xx request.

Useful & required when **eXosip\_automatic\_action()** can't do the automatic action: 1/ if you receive a 401 or 407 for BYE (event EXOSIP\_CALL\_MESSAGE\_REQUESTFAILURE). 2/ if you receive 401 or 407 for any sip request outside of dialog (EXOSIP\_MESSAGE\_REQUESTFAILURE)

**Parameters:**

*excontext* eXosip\_t instance. \
 *je* event to work on.

### void eXosip\_automatic\_refresh (struct eXosip\_t \* excontext)

Initiate some automatic actions:

Refresh REGISTER and SUBSCRIBE before the expiration delay. Those actions are already done by **eXosip\_automatic\_action()**; Prefer eXosip\_automatic\_action instead of this method.

**Parameters:**

*excontext* eXosip\_t instance.

### void eXosip\_automatic\_action (struct eXosip\_t \* excontext)

Initiate some automatic actions:

Retry with credentials upon reception of 401/407. Retry with higher Session-Expires upon reception of 422. Refresh REGISTER and SUBSCRIBE before the expiration delay. Retry with Contact header upon reception of 3xx request. Send automatic UPDATE for session-timer feature.

**Parameters:**

*excontext* eXosip\_t instance.

### int eXosip\_insubscription\_automatic (struct eXosip\_t \* excontext, eXosip\_event\_t \* evt)

Automatic internal handling of dialog package.

**Parameters:**

*excontext* eXosip\_t instance. \
 *evt* Incoming SUBSCRIBE for dialog package.

### int eXosip\_generate\_random (char \* buf, int buf\_size)

Generate random string:

**Parameters:**

*buf* destination buffer for random string. \
 *buf\_size* size of destination buffer

## Author

Generated automatically by Doxygen for libeXosip2 from the source code.
