Ignore:
Timestamp:
Jun 23, 2007 7:26:54 AM (17 years ago)
Author:
bennylp
Message:

More ticket #341: renamed pjsip_transport_send_raw() to pjsip_tpmgr_send_raw(), and added pjsip_endpt_send_raw() and pjsip_endpt_send_raw_to_uri()

File:
1 edited

Legend:

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

    r1269 r1388  
    2121 
    2222#include <pjsip/sip_msg.h> 
     23#include <pjsip/sip_transport.h> 
    2324#include <pjsip/sip_resolve.h> 
    2425 
     
    220221                                             pjsip_host_info *dest_info ); 
    221222 
    222  
    223223/** 
    224224 * This structure holds the state of outgoing stateless request. 
     
    259259} pjsip_send_state; 
    260260 
    261 typedef void (*pjsip_endpt_callback)(pjsip_send_state*, pj_ssize_t sent, 
    262                                                                          pj_bool_t *cont); 
     261 
     262typedef void (*pjsip_send_callback)(pjsip_send_state*, pj_ssize_t sent, 
     263                                    pj_bool_t *cont); 
     264 
    263265/** 
    264266 * Send outgoing request statelessly The function will take care of which  
     
    282284                                    pjsip_tx_data *tdata, 
    283285                                    void *token, 
    284                                     pjsip_endpt_callback cb); 
     286                                    pjsip_send_callback cb); 
     287 
     288/** 
     289 * This is a low-level function to send raw data to a destination. 
     290 * 
     291 * See also #pjsip_endpt_send_raw_to_uri(). 
     292 * 
     293 * @param endpt     The SIP endpoint instance. 
     294 * @param tp_type   Transport type. 
     295 * @param sel       Optional pointer to transport selector instance if 
     296 *                  application wants to use a specific transport instance 
     297 *                  rather then letting transport manager finds the suitable 
     298 *                  transport.. 
     299 * @param raw_data  The data to be sent. 
     300 * @param data_len  The length of the data. 
     301 * @param addr      Destination address. 
     302 * @param addr_len  Length of destination address. 
     303 * @param token     Arbitrary token to be returned back to callback. 
     304 * @param cb        Optional callback to be called to notify caller about 
     305 *                  the completion status of the pending send operation. 
     306 * 
     307 * @return          If the message has been sent successfully, this function 
     308 *                  will return PJ_SUCCESS and the callback will not be  
     309 *                  called. If message cannot be sent immediately, this 
     310 *                  function will return PJ_EPENDING, and application will 
     311 *                  be notified later about the completion via the callback. 
     312 *                  Any statuses other than PJ_SUCCESS or PJ_EPENDING 
     313 *                  indicates immediate failure, and in this case the  
     314 *                  callback will not be called. 
     315 */ 
     316PJ_DECL(pj_status_t) pjsip_endpt_send_raw(pjsip_endpoint *endpt, 
     317                                          pjsip_transport_type_e tp_type, 
     318                                          const pjsip_tpselector *sel, 
     319                                          const void *raw_data, 
     320                                          pj_size_t data_len, 
     321                                          const pj_sockaddr_t *addr, 
     322                                          int addr_len, 
     323                                          void *token, 
     324                                          pjsip_tp_send_callback cb); 
     325 
     326/** 
     327 * Send raw data to the specified destination URI. The actual destination 
     328 * address will be calculated from the URI, using normal SIP URI to host 
     329 * resolution. 
     330 * 
     331 * See also #pjsip_endpt_send_raw(). 
     332 * 
     333 * @param endpt     The SIP endpoint instance. 
     334 * @param dst_uri   Destination address URI. 
     335 * @param sel       Optional pointer to transport selector instance if 
     336 *                  application wants to use a specific transport instance 
     337 *                  rather then letting transport manager finds the suitable 
     338 *                  transport.. 
     339 * @param raw_data  The data to be sent. 
     340 * @param data_len  The length of the data. 
     341 * @param token     Arbitrary token to be returned back to callback. 
     342 * @param cb        Optional callback to be called to notify caller about 
     343 *                  the completion status of the pending send operation. 
     344 * 
     345 * @return          If the message has been sent successfully, this function 
     346 *                  will return PJ_SUCCESS and the callback will not be  
     347 *                  called. If message cannot be sent immediately, this 
     348 *                  function will return PJ_EPENDING, and application will 
     349 *                  be notified later about the completion via the callback. 
     350 *                  Any statuses other than PJ_SUCCESS or PJ_EPENDING 
     351 *                  indicates immediate failure, and in this case the  
     352 *                  callback will not be called. 
     353 */ 
     354PJ_DECL(pj_status_t) pjsip_endpt_send_raw_to_uri(pjsip_endpoint *endpt, 
     355                                                 const pj_str_t *dst_uri, 
     356                                                 const pjsip_tpselector *sel, 
     357                                                 const void *raw_data, 
     358                                                 pj_size_t data_len, 
     359                                                 void *token, 
     360                                                 pjsip_tp_send_callback cb); 
    285361 
    286362/** 
     
    358434                                                pjsip_tx_data *tdata, 
    359435                                                void *token, 
    360                                                 pjsip_endpt_callback cb); 
     436                                                pjsip_send_callback cb); 
    361437 
    362438/** 
     
    381457                                                pjsip_tx_data *tdata, 
    382458                                                void *token, 
    383                                                 pjsip_endpt_callback cb); 
     459                                                pjsip_send_callback cb); 
    384460 
    385461/** 
Note: See TracChangeset for help on using the changeset viewer.