<STRUCT>
<NAME>BodyContext</NAME>
struct BodyContext
{
	struct _BodyContextClass *klass;
	struct _BodyHandler *handler; 	/* the handler of the context  */
	struct _OsipDialog *dialog;			/* the dialog the handler must deal with */
	void *data;
};
</STRUCT>
<STRUCT>
<NAME>BodyContext</NAME>
</STRUCT>
<USER_FUNCTION>
<NAME>BodyContextDestroyFunc</NAME>
<RETURNS>void </RETURNS>
BodyContext*
</USER_FUNCTION>
<USER_FUNCTION>
<NAME>BodyContextNotifyMessageFunc</NAME>
<RETURNS>int </RETURNS>
BodyContext*,sip_t *,char *body
</USER_FUNCTION>
<USER_FUNCTION>
<NAME>BodyContextAddBodyFunc</NAME>
<RETURNS>int </RETURNS>
BodyContext*,sip_t *
</USER_FUNCTION>
<STRUCT>
<NAME>BodyContextClass</NAME>
struct BodyContextClass
{
	BodyContextDestroyFunc _destroy;
	BodyContextNotifyMessageFunc _notify_inc_request;
	BodyContextNotifyMessageFunc _notify_inc_response;
	BodyContextAddBodyFunc _gen_out_request;
	BodyContextAddBodyFunc _gen_out_response;
};
</STRUCT>
<STRUCT>
<NAME>BodyContextClass</NAME>
</STRUCT>
<MACRO>
<NAME>BODY_CONTEXT</NAME>
#define BODY_CONTEXT(b)  ((BodyContext*)(b))
</MACRO>
<MACRO>
<NAME>BODY_CONTEXT_CLASS</NAME>
#define BODY_CONTEXT_CLASS(klass) 	((BodyContextClass*)(klass))
</MACRO>
<FUNCTION>
<NAME>body_context_init</NAME>
<RETURNS>void  </RETURNS>
BodyContext *obj, BodyHandler *info
</FUNCTION>
<MACRO>
<NAME>body_context_class_init</NAME>
#define body_context_class_init(k)
</MACRO>
<MACRO>
<NAME>body_context_get_mime</NAME>
#define body_context_get_mime(context)	((context)->handler->klass->mime_type)
</MACRO>
<MACRO>
<NAME>body_context_notify_inc_request</NAME>
#define body_context_notify_inc_request(context, msg, body) \
			(context)->klass->_notify_inc_request((context),(msg), (body))
</MACRO>
<MACRO>
<NAME>body_context_notify_inc_response</NAME>
#define body_context_notify_inc_response(context, msg, body) \
			(context)->klass->_notify_inc_response((context),(msg),(body))
</MACRO>
<MACRO>
<NAME>body_context_gen_out_request</NAME>
#define body_context_gen_out_request(context, msg) \
			(context)->klass->_gen_out_request((context),(msg))
</MACRO>
<MACRO>
<NAME>body_context_gen_out_response</NAME>
#define body_context_gen_out_response(context, msg) \
			(context)->klass->_gen_out_response((context),(msg))
