Changeset 576 for pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
- Timestamp:
- Jul 2, 2006 2:53:05 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r500 r576 233 233 method = &rdata->msg_info.msg->line.req.method; 234 234 235 if (method->id == PJSIP_INVITE_METHOD || 236 method->id == PJSIP_CANCEL_METHOD || 237 method->id == PJSIP_BYE_METHOD) 235 if (method->id == PJSIP_INVITE_METHOD) { 236 return PJ_TRUE; 237 } 238 239 /* BYE and CANCEL must have existing invite session */ 240 if (method->id == PJSIP_BYE_METHOD || 241 method->id == PJSIP_CANCEL_METHOD) 238 242 { 243 if (inv == NULL) 244 return PJ_FALSE; 245 239 246 return PJ_TRUE; 240 247 } … … 781 788 782 789 *p_tdata = tdata; 790 791 /* Can not return PJ_SUCCESS when response message is produced. 792 * Ref: PROTOS test ~#2490 793 */ 794 if (status == PJ_SUCCESS) 795 status = PJSIP_ERRNO_FROM_SIP_STATUS(code); 796 783 797 } 784 798 … … 2205 2219 2206 2220 } 2207 2221 else if (tsx->method.id == PJSIP_CANCEL_METHOD && 2222 tsx->role == PJSIP_ROLE_UAS && 2223 tsx->status_code < 200 && 2224 e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) 2225 { 2226 2227 /* 2228 * Handle strandled incoming CANCEL. 2229 */ 2230 pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; 2231 pjsip_tx_data *tdata; 2232 pj_status_t status; 2233 2234 status = pjsip_dlg_create_response(dlg, rdata, 200, NULL, &tdata); 2235 if (status != PJ_SUCCESS) return; 2236 2237 status = pjsip_dlg_send_response(dlg, tsx, tdata); 2238 if (status != PJ_SUCCESS) return; 2239 2240 } 2208 2241 } 2209 2242 … … 2243 2276 2244 2277 inv_respond_incoming_bye( inv, tsx, e->body.tsx_state.src.rdata, e ); 2278 2279 } 2280 else if (tsx->method.id == PJSIP_CANCEL_METHOD && 2281 tsx->role == PJSIP_ROLE_UAS && 2282 tsx->status_code < 200 && 2283 e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) 2284 { 2285 2286 /* 2287 * Handle strandled incoming CANCEL. 2288 */ 2289 pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; 2290 pjsip_tx_data *tdata; 2291 pj_status_t status; 2292 2293 status = pjsip_dlg_create_response(dlg, rdata, 200, NULL, &tdata); 2294 if (status != PJ_SUCCESS) return; 2295 2296 status = pjsip_dlg_send_response(dlg, tsx, tdata); 2297 if (status != PJ_SUCCESS) return; 2245 2298 2246 2299 } … … 2378 2431 PJ_ASSERT_ON_FAIL(tsx && dlg, return); 2379 2432 2380 if (tsx->method.id == PJSIP_BYE_METHOD && 2381 tsx->role == PJSIP_ROLE_UAS && 2433 if (tsx->role == PJSIP_ROLE_UAS && 2382 2434 tsx->status_code < 200 && 2383 2435 e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) 2384 2436 { 2437 pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; 2385 2438 2386 2439 /* 2387 * Be nice, handle incoming BYE.2440 * Respond BYE with 200/OK 2388 2441 */ 2389 2390 inv_respond_incoming_bye( inv, tsx, e->body.tsx_state.src.rdata, e ); 2391 2392 } 2393 } 2394 2442 if (tsx->method.id == PJSIP_BYE_METHOD) { 2443 inv_respond_incoming_bye( inv, tsx, rdata, e ); 2444 } else if (tsx->method.id == PJSIP_CANCEL_METHOD) { 2445 /* 2446 * Respond CANCEL with 200/OK too. 2447 */ 2448 pjsip_tx_data *tdata; 2449 pj_status_t status; 2450 2451 status = pjsip_dlg_create_response(dlg, rdata, 200, NULL, &tdata); 2452 if (status != PJ_SUCCESS) return; 2453 2454 status = pjsip_dlg_send_response(dlg, tsx, tdata); 2455 if (status != PJ_SUCCESS) return; 2456 2457 } 2458 } 2459 } 2460
Note: See TracChangeset
for help on using the changeset viewer.