Changeset 248:9d353d913739 in mediastreamer2
- Timestamp:
- Feb 9, 2009 9:12:34 PM (4 years ago)
- Branch:
- default
- Location:
- linphone
- Files:
-
- 3 edited
-
console/commands.c (modified) (3 diffs)
-
console/shell.c (modified) (4 diffs)
-
coreapi/exevents.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
linphone/console/commands.c
r245 r248 1209 1209 if (elem) linphone_proxy_config_done(cfg); 1210 1210 else linphone_core_add_proxy_config(lc,cfg); 1211 linphone_core_set_default_proxy(lc,cfg); 1211 1212 return 1; 1212 1213 } … … 1215 1216 LinphoneProxyConfig *cfg=NULL; 1216 1217 linphone_core_get_default_proxy(lc,&cfg); 1217 if (cfg ) {1218 if (cfg && linphone_proxy_config_is_registered(cfg)) { 1218 1219 linphone_proxy_config_edit(cfg); 1219 1220 linphone_proxy_config_enable_register(cfg,FALSE); … … 1243 1244 if (cfg){ 1244 1245 if (linphone_proxy_config_is_registered(cfg)){ 1245 linphonec_out("identity=%s duration=% s",1246 linphonec_out("identity=%s duration=%i\n", 1246 1247 linphone_proxy_config_get_identity(cfg), 1247 1248 linphone_proxy_config_get_expires(cfg)); 1248 1249 }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"); 1252 1253 }else if (strstr(args,"autoanswer")){ 1253 1254 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"); 1256 1257 }else if (strstr(args,"hook")){ 1257 1258 gstate_t call_state=linphone_core_get_state(lc,GSTATE_GROUP_CALL); 1258 1259 if (!cfg || !linphone_proxy_config_is_registered(cfg)){ 1259 linphonec_out("unregistered"); 1260 linphonec_out("unregistered\n"); 1261 return 1; 1260 1262 } 1261 1263 switch(call_state){ 1262 1264 case GSTATE_CALL_OUT_INVITE: 1263 linphonec_out("hook=dialing ");1265 linphonec_out("hook=dialing\n"); 1264 1266 break; 1265 1267 case GSTATE_CALL_IDLE: 1266 linphonec_out("hook=offhook ");1268 linphonec_out("hook=offhook\n"); 1267 1269 break; 1268 1270 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(), 1270 1272 linphone_core_get_current_call_duration(lc)); 1271 1273 break; 1272 1274 case GSTATE_CALL_IN_CONNECTED: 1273 linphonec_out("hook=answered duration=%i " ,1275 linphonec_out("hook=answered duration=%i\n" , 1274 1276 linphone_core_get_current_call_duration(lc)); 1275 1277 default: -
linphone/console/shell.c
r244 r248 76 76 fprintf(stderr,"Usage:\nlinphonecsh <action> [arguments]\n" 77 77 "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 ); 83 88 exit(-1); 84 89 } … … 94 99 args[j++]="--tcp"; 95 100 args[j++]=DEFAULT_TCP_PORT; 101 args[j++]="-c"; 102 args[j++]="/dev/null"; 96 103 for(i=0;i<argc;++i){ 97 104 args[j++]=argv[i]; … … 190 197 char cmd[512]; 191 198 if (argc==1){ 192 snprintf(cmd,sizeof(cmd)," call%s",argv[0]);199 snprintf(cmd,sizeof(cmd),"status %s",argv[0]); 193 200 return send_generic_command(cmd,TRUE); 194 201 }else{ … … 228 235 }else if (strcmp(argv[argi],"status")==0){ 229 236 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(); 231 240 } 232 241 return 0; -
linphone/coreapi/exevents.c
r232 r248 931 931 ms_return_if_fail(cfg!=NULL); 932 932 cfg->auth_pending=FALSE; 933 cfg->registered=TRUE;934 933 gstate_new_state(lc, GSTATE_REG_OK, NULL); 935 934 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; 937 937 linphone_proxy_config_register_again_with_updated_contact(cfg,ev->request,ev->response); 938 }else cfg->registered=FALSE; 938 939 } 939 940
Note: See TracChangeset
for help on using the changeset viewer.