</MACRO>
<MACRO>
<NAME>body_context_get_dialog</NAME>
#define body_context_get_dialog(context)	((context)->call)
</MACRO>
<MACRO>
<NAME>body_context_get_handler</NAME>
#define body_context_get_handler(context)	((context)->handler)
</MACRO>
<STRUCT>
<NAME>BodyHandler</NAME>
struct BodyHandler
{
	struct _BodyHandlerClass *klass;
	struct _OsipUA *ua;
		
};
</STRUCT>
<STRUCT>
<NAME>BodyHandler</NAME>
</STRUCT>
<USER_FUNCTION>
<NAME>BodyHandlerFunc</NAME>
<RETURNS>void </RETURNS>
BodyHandler *
</USER_FUNCTION>
<STRUCT>
<NAME>BodyHandlerClass</NAME>
struct BodyHandlerClass
{
	char *mime_type;
	BodyContextNewFunc _body_context_new;  /* the constructor of the bodyhandler managed by the BodyHandler*/	
	BodyHandlerFunc _init;	/* called when the body handler info is placed on the ua list of infos.*/
};
</STRUCT>
<STRUCT>
<NAME>BodyHandlerClass</NAME>
</STRUCT>
<MACRO>
<NAME>BODY_HANDLER</NAME>
#define BODY_HANDLER(obj)		((BodyHandler*)(obj))
</MACRO>
<MACRO>
<NAME>BODY_HANDLER_CLASS</NAME>
#define BODY_HANDLER_CLASS(obj)		((BodyHandlerClass*)(obj))
</MACRO>
<FUNCTION>
<NAME>body_handler_init</NAME>
<RETURNS>void  </RETURNS>
BodyHandler *info
</FUNCTION>
<FUNCTION>
<NAME>body_handler_class_init</NAME>
<RETURNS>void  </RETURNS>
BodyHandlerClass *info
</FUNCTION>
<MACRO>
<NAME>HASHLEN</NAME>
#define HASHLEN 16
</MACRO>
<TYPEDEF>
<NAME>HASH[HASHLEN]</NAME>
typedef char HASH[HASHLEN];
</TYPEDEF>
<MACRO>
<NAME>HASHHEXLEN</NAME>
#define HASHHEXLEN 32
</MACRO>
<TYPEDEF>
<NAME>HASHHEX[HASHHEXLEN+1]</NAME>
typedef char HASHHEX[HASHHEXLEN+1];
</TYPEDEF>
<MACRO>
<NAME>IN</NAME>
#define IN
</MACRO>
<MACRO>
<NAME>OUT</NAME>
#define OUT
</MACRO>
<FUNCTION>
<NAME>DigestCalcHA1</NAME>
<RETURNS>void  </RETURNS>
IN char * pszAlg,IN char * pszUserName,IN char * pszRealm,IN char * pszPassword,IN char * pszNonce,IN char * pszCNonce,OUT HASHHEX SessionKey
</FUNCTION>
<FUNCTION>
<NAME>DigestCalcResponse</NAME>
<RETURNS>void  </RETURNS>
IN HASHHEX HA1,IN char * pszNonce,IN char * pszNonceCount,IN char * pszCNonce,IN char * pszQop,IN char * pszMethod,IN char * pszDigestUri,IN HASHHEX HEntity,OUT HASHHEX Response
</FUNCTION>
<VARIABLE>
<NAME>callleg_list</NAME>
extern list_t callleg_list;
</VARIABLE>
<FUNCTION>
<NAME>osip_dialog_new</NAME>
<RETURNS>OsipDialog  *</RETURNS>
struct _OsipUA *ua
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_new_from_incoming_trn</NAME>
<RETURNS>OsipDialog  *</RETURNS>
transaction_t *trn
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_update_from_response</NAME>
<RETURNS>void  </RETURNS>
OsipDialog *call,sip_t *resp
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_update_from_request</NAME>
<RETURNS>void  </RETURNS>
OsipDialog *dia, sip_t *sipmsg
</FUNCTION>
<MACRO>
<NAME>osip_dialog_set_state</NAME>
#define osip_dialog_set_state(call, state) (call)->status=(state)
</MACRO>
<MACRO>
<NAME>osip_dialog_get_state</NAME>
#define osip_dialog_get_state(call) ((call)->status)
</MACRO>
<FUNCTION>
<NAME>osip_dialog_exists</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call
</FUNCTION>
<MACRO>
<NAME>osip_dialog_get_ua</NAME>
#define osip_dialog_get_ua(call) ((struct _OsipUA*)(call->ua))
</MACRO>
<FUNCTION>
<NAME>osip_dialog_find</NAME>
<RETURNS>int  </RETURNS>
sip_t *sipmsg, OsipDialog **ret_dialog
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_accept_invite</NAME>
<RETURNS>void  </RETURNS>
OsipDialog *call_leg,transaction_t *trn
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_invite</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call_leg, char *callee, char *body_mime
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_reinvite_with_authentication</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call_leg,sip_t *previous_answer, char *password
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_register</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call_leg, RegistrationCtxt *ctxt
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_register_with_authentication</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call_leg,sip_t *previous_answer, char *password
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_unregister</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call, RegistrationCtxt *ctxt
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_ack</NAME>
<RETURNS>void  </RETURNS>
OsipDialog *call,transaction_t *trn
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_bye</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call_leg
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_reject_invite</NAME>
<RETURNS>int  </RETURNS>
OsipDialog * call_leg
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_generate_request_within_dialog</NAME>
<RETURNS>int  </RETURNS>
 OsipDialog *call_leg,char *method_name,sip_t **dest
</FUNCTION>
<FUNCTION>
<NAME>generating_request_out_of_dialog</NAME>
<RETURNS>int  </RETURNS>
OsipDialog * call_leg,char *method_name,char *callee, sip_t **dest
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_send_request</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call_leg,sip_t *sipmsg
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_generate_response_default</NAME>
<RETURNS>int</RETURNS>
OsipDialog *call_leg,int status, sip_t *request, sip_t **dest
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_respond</NAME>
<RETURNS>void  </RETURNS>
OsipDialog *call, transaction_t *trn, int code
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_send_response</NAME>
<RETURNS>void  </RETURNS>
OsipDialog *call,transaction_t *trn, sip_t *resp
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_release</NAME>
<RETURNS>void  </RETURNS>
OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_destroy</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_notify</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call_leg
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_refer</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call_leg
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_bye_transfer</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call_leg
</FUNCTION>
<MACRO>
<NAME>INVITE</NAME>
#define INVITE 0
</MACRO>
<MACRO>
<NAME>BYE</NAME>
#define BYE 1
</MACRO>
<MACRO>
<NAME>REGISTER</NAME>
#define REGISTER 2
</MACRO>
<MACRO>
<NAME>ACK</NAME>
#define ACK 3
</MACRO>
<FUNCTION>
<NAME>osip_ua_call_leg_exists</NAME>
<RETURNS>int  </RETURNS>
OsipUA *ua,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_add_body_context</NAME>
<RETURNS>void  </RETURNS>
OsipDialog *call, BodyContext *handler
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_get_body_context</NAME>
<RETURNS>BodyContext  *</RETURNS>
OsipDialog *call, char *body_mime, int pos
</FUNCTION>
<FUNCTION>
<NAME>osip_dialog_add_body_to_request</NAME>
<RETURNS>int  </RETURNS>
OsipDialog *call, sip_t *msg, char *body_mime
</FUNCTION>
<MACRO>
<NAME>OSIP_MAX_UDP_PORTS</NAME>
#define OSIP_MAX_UDP_PORTS 5
</MACRO>
<FUNCTION>
<NAME>osip_manager_new</NAME>
<RETURNS>OsipManager *</RETURNS>

