Changeset 248:9d353d913739 in mediastreamer2


Ignore:
Timestamp:
Feb 9, 2009 9:12:34 PM (4 years ago)
Author:
smorlat <smorlat@…>
Branch:
default
Message:

bugfixing.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@251 3f6dc0c8-ddfe-455d-9043-3cd528dc4637

Location:
linphone
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • linphone/console/commands.c

    r245 r248  
    12091209        if (elem) linphone_proxy_config_done(cfg); 
    12101210        else linphone_core_add_proxy_config(lc,cfg); 
     1211        linphone_core_set_default_proxy(lc,cfg); 
    12111212        return 1; 
    12121213} 
     
    12151216        LinphoneProxyConfig *cfg=NULL; 
    12161217        linphone_core_get_default_proxy(lc,&cfg); 
    1217         if (cfg) { 
     1218        if (cfg && linphone_proxy_config_is_registered(cfg)) { 
    12181219                linphone_proxy_config_edit(cfg); 
    12191220                linphone_proxy_config_enable_register(cfg,FALSE); 
     
    12431244                if (cfg){ 
    12441245                        if (linphone_proxy_config_is_registered(cfg)){ 
    1245                                 linphonec_out("identity=%s duration=%s", 
     1246                                linphonec_out("identity=%s duration=%i\n", 
    12461247                                        linphone_proxy_config_get_identity(cfg), 
    12471248                                        linphone_proxy_config_get_expires(cfg)); 
    12481249                        }else if (linphone_proxy_config_register_enabled(cfg)){ 
    1249                                 linphonec_out("registered=-1"); 
    1250                         }else linphonec_out("registered=0"); 
    1251                 }else linphonec_out("registered=0"); 
     1250                                linphonec_out("registered=-1\n"); 
     1251                        }else linphonec_out("registered=0\n"); 
     1252                }else linphonec_out("registered=0\n"); 
    12521253        }else if (strstr(args,"autoanswer")){ 
    12531254                if (cfg && linphone_proxy_config_is_registered(cfg)) 
    1254                         linphonec_out("autoanswer=%i",linphonec_get_autoanswer()); 
    1255                 else linphonec_out("unregistered"); 
     1255                        linphonec_out("autoanswer=%i\n",linphonec_get_autoanswer()); 
     1256                else linphonec_out("unregistered\n"); 
    12561257        }else if (strstr(args,"hook")){ 
    12571258                gstate_t call_state=linphone_core_get_state(lc,GSTATE_GROUP_CALL); 
    12581259                if (!cfg || !linphone_proxy_config_is_registered(cfg)){ 
    1259                         linphonec_out("unregistered"); 
     1260                        linphonec_out("unregistered\n"); 
     1261                        return 1; 
    12601262                } 
    12611263                switch(call_state){ 
    12621264                        case GSTATE_CALL_OUT_INVITE: 
    1263                                 linphonec_out("hook=dialing"); 
     1265                                linphonec_out("hook=dialing\n"); 
    12641266                        break; 
    12651267                        case GSTATE_CALL_IDLE: 
    1266                                 linphonec_out("hook=offhook"); 
     1268                                linphonec_out("hook=offhook\n"); 
    12671269                        break; 
    12681270                        case GSTATE_CALL_OUT_CONNECTED: 
    1269                                 linphonec_out("hook=%s duration=%i", linphonec_get_callee(), 
     1271                                linphonec_out("hook=%s duration=%i\n", linphonec_get_callee(), 
    12701272                                        linphone_core_get_current_call_duration(lc)); 
    12711273                        break; 
    12721274                        case GSTATE_CALL_IN_CONNECTED: 
    1273                                 linphonec_out("hook=answered duration=%i" , 
     1275                                linphonec_out("hook=answered duration=%i\n" , 
    12741276                                        linphone_core_get_current_call_duration(lc)); 
    12751277                        default: 
  • linphone/console/shell.c

    r244 r248  
    7676        fprintf(stderr,"Usage:\nlinphonecsh <action> [arguments]\n" 
    7777                        "where action is one of\n" 
    78                         "\tinit     : spawn a linphonec daemon (first step to make other actions)\n" 
    79                         "\t\tfollowed by the arguments sent to linphonec\n" 
    80                         "\tgeneric  : sends a generic command to the running linphonec daemon\n" 
    81                         "\t\tfollowed by the generic command surrounded by quotes, for example \"call sip:joe@example.net\"\n" 
    82                         "\tregister : register with specified proxy\n"); 
     78                        "\tinit\t\t: spawn a linphonec daemon (first step to make other actions)\n" 
     79                        "\t\t\tfollowed by the arguments sent to linphonec\n" 
     80                        "\tgeneric\t\t: sends a generic command to the running linphonec daemon\n" 
     81                        "\t\t\tfollowed by the generic command surrounded by quotes,\n\t\t\t for example \"call sip:joe@example.net\"\n" 
     82                        "\tregister\t: register; arguments are \n\t\t\t--host <host>\n\t\t\t--username <username>\n\t\t\t--password <password>\n" 
     83                        "\tunregister\t: unregister\n" 
     84                        "\tdial\t\t: dial <sip uri or number>\n" 
     85                        "\tstatus\t\t: can be 'status register', 'status autoanswer' or 'status hook'\n" 
     86                        "\texit\t\t: make the linphonec daemon to exit.\n" 
     87        ); 
    8388        exit(-1); 
    8489} 
     
    9499        args[j++]="--tcp"; 
    95100        args[j++]=DEFAULT_TCP_PORT; 
     101        args[j++]="-c"; 
     102        args[j++]="/dev/null"; 
    96103        for(i=0;i<argc;++i){ 
    97104                args[j++]=argv[i]; 
     
    190197        char cmd[512]; 
    191198        if (argc==1){ 
    192                 snprintf(cmd,sizeof(cmd),"call %s",argv[0]); 
     199                snprintf(cmd,sizeof(cmd),"status %s",argv[0]); 
    193200                return send_generic_command(cmd,TRUE); 
    194201        }else{ 
     
    228235                }else if (strcmp(argv[argi],"status")==0){ 
    229236                        return status_execute(argc-argi-1,&argv[argi+1]); 
    230                 } 
     237                }else if (strcmp(argv[argi],"exit")==0){ 
     238                        return send_generic_command("quit",TRUE); 
     239                }else print_usage(); 
    231240        } 
    232241        return 0; 
  • linphone/coreapi/exevents.c

    r232 r248  
    931931        ms_return_if_fail(cfg!=NULL); 
    932932        cfg->auth_pending=FALSE; 
    933         cfg->registered=TRUE; 
    934933        gstate_new_state(lc, GSTATE_REG_OK, NULL); 
    935934        osip_message_get_expires(ev->request,0,&h); 
    936         if (h!=NULL && atoi(h->hvalue)!=0) 
     935        if (h!=NULL && atoi(h->hvalue)!=0){ 
     936                cfg->registered=TRUE; 
    937937                linphone_proxy_config_register_again_with_updated_contact(cfg,ev->request,ev->response); 
     938        }else cfg->registered=FALSE; 
    938939} 
    939940 
Note: See TracChangeset for help on using the changeset viewer.