Changeset 3367


Ignore:
Timestamp:
Nov 16, 2010 6:01:38 AM (13 years ago)
Author:
bennylp
Message:

re #1020 (SIP outbound): remove sip.instance and reg-id parameters from the Contact when re-registering if the server does not support SIP outbound

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r3366 r3367  
    2626enum 
    2727{ 
    28     OUTBOUND_NONE, 
    29     OUTBOUND_WANTED, 
    30     OUTBOUND_ACTIVE 
     28    OUTBOUND_UNKNOWN,   // status unknown 
     29    OUTBOUND_WANTED,    // initiated in registration 
     30    OUTBOUND_ACTIVE,    // got positive response from server 
     31    OUTBOUND_NA         // not wanted or got negative response from server 
    3132}; 
    3233 
     
    10331034        goto done; 
    10341035 
     1036    /* Check if outbound has been requested and rejected */ 
     1037    if (acc->rfc5626_status == OUTBOUND_NA) 
     1038        goto done; 
     1039 
    10351040    if (pj_stristr(&acc->contact, &tcp_param)==NULL && 
    10361041        pj_stristr(&acc->contact, &tls_param)==NULL) 
     
    10511056         */ 
    10521057        acc->reg_contact = acc->contact; 
    1053         acc->rfc5626_status = OUTBOUND_NONE; 
     1058        acc->rfc5626_status = OUTBOUND_NA; 
    10541059    } else { 
    10551060        /* Need to use outbound, append the contact with +sip.instance and 
     
    15591564    unsigned i; 
    15601565 
    1561     if (acc->rfc5626_status == OUTBOUND_NONE) { 
     1566    if (acc->rfc5626_status == OUTBOUND_UNKNOWN) { 
    15621567        goto on_return; 
    15631568    } 
     
    15651570    hreq = rdata->msg_info.require; 
    15661571    if (!hreq) { 
    1567         acc->rfc5626_status = OUTBOUND_NONE; 
     1572        acc->rfc5626_status = OUTBOUND_NA; 
    15681573        goto on_return; 
    15691574    } 
     
    15771582 
    15781583    /* Server does not support outbound */ 
    1579     acc->rfc5626_status = OUTBOUND_NONE; 
     1584    acc->rfc5626_status = OUTBOUND_NA; 
    15801585 
    15811586on_return: 
     1587    if (acc->rfc5626_status != OUTBOUND_ACTIVE) { 
     1588        acc->reg_contact = acc->contact; 
     1589    } 
    15821590    PJ_LOG(4,(THIS_FILE, "SIP outbound status for acc %d is %s", 
    15831591                         acc->index, (acc->rfc5626_status==OUTBOUND_ACTIVE? 
Note: See TracChangeset for help on using the changeset viewer.