</FUNCTION>
<FUNCTION>
<NAME>osip_manager_add_udpport</NAME>
<RETURNS>int  </RETURNS>
OsipManager *manager, int port
</FUNCTION>
<FUNCTION>
<NAME>osip_manager_remove_udpport</NAME>
<RETURNS>int  </RETURNS>
OsipManager *manager, int port
</FUNCTION>
<FUNCTION>
<NAME>osip_manager_start_udp_daemon</NAME>
<RETURNS>void  </RETURNS>
OsipManager *manager
</FUNCTION>
<FUNCTION>
<NAME>osip_manager_stop_udp_daemon</NAME>
<RETURNS>void  </RETURNS>
OsipManager *manager
</FUNCTION>
<FUNCTION>
<NAME>osip_manager_start_resolver</NAME>
<RETURNS>void  </RETURNS>
OsipManager *manager
</FUNCTION>
<FUNCTION>
<NAME>osip_manager_stop_resolver</NAME>
<RETURNS>void  </RETURNS>
OsipManager *manager
</FUNCTION>
<FUNCTION>
<NAME>osip_manager_set_send_port</NAME>
<RETURNS>int  </RETURNS>
OsipManager *manager,int port
</FUNCTION>
<FUNCTION>
<NAME>osip_manager_destroy</NAME>
<RETURNS>void  </RETURNS>
OsipManager *manager
</FUNCTION>
<FUNCTION>
<NAME>ict_kill_transaction</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn
</FUNCTION>
<FUNCTION>
<NAME>ict_1xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* msg
</FUNCTION>
<FUNCTION>
<NAME>ict_2xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>ict_3xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>ict_4xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>ict_5xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>ict_6xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nict_kill_transaction</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn
</FUNCTION>
<FUNCTION>
<NAME>nict_1xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nict_2xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nict_3xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nict_4xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nict_5xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nict_6xx_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t* trn, sip_t* sipmsg
</FUNCTION>
<FUNCTION>
<NAME>ist_kill_transaction</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn
</FUNCTION>
<FUNCTION>
<NAME>ist_invite_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn, sip_t *sipmsg
</FUNCTION>
<FUNCTION>
<NAME>ist_ack_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn, sip_t *sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nist_kill_transaction</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn
</FUNCTION>
<FUNCTION>
<NAME>nist_register_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn, sip_t *sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nist_bye_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn, sip_t *sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nist_refer_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn, sip_t *sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nist_notify_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn, sip_t *sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nist_cancel_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn, sip_t *sipmsg
</FUNCTION>
<FUNCTION>
<NAME>nist_options_received</NAME>
<RETURNS>void  </RETURNS>
transaction_t * trn, sip_t *sipmsg
</FUNCTION>
<VARIABLE>
<NAME>def_manager</NAME>
extern OsipManager *def_manager;
</VARIABLE>
<FUNCTION>
<NAME>osip_send_response</NAME>
<RETURNS>void  </RETURNS>
OsipManager *mgr,transaction_t *transaction,sip_t *response
</FUNCTION>
<FUNCTION>
<NAME>udp_send</NAME>
<RETURNS>int  </RETURNS>
transaction_t *trn, sip_t *sipmsg,char *host,int port,int sock
</FUNCTION>
<MACRO>
<NAME>osip_manager_wake_up</NAME>
#define osip_manager_wake_up(manager) write((manager)->udp_control_fd,"n",1);
</MACRO>
<MACRO>
<NAME>IP4_SIZE</NAME>
#define IP4_SIZE 20
</MACRO>
<FUNCTION>
<NAME>make_message</NAME>
<RETURNS>char  *</RETURNS>
const char *fmt, ...
</FUNCTION>
<MACRO>
<NAME>osip_trace</NAME>
#define osip_trace(loglevel,args)  do        \
{                       \
	char *__strmsg;  \
	__strmsg=make_message args ;    \
	OSIP_TRACE(osip_trace(__FILE__,__LINE__,(loglevel),NULL,"%s\n",__strmsg)); \
	sfree (__strmsg);        \
}while (0);
</MACRO>
<STRUCT>
<NAME>OsipDialog</NAME>
struct OsipDialog
{
	from_t *from;
	// to_t *to;
	// call_id_t *callid;
	// int local_cseq;
	// int remote_cseq;
	int status;
	url_t *registrar;
	/*
	 * * GRS
	 * * from and to are not enough if (for example) the far end proxy server <        * gets out of the loop and you end up communicating directly with the
	 * * end system.  Your from and to remain constant, but you need to
	 * * know who the "real" peer is for request URIs and to send the UDP
	 * * packets to the right place.
	 * *
	 * * this could be handled in one of two ways - the "peer" field could
	 * * stay null unless its valid, or we could always initialize it to
	 * * be the same as the to field.  Simon, I'll leave that up to you.
	 */
	/* AMD: this can be acheived by the dialog.h API in oSIP */
	dialog_t *dialog;

