Changeset 683 for pjproject/trunk
- Timestamp:
- Aug 15, 2006 1:11:22 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r661 r683 65 65 66 66 67 static pjsua_acc_id current_acc; 67 //static pjsua_acc_id current_acc; 68 #define current_acc pjsua_acc_get_default() 68 69 static pjsua_call_id current_call; 69 70 static pj_str_t uri_arg; … … 1920 1921 i = my_atoi(buf); 1921 1922 if (pjsua_acc_is_valid(i)) { 1922 current_acc = i;1923 pjsua_acc_set_default(i); 1923 1924 PJ_LOG(3,(THIS_FILE, "Current account changed to %d", i)); 1924 1925 } else { … … 2378 2379 2379 2380 /* Add local account */ 2380 pjsua_acc_add_local(transport_id, PJ_TRUE, ¤t_acc);2381 pjsua_acc_add_local(transport_id, PJ_TRUE, NULL); 2381 2382 pjsua_acc_set_online_status(current_acc, PJ_TRUE); 2382 2383 … … 2393 2394 2394 2395 /* Add local account */ 2395 pjsua_acc_add_local(transport_id, PJ_TRUE, ¤t_acc);2396 pjsua_acc_add_local(transport_id, PJ_TRUE, NULL); 2396 2397 pjsua_acc_set_online_status(current_acc, PJ_TRUE); 2397 2398 } … … 2406 2407 /* Add accounts */ 2407 2408 for (i=0; i<app_config.acc_cnt; ++i) { 2408 status = pjsua_acc_add(&app_config.acc_cfg[i], PJ_TRUE, ¤t_acc);2409 status = pjsua_acc_add(&app_config.acc_cfg[i], PJ_TRUE, NULL); 2409 2410 if (status != PJ_SUCCESS) 2410 2411 goto on_error; -
pjproject/trunk/pjsip/build/pjsip_simple.dsp
r458 r683 110 110 # Begin Source File 111 111 112 SOURCE="..\src\pjsip-simple\publishc.c" 113 114 !IF "$(CFG)" == "pjsip_simple - Win32 Release" 115 116 !ELSEIF "$(CFG)" == "pjsip_simple - Win32 Debug" 117 118 # PROP Exclude_From_Build 1 119 120 !ENDIF 121 122 # End Source File 123 # Begin Source File 124 112 125 SOURCE="..\src\pjsip-simple\xpidf.c" 113 126 # End Source File … … 146 159 # Begin Source File 147 160 161 SOURCE="..\include\pjsip-simple\publish.h" 162 # End Source File 163 # Begin Source File 164 148 165 SOURCE="..\include\pjsip-simple\types.h" 149 166 # End Source File -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r659 r683 1161 1161 */ 1162 1162 PJ_DECL(pj_bool_t) pjsua_acc_is_valid(pjsua_acc_id acc_id); 1163 1164 1165 /** 1166 * Set default account to be used when incoming and outgoing 1167 * requests doesn't match any accounts. 1168 * 1169 * @param acc_id The account ID to be used as default. 1170 * 1171 * @return PJ_SUCCESS on success. 1172 */ 1173 PJ_DECL(pj_status_t) pjsua_acc_set_default(pjsua_acc_id acc_id); 1174 1175 1176 /** 1177 * Get default account. 1178 * 1179 * @return The default account ID, or PJSUA_INVALID_ID if no 1180 * default account is configured. 1181 */ 1182 PJ_DECL(pjsua_acc_id) pjsua_acc_get_default(void); 1163 1183 1164 1184 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r635 r683 44 44 45 45 /* 46 * Set default account 47 */ 48 PJ_DEF(pj_status_t) pjsua_acc_set_default(pjsua_acc_id acc_id) 49 { 50 pjsua_var.default_acc = acc_id; 51 return PJ_SUCCESS; 52 } 53 54 55 /* 56 * Get default account. 57 */ 58 PJ_DEF(pjsua_acc_id) pjsua_acc_get_default(void) 59 { 60 return pjsua_var.default_acc; 61 } 62 63 64 /* 46 65 * Copy account configuration. 47 66 */ … … 725 744 sip_uri = pjsip_uri_get_uri(uri); 726 745 746 /* See if default acc match */ 747 if (pjsua_var.default_acc != PJSUA_INVALID_ID && 748 pj_stricmp(&pjsua_var.acc[pjsua_var.default_acc].srv_domain, &sip_uri->host)==0 && 749 pjsua_var.acc[pjsua_var.default_acc].srv_port == sip_uri->port) 750 { 751 acc_id = pjsua_var.default_acc; 752 } else { 753 acc_id = PJ_ARRAY_SIZE(pjsua_var.acc); 754 } 755 727 756 /* Find matching domain AND port */ 728 for (acc_id=0; acc_id<PJ_ARRAY_SIZE(pjsua_var.acc); ++acc_id) { 729 if (!pjsua_var.acc[acc_id].valid) 730 continue; 731 if (pj_stricmp(&pjsua_var.acc[acc_id].srv_domain, &sip_uri->host)==0 && 732 pjsua_var.acc[acc_id].srv_port == sip_uri->port) 733 break; 757 if (acc_id == PJ_ARRAY_SIZE(pjsua_var.acc)) { 758 for (acc_id=0; acc_id<PJ_ARRAY_SIZE(pjsua_var.acc); ++acc_id) { 759 if (!pjsua_var.acc[acc_id].valid) 760 continue; 761 if (pj_stricmp(&pjsua_var.acc[acc_id].srv_domain, &sip_uri->host)==0 && 762 pjsua_var.acc[acc_id].srv_port == sip_uri->port) 763 break; 764 } 734 765 } 735 766 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r611 r683 544 544 status = pjsip_pres_notify( sub, PJSIP_EVSUB_STATE_ACTIVE, NULL, 545 545 NULL, &tdata); 546 if (status == PJ_SUCCESS) 546 if (status == PJ_SUCCESS) { 547 pjsua_process_msg_data(tdata, NULL); 547 548 status = pjsip_pres_send_request( sub, tdata); 549 } 548 550 549 551 if (status != PJ_SUCCESS) { … … 612 614 pjsip_pres_set_status(uapres->sub, &pres_status); 613 615 614 if (pjsip_pres_current_notify(uapres->sub, &tdata)==PJ_SUCCESS) 616 if (pjsip_pres_current_notify(uapres->sub, &tdata)==PJ_SUCCESS) { 617 pjsua_process_msg_data(tdata, NULL); 615 618 pjsip_pres_send_request(uapres->sub, tdata); 619 } 616 620 } 617 621 … … 836 840 } 837 841 842 pjsua_process_msg_data(tdata, NULL); 843 838 844 status = pjsip_pres_send_request(buddy->sub, tdata); 839 845 if (status != PJ_SUCCESS) { … … 865 871 866 872 status = pjsip_pres_initiate( buddy->sub, 0, &tdata); 867 if (status == PJ_SUCCESS) 873 if (status == PJ_SUCCESS) { 874 pjsua_process_msg_data(tdata, NULL); 868 875 status = pjsip_pres_send_request( buddy->sub, tdata ); 876 } 869 877 870 878 if (status != PJ_SUCCESS) {
Note: See TracChangeset
for help on using the changeset viewer.