📄 exosip.h
字号:
int eXosip_set_call_reference(int jid, void *reference);/** * Put a call on hold. * * @param jid dialog id of call. */int eXosip_on_hold_call (int jid);int eXosip_off_hold_call (int jid);/** * Tranfer a call. * * @param jid dialog id of call. * @param refer_to SIP Url for transfer. */int eXosip_transfer_call(int jid, char *refer_to);/** * Terminate a call. * * @param cid call id of call. * @param jid dialog id of call. */int eXosip_terminate_call(int cid, int jid);/** * Send an OPTIONS message within a call. * * @param cid call id of call. * @param jid dialog id of call. */int eXosip_options_call (int jid);/** * Send an INFO message within a call. * * @param jid dialog id of call. * @param content_type content-type of body. * @param body body to attach. */int eXosip_info_call(int jid, char *content_type, char *body);/** * Answer an OPTIONS message. * * @param cid call id of call. * @param jid dialog id of call. */int eXosip_answer_options(int cid, int jid, int status);/** @} *//** * @defgroup eXosip_registration eXosip Registration Management * @ingroup eXosip * @{ *//** * Send initial registration to a server. (REGISTER request) * * @param from SIP url for caller. * @param proxy Proxy used for registration. * @param contact Contact address. (optionnal) */int eXosip_register_init (char *from, char *proxy, char *contact);/** * Update the registration. (REGISTER request) * * @param rid . * @param expires The expires value for registration. */int eXosip_register (int rid, int expires);/** @} *//** * @defgroup eXosip_impp eXosip Instant Messaging and Presence Management * @ingroup eXosip * @{ *//** * Send an Instant Message (MESSAGE request). * * @param rid . */void eXosip_message (char *to, char *from, char *route, char *buff);/** * Send initial subscription to a user. (SUBSCRIBE request) * * @param to SIP url for callee. * @param from SIP url for caller. * @param route Route used for registration. */int eXosip_subscribe(char *to, char *from, char *route);/** * Update a subscription (SUBSCRIBE request). * * @param sid id of subscription. * @param expires Time between updates. */int eXosip_subscribe_refresh(int sid, char *expires);/** * Close a subscription (SUBSCRIBE request). * * @param sid id of subscription. */int eXosip_subscribe_close(int sid);typedef enum eXosip_ss { EXOSIP_SUBCRSTATE_UNKNOWN, EXOSIP_SUBCRSTATE_PENDING, EXOSIP_SUBCRSTATE_ACTIVE, EXOSIP_SUBCRSTATE_TERMINATED} eXosip_ss_t;typedef enum eXosip_ss_reason { DEACTIVATED, PROBATION, REJECTED, TIMEOUT, GIVEUP, NORESSOURCE} eXosip_ss_reason_t;typedef enum eXosip_ss_status { EXOSIP_NOTIFY_UNKNOWN, EXOSIP_NOTIFY_PENDING, /* subscription not yet accepted */ EXOSIP_NOTIFY_ONLINE, EXOSIP_NOTIFY_BUSY, EXOSIP_NOTIFY_BERIGHTBACK, EXOSIP_NOTIFY_AWAY, EXOSIP_NOTIFY_ONTHEPHONE, EXOSIP_NOTIFY_OUTTOLUNCH, EXOSIP_NOTIFY_CLOSED} eXosip_ss_status_t;/** * Accept a subscription and notify state (NOTIFY request). * * @param nid call id of call. * @param code code for answer to subscribe. * @param subscription_status subscription status. * @param online_status online status to send. */int eXosip_notify_accept_subscribe (int nid, int code, int subscription_status, int online_status);/** * Update a subscription and notify state (NOTIFY request). * * @param nid call id of call. * @param subscription_status subscription status. * @param online_status online status to send. */int eXosip_notify(int nid, int subscription_status, int online_status);/** @} *//** * @defgroup eXosip_event eXosip event Management * @ingroup eXosip * @{ */typedef enum eXosip_event_type_t { /* Registration Info */ EXOSIP_REGISTRATION_NEW, /* announce new registration. */ EXOSIP_REGISTRATION_SUCCESS, /* user is successfully registred. */ EXOSIP_REGISTRATION_FAILURE, /* user is not registred. */ EXOSIP_REGISTRATION_REFRESHED, /* registration has been refreshed. */ EXOSIP_REGISTRATION_TERMINATED, /* UA is not registred any more. */ /* for UAC events */ EXOSIP_CALL_NOANSWER, /* announce no answer within the timeout */ EXOSIP_CALL_PROCEEDING, /* announce processing by a remote app */ EXOSIP_CALL_RINGING, /* announce ringback */ EXOSIP_CALL_ANSWERED, /* announce start of call */ EXOSIP_CALL_REDIRECTED, /* announce a redirection */ EXOSIP_CALL_REQUESTFAILURE, /* announce a request failure */ EXOSIP_CALL_SERVERFAILURE, /* announce a server failure */ EXOSIP_CALL_GLOBALFAILURE, /* announce a global failure */ /* for UAS events */ EXOSIP_CALL_NEW, /* announce a new call */ EXOSIP_CALL_ACK, /* ACK received for 200ok to INVITE */ EXOSIP_CALL_CANCELLED, /* announce that call has been cancelled */ EXOSIP_CALL_TIMEOUT, /* announce that call has failed */ EXOSIP_CALL_HOLD, /* audio must be stopped */ EXOSIP_CALL_OFFHOLD, /* audio must be restarted */ EXOSIP_CALL_CLOSED, /* a BYE was received for this call */ /* for both UAS & UAC events */ EXOSIP_CALL_STARTAUDIO, /* audio must be established */ EXOSIP_CALL_RELEASED, /* call context is cleared. */ /* for UAC events */ EXOSIP_OPTIONS_NOANSWER, /* announce no answer within the timeout */ EXOSIP_OPTIONS_PROCEEDING, /* announce processing by a remote app */ EXOSIP_OPTIONS_ANSWERED, /* announce a 200ok */ EXOSIP_OPTIONS_REDIRECTED, /* announce a redirection */ EXOSIP_OPTIONS_REQUESTFAILURE, /* announce a request failure */ EXOSIP_OPTIONS_SERVERFAILURE, /* announce a server failure */ EXOSIP_OPTIONS_GLOBALFAILURE, /* announce a global failure */ EXOSIP_INFO_NOANSWER, /* announce no answer within the timeout */ EXOSIP_INFO_PROCEEDING, /* announce processing by a remote app */ EXOSIP_INFO_ANSWERED, /* announce a 200ok */ EXOSIP_INFO_REDIRECTED, /* announce a redirection */ EXOSIP_INFO_REQUESTFAILURE, /* announce a request failure */ EXOSIP_INFO_SERVERFAILURE, /* announce a server failure */ EXOSIP_INFO_GLOBALFAILURE, /* announce a global failure */ /* for UAS events */ EXOSIP_OPTIONS_NEW, /* announce a new options method */ EXOSIP_INFO_NEW, /* new info request received */ /* Presence and Instant Messaging */ EXOSIP_SUBSCRIPTION_NEW, /* announce new incoming SUBSCRIBE. */ EXOSIP_SUBSCRIPTION_UPDATE, /* announce incoming SUBSCRIBE. */ EXOSIP_SUBSCRIPTION_CLOSED, /* announce end of subscription. */ EXOSIP_SUBSCRIPTION_NOANSWER, /* announce no answer */ EXOSIP_SUBSCRIPTION_PROCEEDING, /* announce a 1xx */ EXOSIP_SUBSCRIPTION_ANSWERED, /* announce a 200ok */ EXOSIP_SUBSCRIPTION_REDIRECTED, /* announce a redirection */ EXOSIP_SUBSCRIPTION_REQUESTFAILURE, /* announce a request failure */ EXOSIP_SUBSCRIPTION_SERVERFAILURE, /* announce a server failure */ EXOSIP_SUBSCRIPTION_GLOBALFAILURE, /* announce a global failure */ EXOSIP_SUBSCRIPTION_NOTIFY, /* announce new NOTIFY request */ EXOSIP_SUBSCRIPTION_RELEASED, /* call context is cleared. */ EXOSIP_IN_SUBSCRIPTION_NEW, /* announce new incoming SUBSCRIBE.*/ EXOSIP_IN_SUBSCRIPTION_RELEASED, /* announce end of subscription. */ EXOSIP_CALLBACK_COUNT} eXosip_event_type_t;typedef struct eXosip_event { eXosip_event_type_t type; void *external_reference; char reason_phrase[50]; int status_code; char textinfo[256]; char req_uri[256]; char local_uri[256]; char remote_uri[256]; char subject[256]; osip_content_type_t *i_ctt; osip_list_t *i_bodies; char remote_sdp_audio_ip[50]; int remote_sdp_audio_port; int local_sdp_audio_port; int payload; char payload_name[50]; char sdp_body[1000]; /* The whole SDP body */ int online_status; int ss_status; int ss_reason; /* For a high level usage of the eXosip stack? (API is enough?) */ int did; int cid; int rid; int sid; int nid; /* For a low level usage of the eXosip stack */ struct eXosip_dialog_t *jd; struct eXosip_call_t *jc; struct eXosip_reg_t *jr; struct eXosip_subscribe_t *js; struct eXosip_notify_t *jn;} eXosip_event_t;/** * Free ressource in an eXosip event. * * @param je event to work on. */void eXosip_event_free(eXosip_event_t *je);/** * Wait for an eXosip event. (FUTURE USE) * * @param tv_s timeout value (seconds). * @param tv_ms timeout value (mseconds). */eXosip_event_t *eXosip_event_wait(int tv_s, int tv_ms);/** * Wait for next eXosip event. * */eXosip_event_t *eXosip_event_get(void);#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -