Changeset 780 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- Oct 18, 2006 5:16:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r777 r780 38 38 pjsua_logging_config log_cfg; 39 39 pjsua_media_config media_cfg; 40 pj_bool_t no_refersub; 40 41 pj_bool_t no_tcp; 41 42 pj_bool_t no_udp; … … 161 162 puts (" --thread-cnt=N Number of worker threads (default:1)"); 162 163 puts (" --duration=SEC Set maximum call duration (default:no limit)"); 164 puts (" --norefersub Suppress event subscription when transfering calls"); 163 165 164 166 puts (""); … … 288 290 OPT_NEXT_ACCOUNT, OPT_NEXT_CRED, OPT_MAX_CALLS, 289 291 OPT_DURATION, OPT_NO_TCP, OPT_NO_UDP, OPT_THREAD_CNT, 292 OPT_NOREFERSUB, 290 293 }; 291 294 struct pj_getopt_option long_options[] = { … … 302 305 { "no-tcp", 0, 0, OPT_NO_TCP}, 303 306 { "no-udp", 0, 0, OPT_NO_UDP}, 307 { "norefersub", 0, 0, OPT_NOREFERSUB}, 304 308 { "proxy", 1, 0, OPT_PROXY}, 305 309 { "outbound", 1, 0, OPT_OUTBOUND_PROXY}, … … 457 461 break; 458 462 463 case OPT_NOREFERSUB: /* norefersub */ 464 cfg->no_refersub = PJ_TRUE; 465 break; 466 459 467 case OPT_NO_TCP: /* no-tcp */ 460 468 if (cfg->no_udp) { … … 948 956 } 949 957 958 /* No TCP ? */ 959 if (config->no_tcp) { 960 pj_strcat2(&cfg, "--no-tcp\n"); 961 } 962 963 /* No UDP ? */ 964 if (config->no_udp) { 965 pj_strcat2(&cfg, "--no-udp\n"); 966 } 950 967 951 968 /* STUN */ … … 1090 1107 } 1091 1108 1109 /* norefersub ? */ 1110 if (config->no_refersub) { 1111 pj_strcat2(&cfg, "--norefersub\n"); 1112 } 1113 1114 1092 1115 pj_strcat2(&cfg, "\n#\n# Buddies:\n#\n"); 1093 1116 … … 1471 1494 (int)from->slen, from->ptr, 1472 1495 (is_typing?"is typing..":"has stopped typing"))); 1496 } 1497 1498 1499 /** 1500 * Call transfer request status. 1501 */ 1502 static void on_call_transfer_status(pjsua_call_id call_id, 1503 int status_code, 1504 const pj_str_t *status_text, 1505 pj_bool_t final, 1506 pj_bool_t *p_cont) 1507 { 1508 PJ_LOG(3,(THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", 1509 call_id, status_code, 1510 (int)status_text->slen, status_text->ptr, 1511 (final ? "[final]" : ""))); 1512 1513 if (status_code/100 == 2) { 1514 PJ_LOG(3,(THIS_FILE, 1515 "Call %d: call transfered successfully, disconnecting call", 1516 call_id)); 1517 pjsua_call_hangup(call_id, PJSIP_SC_GONE, NULL, NULL); 1518 *p_cont = PJ_FALSE; 1519 } 1473 1520 } 1474 1521 … … 2148 2195 } 2149 2196 2150 /* Add Refer-Sub: false in outgoing REFER request */2151 2197 pjsua_msg_data_init(&msg_data); 2152 pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB, 2153 &STR_FALSE); 2154 pj_list_push_back(&msg_data.hdr_list, &refer_sub); 2155 2198 if (app_config.no_refersub) { 2199 /* Add Refer-Sub: false in outgoing REFER request */ 2200 pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB, 2201 &STR_FALSE); 2202 pj_list_push_back(&msg_data.hdr_list, &refer_sub); 2203 } 2156 2204 if (result.nb_result != NO_NB) { 2157 2205 if (result.nb_result == -1 || result.nb_result == 0) … … 2168 2216 pjsua_call_xfer( current_call, &tmp, &msg_data); 2169 2217 } 2170 2171 /* Hangup call regardless of xfer status */2172 pjsua_call_hangup(current_call, PJSIP_SC_GONE, NULL, NULL);2173 2218 } 2174 2219 break; … … 2462 2507 app_config.cfg.cb.on_pager = &on_pager; 2463 2508 app_config.cfg.cb.on_typing = &on_typing; 2509 app_config.cfg.cb.on_call_transfer_status = &on_call_transfer_status; 2464 2510 2465 2511 /* Initialize pjsua */
Note: See TracChangeset
for help on using the changeset viewer.