	/* transactions associated with call-leg */
	transaction_t *inc_invite_tr;
	transaction_t *out_invite_tr;
	transaction_t *inc_bye_tr;
	transaction_t *out_bye_tr;
	transaction_t *inc_cancel_tr;
	transaction_t *out_cancel_tr;
	transaction_t *inc_notify_tr;
	transaction_t *out_notify_tr;
	transaction_t *out_register_tr;

	/* list_t incoming_transactions; */
	/* list_t outgoing_transactions; */

	struct _RegistrationCtxt *reg_context;	/* the registration context if a registration is occuring */
	int inv_auth_count;
	int reg_auth_count;
	int resp180_count;
	unsigned int tag_set:1;
	unsigned int padding:31;

	struct _OsipUA *ua;	/* the ua object that manages the call */
	list_t body_contexts;	/* the active body contexts */
        /* LIK: transfer related functionality */
        char *transferurl;      /* Url to transfer to when not NULL*/
        char *referurl;         /* Alternate Url to transfer to when not NULL.  
				   Used in conjunction with refer method*/
	void *data;
};
</STRUCT>
<STRUCT>
<NAME>OsipDialog</NAME>
</STRUCT>
<USER_FUNCTION>
<NAME>OsipUACallbackFunc</NAME>
<RETURNS>int </RETURNS>
OsipDialog *, transaction_t *, sip_t *,
				   void *
</USER_FUNCTION>
<STRUCT>
<NAME>OsipUA</NAME>
struct OsipUA
{
	osip_t *config;		/* the config structure driving the stack */
	struct _OsipManager *manager;	/* the manager object that manages the stack on which the ua is running */	
	contact_t *contact;	/* the user agent real identity, like machin@217.0.0.128 */
	list_t *alias;		/* list of alias like machin@www-db.research.bell-labs.com, including address of records */
	char *fromtag;		/* the from tag put in all from fields of the requests */
	char ua_ip4addr[IP4_SIZE];
	int ua_port;
	list_t call_list;	/* the list of dialogs managed by the user agent */
	int max_dialogs;		/* the number of active dialogs of ua will process. If the limit is exceeded, it will answer BUSY HERE */
	int dialog_count;	/* number of active dialogs */
	url_t *registrar;	/* sip url of a registrar. This is also the address of the proxy if the OSIPUA_USE_PROXY flag is set */
	char *reg_passwd;	/* the password used for registration */
	unsigned int flags;
#define OSIP_UA_USE_PROXY (0x0001)
	//struct _MediaDesc *maudio;     /* a MediaDescriptor for audio*/
	//struct _MediaDesc *mvideo;     /* a MediaDescriptor for video*/
	/*signals */
	OsipUACallbackFunc invite;/*INVITE*/ 
	OsipUACallbackFunc invite_accepted;	/*INVITE_ACCEPTED *//* called to signal that media sessions can start */
	OsipUACallbackFunc bye;/*BYE*/ 
	OsipUACallbackFunc faillure;	/* FAILLURE */
	OsipUACallbackFunc informative;	/*various informations */
        OsipUACallbackFunc mute_function;  /* Function to call when
					      receiving mute request */
        OsipUACallbackFunc byetransfer_function;  /* Function to call when
						      receiving transfer request as part of a bye*/
        OsipUACallbackFunc refertransfer_function;  /* Function to call when
							receiving transfer request as part of a refer*/
    
        OsipUACallbackFunc notifytransfer_function;  /* Function to call when notifying as part of 
							 a completed REFER transaction */

	FILE *dbg;

	/* presence management infos */
	int presence_mode;	/* 200-> accept calls
				 * 486-> answer automatic 486 Busy
				 * 600-> 600 Busy Evrywhere
				 * 480-> answar automatic 480 Temporirily unavailable
				 * 302-> Moved temporarily
				 * 380-> Alternative service */
	int presence_delay;	/* a value in seconds to ba added to Retry-After
				 * in 486 Busy or 480 Temporirily unavailable */
	char *presence_contact_url;	/* contain a sip-url for 302, 301, 380.
					 * TO BE DONE: Can also contain an email instead of url!
					 */
        int    in_refer_mode;    /* Indicates that the UA is in the middle of a REFER transaction */
	list_t body_handlers;
	void *data;
};
</STRUCT>
<STRUCT>
<NAME>OsipUA</NAME>
</STRUCT>
<FUNCTION>
<NAME>osipua_init</NAME>
<RETURNS>void  </RETURNS>

