⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ht0-initialize.dox

📁 libosip2-3.0.3最新版本
💻 DOX
字号:
/** * @ingroup libosip2 The GNU oSIP stack * @defgroup howto0_initialize How-To initialize libosip2.When using osip, your first task is to initializethe parser and the state machine. This must be doneprior to any use of libosip2.<PRE>	#include <sys/time.h>	#include <osip2/osip.h>	int i;	osip_t *osip;	i=osip_init(&osip);	if (i!=0)	  return -1;</PRE>On windows, you should write<PRE>	#include <winsock2.h>	#include <osip2/osip.h>	int i;	osip_t *osip;	i=osip_init(&osip);	if (i!=0)	  return -1;</PRE>In case you want to use the state machines (transaction management),the second step will be to set a few callbacks which will informyou of any change in the state of a SIP transaction.Most of the following callbacks are optional. The following ones areusefull.<PRE>	// callback called when a SIP message must be sent.	osip_set_cb_send_message(osip, &cb_udp_snd_message);		// callback called when a SIP transaction is TERMINATED.	osip_set_kill_transaction_callback(osip ,OSIP_ICT_KILL_TRANSACTION,				 &cb_ict_kill_transaction);	osip_set_kill_transaction_callback(osip ,OSIP_NIST_KILL_TRANSACTION,				 &cb_ist_kill_transaction);	osip_set_kill_transaction_callback(osip ,OSIP_NICT_KILL_TRANSACTION,				 &cb_nict_kill_transaction);	osip_set_kill_transaction_callback(osip ,OSIP_NIST_KILL_TRANSACTION,				 &cb_nist_kill_transaction);	// callback called when the callback to send message have failed.	osip_set_transport_error_callback(osip ,OSIP_ICT_TRANSPORT_ERROR,				    &cb_transport_error);	osip_set_transport_error_callback(osip ,OSIP_IST_TRANSPORT_ERROR,				    &cb_transport_error);	osip_set_transport_error_callback(osip ,OSIP_NICT_TRANSPORT_ERROR,				    &cb_transport_error);	osip_set_transport_error_callback(osip ,OSIP_NIST_TRANSPORT_ERROR,				    &cb_transport_error);		// callback called when a received answer has been accepted by the transaction.	osip_set_message_callback(osip ,OSIP_ICT_STATUS_1XX_RECEIVED, &cb_rcv1xx);	osip_set_message_callback(osip ,OSIP_ICT_STATUS_2XX_RECEIVED, &cb_rcv2xx);	osip_set_message_callback(osip ,OSIP_ICT_STATUS_3XX_RECEIVED, &cb_rcv3456xx);	osip_set_message_callback(osip ,OSIP_ICT_STATUS_4XX_RECEIVED, &cb_rcv3456xx);	osip_set_message_callback(osip ,OSIP_ICT_STATUS_5XX_RECEIVED, &cb_rcv3456xx);	osip_set_message_callback(osip ,OSIP_ICT_STATUS_6XX_RECEIVED, &cb_rcv3456xx);		// callback called when a received answer has been accepted by the transaction.	osip_set_message_callback(osip ,OSIP_NICT_STATUS_1XX_RECEIVED, &cb_rcv1xx);	osip_set_message_callback(osip ,OSIP_NICT_STATUS_2XX_RECEIVED, &cb_rcv2xx);	osip_set_message_callback(osip ,OSIP_NICT_STATUS_3XX_RECEIVED, &cb_rcv3456xx);	osip_set_message_callback(osip ,OSIP_NICT_STATUS_4XX_RECEIVED, &cb_rcv3456xx);	osip_set_message_callback(osip ,OSIP_NICT_STATUS_5XX_RECEIVED, &cb_rcv3456xx);	osip_set_message_callback(osip ,OSIP_NICT_STATUS_6XX_RECEIVED, &cb_rcv3456xx);	    	// callback called when a received request has been accepted by the transaction.	osip_set_message_callback(osip ,OSIP_IST_INVITE_RECEIVED,     &cb_rcvreq);	osip_set_message_callback(osip ,OSIP_IST_ACK_RECEIVED,        &cb_rcvreq);	osip_set_message_callback(osip ,OSIP_NIST_REGISTER_RECEIVED,  &cb_rcvreq);	osip_set_message_callback(osip ,OSIP_NIST_BYE_RECEIVED,       &cb_rcvreq);	osip_set_message_callback(osip ,OSIP_NIST_CANCEL_RECEIVED,    &cb_rcvreq);	osip_set_message_callback(osip ,OSIP_NIST_INFO_RECEIVED,      &cb_rcvreq);	osip_set_message_callback(osip ,OSIP_NIST_OPTIONS_RECEIVED,   &cb_rcvreq);	osip_set_message_callback(osip ,OSIP_NIST_SUBSCRIBE_RECEIVED, &cb_rcvreq);	osip_set_message_callback(osip ,OSIP_NIST_NOTIFY_RECEIVED,    &cb_rcvreq);	osip_set_message_callback(osip ,OSIP_NIST_UNKNOWN_REQUEST_RECEIVED, &cb_rcvreq);	// other callbacks exists... They are optionnal.</PRE>*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -