Changeset 597 for pjproject/trunk
- Timestamp:
- Jul 10, 2006 2:40:21 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/config.c
r563 r597 22 22 23 23 static const char *id = "config.c"; 24 const char *PJ_VERSION = "0.5.6. 1";24 const char *PJ_VERSION = "0.5.6.5"; 25 25 26 26 PJ_DEF(void) pj_dump_config(void) -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r582 r597 468 468 return PJ_EINVAL; 469 469 } 470 cur_acc-> contact = pj_str(pj_optarg);470 cur_acc->force_contact = pj_str(pj_optarg); 471 471 break; 472 472 … … 715 715 716 716 /* Contact */ 717 if (acc_cfg-> contact.slen) {717 if (acc_cfg->force_contact.slen) { 718 718 pj_ansi_sprintf(line, "--contact %.*s\n", 719 (int)acc_cfg-> contact.slen,720 acc_cfg-> contact.ptr);719 (int)acc_cfg->force_contact.slen, 720 acc_cfg->force_contact.ptr); 721 721 pj_strcat2(result, line); 722 722 } -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r582 r597 1023 1023 * automatically based on the transport address. 1024 1024 */ 1025 pj_str_t contact;1025 pj_str_t force_contact; 1026 1026 1027 1027 /** -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r563 r597 81 81 int index; /**< Index in accounts array. */ 82 82 pj_str_t user_part; /**< User part of local URI. */ 83 pj_str_t host_part; /**< Host part of local URI. */84 83 pj_str_t real_contact; /**< Real contact address. */ 84 85 pj_str_t srv_domain; /**< Host part of reg server. */ 86 int srv_port; /**< Port number of reg server. */ 85 87 86 88 pjsip_regc *regc; /**< Client registration session. */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r582 r597 56 56 pj_strdup_with_null(pool, &dst->id, &src->id); 57 57 pj_strdup_with_null(pool, &dst->reg_uri, &src->reg_uri); 58 pj_strdup_with_null(pool, &dst-> contact, &src->contact);58 pj_strdup_with_null(pool, &dst->force_contact, &src->force_contact); 59 59 60 60 dst->proxy_cnt = src->proxy_cnt; … … 104 104 pjsua_acc *acc = &pjsua_var.acc[acc_id]; 105 105 pjsip_uri *uri; 106 pjsip_sip_uri *sip_uri ;106 pjsip_sip_uri *sip_uri, *sip_reg_uri; 107 107 unsigned i; 108 108 … … 129 129 130 130 /* Get the SIP URI object: */ 131 132 131 sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(uri); 132 133 134 /* Parse registrar URI, if any */ 135 if (acc_cfg->reg_uri.slen) { 136 pjsip_uri *reg_uri; 137 138 reg_uri = pjsip_parse_uri(pjsua_var.pool, acc_cfg->reg_uri.ptr, 139 acc_cfg->reg_uri.slen, 0); 140 if (reg_uri == NULL) { 141 pjsua_perror(THIS_FILE, "Invalid registrar URI", 142 PJSIP_EINVALIDURI); 143 return PJSIP_EINVALIDURI; 144 } 145 146 /* Registrar URI MUST be a SIP or SIPS: */ 147 if (!PJSIP_URI_SCHEME_IS_SIP(reg_uri) && 148 !PJSIP_URI_SCHEME_IS_SIPS(reg_uri)) 149 { 150 pjsua_perror(THIS_FILE, "Invalid registar URI", 151 PJSIP_EINVALIDSCHEME); 152 return PJSIP_EINVALIDSCHEME; 153 } 154 155 sip_reg_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(reg_uri); 156 157 } else { 158 sip_reg_uri = NULL; 159 } 160 133 161 134 162 /* Save the user and domain part. These will be used when finding an … … 136 164 */ 137 165 acc->user_part = sip_uri->user; 138 acc->host_part = sip_uri->host; 139 166 acc->srv_domain = sip_uri->host; 167 acc->srv_port = 0; 168 169 if (sip_reg_uri) { 170 acc->srv_port = sip_reg_uri->port; 171 } 140 172 141 173 /* Create Contact header if not present. */ 142 if (acc_cfg->contact.slen == 0) {143 acc_cfg->contact = acc_cfg->id;144 }174 //if (acc_cfg->contact.slen == 0) { 175 // acc_cfg->contact = acc_cfg->id; 176 //} 145 177 146 178 PJ_TODO(attach_account_to_transport); … … 704 736 sip_uri = pjsip_uri_get_uri(uri); 705 737 706 /* Find matching domain */738 /* Find matching domain AND port */ 707 739 for (acc_id=0; acc_id<PJ_ARRAY_SIZE(pjsua_var.acc); ++acc_id) { 708 740 if (!pjsua_var.acc[acc_id].valid) 709 741 continue; 710 if (pj_stricmp(&pjsua_var.acc[acc_id].host_part, &sip_uri->host)==0) 742 if (pj_stricmp(&pjsua_var.acc[acc_id].srv_domain, &sip_uri->host)==0 && 743 pjsua_var.acc[acc_id].srv_port == sip_uri->port) 711 744 break; 745 } 746 747 /* If no match, try to match the domain part only */ 748 if (acc_id == PJ_ARRAY_SIZE(pjsua_var.acc)) { 749 /* Just use default account */ 750 for (acc_id=0; acc_id<PJ_ARRAY_SIZE(pjsua_var.acc); ++acc_id) { 751 if (!pjsua_var.acc[acc_id].valid) 752 continue; 753 if (pj_stricmp(&pjsua_var.acc[acc_id].srv_domain, &sip_uri->host)==0) 754 break; 755 } 712 756 } 713 757 … … 754 798 755 799 if (pj_stricmp(&acc->user_part, &sip_uri->user)==0 && 756 pj_stricmp(&acc-> host_part, &sip_uri->host)==0)800 pj_stricmp(&acc->srv_domain, &sip_uri->host)==0) 757 801 { 758 802 /* Match ! */ … … 767 811 pjsua_acc *acc = &pjsua_var.acc[acc_id]; 768 812 769 if (pj_stricmp(&acc-> host_part, &sip_uri->host)==0) {813 if (pj_stricmp(&acc->srv_domain, &sip_uri->host)==0) { 770 814 /* Match ! */ 771 815 PJSUA_UNLOCK(); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r582 r597 235 235 /* Create outgoing dialog: */ 236 236 status = pjsip_dlg_create_uac( pjsip_ua_instance(), 237 &acc->cfg.id, &acc-> cfg.contact,237 &acc->cfg.id, &acc->real_contact, 238 238 dest_uri, dest_uri, &dlg); 239 239 if (status != PJ_SUCCESS) { … … 442 442 /* Create dialog: */ 443 443 status = pjsip_dlg_create_uas( pjsip_ua_instance(), rdata, 444 &pjsua_var.acc[acc_id]. cfg.contact,444 &pjsua_var.acc[acc_id].real_contact, 445 445 &dlg); 446 446 if (status != PJ_SUCCESS) { -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r582 r597 69 69 static pj_bool_t logging_on_rx_msg(pjsip_rx_data *rdata) 70 70 { 71 PJ_LOG(4,(THIS_FILE, "RX %d bytes %s from %s :%d:\n"72 "% s\n"71 PJ_LOG(4,(THIS_FILE, "RX %d bytes %s from %s %s:%d:\n" 72 "%.*s\n" 73 73 "--end msg--", 74 74 rdata->msg_info.len, 75 75 pjsip_rx_data_get_info(rdata), 76 rdata->tp_info.transport->type_name, 76 77 rdata->pkt_info.src_name, 77 78 rdata->pkt_info.src_port, 79 (int)rdata->msg_info.len, 78 80 rdata->msg_info.msg_buf)); 79 81 … … 92 94 */ 93 95 94 PJ_LOG(4,(THIS_FILE, "TX %d bytes %s to %s :%d:\n"95 "% s\n"96 PJ_LOG(4,(THIS_FILE, "TX %d bytes %s to %s %s:%d:\n" 97 "%.*s\n" 96 98 "--end msg--", 97 99 (tdata->buf.cur - tdata->buf.start), 98 100 pjsip_tx_data_get_info(tdata), 101 tdata->tp_info.transport->type_name, 99 102 tdata->tp_info.dst_name, 100 103 tdata->tp_info.dst_port, 104 (int)(tdata->buf.cur - tdata->buf.start), 101 105 tdata->buf.start)); 102 106 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c
r503 r597 441 441 pjsip_generic_string_hdr_create(tdata->pool, 442 442 &STR_CONTACT, 443 &pjsua_var.acc[acc_id]. cfg.contact));443 &pjsua_var.acc[acc_id].real_contact)); 444 444 445 445 /* Create IM data to keep message details and give it back to … … 522 522 pjsip_generic_string_hdr_create(tdata->pool, 523 523 &STR_CONTACT, 524 &pjsua_var.acc[acc_id]. cfg.contact));524 &pjsua_var.acc[acc_id].real_contact)); 525 525 526 526 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r582 r597 466 466 /* Create UAS dialog: */ 467 467 status = pjsip_dlg_create_uas(pjsip_ua_instance(), rdata, 468 &acc-> cfg.contact,468 &acc->real_contact, 469 469 &dlg); 470 470 if (status != PJ_SUCCESS) { … … 771 771 acc = &pjsua_var.acc[acc_id]; 772 772 773 PJ_LOG(4,(THIS_FILE, "Using account %d for buddy %d subscription", 774 acc_id, index)); 775 773 776 /* Create UAC dialog */ 774 777 status = pjsip_dlg_create_uac( pjsip_ua_instance(), 775 778 &acc->cfg.id, 776 &acc-> cfg.contact,779 &acc->real_contact, 777 780 &buddy->uri, 778 781 NULL, &dlg);
Note: See TracChangeset
for help on using the changeset viewer.