</FUNCTION>
<FUNCTION>
<NAME>osipua_exit</NAME>
<RETURNS>void  </RETURNS>

</FUNCTION>
<FUNCTION>
<NAME>osip_ua_new</NAME>
<RETURNS>OsipUA  *</RETURNS>

</FUNCTION>
<FUNCTION>
<NAME>osip_ua_set_ip4addr</NAME>
<RETURNS>void  </RETURNS>
OsipUA * ua, char *ip4addr, int port
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_set_max_dialogs</NAME>
<RETURNS>void  </RETURNS>
OsipUA * ua, int max
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_set_contact</NAME>
<RETURNS>int  </RETURNS>
OsipUA * ua, char *contact
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_add_alias</NAME>
<RETURNS>int  </RETURNS>
OsipUA * ua, char *contact
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_remove_alias</NAME>
<RETURNS>int  </RETURNS>
OsipUA * ua, char *contact
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_clean_alias</NAME>
<RETURNS>void  </RETURNS>
OsipUA * ua
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_set_registrar</NAME>
<RETURNS>int  </RETURNS>
OsipUA * ua, char *registrar, char *passwd
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_set_outbound_proxy</NAME>
<RETURNS>int  </RETURNS>
OsipUA * ua, char *proxy, char *passwd
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_set_presence_mode</NAME>
<RETURNS>void  </RETURNS>
OsipUA * ua, int mode
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_set_presence_contact_url</NAME>
<RETURNS>void  </RETURNS>
OsipUA * ua, char *url
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_set_presence_delay</NAME>
<RETURNS>void  </RETURNS>
OsipUA * ua, int delay
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_add_body_handler</NAME>
<RETURNS>void  </RETURNS>
OsipUA * ua, BodyHandler * info
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_signal_connect</NAME>
<RETURNS>int  </RETURNS>
OsipUA * ua, char *signal,OsipUACallbackFunc func
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_get_dialog</NAME>
<RETURNS>OsipDialog  *</RETURNS>
OsipUA *ua, int number
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_destroy</NAME>
<RETURNS>int  </RETURNS>
OsipUA * ua
</FUNCTION>
<VARIABLE>
<NAME>ua_list</NAME>
extern list_t ua_list;
</VARIABLE>
<FUNCTION>
<NAME>osip_ua_find</NAME>
<RETURNS>OsipUA  *</RETURNS>
sip_t * sipmsg
</FUNCTION>
<FUNCTION>
<NAME>osip_ua_find_handler</NAME>
<RETURNS>BodyHandler  *</RETURNS>
OsipUA * ua, char *body_mime
</FUNCTION>
<STRUCT>
<NAME>RegistrationCtxt</NAME>
struct RegistrationCtxt
{
	char *registrar;   /* name or address of the registrar */
	char *address_of_record;   /* can be NULL, in which case calleg->from is used */
	char *password;
        int cseq_number;
        char *callid_number;
	int expires;
	int action; 	/* perhaps deprecated ...*/
#define REGISTER_ACTION_PROXY 0
#define REGISTER_ACTION_REDIRECT 1
#define REGISTER_ACTION_ANY 2
	int ref_count;  /* private, don 't touch it ! */
} ;
</STRUCT>
<STRUCT>
<NAME>RegistrationCtxt</NAME>
</STRUCT>
<FUNCTION>
<NAME>registration_ctxt_new</NAME>
<RETURNS>RegistrationCtxt  *</RETURNS>

</FUNCTION>
<FUNCTION>
<NAME>registration_ctxt_set_registrar</NAME>
<RETURNS>void  </RETURNS>
RegistrationCtxt *ctxt, char *registrar
</FUNCTION>
<FUNCTION>
<NAME>registration_ctxt_set_password</NAME>
<RETURNS>void  </RETURNS>
RegistrationCtxt *ctxt, char *password
</FUNCTION>
<FUNCTION>
<NAME>registration_ctxt_set_address_of_record</NAME>
<RETURNS>void  </RETURNS>
RegistrationCtxt *ctxt, char *addr_of_rec
</FUNCTION>
<MACRO>
<NAME>registration_ctxt_set_expires</NAME>
#define registration_ctxt_set_expires(r,e) 	(r)->expires=(e)
</MACRO>
<MACRO>
<NAME>registration_ctxt_set_action</NAME>
#define registration_ctxt_set_action(r,a) 	(r)->action=(a)
</MACRO>
<FUNCTION>
<NAME>registration_ctxt_destroy</NAME>
<RETURNS>void  </RETURNS>
 RegistrationCtxt *ctx
</FUNCTION>
<MACRO>
<NAME>registration_ctxt_ref</NAME>
#define registration_ctxt_ref(ctx) 	(ctx)->ref_count++
</MACRO>
<FUNCTION>
<NAME>registration_ctxt_free</NAME>
<RETURNS>void  </RETURNS>
RegistrationCtxt *ctx
</FUNCTION>
<MACRO>
<NAME>CACHE_ENTRY_DEFAULT_MAX_TIME</NAME>
#define CACHE_ENTRY_DEFAULT_MAX_TIME 3600 /* seconds*/
</MACRO>
<MACRO>
<NAME>RC_MAX_DEPHT</NAME>
#define RC_MAX_DEPHT 5
</MACRO>
<MACRO>
<NAME>RC_DELETE_OLD</NAME>
#define RC_DELETE_OLD
</MACRO>
<MACRO>
<NAME>RC_DELETE_LESS_ACCESSED</NAME>
#define RC_DELETE_LESS_ACCESSED
</MACRO>
<FUNCTION>
<NAME>resolver_cache_new</NAME>
<RETURNS>ResolverCache  *</RETURNS>
unsigned int size
</FUNCTION>
<FUNCTION>
<NAME>resolver_cache_put</NAME>
<RETURNS>void  </RETURNS>
ResolverCache *rc,char *hostname, unsigned int ip4addr
</FUNCTION>
<FUNCTION>
<NAME>resolver_cache_get</NAME>
<RETURNS>int  </RETURNS>
ResolverCache *rc,char *hostname, unsigned int *ip4addr
</FUNCTION>
<FUNCTION>
<NAME>resolver_cache_set_policy</NAME>
<RETURNS>void  </RETURNS>
ResolverCache *rc,int policy
</FUNCTION>
<FUNCTION>
<NAME>resolver_cache_destroy</NAME>
<RETURNS>void  </RETURNS>
ResolverCache *rc
</FUNCTION>
<FUNCTION>
<NAME>resolver_cache_update</NAME>
<RETURNS>void  </RETURNS>
ResolverCache *rc
</FUNCTION>
<FUNCTION>
<NAME>resolver_cache_hash</NAME>
<RETURNS>unsigned int  </RETURNS>
char *name
</FUNCTION>
<FUNCTION>
<NAME>resolver_thread</NAME>
<RETURNS>void  *</RETURNS>
void *
</FUNCTION>
<FUNCTION>
<NAME>async_resolv_and_send</NAME>
<RETURNS>int  </RETURNS>
OsipManager *manager, transaction_t *transaction, sipevent_t *sipevent
</FUNCTION>
<FUNCTION>
<NAME>async_resolv_and_send_ack</NAME>
<RETURNS>int</RETURNS>
OsipManager * manager, dialog_t *dialog, char *dest, int port,sip_t * ackmsg
</FUNCTION>
<ENUM>
<NAME>SdpContextState</NAME>
typedef enum _SdpContextState
{
	SDP_CONTEXT_STATE_INIT,
	SDP_CONTEXT_STATE_NEGOCIATION_OPENED,
	SDP_CONTEXT_STATE_NEGOCIATION_CLOSED
} SdpContextState;
</ENUM>
<STRUCT>
<NAME>SdpContext</NAME>
struct SdpContext
{
	BodyContext parent;
	sdp_t *offer;		/* the local sdp to be used for outgoing request */
	sdp_t *answer;		/* the local sdp generated from an inc request */
	sdp_t *remote;  	
	int negoc_status;	/* in sip code */
	int incb;
	SdpContextState state;
};
</STRUCT>
<STRUCT>
<NAME>SdpContextClass</NAME>
struct SdpContextClass
{
	BodyContextClass parent_class;
};
</STRUCT>
<STRUCT>
<NAME>SdpContext</NAME>
</STRUCT>
<STRUCT>
<NAME>SdpContextClass</NAME>
</STRUCT>
<FUNCTION>
<NAME>sdp_context_init</NAME>
<RETURNS>void  </RETURNS>
SdpContext *obj, SdpHandler *info
</FUNCTION>
<FUNCTION>
<NAME>sdp_context_class_init</NAME>
<RETURNS>void  </RETURNS>
SdpContextClass *klass
</FUNCTION>
<FUNCTION>
<NAME>sdp_context_new</NAME>
<RETURNS>BodyContext  *</RETURNS>
SdpHandler *info
</FUNCTION>
<FUNCTION>
<NAME>sdp_context_destroy</NAME>
<RETURNS>void  </RETURNS>
SdpContext *obj
</FUNCTION>
<MACRO>
<NAME>SDP_CONTEXT</NAME>
#define SDP_CONTEXT(obj)  ((SdpContext*)(obj))
</MACRO>
<MACRO>
<NAME>SDP_CONTEXT_CLASS</NAME>
#define SDP_CONTEXT_CLASS(klass)  ((SdpContextClass*)(klass))
</MACRO>
<MACRO>
<NAME>sdp_context_get_answer</NAME>
#define sdp_context_get_answer(h)	((h)->localneg)
</MACRO>
<MACRO>
<NAME>sdp_context_get_remote</NAME>
#define sdp_context_get_remote(h)	((h)->remote)
</MACRO>
<MACRO>
<NAME>sdp_context_get_negociation_status</NAME>
#define sdp_context_get_negociation_status(ctx)		((ctx)->negoc_status)
</MACRO>
<USER_FUNCTION>
<NAME>SdpHandlerReadCodecFunc</NAME>
<RETURNS>int </RETURNS>
struct _SdpHandler *, struct _SdpContext *,
											SdpPayload *
</USER_FUNCTION>
<USER_FUNCTION>
<NAME>SdpHandlerWriteCodecFunc</NAME>
<RETURNS>int </RETURNS>
struct _SdpHandler *, struct _SdpContext *
</USER_FUNCTION>
<STRUCT>
<NAME>SdpHandler</NAME>
struct SdpHandler
{
	BodyHandler parent;
	SdpHandlerReadCodecFunc accept_audio_codecs;   /*from remote sdp */
	SdpHandlerReadCodecFunc accept_video_codecs;   /*from remote sdp */
	SdpHandlerWriteCodecFunc set_audio_codecs;	/*to local sdp */
	SdpHandlerWriteCodecFunc set_video_codecs;	/*to local sdp */
	SdpHandlerReadCodecFunc get_audio_codecs;	/*from incoming answer  */
	SdpHandlerReadCodecFunc get_video_codecs;	/*from incoming answer  */
};
</STRUCT>
<STRUCT>
<NAME>SdpHandler</NAME>
</STRUCT>
<STRUCT>
<NAME>SdpHandlerClass</NAME>
struct SdpHandlerClass
{
	BodyHandlerClass parent_class;
};
</STRUCT>
<STRUCT>
<NAME>SdpHandlerClass</NAME>
</STRUCT>
<FUNCTION>
<NAME>sdp_handler_init</NAME>
<RETURNS>void  </RETURNS>
SdpHandler * obj
</FUNCTION>
<FUNCTION>
<NAME>sdp_handler_class_init</NAME>
<RETURNS>void  </RETURNS>
SdpHandlerClass * klass
</FUNCTION>
<FUNCTION>
<NAME>sdp_handler_new</NAME>
<RETURNS>BodyHandler  *</RETURNS>

