SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
oSIP dialog Handling

Data Structures

struct  osip_dialog
 Structure for referencing a dialog. More...
 

Macros

#define osip_dialog_set_instance(dialog, instance)   (dialog)->your_instance = (void*)(instance)
 Link osip dialog to application. More...
 
#define osip_dialog_get_instance(dialog)   (dialog)->your_instance
 Retrieve application instance from dialog. More...
 

Typedefs

typedef enum _osip_dialog_type_t osip_dialog_type_t
 
typedef struct osip_dialog osip_dialog_t
 Structure for referencing a dialog. More...
 

Enumerations

enum  _osip_dialog_type_t { CALLER, CALLEE }
 

Functions

int osip_dialog_init_as_uac (osip_dialog_t **dialog, osip_message_t *response)
 Allocate a osip_dialog_t element as a UAC. More...
 
int osip_dialog_init_as_uac_with_remote_request (osip_dialog_t **dialog, osip_message_t *next_request, int local_cseq)
 Allocate a osip_dialog_t element as a UAC. More...
 
int osip_dialog_init_as_uas (osip_dialog_t **dialog, osip_message_t *invite, osip_message_t *response)
 Allocate a osip_dialog_t element as a UAS. More...
 
void osip_dialog_free (osip_dialog_t *dialog)
 Free all resource in a osip_dialog_t element. More...
 
void osip_dialog_set_state (osip_dialog_t *dialog, state_t type)
 Set the state of the dialog. More...
 
int osip_dialog_update_route_set_as_uas (osip_dialog_t *dialog, osip_message_t *invite)
 Update the Route-Set as UAS of a dialog. More...
 
int osip_dialog_update_osip_cseq_as_uas (osip_dialog_t *dialog, osip_message_t *request)
 Update the CSeq (remote cseq) during a UAS transaction of a dialog. More...
 
int osip_dialog_match_as_uac (osip_dialog_t *dialog, osip_message_t *response)
 Match a response received with a dialog. More...
 
int osip_dialog_update_tag_as_uac (osip_dialog_t *dialog, osip_message_t *response)
 Update the tag as UAC of a dialog?. More...
 
int osip_dialog_update_route_set_as_uac (osip_dialog_t *dialog, osip_message_t *response)
 Update the Route-Set as UAC of a dialog. More...
 
int osip_dialog_match_as_uas (osip_dialog_t *dialog, osip_message_t *request)
 Match a request (response sent?) received with a dialog. More...
 
int osip_dialog_is_originator (osip_dialog_t *dialog)
 Is dialog initiated by as CALLER. More...
 
int osip_dialog_is_callee (osip_dialog_t *dialog)
 Is dialog initiated by as CALLEE. More...
 

Detailed Description

Macro Definition Documentation

#define osip_dialog_get_instance (   dialog)    (dialog)->your_instance

#include <osip_dialog.h>

Retrieve application instance from dialog.

Parameters
dialogThe osip dialog
Returns
instance The application instance

Definition at line 91 of file osip_dialog.h.

#define osip_dialog_set_instance (   dialog,
  instance 
)    (dialog)->your_instance = (void*)(instance)

#include <osip_dialog.h>

Link osip dialog to application.

Parameters
dialogThe osip dialog
instanceThe application instance

Definition at line 84 of file osip_dialog.h.

Typedef Documentation

#include <osip_dialog.h>

Structure for referencing a dialog.

Definition at line 53 of file osip_dialog.h.

#include <osip_dialog.h>

Enumeration Type Documentation

#include <osip_dialog.h>

Enumerator
CALLER 
CALLEE 

Definition at line 42 of file osip_dialog.h.

Function Documentation

void osip_dialog_free ( osip_dialog_t dialog)

#include <osip_dialog.h>

Free all resource in a osip_dialog_t element.

Parameters
dialogThe element to free.
int osip_dialog_init_as_uac ( osip_dialog_t **  dialog,
osip_message_t response 
)

#include <osip_dialog.h>

Allocate a osip_dialog_t element as a UAC.

