diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-02-08 22:44:25 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-02-08 22:44:25 +0000 |
commit | e88c16ac16d93a586406bc5503d3110f264c5263 (patch) | |
tree | d56410f7f00fc914ed26c1c0442d72040210f146 /pjsip/include | |
parent | 66f9158fa3c12ebd3b2d317cf42e461e0b86a6aa (diff) |
Finished invite session UAS implementation
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@160 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r-- | pjsip/include/pjsip/sip_dialog.h | 11 | ||||
-rw-r--r-- | pjsip/include/pjsip/sip_event.h | 8 | ||||
-rw-r--r-- | pjsip/include/pjsip/sip_transaction.h | 22 | ||||
-rw-r--r-- | pjsip/include/pjsip/sip_types.h | 4 |
4 files changed, 37 insertions, 8 deletions
diff --git a/pjsip/include/pjsip/sip_dialog.h b/pjsip/include/pjsip/sip_dialog.h index e63ba6d1..ede79b26 100644 --- a/pjsip/include/pjsip/sip_dialog.h +++ b/pjsip/include/pjsip/sip_dialog.h @@ -49,6 +49,15 @@ typedef struct pjsip_dlg_party /** + * Dialog state. + */ +enum pjsip_dialog_state +{ + PJSIP_DIALOG_STATE_NULL, + PJSIP_DIALOG_STATE_ESTABLISHED, +}; + +/** * This structure describes the dialog structure. */ struct pjsip_dialog @@ -67,7 +76,7 @@ struct pjsip_dialog void *dlg_set; /* Dialog's session properties. */ - pj_bool_t established;/**< Dialog is established? */ + enum pjsip_dialog_state state; /**< Dialog state. */ pjsip_uri *target; /**< Current target. */ pjsip_dlg_party local; /**< Local party info. */ pjsip_dlg_party remote; /**< Remote party info. */ diff --git a/pjsip/include/pjsip/sip_event.h b/pjsip/include/pjsip/sip_event.h index 268a60e7..caac953f 100644 --- a/pjsip/include/pjsip/sip_event.h +++ b/pjsip/include/pjsip/sip_event.h @@ -124,7 +124,6 @@ struct pjsip_event struct { pjsip_tx_data *tdata; /**< The transmit data buffer. */ - pjsip_transaction *tsx; /**< The transaction. */ } tx_msg; @@ -139,7 +138,6 @@ struct pjsip_event struct { pjsip_rx_data *rdata; /**< The receive data buffer. */ - pjsip_transaction *tsx; /**< The transaction. */ } rx_msg; /** User event. */ @@ -178,20 +176,18 @@ struct pjsip_event /** * Init tx msg event. */ -#define PJSIP_EVENT_INIT_TX_MSG(event,ptsx,ptdata) \ +#define PJSIP_EVENT_INIT_TX_MSG(event,ptdata) \ do { \ (event).type = PJSIP_EVENT_TX_MSG; \ - (event).body.tx_msg.tsx = ptsx; \ (event).body.tx_msg.tdata = ptdata; \ } while (0) /** * Init rx msg event. */ -#define PJSIP_EVENT_INIT_RX_MSG(event,ptsx,prdata) \ +#define PJSIP_EVENT_INIT_RX_MSG(event,prdata) \ do { \ (event).type = PJSIP_EVENT_RX_MSG; \ - (event).body.rx_msg.tsx = ptsx; \ (event).body.rx_msg.rdata = prdata; \ } while (0) diff --git a/pjsip/include/pjsip/sip_transaction.h b/pjsip/include/pjsip/sip_transaction.h index 712fa8ad..eece1be0 100644 --- a/pjsip/include/pjsip/sip_transaction.h +++ b/pjsip/include/pjsip/sip_transaction.h @@ -175,7 +175,9 @@ PJ_DECL(pj_status_t) pjsip_tsx_create_uac( pjsip_module *tsx_user, /** * Create, initialize, and register a new transaction as UAS from the - * specified incoming request in \c rdata. + * specified incoming request in \c rdata. After calling this function, + * application MUST call #pjsip_tsx_recv_msg() so that transaction + * moves from state NULL. * * @param tsx_user Module to be registered as transaction user of the new * transaction, which will receive notification from the @@ -189,6 +191,24 @@ PJ_DECL(pj_status_t) pjsip_tsx_create_uas( pjsip_module *tsx_user, pjsip_rx_data *rdata, pjsip_transaction **p_tsx ); + +/** + * Call this function to manually feed a message to the transaction. + * For UAS transaction, application MUST call this function after + * UAS transaction has been created. + * + * This function SHOULD only be called to pass initial request message + * to UAS transaction. Before this function returns, on_tsx_state() + * callback of the transaction user will be called. If response message + * is passed to this function, then on_rx_response() will also be called + * before on_tsx_state(). + * + * @param tsx The transaction. + * @param rdata The message. + */ +PJ_DECL(void) pjsip_tsx_recv_msg( pjsip_transaction *tsx, + pjsip_rx_data *rdata); + /** * Transmit message in tdata with this transaction. It is possible to * pass NULL in tdata for UAC transaction, which in this case the last diff --git a/pjsip/include/pjsip/sip_types.h b/pjsip/include/pjsip/sip_types.h index fc79f95a..a77f2550 100644 --- a/pjsip/include/pjsip/sip_types.h +++ b/pjsip/include/pjsip/sip_types.h @@ -133,6 +133,10 @@ typedef pjsip_module pjsip_user_agent; */ typedef struct pjsip_dialog pjsip_dialog; +/** + * Dialog state (sip_dialog.h). + */ +enum pjsip_dialog_state pjsip_dialog_state; /** * Transaction role. |