Changeset 1931 for pjproject/trunk
- Timestamp:
- Apr 15, 2008 10:37:19 AM (17 years ago)
- Location:
- pjproject/trunk/pjsip/src/pjsua-lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r1929 r1931 572 572 pjsip_regc_destroy(acc->regc); 573 573 acc->regc = NULL; 574 acc->contact.slen = 0; 574 575 } 575 576 … … 860 861 pjsip_regc_destroy(acc->regc); 861 862 acc->regc = NULL; 863 acc->contact.slen = 0; 862 864 863 865 /* Stop keep-alive timer if any. */ … … 870 872 pjsip_regc_destroy(acc->regc); 871 873 acc->regc = NULL; 874 acc->contact.slen = 0; 872 875 873 876 /* Stop keep-alive timer if any. */ … … 879 882 pjsip_regc_destroy(acc->regc); 880 883 acc->regc = NULL; 884 acc->contact.slen = 0; 881 885 882 886 /* Stop keep-alive timer if any. */ … … 947 951 pjsip_regc_destroy(acc->regc); 948 952 acc->regc = NULL; 953 acc->contact.slen = 0; 949 954 } 950 955 … … 993 998 pj_pool_release(pool); 994 999 acc->regc = NULL; 1000 acc->contact.slen = 0; 995 1001 return status; 996 1002 } -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r1929 r1931 406 406 call->res_time.sec = 0; 407 407 408 /* Create suitable Contact header */ 409 status = pjsua_acc_create_uac_contact(pjsua_var.pool, &contact, 410 acc_id, dest_uri); 411 if (status != PJ_SUCCESS) { 412 pjsua_perror(THIS_FILE, "Unable to generate Contact header", status); 413 PJSUA_UNLOCK(); 414 return status; 408 /* Create suitable Contact header unless a Contact header has been 409 * set in the account. 410 */ 411 if (acc->contact.slen) { 412 contact = acc->contact; 413 } else { 414 status = pjsua_acc_create_uac_contact(pjsua_var.pool, &contact, 415 acc_id, dest_uri); 416 if (status != PJ_SUCCESS) { 417 pjsua_perror(THIS_FILE, "Unable to generate Contact header", 418 status); 419 PJSUA_UNLOCK(); 420 return status; 421 } 415 422 } 416 423 … … 788 795 789 796 /* Get suitable Contact header */ 790 status = pjsua_acc_create_uas_contact(rdata->tp_info.pool, &contact, 791 acc_id, rdata); 792 if (status != PJ_SUCCESS) { 793 pjsua_perror(THIS_FILE, "Unable to generate Contact header", status); 794 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL, 795 NULL, NULL); 796 pjsua_media_channel_deinit(call->index); 797 PJSUA_UNLOCK(); 798 return PJ_TRUE; 797 if (pjsua_var.acc[acc_id].contact.slen) { 798 contact = pjsua_var.acc[acc_id].contact; 799 } else { 800 status = pjsua_acc_create_uas_contact(rdata->tp_info.pool, &contact, 801 acc_id, rdata); 802 if (status != PJ_SUCCESS) { 803 pjsua_perror(THIS_FILE, "Unable to generate Contact header", 804 status); 805 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL, 806 NULL, NULL); 807 pjsua_media_channel_deinit(call->index); 808 PJSUA_UNLOCK(); 809 return PJ_TRUE; 810 } 799 811 } 800 812 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r1569 r1931 553 553 554 554 /* 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 } 561 566 } 562 567 … … 1124 1129 acc_id, index)); 1125 1130 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 } 1132 1144 } 1133 1145
Note: See TracChangeset
for help on using the changeset viewer.