#include "linphone/core.h"
#include <signal.h>
static bool_t running = TRUE;
static void stop(int signum) {
running = FALSE;
}
if (friend_address != NULL) {
printf("New state state [%s] for user id [%s] \n", activity_str, str);
ms_free(str);
}
}
if (friend_address != NULL) {
printf(" [%s] wants to see your status, accepting\n", str);
ms_free(str);
}
linphone_core_add_friend(lc, friend);
}
static void registration_state_changed(struct _LinphoneCore *lc,
const char *message) {
}
int main(int argc, char *argv[]) {
char *dest_friend = NULL;
char *identity = NULL;
char *password = NULL;
if (argc > 1) {
dest_friend = argv[1];
}
if (argc > 2) {
identity = argv[2];
}
if (argc > 3) {
password = argv[3];
}
signal(SIGINT, stop);
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL);
#endif
if (identity != NULL) {
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);
}
do {
ms_usleep(100000);
}
if (dest_friend) {
if (my_friend == NULL) {
printf("bad destination uri for friend [%s]\n", dest_friend);
goto end;
}
my_friend, TRUE);
linphone_core_add_friend(lc, my_friend);
}
while (running) {
ms_usleep(50000);
}
end:
printf("Shutting down...\n");
printf("Exited\n");
return 0;
}
LinphoneAuthInfo * linphone_auth_info_new(const char *username, const char *userid, const char *passwd, const char *ha1, const char *realm, const char *domain)
Safely cast a belle_sip_object_t into LinphoneAuthInfo.
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
LinphoneFriend * linphone_core_create_friend_with_address(LinphoneCore *core, const char *address)
Create a LinphoneFriend from the given address.
const LinphoneAddress * linphone_friend_get_address(const LinphoneFriend *linphone_friend)
Get address of this friend.
struct _LinphoneFriend LinphoneFriend
This object is used to store a SIP address.
Definition types.h:326
LinphonePresenceActivity * linphone_presence_model_get_activity(const LinphonePresenceModel *model)
Gets the first activity of a presence model (there is usually only one).
LinphoneStatus linphone_presence_model_set_basic_status(LinphonePresenceModel *model, LinphonePresenceBasicStatus basic_status)
Sets the basic status of a presence model.
LinphoneStatus linphone_friend_set_inc_subscribe_policy(LinphoneFriend *linphone_friend, LinphoneSubscribePolicy policy)
Configure incoming subscription policy for this friend.
LinphoneStatus linphone_friend_enable_subscribes(LinphoneFriend *linphone_friend, bool_t enable)
Configure LinphoneFriend to subscribe to presence information.
LinphonePresenceModel * linphone_presence_model_unref(LinphonePresenceModel *model)
Decrease the reference count of the LinphonePresenceModel object and destroy it if it reaches 0.
void linphone_friend_done(LinphoneFriend *linphone_friend)
Commits modification made to the friend configuration.
LinphonePresenceModel * linphone_presence_model_new(void)
Creates a default presence model.
char * linphone_presence_activity_to_string(const LinphonePresenceActivity *activity)
Gets the string representation of a presence activity.
void linphone_friend_edit(LinphoneFriend *linphone_friend)
Starts editing a friend configuration.
void linphone_core_set_presence_model(LinphoneCore *core, LinphonePresenceModel *presence)
Set my presence model.
const LinphonePresenceModel * linphone_friend_get_presence_model(const LinphoneFriend *linphone_friend)
Get the presence model of a friend.
struct _LinphonePresenceModel LinphonePresenceModel
Presence model type holding information about the presence of a person.
Definition types.h:1004
struct _LinphonePresenceActivity LinphonePresenceActivity
Presence activity type holding information about a presence activity.
Definition types.h:890
@ LinphonePresenceBasicStatusClosed
This value means that the associated contact element, if any, is unable to accept communication.
Definition types.h:997
@ LinphonePresenceBasicStatusOpen
This value means that the associated contact element, if any, is ready to accept communication.
Definition types.h:994
@ LinphoneSPAccept
Automatically accepts a subscription request.
Definition types.h:1187
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:495
MS2_DEPRECATED void linphone_core_destroy(LinphoneCore *core)
Destroys a LinphoneCore.
char * linphone_address_as_string(const LinphoneAddress *address)
Returns the address as a string.
struct _LinphoneAddress LinphoneAddress
Object that represents a parsed SIP address.
Definition c-types.h:131
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.
LinphoneProxyConfig * linphone_core_create_proxy_config(LinphoneCore *core)
Create a proxy config with default values from Linphone core.
struct _LinphoneProxyConfig LinphoneProxyConfig
Represents an account configuration to be used by LinphoneCore.
Definition types.h:54
const char * linphone_registration_state_to_string(LinphoneRegistrationState state)
Human readable version of the LinphoneRegistrationState.
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.
void linphone_proxy_config_enable_register(LinphoneProxyConfig *proxy_config, bool_t enable)
Indicates either or not, REGISTRATION must be issued for this LinphoneProxyConfig.
void linphone_core_set_default_proxy_config(LinphoneCore *core, LinphoneProxyConfig *config)
Sets the default proxy.
LinphoneStatus linphone_core_add_proxy_config(LinphoneCore *core, LinphoneProxyConfig *config)
Add a proxy configuration.
LinphoneStatus linphone_proxy_config_set_identity_address(LinphoneProxyConfig *proxy_config, LinphoneAddress *identity)
Sets the user identity as a SIP address.
MS2_DEPRECATED const char * linphone_proxy_config_get_identity(const LinphoneProxyConfig *cfg)
LinphoneStatus linphone_proxy_config_set_server_addr(LinphoneProxyConfig *proxy_config, const char *server_address)
Sets the proxy address.
void linphone_proxy_config_enable_publish(LinphoneProxyConfig *proxy_config, bool_t enable)
Indicates either or not, PUBLISH must be issued for this LinphoneProxyConfig.
@ LinphoneRegistrationProgress
Registration is in progress.
Definition types.h:465
This structure holds all callbacks that the application should implement.
Definition core.h:217
LinphoneCoreRegistrationStateChangedCb registration_state_changed
Notifies registration state changes.
Definition core.h:219
LinphoneCoreNewSubscriptionRequestedCb new_subscription_requested
Notify about pending presence subscription request.
Definition core.h:225
LinphoneCoreNotifyPresenceReceivedCb notify_presence_received
Notify received presence events.
Definition core.h:221