NOTE1: The dialog should be created when the first response is received. (except for a 100 Trying) NOTE2: Remote UA should be compliant! If not (not tag in the to header?) the old mechanism is used to match the request but if 2 uncompliant UA both answer 200 OK for the same transaction, they won't be detected. This is a major BUG in the old rfc.

Parameters
dialogThe element to allocate.
responseThe response containing the informations.
int osip_dialog_init_as_uac_with_remote_request ( osip_dialog_t **  dialog,
osip_message_t next_request,
int  local_cseq 
)

#include <osip_dialog.h>

Allocate a osip_dialog_t element as a UAC.

  • This could be used to initiate dialog with a NOTIFY coming before the answer for a subscribe has reached us.
Parameters
dialogThe element to allocate.
next_requestThe response containing the informations.
local_cseqThe local cseq
int osip_dialog_init_as_uas ( osip_dialog_t **  dialog,
osip_message_t invite,
osip_message_t response 
)

#include <osip_dialog.h>

Allocate a osip_dialog_t element as a UAS.

NOTE1: The dialog should be created when the first response is sent. (except for a 100 Trying)

Parameters
dialogThe element to allocate.
inviteThe INVITE request containing some informations.
responseThe response containing other informations.
int osip_dialog_is_callee ( osip_dialog_t dialog)

#include <osip_dialog.h>

Is dialog initiated by as CALLEE.

Parameters
dialogThe element to work on.
int osip_dialog_is_originator ( osip_dialog_t dialog)

#include <osip_dialog.h>

Is dialog initiated by as CALLER.

Parameters
dialogThe element to work on.
int osip_dialog_match_as_uac ( osip_dialog_t dialog,
osip_message_t response 
)

#include <osip_dialog.h>

Match a response received with a dialog.

Parameters
dialogThe element to work on.
responseThe response received.
int osip_dialog_match_as_uas ( osip_dialog_t dialog,
osip_message_t request 
)

#include <osip_dialog.h>

Match a request (response sent?) received with a dialog.

Parameters
dialogThe element to work on.
requestThe request received.
void osip_dialog_set_state ( osip_dialog_t dialog,
state_t  type 
)

#include <osip_dialog.h>

Set the state of the dialog.

This is useful to keep information on who is the initiator of the call.

Parameters
dialogThe element to work on.
typeThe type of dialog (CALLEE or CALLER).
int osip_dialog_update_osip_cseq_as_uas ( osip_dialog_t dialog,
osip_message_t request 
)

#include <osip_dialog.h>

Update the CSeq (remote cseq) during a UAS transaction of a dialog.

NOTE: All INCOMING transactions MUST update the remote CSeq.

Parameters
dialogThe element to work on.
requestThe request received.
int osip_dialog_update_route_set_as_uac ( osip_dialog_t dialog,
osip_message_t response 
)

#include <osip_dialog.h>

Update the Route-Set as UAC of a dialog.

NOTE: bis-09 says that only INVITE transactions can update the route-set. NOTE: bis-09 says that updating the route-set means: update the contact field only (AND NOT THE ROUTE-SET). This method follow this behaviour. NOTE: This method should be called for each request (except 100 Trying) received for a dialog.

Parameters
dialogThe element to work on.
responseThe response received.
int osip_dialog_update_route_set_as_uas ( osip_dialog_t dialog,
osip_message_t invite 
)

#include <osip_dialog.h>

Update the Route-Set as UAS of a dialog.

NOTE: bis-09 says that only INVITE transactions can update the route-set. NOTE: bis-09 says that updating the route-set means: update the contact field only (AND NOT THE ROUTE-SET). This method follow this behaviour. NOTE: This method should be called for each request received for a dialog.

Parameters
dialogThe element to work on.
inviteThe invite received.
int osip_dialog_update_tag_as_uac ( osip_dialog_t dialog,
osip_message_t response 
)

#include <osip_dialog.h>

Update the tag as UAC of a dialog?.

(this could be needed if the 180 does not contains any tag, but the 200 contains one.

Parameters
dialogThe element to work on.
responseThe response received.