# &develguide;

## Available Functions

### `pack_hep(from, to, proto, payload, plen, retbuf, retlen)`

The function packs connection details and sip message into HEP message. It's your job to free both the old and the new buffer.

Meaning of the parameters is as follows:

- sockaddr_union *from - sockaddr_union describing sending socket

- sockaddr_union *to - sockaddr_union describing receiving socket

- int proto - protocol used in hep header;

- char *payload SIP payload buffer

- int plen SIP payload buffer length

- char **retbuf HEP message buffer

- int *retlen HEP message buffer length

### `register_hep_cb(cb)`

The function register callbacks to be called whenever a HEP message is received. The callbacks parameters are struct hep_desc*(see hep.h for details) a structure that holds all details about the hep header and the receive_info* structure. The callback can return HEP_SCRIPT_SKIP which stops the HEP message from being passed thrrough scripts.

Meaning of the parameters is as follows:

- hep_cb_t cb HEP callback

### `hep_version`

Current version of hep used.