Ignore:
Timestamp:
Apr 15, 2008 10:35:32 AM (16 years ago)
Author:
bennylp
Message:

Use the smart Contact header for TCP/TLS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/ice-turn07/pjsip/src/pjsua-lib/pjsua_pres.c

    r1569 r1930  
    553553     
    554554    /* Create suitable Contact header */ 
    555     status = pjsua_acc_create_uas_contact(rdata->tp_info.pool, &contact, 
    556                                           acc_id, rdata); 
    557     if (status != PJ_SUCCESS) { 
    558         pjsua_perror(THIS_FILE, "Unable to generate Contact header", status); 
    559         PJSUA_UNLOCK(); 
    560         return PJ_TRUE; 
     555    if (acc->contact.slen) { 
     556        contact = acc->contact; 
     557    } else { 
     558        status = pjsua_acc_create_uas_contact(rdata->tp_info.pool, &contact, 
     559                                              acc_id, rdata); 
     560        if (status != PJ_SUCCESS) { 
     561            pjsua_perror(THIS_FILE, "Unable to generate Contact header",  
     562                         status); 
     563            PJSUA_UNLOCK(); 
     564            return PJ_TRUE; 
     565        } 
    561566    } 
    562567 
     
    11241129                         acc_id, index)); 
    11251130 
    1126     /* Generate suitable Contact header */ 
    1127     status = pjsua_acc_create_uac_contact(pjsua_var.pool, &contact, 
    1128                                           acc_id, &buddy->uri); 
    1129     if (status != PJ_SUCCESS) { 
    1130         pjsua_perror(THIS_FILE, "Unable to generate Contact header", status); 
    1131         return; 
     1131    /* Generate suitable Contact header unless one is already set in 
     1132     * the account 
     1133     */ 
     1134    if (acc->contact.slen) { 
     1135        contact = acc->contact; 
     1136    } else { 
     1137        status = pjsua_acc_create_uac_contact(pjsua_var.pool, &contact, 
     1138                                              acc_id, &buddy->uri); 
     1139        if (status != PJ_SUCCESS) { 
     1140            pjsua_perror(THIS_FILE, "Unable to generate Contact header",  
     1141                         status); 
     1142            return; 
     1143        } 
    11321144    } 
    11331145 
Note: See TracChangeset for help on using the changeset viewer.