mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-31 02:09:22 +00:00
shell.c: add STATUS_IN_COMING status for incoming call
This commit is contained in:
parent
83f6597b01
commit
adb12547e8
1 changed files with 9 additions and 5 deletions
|
|
@ -48,6 +48,7 @@
|
|||
#define STATUS_AUTOANSWER (1<<3)
|
||||
#define STATUS_IN_CONNECTED (1<<4) /* incoming call accepted */
|
||||
#define STATUS_OUT_CONNECTED (1<<5) /*outgoing call accepted */
|
||||
#define STATUS_IN_COMING (1<<6) /*incoming call pending */
|
||||
|
||||
|
||||
static int make_status_value(const char *status_string){
|
||||
|
|
@ -70,6 +71,9 @@ static int make_status_value(const char *status_string){
|
|||
if (strstr(status_string,"hook=answered")){
|
||||
ret|=STATUS_IN_CONNECTED;
|
||||
}
|
||||
if (strstr(status_string,"Incoming call from ")){
|
||||
ret|=STATUS_IN_COMING;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +185,7 @@ static void spawn_linphonec(int argc, char *argv[]){
|
|||
int fd;
|
||||
/*we are the new process*/
|
||||
setsid();
|
||||
|
||||
|
||||
fd = open("/dev/null", O_RDWR);
|
||||
if (fd==-1){
|
||||
fprintf(stderr,"Could not open /dev/null\n");
|
||||
|
|
@ -191,7 +195,7 @@ static void spawn_linphonec(int argc, char *argv[]){
|
|||
dup2(fd, 1);
|
||||
dup2(fd, 2);
|
||||
close(fd);
|
||||
|
||||
|
||||
if (execvp("linphonec",args)==-1){
|
||||
fprintf(stderr,"Fail to spawn linphonec: %s\n",strerror(errno));
|
||||
exit(-1);
|
||||
|
|
@ -207,7 +211,7 @@ static void spawn_linphonec(int argc, char *argv[]){
|
|||
const char *cmd = "linphoned.exe --pipe -c NUL";
|
||||
char *args_in_line = argv_to_line(argc, argv);
|
||||
char *cmd_with_args;
|
||||
|
||||
|
||||
ZeroMemory( &si, sizeof(si) );
|
||||
si.cb = sizeof(si);
|
||||
ZeroMemory( &pinfo, sizeof(pinfo) );
|
||||
|
|
@ -217,7 +221,7 @@ static void spawn_linphonec(int argc, char *argv[]){
|
|||
} else {
|
||||
cmd_with_args = ortp_strdup(cmd);
|
||||
}
|
||||
|
||||
|
||||
ret=CreateProcess(NULL, cmd_with_args,
|
||||
NULL,
|
||||
NULL,
|
||||
|
|
@ -308,7 +312,7 @@ static int status_execute(int argc, char *argv[]){
|
|||
char cmd[512];
|
||||
char reply[DEFAULT_REPLY_SIZE];
|
||||
int err;
|
||||
|
||||
|
||||
if (argc==1){
|
||||
snprintf(cmd,sizeof(cmd),"status %s",argv[0]);
|
||||
err=send_command(cmd,reply,sizeof(reply),TRUE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue