#include "linphone/core.h"
#include <signal.h>
static bool_t running = TRUE;
static void stop(int signum) {
running = FALSE;
}
static void account_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
vtable.account_registration_state_changed = account_registration_state_changed;
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;
}
void linphone_core_set_default_account(LinphoneCore *core, LinphoneAccount *account)
Sets the default account.
struct _LinphoneAccount LinphoneAccount
Object that represents a Linphone Account.
Definition c-types.h:96
struct _LinphoneAccountParams LinphoneAccountParams
Object that is used to set the different parameters of a LinphoneAccount.
Definition c-types.h:105
LinphoneAccountParams * linphone_account_params_new(LinphoneCore *lc, bool_t use_default_values)
Create a new LinphoneAccountParams object.
LinphoneAccount * linphone_core_create_account(LinphoneCore *core, LinphoneAccountParams *params)
Creates an account using given parameters, see linphone_core_create_account_params().
MS2_DEPRECATED LinphoneStatus linphone_account_params_set_server_addr(LinphoneAccountParams *params, const char *server_address)
Sets the proxy address.
LinphoneStatus linphone_core_add_account(LinphoneCore *core, LinphoneAccount *account)
Adds an account.
LinphoneStatus linphone_account_params_set_identity_address(LinphoneAccountParams *params, const LinphoneAddress *identity)
Sets the user identity as a SIP address.
void linphone_account_params_unref(LinphoneAccountParams *params)
Release a LinphoneAccountParams.
const LinphoneAccountParams * linphone_account_get_params(const LinphoneAccount *account)
Get the LinphoneAccountParams as read-only object.
void linphone_account_params_enable_register(LinphoneAccountParams *params, bool_t enable)
Indicates either or not, REGISTRATION must be issued for this LinphoneAccountParams.
MS2_DEPRECATED const char * linphone_account_params_get_identity(const LinphoneAccountParams *params)
Get the identity of the account params.
void linphone_core_add_auth_info(LinphoneCore *core, const LinphoneAuthInfo *info)
Adds authentication information to the LinphoneCore.
struct _LinphoneAuthInfo LinphoneAuthInfo
Object holding authentication information.
Definition c-types.h:84
void linphone_core_iterate(LinphoneCore *core)
Main loop integration.
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 _LinphoneCoreVTable LinphoneCoreVTable
This structure holds all callbacks that the application should implement.
struct _LinphoneCore LinphoneCore
Main object to instanciate and on which to keep a reference.
Definition types.h:485
MS2_DEPRECATED void linphone_core_destroy(LinphoneCore *core)
Destroys a LinphoneCore.
struct _LinphoneAddress LinphoneAddress
Object that represents a parsed SIP address.
Definition c-types.h:156
const char * linphone_address_get_username(const LinphoneAddress *address)
Returns the username.
LinphoneAddress * linphone_address_new(const char *address)
Constructs a LinphoneAddress object by parsing the user supplied address, given as a string.
void linphone_address_unref(LinphoneAddress *address)
Decrement reference count of LinphoneAddress object.
const char * linphone_address_get_domain(const LinphoneAddress *address)
Returns the domain name.
struct _LinphoneProxyConfig LinphoneProxyConfig
Represents an account configuration to be used by LinphoneCore.
Definition types.h:54
LinphoneStatus linphone_proxy_config_done(LinphoneProxyConfig *proxy_config)
Commits modification made to the proxy configuration.
const char * linphone_registration_state_to_string(LinphoneRegistrationState state)
Human readable version of the LinphoneRegistrationState.
void linphone_proxy_config_edit(LinphoneProxyConfig *proxy_config)
Starts editing a proxy configuration.
LinphoneRegistrationState linphone_proxy_config_get_state(const LinphoneProxyConfig *proxy_config)
Get the registration state of the given proxy config.
enum _LinphoneRegistrationState LinphoneRegistrationState
Describes proxy registration states.
LinphoneProxyConfig * linphone_core_get_default_proxy_config(const LinphoneCore *core)
Returns the default proxy configuration, that is the one used to determine the current identity.
void linphone_proxy_config_enable_register(LinphoneProxyConfig *proxy_config, bool_t enable)
Indicates either or not, REGISTRATION must be issued for this LinphoneProxyConfig.
@ LinphoneRegistrationCleared
Unregistration succeeded.
Definition types.h:457