Changeset 4347
- Timestamp:
- Feb 13, 2013 10:19:25 AM (12 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r4330 r4347 378 378 puts (" --no-force-lr Allow strict-route to be used (i.e. do not force lr)"); 379 379 puts (" --accept-redirect=N Specify how to handle call redirect (3xx) response."); 380 puts (" 0: reject, 1: follow automatically (default), 2: ask"); 380 puts (" 0: reject, 1: follow automatically,"); 381 puts (" 2: follow + replace To header (default), 3: ask"); 381 382 382 383 puts (""); … … 405 406 pjsua_transport_config_default(&cfg->rtp_cfg); 406 407 cfg->rtp_cfg.port = 4000; 407 cfg->redir_op = PJSIP_REDIRECT_ACCEPT ;408 cfg->redir_op = PJSIP_REDIRECT_ACCEPT_REPLACE; 408 409 cfg->duration = NO_LIMIT; 409 410 cfg->wav_id = PJSUA_INVALID_ID; … … 2242 2243 2243 2244 /* accept-redirect */ 2244 if (config->redir_op != PJSIP_REDIRECT_ACCEPT ) {2245 if (config->redir_op != PJSIP_REDIRECT_ACCEPT_REPLACE) { 2245 2246 pj_ansi_sprintf(line, "--accept-redirect %d\n", 2246 2247 config->redir_op); … … 3052 3053 3053 3054 PJ_LOG(3,(THIS_FILE, "Call %d is being redirected to %.*s. " 3054 "Press 'Ra' to accept , 'Rr' to reject, or 'Rd' to"3055 " disconnect.",3055 "Press 'Ra' to accept+replace To header, 'RA' to accept, " 3056 "'Rr' to reject, or 'Rd' to disconnect.", 3056 3057 call_id, len, uristr)); 3057 3058 } … … 5382 5383 } else if (menuin[1] == 'a') { 5383 5384 pjsua_call_process_redirect(current_call, 5385 PJSIP_REDIRECT_ACCEPT_REPLACE); 5386 } else if (menuin[1] == 'A') { 5387 pjsua_call_process_redirect(current_call, 5384 5388 PJSIP_REDIRECT_ACCEPT); 5385 5389 } else if (menuin[1] == 'r') { -
pjproject/trunk/pjsip/include/pjsip/sip_util.h
r3553 r4347 91 91 */ 92 92 PJSIP_REDIRECT_ACCEPT, 93 94 /** 95 * Accept the redirection to the current target and replace the To 96 * header in the INVITE request with the current target. The INVITE 97 * request will be resent to the current target. 98 */ 99 PJSIP_REDIRECT_ACCEPT_REPLACE, 93 100 94 101 /** -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r4343 r4347 1126 1126 * received redirection response. 1127 1127 * 1128 * Application may accept the redirection to the specified target 1129 * (the default behavior if this callback is implemented), reject 1130 * this target only and make the session continue to try the next 1128 * Application may accept the redirection to the specified target, 1129 * reject this target only and make the session continue to try the next 1131 1130 * target in the list if such target exists, stop the whole 1132 1131 * redirection process altogether and cause the session to be … … 1148 1147 * parameter to one of the value below: 1149 1148 * - PJSIP_REDIRECT_ACCEPT: immediately accept the 1150 * redirection (default value). When set, the 1151 * call will immediately resend INVITE request 1152 * to the target. 1149 * redirection. When set, the call will immediately 1150 * resend INVITE request to the target. 1151 * - PJSIP_REDIRECT_ACCEPT_REPLACE: immediately accept 1152 * the redirection and replace the To header with the 1153 * current target. When set, the call will immediately 1154 * resend INVITE request to the target. 1153 1155 * - PJSIP_REDIRECT_REJECT: immediately reject this 1154 1156 * target. The call will continue retrying with -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r4323 r4347 2330 2330 switch (op) { 2331 2331 case PJSIP_REDIRECT_ACCEPT: 2332 case PJSIP_REDIRECT_ACCEPT_REPLACE: 2332 2333 case PJSIP_REDIRECT_STOP: 2333 2334 /* Must increment session counter, that's the convention of the … … 2395 2396 switch (op) { 2396 2397 case PJSIP_REDIRECT_ACCEPT: 2398 case PJSIP_REDIRECT_ACCEPT_REPLACE: 2397 2399 /* User accept the redirection. Reset the session and resend the 2398 2400 * INVITE request. … … 2419 2421 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 2420 2422 via->branch_param.slen = 0; 2423 2424 /* Process PJSIP_REDIRECT_ACCEPT_REPLACE */ 2425 if (op == PJSIP_REDIRECT_ACCEPT_REPLACE) { 2426 pjsip_to_hdr *to; 2427 pjsip_dialog *dlg = inv->dlg; 2428 enum { TMP_LEN = 128 }; 2429 char tmp[TMP_LEN]; 2430 int len; 2431 2432 /* Replace To header */ 2433 to = PJSIP_MSG_TO_HDR(tdata->msg); 2434 to->uri = (pjsip_uri*) 2435 pjsip_uri_clone(tdata->pool, 2436 dlg->target_set.current->uri); 2437 to->tag.slen = 0; 2438 pj_list_init(&to->other_param); 2439 2440 /* Re-init dialog remote info */ 2441 dlg->remote.info = (pjsip_to_hdr*) 2442 pjsip_hdr_clone(dlg->pool, to); 2443 2444 /* Remove header param from remote info */ 2445 if (PJSIP_URI_SCHEME_IS_SIP(dlg->remote.info->uri) || 2446 PJSIP_URI_SCHEME_IS_SIPS(dlg->remote.info->uri)) 2447 { 2448 pjsip_sip_uri *sip_uri = (pjsip_sip_uri *) 2449 pjsip_uri_get_uri(dlg->remote.info->uri); 2450 if (!pj_list_empty(&sip_uri->header_param)) { 2451 /* Remove all header param */ 2452 pj_list_init(&sip_uri->header_param); 2453 } 2454 } 2455 2456 /* Print the remote info. */ 2457 len = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, 2458 dlg->remote.info->uri, tmp, TMP_LEN); 2459 if (len < 1) { 2460 pj_ansi_strcpy(tmp, "<-error: uri too long->"); 2461 len = pj_ansi_strlen(tmp); 2462 } 2463 pj_strdup2_with_null(dlg->pool, &dlg->remote.info_str, tmp); 2464 2465 /* Secure? */ 2466 dlg->secure = PJSIP_URI_SCHEME_IS_SIPS(to->uri); 2467 } 2421 2468 2422 2469 /* Reset message destination info (see #1248). */
Note: See TracChangeset
for help on using the changeset viewer.