This program is a very simple usage example of liblinphone.
More...
This program is a very simple usage example of liblinphone.
Desmonstrating how to initiate a SIP registration from a sip uri identity passed from the command line. first argument must be like sip:jehan.nosp@m.@sip.nosp@m..linp.nosp@m.hone.nosp@m..org , second must be password .
ex registration sip:jehan.nosp@m.@sip.nosp@m..linp.nosp@m.hone.nosp@m..org secret
Registration is cleared on SIGINT
#include "linphone/core.h"
#include <signal.h>
static bool_t running = TRUE;
static void stop(int signum) {
running = FALSE;
}
static void registration_state_changed(struct _LinphoneCore *lc,
const char *message) {
}
int main(int argc, char *argv[]) {
char *identity = NULL;
char *password = NULL;
const char *server_addr;
if (argc > 1) {
identity = argv[1];
}
if (argc > 2) {
password = argv[2];
}
signal(SIGINT, stop);
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL);
#endif
if (from == NULL) {
printf("%s not a valid sip uri, must be like sip:toto@sip.linphone.org \n", identity);
goto end;
}
if (password != NULL) {
NULL);
}
while (running) {
ms_usleep(50000);
}
ms_usleep(50000);
}
end:
printf("Shutting down...\n");
printf("Exited\n");
return 0;
}