struct _SipSetupContext;
-/**
- * The LinphoneCall object represents a call issued or received by the LinphoneCore
-**/
-struct _LinphoneCall;
-typedef struct _LinphoneCall LinphoneCall;
-bool_t linphone_call_asked_to_autoanswer(struct _LinphoneCall *call);
-
/**
* Enum representing the direction of a call.
* @ingroup call_logs
const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl);
char * linphone_call_log_to_str(LinphoneCallLog *cl);
+
+/**
+ * The LinphoneCall object represents a call issued or received by the LinphoneCore
+**/
+struct _LinphoneCall;
+typedef struct _LinphoneCall LinphoneCall;
+
+typedef enum _LinphoneCallState{
+ LinphoneCallInit,
+ LinphoneCallPreEstablishing,
+ LinphoneCallRinging,
+ LinphoneCallAVRunning,
+ LinphoneCallPaused,
+ LinphoneCallTerminated
+}LinphoneCallState;
+
+LinphoneCallState linphone_call_get_state(const LinphoneCall *call);
+bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call);
+bool_t linphone_call_paused(LinphoneCall *call);
+const LinphoneAddress * linphone_core_get_current_call_remote_address(struct _LinphoneCore *lc);
+const LinphoneAddress * linphone_call_get_remote_address(const LinphoneCall *call);
+char *linphone_call_get_remote_address_as_string(const LinphoneCall *call);
+void linphone_call_ref(LinphoneCall *call);
+void linphone_call_unref(LinphoneCall *call);
+LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call);
+
+
typedef enum{
LinphoneSPWait,
LinphoneSPDeny,
};
typedef struct _LinphoneGeneralState LinphoneGeneralState;
-/* private: set a new state */
-void gstate_new_state(struct _LinphoneCore *lc, gstate_t new_state, const char *message);
-/*private*/
-void gstate_initialize(struct _LinphoneCore *lc) ;
+
+typedef union _LinphoneGeneralStateContext{
+ LinphoneCall *call;
+ LinphoneProxyConfig *proxy;
+}LinphoneGeneralStateContext;
/**
* @addtogroup initializing
/** Callback prototype */
typedef void (*ShowInterfaceCb)(struct _LinphoneCore *lc);
/** Callback prototype */
-typedef void (*InviteReceivedCb)(struct _LinphoneCore *lc, const char *from);
+typedef void (*InviteReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call);
+/** Callback prototype */
+typedef void (*ByeReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call);
+/** Callback prototype */
+typedef void (*RingingReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call);
+/** Callback prototype */
+typedef void (*ConnectedReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call);
+/** Callback prototype */
+typedef void (*FailureReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call, int error_code);
+/** Callback prototype */
+typedef void (*PausedReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call);
/** Callback prototype */
-typedef void (*ByeReceivedCb)(struct _LinphoneCore *lc, const char *from);
+typedef void (*ResumedReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call);
+/** Callback prototype */
+typedef void (*AckPausedReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call);
+/** Callback prototype */
+typedef void (*AckResumedReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call);
/** Callback prototype */
typedef void (*DisplayStatusCb)(struct _LinphoneCore *lc, const char *message);
/** Callback prototype */
/** Callback prototype */
typedef void (*TextMessageReceived)(struct _LinphoneCore *lc, LinphoneChatRoom *room, const char *from, const char *message);
/** Callback prototype */
-typedef void (*GeneralStateChange)(struct _LinphoneCore *lc, LinphoneGeneralState *gstate);
+typedef void (*GeneralStateChange)(struct _LinphoneCore *lc, LinphoneGeneralState *gstate, LinphoneGeneralStateContext ctx);
/** Callback prototype */
-typedef void (*DtmfReceived)(struct _LinphoneCore* lc, int dtmf);
+typedef void (*DtmfReceived)(struct _LinphoneCore* lc, LinphoneCall *call, int dtmf);
/** Callback prototype */
-typedef void (*ReferReceived)(struct _LinphoneCore *lc, const char *refer_to);
+typedef void (*ReferReceived)(struct _LinphoneCore *lc, LinphoneCall *call, const char *refer_to);
/** Callback prototype */
typedef void (*BuddyInfoUpdated)(struct _LinphoneCore *lc, LinphoneFriend *lf);
ShowInterfaceCb show; /**< Notifies the application that it should show up*/
InviteReceivedCb inv_recv; /**< Notifies incoming calls */
ByeReceivedCb bye_recv; /**< Notify calls terminated by far end*/
+ RingingReceivedCb ringing_recv; /**< Notify that the distant phone is ringing*/
+ ConnectedReceivedCb connected_recv; /**< Notify that the distant phone answered the call*/
+ FailureReceivedCb failure_recv; /**< Notify that the call failed*/
+ PausedReceivedCb paused_recv; /**< Notify that the call has been paused*/
+ ResumedReceivedCb resumed_recv; /**< Notify that the call has been resumed*/
+ AckPausedReceivedCb ack_paused_recv;/**< Notify that the previous command pause sent to the call has been acknowledge*/
+ AckResumedReceivedCb ack_resumed_recv;/**< Notify that the previous command resumed sent to the call has been acknowledge*/
NotifyPresenceReceivedCb notify_presence_recv; /**< Notify received presence events*/
NewUnknownSubscriberCb new_unknown_subscriber; /**< Notify about unknown subscriber */
AuthInfoRequested auth_info_requested; /**< Ask the application some authentication information */
LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url);
-int linphone_core_invite(LinphoneCore *lc, const char *url);
+LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url);
-int linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *addr);
+LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *addr);
-int linphone_core_refer(LinphoneCore *lc, const char *url);
+int linphone_core_refer(LinphoneCore *lc, LinphoneCall *call, const char *url);
bool_t linphone_core_inc_invite_pending(LinphoneCore*lc);
LinphoneCall *linphone_core_get_current_call(LinphoneCore *lc);
-int linphone_core_accept_call(LinphoneCore *lc, const char *url);
+int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call);
+
+int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *call);
+
+int linphone_core_terminate_all_calls(LinphoneCore *lc);
+
+int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call);
+
+int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *call);
-int linphone_core_terminate_call(LinphoneCore *lc, const char *url);
+LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, const char *remote_address);
void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf);
gstate_t linphone_core_get_state(const LinphoneCore *lc, gstate_group_t group);
int linphone_core_get_current_call_duration(const LinphoneCore *lc);
-const LinphoneAddress *linphone_core_get_remote_uri(LinphoneCore *lc);
+const LinphoneAddress *linphone_core_get_remote_address(LinphoneCore *lc);
int linphone_core_get_mtu(const LinphoneCore *lc);
void linphone_core_set_mtu(LinphoneCore *lc, int mtu);
#ifdef __cplusplus
}
#endif
+MSList *linphone_core_get_calls(LinphoneCore *lc);
+void *linphone_call_get_user_pointer(LinphoneCall *call);
+void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
#endif