Ignore:
Timestamp:
Jun 23, 2007 4:22:51 AM (17 years ago)
Author:
bennylp
Message:

Ticket #341: implemented pjsip_send_raw_data() function to send raw data to a destination

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_transport.h

    r1310 r1387  
    905905typedef pj_status_t (*pjsip_tx_callback)(pjsip_endpoint*, pjsip_tx_data*); 
    906906/** 
    907  * Create a new transport manager. 
     907 * Create a transport manager. Normally application doesn't need to call 
     908 * this function directly, since a transport manager will be created and 
     909 * destroyed automatically by the SIP endpoint. 
    908910 * 
    909911 * @param pool      Pool. 
     
    960962 
    961963/** 
    962  * Destroy transport manager. 
     964 * Destroy a transport manager. Normally application doesn't need to call 
     965 * this function directly, since a transport manager will be created and 
     966 * destroyed automatically by the SIP endpoint. 
     967 * 
     968 * @param mgr       The transport manager. 
     969 * 
     970 * @return          PJ_SUCCESS on success. 
    963971 */ 
    964972PJ_DECL(pj_status_t) pjsip_tpmgr_destroy(pjsip_tpmgr *mgr); 
     
    966974 
    967975/** 
    968  * Dump transport info. 
     976 * Dump transport info and status to log. 
     977 * 
     978 * @param mgr       The transport manager. 
    969979 */ 
    970980PJ_DECL(void) pjsip_tpmgr_dump_transports(pjsip_tpmgr *mgr); 
     
    10031013                                                   pjsip_transport **tp); 
    10041014 
     1015/** 
     1016 * Type of callback to receive notification when message or raw data 
     1017 * has been sent. 
     1018 * 
     1019 * @param token         The token that was given when calling the function 
     1020 *                      to send message or raw data. 
     1021 * @param tdata         The transmit buffer used to send the message. 
     1022 * @param bytes_sent    Number of bytes sent. On success, the value will be 
     1023 *                      positive number indicating the number of bytes sent. 
     1024 *                      On failure, the value will be a negative number of 
     1025 *                      the error code (i.e. bytes_sent = -status). 
     1026 */ 
    10051027typedef void (*pjsip_tp_send_callback)(void *token, pjsip_tx_data *tdata, 
    1006                                                                            pj_ssize_t bytes_sent); 
    1007 /** 
    1008  * Send a SIP message using the specified transport. 
     1028                                       pj_ssize_t bytes_sent); 
     1029 
     1030 
     1031/** 
     1032 * This is a low-level function to send a SIP message using the specified 
     1033 * transport to the specified destination. 
     1034 *  
     1035 * @param tr        The SIP transport to be used. 
     1036 * @param tdata     Transmit data buffer containing SIP message. 
     1037 * @param addr      Destination address. 
     1038 * @param addr_len  Length of destination address. 
     1039 * @param token     Arbitrary token to be returned back to callback. 
     1040 * @param cb        Optional callback to be called to notify caller about 
     1041 *                  the completion status of the pending send operation. 
     1042 * 
     1043 * @return          If the message has been sent successfully, this function 
     1044 *                  will return PJ_SUCCESS and the callback will not be  
     1045 *                  called. If message cannot be sent immediately, this 
     1046 *                  function will return PJ_EPENDING, and application will 
     1047 *                  be notified later about the completion via the callback. 
     1048 *                  Any statuses other than PJ_SUCCESS or PJ_EPENDING 
     1049 *                  indicates immediate failure, and in this case the  
     1050 *                  callback will not be called. 
    10091051 */ 
    10101052PJ_DECL(pj_status_t) pjsip_transport_send( pjsip_transport *tr,  
     
    10171059 
    10181060/** 
     1061 * This is a low-level function to send raw data using the specified transport 
     1062 * to the specified destination. 
     1063 * 
     1064 * @param tr        The SIP transport to be used. 
     1065 * @param raw_data  The data to be sent. 
     1066 * @param data_len  The length of the data. 
     1067 * @param addr      Destination address. 
     1068 * @param addr_len  Length of destination address. 
     1069 * @param token     Arbitrary token to be returned back to callback. 
     1070 * @param cb        Optional callback to be called to notify caller about 
     1071 *                  the completion status of the pending send operation. 
     1072 * 
     1073 * @return          If the message has been sent successfully, this function 
     1074 *                  will return PJ_SUCCESS and the callback will not be  
     1075 *                  called. If message cannot be sent immediately, this 
     1076 *                  function will return PJ_EPENDING, and application will 
     1077 *                  be notified later about the completion via the callback. 
     1078 *                  Any statuses other than PJ_SUCCESS or PJ_EPENDING 
     1079 *                  indicates immediate failure, and in this case the  
     1080 *                  callback will not be called. 
     1081 */ 
     1082PJ_DECL(pj_status_t) pjsip_transport_send_raw(pjsip_transport *tr, 
     1083                                              const void *raw_data, 
     1084                                              pj_size_t data_len, 
     1085                                              const pj_sockaddr_t *addr, 
     1086                                              int addr_len, 
     1087                                              void *token, 
     1088                                              pjsip_tp_send_callback cb); 
     1089 
     1090 
     1091/** 
    10191092 * @} 
    10201093 */ 
Note: See TracChangeset for help on using the changeset viewer.