</FUNCTION>
<FUNCTION>
<NAME>sdp_handler_set_accept_offer_fcn</NAME>
<RETURNS>void  </RETURNS>
SdpHandler *sh,SdpHandlerReadCodecFunc audiofunc,SdpHandlerReadCodecFunc videofunc
</FUNCTION>
<FUNCTION>
<NAME>sdp_handler_set_write_offer_fcn</NAME>
<RETURNS>void  </RETURNS>
SdpHandler *sh,SdpHandlerWriteCodecFunc audiofunc,SdpHandlerWriteCodecFunc videofunc
</FUNCTION>
<FUNCTION>
<NAME>sdp_handler_set_read_answer_fcn</NAME>
<RETURNS>void  </RETURNS>
SdpHandler *sh,SdpHandlerReadCodecFunc audiofunc,SdpHandlerReadCodecFunc videofunc
</FUNCTION>
<FUNCTION>
<NAME>sdp_handler_add_audio_payload</NAME>
<RETURNS>void  </RETURNS>
SdpHandler *sh,SdpContext *ctx,SdpPayload *payload
</FUNCTION>
<MACRO>
<NAME>SDP_HANDLER</NAME>
#define SDP_HANDLER(obj)	((SdpHandler*)(obj))
</MACRO>
<FUNCTION>
<NAME>sdp_handler_generate_template</NAME>
<RETURNS>sdp_t  *</RETURNS>
SdpHandler * obj
</FUNCTION>
<FUNCTION>
<NAME>sdp_handler_generate_offer</NAME>
<RETURNS>sdp_t  *</RETURNS>
SdpHandler *sdph, struct _SdpContext *ctx
</FUNCTION>
<FUNCTION>
<NAME>sdp_handler_gererate_answer</NAME>
<RETURNS>sdp_t  *</RETURNS>
SdpHandler *sdph, struct _SdpContext *ctx
</FUNCTION>
<FUNCTION>
<NAME>sdp_handler_read_remote_answer</NAME>
<RETURNS>void  </RETURNS>
SdpHandler *sdph,struct _SdpContext *ctx
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_new</NAME>
<RETURNS>transaction_t  *</RETURNS>
OsipDialog *call, sip_t *msg
</FUNCTION>
<MACRO>
<NAME>ua_transaction_get_dialog</NAME>
#define ua_transaction_get_dialog(trn) ((OsipDialog*)((trn)->your_instance))
</MACRO>
<FUNCTION>
<NAME>ua_transaction_set_incoming_invite_tr</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_set_outgoing_invite_tr</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_set_incoming_bye_tr</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_set_outgoing_bye_tr</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_set_outgoing_register_tr</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_set_outgoing_cancel_tr</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_set_incoming_cancel_tr</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_set_outgoing_notify_tr</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_set_incoming_notify_tr</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,OsipDialog *call
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_free</NAME>
<RETURNS>void  </RETURNS>
transaction_t *transaction
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_set_destination</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn,char *destination, int port
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_get_destination</NAME>
<RETURNS>int  </RETURNS>
transaction_t *trn, char **destination, int *port
</FUNCTION>
<FUNCTION>
<NAME>ua_transaction_execute</NAME>
<RETURNS>void  </RETURNS>
transaction_t *trn, sipevent_t *ev
</FUNCTION>
<FUNCTION>
<NAME>sipd_thread</NAME>
<RETURNS>void  *</RETURNS>
void *managerp
</FUNCTION>
<FUNCTION>
<NAME>get_compatible_profile</NAME>
<RETURNS>int  </RETURNS>
list_t *ua_profiles,list_t *profiles
</FUNCTION>
<FUNCTION>
<NAME>respond_to_request</NAME>
<RETURNS>void  </RETURNS>
osip_t *config, transaction_t *transaction, int code
</FUNCTION>
<FUNCTION>
<NAME>msg_make_template_reply</NAME>
<RETURNS>sip_t  *</RETURNS>
sip_t * request, int code
</FUNCTION>
<FUNCTION>
<NAME>sdp_compose</NAME>
<RETURNS>char  *</RETURNS>
int sess_id, char *user, char *ip4addr,char *subject, list_t *media_list
</FUNCTION>
<FUNCTION>
<NAME>list_remove_el</NAME>
<RETURNS>int  </RETURNS>
list_t *list,void *el
</FUNCTION>
<FUNCTION>
<NAME>callid_getcopy</NAME>
<RETURNS>void  </RETURNS>
call_id_t	*dest,call_id_t *source
</FUNCTION>
<MACRO>
<NAME>LIST_ELEM_DESTRUCTOR</NAME>
#define LIST_ELEM_DESTRUCTOR(func)     ((void (*)(void *))func)
</MACRO>
<FUNCTION>
<NAME>list_free</NAME>
<RETURNS>void  </RETURNS>
list_t *li, void (*destructor)(void *)
</FUNCTION>
<FUNCTION>
<NAME>from_copy_tag</NAME>
<RETURNS>int  </RETURNS>
from_t *from1,from_t *from2
</FUNCTION>
<MACRO>
<NAME>tag_init</NAME>
#define tag_init(pc) _tag_init( (pc),5)
</MACRO>
<MACRO>
<NAME>from_tag_add</NAME>
#define from_tag_add(_from,_tag) from_param_add((_from),sgetcopy("tag"),(_tag))
</MACRO>
<MACRO>
<NAME>from_tag_add_random</NAME>
#define from_tag_add_random(_from) \
	do \
	{\
		char *_tag; \
		tag_init(&_tag); \
		from_param_add((_from),sgetcopy("tag"),_tag); \
	}while (0)
</MACRO>
<MACRO>
<NAME>to_tag_add</NAME>
#define to_tag_add(_to,_tag) to_param_add((_to),sgetcopy("tag"),(_tag))	
</MACRO>
<FUNCTION>
<NAME>msg_getbody_by_mime</NAME>
<RETURNS>int  </RETURNS>
sip_t *sipmsg,char *mime,body_t **body
</FUNCTION>
<FUNCTION>
<NAME>content_type_get_type</NAME>
<RETURNS>char  *</RETURNS>
content_type_t *ct
</FUNCTION>
<FUNCTION>
<NAME>osip_create_proxy_authorization_header</NAME>
<RETURNS>int</RETURNS>
sip_t *previous_answer,char *rquri, char *username, char *passwd,proxy_authorization_t **auth
</FUNCTION>
<FUNCTION>
<NAME>osip_create_authorization_header</NAME>
<RETURNS>int</RETURNS>
sip_t *previous_answer,char *rquri, char *username, char *passwd,authorization_t **auth
</FUNCTION>
<FUNCTION>
<NAME>int_2char</NAME>
<RETURNS>char  *</RETURNS>
int a
</FUNCTION>
<FUNCTION>
<NAME>srealloc</NAME>
<RETURNS>void  *</RETURNS>
void *p, int i
</FUNCTION>
<MACRO>
<NAME>keywordcmp</NAME>
#define keywordcmp(key,str)  strncmp(key,str,strlen(key))
</MACRO>
<FUNCTION>
<NAME>sdp_a_attr_value_get_with_pt</NAME>
<RETURNS>char  *</RETURNS>
sdp_t *sdp,int pos,int pt,char *field
</FUNCTION>
<FUNCTION>
<NAME>sdp_b_bandwidth_get_with_pt</NAME>
<RETURNS>int  </RETURNS>
sdp_t *sdp,int pos,int pt
</FUNCTION>
