#include "linphone/core.h"
#include <signal.h>
static bool_t running = TRUE;
static void stop(int signum) {
running = FALSE;
}
switch (cstate) {
case LinphoneCallOutgoingRinging:
printf("It is now ringing remotely !\n");
break;
case LinphoneCallOutgoingEarlyMedia:
printf("Receiving some early media\n");
break;
case LinphoneCallConnected:
printf("We are connected !\n");
break;
case LinphoneCallStreamsRunning:
printf("Media streams established !\n");
break;
case LinphoneCallEnd:
printf("Call is terminated.\n");
break;
case LinphoneCallError:
printf("Call failure !");
break;
default:
printf("Unhandled notification %i\n", cstate);
}
}
int main(int argc, char *argv[]) {
const char *dest = NULL;
if (argc > 1) {
dest = argv[1];
}
signal(SIGINT, stop);
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL);
#endif
if (dest) {
if (call == NULL) {
printf("Could not place call to %s\n", dest);
goto end;
} else printf("Call to %s is in progress...", dest);
}
while (running) {
ms_usleep(50000);
}
printf("Terminating the call...\n");
}
end:
printf("Shutting down...\n");
printf("Exited\n");
return 0;
}
MS2_DEPRECATED LinphoneStatus linphone_core_terminate_call(LinphoneCore *core, LinphoneCall *call)
Terminates a call.
LinphoneCall * linphone_core_invite(LinphoneCore *core, const char *url)
Initiates an outgoing call.
LinphoneCallState linphone_call_get_state(const LinphoneCall *call)
Retrieves the call's current state.
struct _LinphoneCall LinphoneCall
This object represents a call issued or received by the LinphoneCore.
Definition c-types.h:267
enum _LinphoneCallState LinphoneCallState
LinphoneCallState enum represents the different states a call can reach into.
LinphoneCall * linphone_call_ref(LinphoneCall *call)
Acquire a reference to the call.
void linphone_call_unref(LinphoneCall *call)
Release reference to the call.
void linphone_core_iterate(LinphoneCore *core)
Main loop function.
MS2_DEPRECATED LinphoneCore * linphone_core_new(const LinphoneCoreVTable *vtable, const char *config_path, const char *factory_config_path, void *userdata)
Instanciates a LinphoneCore object.
struct _LinphoneCore LinphoneCore
Main object to instanciate and on which to keep a reference.
Definition types.h:493
MS2_DEPRECATED void linphone_core_destroy(LinphoneCore *core)
Destroys a LinphoneCore.
This structure holds all callbacks that the application should implement.
Definition core.h:217
LinphoneCoreCallStateChangedCb call_state_changed
Notifies call state changes.
Definition core.h:220