Changeset 3385 for pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
- Timestamp:
- Dec 2, 2010 11:21:01 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r3383 r3385 34 34 #include <pj/os.h> 35 35 #include <pj/log.h> 36 #include <pj/rand.h> 36 37 37 38 /* … … 3917 3918 /* Check if we have INVITE pending. */ 3918 3919 if (inv->invite_tsx && inv->invite_tsx!=tsx) { 3920 int code; 3919 3921 pj_str_t reason; 3920 3922 3921 3923 reason = pj_str("Another INVITE transaction in progress"); 3922 3924 3925 if (inv->invite_tsx->role == PJSIP_ROLE_UAC) 3926 code = 491; 3927 else 3928 code = 500; 3929 3923 3930 /* Can not receive re-INVITE while another one is pending. */ 3924 status = pjsip_dlg_create_response( inv->dlg, rdata, 500,3931 status = pjsip_dlg_create_response( inv->dlg, rdata, code, 3925 3932 &reason, &tdata); 3926 3933 if (status != PJ_SUCCESS) 3927 3934 return; 3935 3936 if (code == 500) { 3937 /* MUST include Retry-After header with random value 3938 * between 0-10. 3939 */ 3940 pjsip_retry_after_hdr *ra_hdr; 3941 int val = (pj_rand() % 10); 3942 3943 ra_hdr = pjsip_retry_after_hdr_create(tdata->pool, val); 3944 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)ra_hdr); 3945 } 3928 3946 3929 3947 status = pjsip_dlg_send_response( inv->dlg, tsx, tdata);
Note: See TracChangeset
for help on using the changeset viewer.