Ignore:
Timestamp:
Oct 12, 2009 7:44:14 AM (15 years ago)
Author:
bennylp
Message:

Ticket #411: Cannot update account presence's status while previous PUBLISH is in progress (thanks Olivier Beytrison for the report)

  • enable request queueing. If PUBLISH is to be sent while another one is still in progress, queue the request and send it later when the ongoing request completes
  • this behavior is controlled by new pjsip_publishc_opt structure to control session's options
  • default behavior is to queue the request
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip-simple/publish.h

    r2661 r2940  
    6565typedef struct pjsip_publishc pjsip_publishc; 
    6666 
     67 
     68/** 
     69 * Client publication options. Application should initialize this structure 
     70 * with its default values by calling #pjsip_publishc_opt_default() 
     71 */ 
     72typedef struct pjsip_publishc_opt 
     73{ 
     74    /** 
     75     * Specify whether the client publication session should queue the 
     76     * PUBLISH request should there be another PUBLISH transaction still 
     77     * pending. If this is set to false, the client will return error 
     78     * on the PUBLISH request if there is another PUBLISH transaction still 
     79     * in progress. 
     80     * 
     81     * Default: PJSIP_PUBLISHC_QUEUE_REQUEST 
     82     */ 
     83    pj_bool_t   queue_request; 
     84 
     85} pjsip_publishc_opt; 
    6786 
    6887 
     
    90109 
    91110/** 
     111 * Initialize client publication session option with default values. 
     112 * 
     113 * @param opt       The option. 
     114 */ 
     115PJ_DECL(void) pjsip_publishc_opt_default(pjsip_publishc_opt *opt); 
     116 
     117 
     118/** 
    92119 * Initialize client publication module. 
    93120 * 
     
    99126 
    100127 
    101  
    102128/** 
    103129 * Create client publication structure. 
    104130 * 
    105131 * @param endpt     Endpoint, used to allocate pool from. 
    106  * @param options   Option flags. 
     132 * @param opt       Options, or NULL to specify default options. 
    107133 * @param token     Opaque data to be associated with the client publication. 
    108134 * @param cb        Pointer to callback function to receive publication status. 
     
    112138 */ 
    113139PJ_DECL(pj_status_t) pjsip_publishc_create( pjsip_endpoint *endpt,  
    114                                             unsigned options, 
     140                                            const pjsip_publishc_opt *opt, 
    115141                                            void *token, 
    116142                                            pjsip_publishc_cb *cb,  
     
    270296 * completes. 
    271297 * 
     298 * If the session has another PUBLISH request outstanding, the behavior 
     299 * depends on whether request queueing is enabled in the session (this was 
     300 * set by setting \a queue_request field of #pjsip_publishc_opt to true 
     301 * when calling #pjsip_publishc_create(). Default is true). If request 
     302 * queueing is enabled, the request will be queued and the function will  
     303 * return PJ_EPENDING. One the outstanding request is complete, the queued 
     304 * request will be sent automatically. If request queueing is disabled, the 
     305 * function will reject the request and return PJ_EBUSY. 
     306 * 
    272307 * @param pubc      The client publication structure. 
    273308 * @param tdata     Transmit data. 
    274309 * 
    275  * @return          PJ_SUCCESS on success. 
     310 * @return          - PJ_SUCCESS on success, or  
     311 *                  - PJ_EPENDING if request is queued, or 
     312 *                  - PJ_EBUSY if request is rejected because another PUBLISH 
     313 *                    request is in progress, or 
     314 *                  - other status code to indicate the error. 
    276315 */ 
    277316PJ_DECL(pj_status_t) pjsip_publishc_send(pjsip_publishc *pubc,  
Note: See TracChangeset for help on using the changeset viewer.