Changeset 5456


Ignore:
Timestamp:
Oct 7, 2016 8:41:55 AM (3 years ago)
Author:
ming
Message:

Fixed #1967: Add function pjsip_tdata_get_dlg

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

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

    r5241 r5456  
    558558 
    559559/** 
     560 * Get the dialog instance for the outgoing tdata. Returns NULL if the message 
     561 * wasn't sent from a dialog. 
     562 * 
     563 * @param tdata             Outgoing message buffer. 
     564 * 
     565 * @return                  The dialog instance that "owns" the message. 
     566 */ 
     567PJ_DECL(pjsip_dialog*) pjsip_tdata_get_dlg( pjsip_tx_data *tdata ); 
     568 
     569/** 
    560570 * Get the associated dialog for the specified transaction, if any. 
    561571 * 
  • pjproject/trunk/pjsip/src/pjsip/sip_dialog.c

    r5401 r5456  
    11251125        return status; 
    11261126 
     1127    /* Put this dialog in tdata's mod_data */ 
     1128    tdata->mod_data[dlg->ua->id] = dlg; 
     1129 
    11271130    /* Just copy dialog route-set to Route header. 
    11281131     * The transaction will do the processing as specified in Section 12.2.1 
     
    12241227    /* Lock and increment session */ 
    12251228    pjsip_dlg_inc_lock(dlg); 
     1229 
     1230    /* Put this dialog in tdata's mod_data */ 
     1231    tdata->mod_data[dlg->ua->id] = dlg; 
    12261232 
    12271233    /* If via_addr is set, use this address for the Via header. */ 
     
    14061412    /* Lock the dialog. */ 
    14071413    pjsip_dlg_inc_lock(dlg); 
     1414 
     1415    /* Put this dialog in tdata's mod_data */ 
     1416    tdata->mod_data[dlg->ua->id] = dlg; 
    14081417 
    14091418    dlg_beautify_response(dlg, PJ_FALSE, st_code, tdata); 
  • pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c

    r5243 r5456  
    413413} 
    414414 
     415PJ_DEF(pjsip_dialog*) pjsip_tdata_get_dlg( pjsip_tx_data *tdata ) 
     416{ 
     417    return (pjsip_dialog*) tdata->mod_data[mod_ua.mod.id]; 
     418} 
     419 
    415420PJ_DEF(pjsip_dialog*) pjsip_tsx_get_dlg( pjsip_transaction *tsx ) 
    416421{ 
Note: See TracChangeset for help on using the changeset viewer.