# RPC Commands

## `tm.list`

List details of transactions.

Parameters:

- none

## `tm.t_uac_start`

Generates and sends a local SIP request.

Parameters:

- method - request method

- RURI - request SIP URI

- NEXT HOP - next hop SIP URI (OBP); use . if no value.

- socket - local socket to be used for sending the request; use . if no value.

- headers - set of additional headers to be added to the request; at least From and To headers must be provided)

- body - (optional, may not be present) request body (if present, requires the Content-Type and Content-length headers)

## `tm.t_uac_start_hex`

Similar to tm.t_uac_start, but with hexa-encoded body. The whitespaces are ignored when decoding the body.

## `tm.t_uac_wait`

Similar to tm.t_uac_start, but waits asynchronously for the SIP response and tries to provide its details via RPC response.

## `tm.t_uac_wait_hex`

Similar to tm.t_uac_wait, but with hexa-encoded body. The whitespaces are ignored when decoding the body.

## `tm.t_uac_wait_block`

Similar to tm.t_uac_start, but blocks waiting for the SIP response and returns the SIP reply code and reason text via RPC response. It waits up to 80 seconds, if no reply is received, it returns a RPC fault 500 code. While waiting, the RPC process cannot handle other RPC commands.

## `tm.t_uac_wait_block_hex`

Similar to tm.t_uac_wait_block, but with hexa-encoded body. The whitespaces are ignored when decoding the body.

## `tm.t_uac_start_noack`

Similar to tm.t_uac_start, but do not automatically send ACK for local INVITE requests.

## `tm.t_uac_start_noack_hex`

Similar to tm.t_uac_start_noack, but with hexa-encoded body. The whitespaces are ignored when decoding the body.

## `tm.t_uac_wait_noack`

Similar to tm.t_uac_wait, but do not automatically send ACK for local INVITE requests.

## `tm.t_uac_wait_noack_hex`

Similar to tm.t_uac_wait_noack, but with hexa-encoded body. The whitespaces are ignored when decoding the body.

## `tm.t_uac_wait_block_noack`

Similar to tm.t_uac_wait_block, but do not automatically send ACK for local INVITE requests.

## `tm.t_uac_wait_block_noack_hex`

Similar to tm.t_uac_wait_block_noack, but with hexa-encoded body. The whitespaces are ignored when decoding the body.

## `tm.t_uac_attrs`

Combine the tm.t_uac_* variants, by providing the first parameter with attributes, then the other parameters are like for tm.t_uac_start.

The attributes are in the format "name1=value1;...;nameX=valueX". The name of the attribute can be:

- mode - control how the command is done. If not provided or the value is "start", acts like tm.t_uac_start. The other values can be: "wait" - act like tm.t_uac_wait; "block" - act like tm.t_uac_wait_block.

- cbflags - the transaction callback flags. The values can be: "noack" - to not automatically send ACK for local INVITE requests

- rpflags - RPC parameters flags. The values can be: 1 - the body is hexa-encoded value.

- fr_timeout - the fr_timeout value for the local transaction.

- fr_inv_timeout - the fr_inv_timeout value for the local transaction.

### Using tm.t_uac_attrs

    ...
    kamcli rpc tm.t_uac_attrs 'reply=wait;cbflags=noack;rpflags=1' 'INVITE' ...
    ...

## `tm.cancel`

Generates and sends a CANCEL for an existing local SIP request.

Parameters:

- callid - callid of the INVITE request to be cancelled.

- cseq - cseq of the INVITE request to be cancelled.

## `tm.hash_stats`

Gets information about the load of TM internal hash table.

Parameters:

- none

## `tm.reply`

Generates and sends a reply for an existing inbound SIP transaction.

Parameters:

- code - reply code

- reason - reason phrase.

- trans_id - transaction identifier (has the hash_entry:label format)

- to_tag - To tag to be added to TO header

- new_headers - extra headers to be appended to the reply; use a dot (.) char only if there are no headers;

- body - (optional, may not be present) reply body (if present, requires the Content-Type and Content-length headers)

## `tm.reply_callid`

Generates and sends a reply for an existing inbound SIP transaction.

Parameters:

- code - reply code

- reason - reason phrase.

- callid - SIP Call-ID header

- cseq - SIP CSeq header

- to_tag - To tag to be added to TO header

- new_headers - extra headers to be appended to the reply; use a dot (.) char only if there are no headers;

- body - (optional, may not be present) reply body (if present, requires the Content-Type and Content-length headers)

## `tm.retransmit_reply`

Retransmit the reply for an existing SIP transaction.

Parameters:

- trans_id - transaction identifier (has the hash_entry:label format)

### Using tm.retransmit_reply

    ...
    kamcli rpc tm.retransmit_reply 1234:5678
    ...

## `tm.retransmit_reply_callid`

Retransmit the reply for an existing SIP transaction.

Parameters:

- callid - SIP Call-ID header

- cseq - SIP CSeq header

### Using tm.retransmit_reply_callid

    ...
    kamcli rpc tm.retransmit_reply_callid "abc-xyz" "10 INVITE"
    ...

## `tm.clean`

Trigger a hard clean of expired transactions.

Parameters:

- none

## `tm.stats`

Gets information about current and past TM transaction handling.

Parameters:

- none