[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Linphone-users] How to control linphonec with other aplication? pip
From: |
Samuel Ayet San Andres |
Subject: |
Re: [Linphone-users] How to control linphonec with other aplication? pipes? |
Date: |
Thu, 16 Oct 2008 17:24:14 +0200 |
User-agent: |
Internet Messaging Program (IMP) 3.2.8 |
Hi all,
I have been testing many things and I have solved the problem and you dont need
to do nothing to control linphonec with other app (just pipes...). You can
control linphonec trhu other app with just a pipe. It´s more easy than I
think!!! For example (dumy example), I want than linphonec shows every 1 second
the proxy list and I want that a program called 'hello' controls linpehonec to
do it.
- Here we have the hello.c program:
#include <stdio.h>
int main(){
while(1){
usleep(100000); // Pause for 1 second
printf("proxy list\n"); // write in stdout any comand followed by '\n'
that is the INTRO(then we will redirect this to the input of the pipe)
fflush(NULL); // Flush the stdout (if you don´t do this you will
have to waint until the pipe is full and then make an autoflush)
}
}
- We compile it
gcc hello.c -o hello
- And now we use pipes!!! and this is just:
bash> ./hello | linphonec
That´s all!!! The problem I had is that i didn´t use fflush so until the pipe
was full I didn´t saw the result on the screen... Tahnk you for all!!!
Re: [Linphone-users] How to control linphonec with other aplication? pipes?, Alastair Johnson, 2008/10/16