Changeset 244:341831610f7f in mediastreamer2
- Timestamp:
- Feb 7, 2009 9:51:56 PM (4 years ago)
- Branch:
- default
- Location:
- linphone
- Files:
-
- 4 edited
-
console/commands.c (modified) (7 diffs)
-
console/shell.c (modified) (4 diffs)
-
coreapi/linphonecore.h (modified) (1 diff)
-
coreapi/proxy.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
linphone/console/commands.c
r242 r244 60 60 static int lpc_cmd_record(LinphoneCore *, char *); 61 61 static int lpc_cmd_register(LinphoneCore *, char *); 62 static int lpc_cmd_unregister(LinphoneCore *, char *); 62 63 static int lpc_cmd_duration(LinphoneCore *lc, char *args); 63 64 … … 68 69 static void linphonec_proxy_remove(LinphoneCore *lc, int index); 69 70 static int linphonec_proxy_use(LinphoneCore *lc, int index); 71 static void linphonec_proxy_show(LinphoneCore *lc,int index); 70 72 static void linphonec_friend_display(LinphoneFriend *fr); 71 73 static int linphonec_friend_list(LinphoneCore *lc, char *arg); … … 110 112 "'proxy use <index>' : use proxy with number index as default proxy.\n" 111 113 "'proxy unuse' : don't use a default proxy." 114 "'proxy show <index>' : show configuration and status of the proxy numbered by index.\n" 115 "'proxy show default' : show configuration and status of the default proxy.\n" 112 116 }, 113 117 { "soundcard", lpc_cmd_soundcard, "Manage soundcards", … … 160 164 { "quit", lpc_cmd_quit, "Exit linphonec", NULL }, 161 165 { "register", lpc_cmd_register, "Register in one line to a proxy" , "register <sip identity> <sip proxy> <password>"}, 166 { "unregister", lpc_cmd_unregister, "Unregister from default proxy", NULL }, 162 167 { "duration", lpc_cmd_duration, "Print duration in seconds of the last call.", NULL }, 163 168 { (char *)NULL, (lpc_cmd_handler)NULL, (char *)NULL, (char *)NULL } … … 634 639 else linphonec_out("Current default proxy is %d.\n", proxynum); 635 640 } 636 } 637 else if (strcmp(arg1, "unuse")==0) 638 { 641 }else if (strcmp(arg1, "unuse")==0){ 639 642 linphone_core_set_default_proxy(lc, NULL); 640 643 linphonec_out("Use no proxy.\n"); 641 } 642 else 644 }else if (strcmp(arg1,"show")==0){ 645 if (arg2 && *arg2){ 646 if (strstr(arg2,"default")==0){ 647 proxynum=linphone_core_get_default_proxy(lc, NULL); 648 linphonec_proxy_show(lc,proxynum); 649 }else linphonec_proxy_show(lc,atoi(arg2)); 650 } 651 }else 643 652 { 644 653 linphonec_out("Syntax error - see 'help proxy'\n"); … … 967 976 linphonec_proxy_display(LinphoneProxyConfig *cfg) 968 977 { 969 linphonec_out("sip address: %s\nroute: %s\nidentity: %s\nregister: %s\nexpires: %i\n ",978 linphonec_out("sip address: %s\nroute: %s\nidentity: %s\nregister: %s\nexpires: %i\nregistered: %s\n", 970 979 cfg->reg_proxy, 971 980 (cfg->reg_route!=NULL)?cfg->reg_route:"", 972 981 (cfg->reg_identity!=NULL)?cfg->reg_identity:"", 973 982 (cfg->reg_sendregister)?"yes":"no", 974 cfg->expires); 983 cfg->expires, 984 linphone_proxy_config_is_registered(cfg) ? "yes" : "no"); 985 } 986 987 static void linphonec_proxy_show(LinphoneCore *lc, int index){ 988 const MSList *elem; 989 int i; 990 for(elem=linphone_core_get_proxy_config_list(lc),i=0;elem!=NULL;elem=elem->next,++i){ 991 if (index==i){ 992 LinphoneProxyConfig *cfg=(LinphoneProxyConfig *)elem->data; 993 linphonec_proxy_display(cfg); 994 return; 995 } 996 } 997 linphonec_out("No proxy with index %i",index); 975 998 } 976 999 … … 1162 1185 } 1163 1186 1187 static int lpc_cmd_unregister(LinphoneCore *lc, char *args){ 1188 LinphoneProxyConfig *cfg=NULL; 1189 linphone_core_get_default_proxy(lc,&cfg); 1190 if (cfg) { 1191 linphone_proxy_config_edit(cfg); 1192 linphone_proxy_config_enable_register(cfg,FALSE); 1193 linphone_proxy_config_done(cfg); 1194 }else{ 1195 linphonec_out("unregistered\n"); 1196 } 1197 return 1; 1198 } 1199 1164 1200 int lpc_cmd_duration(LinphoneCore *lc, char *args){ 1165 1201 LinphoneCallLog *cl; -
linphone/console/shell.c
r242 r244 171 171 } 172 172 173 static int unregister_execute(int argc, char *argv[]){ 174 return send_generic_command("unregister",FALSE); 175 } 176 177 173 178 static int dial_execute(int argc, char *argv[]){ 174 179 char cmd[512]; … … 181 186 return -1; 182 187 } 188 189 static int status_execute(int argc, char *argv[]){ 190 char cmd[512]; 191 if (argc==1){ 192 snprintf(cmd,sizeof(cmd),"call %s",argv[0]); 193 return send_generic_command(cmd,TRUE); 194 }else{ 195 print_usage(); 196 } 197 return -1; 198 } 199 183 200 int main(int argc, char *argv[]){ 184 201 int argi; … … 202 219 }else if (strcmp(argv[argi],"register")==0){ 203 220 return register_execute(argc-argi-1,&argv[argi+1]); 221 }else if (strcmp(argv[argi],"unregister")==0){ 222 return unregister_execute(argc-argi-1,&argv[argi+1]); 204 223 }else if (strcmp(argv[argi],"dial")==0){ 205 224 return dial_execute(argc-argi-1,&argv[argi+1]); … … 207 226 send_generic_command("terminate",FALSE); 208 227 send_generic_command("duration",TRUE); 228 }else if (strcmp(argv[argi],"status")==0){ 229 return status_execute(argc-argi-1,&argv[argi+1]); 209 230 } 210 231 } -
linphone/coreapi/linphonecore.h
r222 r244 305 305 int linphone_proxy_config_done(LinphoneProxyConfig *obj); 306 306 void linphone_proxy_config_enable_publish(LinphoneProxyConfig *obj, bool_t val); 307 bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj); 307 308 #define linphone_proxy_config_get_route(obj) ((obj)->reg_route) 308 309 #define linphone_proxy_config_get_identity(obj) ((obj)->reg_identity) -
linphone/coreapi/proxy.c
r222 r244 47 47 } 48 48 49 bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj){ 50 return obj->registered; 51 } 52 49 53 static void linphone_proxy_config_register(LinphoneProxyConfig *obj){ 50 54 osip_message_t *msg;
Note: See TracChangeset
for help on using the changeset viewer.
