Changeset 5455 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
- Timestamp:
- Oct 7, 2016 7:42:22 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r5366 r5455 88 88 pj_strdup_with_null(pool, &dst->reg_uri, &src->reg_uri); 89 89 pj_strdup_with_null(pool, &dst->force_contact, &src->force_contact); 90 pj_strdup_with_null(pool, &dst->reg_contact_params, 91 &src->reg_contact_params); 90 92 pj_strdup_with_null(pool, &dst->contact_params, &src->contact_params); 91 93 pj_strdup_with_null(pool, &dst->contact_uri_params, … … 993 995 update_reg = PJ_TRUE; 994 996 unreg_first = PJ_TRUE; 997 } 998 999 /* Register contact params */ 1000 if (pj_strcmp(&acc->cfg.reg_contact_params, &cfg->reg_contact_params)) { 1001 pj_strdup_with_null(acc->pool, &acc->cfg.reg_contact_params, 1002 &cfg->reg_contact_params); 1003 update_reg = PJ_TRUE; 995 1004 } 996 1005 … … 1478 1487 1479 1488 done: 1480 if (!need_outbound) { 1481 /* Outbound is not needed/wanted for the account. acc->reg_contact 1482 * is set to the same as acc->contact. 1483 */ 1484 acc->reg_contact = acc->contact; 1485 acc->rfc5626_status = OUTBOUND_NA; 1486 } else { 1487 /* Need to use outbound, append the contact with +sip.instance and 1488 * reg-id parameters. 1489 */ 1489 { 1490 1490 pj_ssize_t len; 1491 1491 pj_str_t reg_contact; 1492 1492 1493 1493 acc->rfc5626_status = OUTBOUND_WANTED; 1494 len = acc->contact.slen + acc->rfc5626_instprm.slen + 1495 acc->rfc5626_regprm.slen; 1496 reg_contact.ptr = (char*) pj_pool_alloc(acc->pool, len); 1497 1498 pj_strcpy(®_contact, &acc->contact); 1499 pj_strcat(®_contact, &acc->rfc5626_regprm); 1500 pj_strcat(®_contact, &acc->rfc5626_instprm); 1501 1502 acc->reg_contact = reg_contact; 1503 1504 PJ_LOG(4,(THIS_FILE, 1505 "Contact for acc %d updated for SIP outbound: %.*s", 1506 acc->index, 1507 (int)acc->reg_contact.slen, 1508 acc->reg_contact.ptr)); 1494 len = acc->contact.slen + acc->cfg.reg_contact_params.slen + 1495 (need_outbound? 1496 (acc->rfc5626_instprm.slen + acc->rfc5626_regprm.slen): 0); 1497 if (len > acc->contact.slen) { 1498 reg_contact.ptr = (char*) pj_pool_alloc(acc->pool, len); 1499 1500 pj_strcpy(®_contact, &acc->contact); 1501 1502 if (need_outbound) { 1503 acc->rfc5626_status = OUTBOUND_WANTED; 1504 1505 /* Need to use outbound, append the contact with 1506 * +sip.instance and reg-id parameters. 1507 */ 1508 pj_strcat(®_contact, &acc->rfc5626_regprm); 1509 pj_strcat(®_contact, &acc->rfc5626_instprm); 1510 } else { 1511 acc->rfc5626_status = OUTBOUND_NA; 1512 } 1513 1514 pj_strcat(®_contact, &acc->cfg.reg_contact_params); 1515 1516 acc->reg_contact = reg_contact; 1517 1518 PJ_LOG(4,(THIS_FILE, 1519 "Contact for acc %d updated: %.*s", 1520 acc->index, 1521 (int)acc->reg_contact.slen, 1522 acc->reg_contact.ptr)); 1523 1524 } else { 1525 /* Outbound is not needed/wanted for the account and there's 1526 * no custom registration Contact params. acc->reg_contact 1527 * is set to the same as acc->contact. 1528 */ 1529 acc->reg_contact = acc->contact; 1530 acc->rfc5626_status = OUTBOUND_NA; 1531 } 1509 1532 } 1510 1533 }
Note: See TracChangeset
for help on using the changeset viewer.