Changeset 832


Ignore:
Timestamp:
Nov 26, 2006 10:49:58 AM (17 years ago)
Author:
bennylp
Message:

Added 'cc x y' and 'cd x y' command in pjsua as shortcut commands for the normal cc and cd command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r831 r832  
    19261926void console_app_main(const pj_str_t *uri_to_call) 
    19271927{ 
    1928     char menuin[10]; 
     1928    char menuin[32]; 
    19291929    char buf[128]; 
    19301930    char text[128]; 
     
    25542554            case 'd': 
    25552555                { 
    2556                     char src_port[10], dst_port[10]; 
     2556                    char tmp[10], src_port[10], dst_port[10]; 
    25572557                    pj_status_t status; 
     2558                    int cnt; 
    25582559                    const char *src_title, *dst_title; 
    25592560 
    2560                     conf_list(); 
    2561  
    2562                     src_title = (menuin[1]=='c'? 
    2563                                  "Connect src port #": 
    2564                                  "Disconnect src port #"); 
    2565                     dst_title = (menuin[1]=='c'? 
    2566                                  "To dst port #": 
    2567                                  "From dst port #"); 
    2568  
    2569                     if (!simple_input(src_title, src_port, sizeof(src_port))) 
    2570                         break; 
    2571  
    2572                     if (!simple_input(dst_title, dst_port, sizeof(dst_port))) 
    2573                         break; 
     2561                    cnt = sscanf(menuin, "%s %s %s", tmp, src_port, dst_port); 
     2562 
     2563                    if (cnt != 3) { 
     2564                        conf_list(); 
     2565 
     2566                        src_title = (menuin[1]=='c'? 
     2567                                     "Connect src port #": 
     2568                                     "Disconnect src port #"); 
     2569                        dst_title = (menuin[1]=='c'? 
     2570                                     "To dst port #": 
     2571                                     "From dst port #"); 
     2572 
     2573                        if (!simple_input(src_title, src_port, sizeof(src_port))) 
     2574                            break; 
     2575 
     2576                        if (!simple_input(dst_title, dst_port, sizeof(dst_port))) 
     2577                            break; 
     2578                    } 
    25742579 
    25752580                    if (menuin[1]=='c') { 
Note: See TracChangeset for help on using the changeset viewer.