Changeset 201 for pjproject/trunk/pjsip/src/pjsua/main.c
- Timestamp:
- Feb 19, 2006 3:37:19 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua/main.c
r197 r201 99 99 static void keystroke_help(void) 100 100 { 101 102 printf(">>>>\nOnline status: %s\n", 101 char reg_status[128]; 102 103 if (pjsua.regc == NULL) { 104 pj_ansi_strcpy(reg_status, " -not registered to server-"); 105 } else if (pjsua.regc_last_err != PJ_SUCCESS) { 106 pj_strerror(pjsua.regc_last_err, reg_status, sizeof(reg_status)); 107 } else if (pjsua.regc_last_code>=200 && pjsua.regc_last_code<=699) { 108 109 pjsip_regc_info info; 110 111 pjsip_regc_get_info(pjsua.regc, &info); 112 113 pj_snprintf(reg_status, sizeof(reg_status), 114 "%s (%.*s;expires=%d)", 115 pjsip_get_status_text(pjsua.regc_last_code)->ptr, 116 (int)info.server_uri.slen, 117 info.server_uri.ptr, 118 info.next_reg); 119 120 } else { 121 pj_sprintf(reg_status, "in progress (%d)", pjsua.regc_last_code); 122 } 123 124 printf(">>>>\nRegistration status: %s\n", reg_status); 125 printf("Online status: %s\n", 103 126 (pjsua.online_status ? "Online" : "Invisible")); 104 127 print_buddy_list(); … … 109 132 puts("| | | |"); 110 133 puts("| m Make new call | i Send IM | o Send OPTIONS |"); 111 puts("| a Answer call | s Subscribe presence | d Dump status|");112 puts("| h Hangup call | u Unsubscribe presence | d1 Dump detailed|");113 puts("| ] Select next dialog | t Toggle Online status | 134 puts("| a Answer call | s Subscribe presence | R (Re-)register |"); 135 puts("| h Hangup call | u Unsubscribe presence | r Unregister |"); 136 puts("| ] Select next dialog | t Toggle Online status | d Dump status |"); 114 137 puts("| [ Select previous dialog | | |"); 115 138 puts("+-----------------------------------------------------------------------------+"); … … 224 247 225 248 if ((status=pjsua_verify_sip_url(buf)) != PJ_SUCCESS) { 226 pjsua_perror( "Invalid URL", status);249 pjsua_perror(THIS_FILE, "Invalid URL", status); 227 250 return; 228 251 } … … 291 314 292 315 if (status != PJ_SUCCESS) 293 pjsua_perror("Unable to create/send response", status); 316 pjsua_perror(THIS_FILE, "Unable to create/send response", 317 status); 294 318 } 295 319 … … 311 335 PJSIP_SC_DECLINE, NULL, &tdata); 312 336 if (status != PJ_SUCCESS) { 313 pjsua_perror("Failed to create end session message", status); 337 pjsua_perror(THIS_FILE, 338 "Failed to create end session message", 339 status); 314 340 continue; 315 341 } … … 317 343 status = pjsip_inv_send_msg(inv_session->inv, tdata, NULL); 318 344 if (status != PJ_SUCCESS) { 319 pjsua_perror("Failed to send end session message", status); 345 pjsua_perror(THIS_FILE, 346 "Failed to send end session message", 347 status); 320 348 continue; 321 349 } … … 353 381 } 354 382 383 break; 384 385 case 'R': 386 pjsua_regc_update(PJ_TRUE); 387 break; 388 389 case 'r': 390 pjsua_regc_update(PJ_FALSE); 355 391 break; 356 392 … … 501 537 * Display error message for the specified error code. 502 538 */ 503 void pjsua_perror(const char *title, pj_status_t status) 539 void pjsua_perror(const char *sender, const char *title, 540 pj_status_t status) 504 541 { 505 542 char errmsg[PJ_ERR_MSG_SIZE]; … … 507 544 pj_strerror(status, errmsg, sizeof(errmsg)); 508 545 509 PJ_LOG(1,( THIS_FILE, "%s: %s [code=%d]", title, errmsg, status));546 PJ_LOG(1,(sender, "%s: %s [code=%d]", title, errmsg, status)); 510 547 } 511 548
Note: See TracChangeset
for help on using the changeset viewer.