diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 263277070..1f553066a 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -423,6 +423,18 @@ void linphone_call_log_destroy(LinphoneCallLog *cl){ ms_free(cl); } +/** + * Returns TRUE if the LinphoneCall asked to autoanswer + * +**/ +bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call){ + //return TRUE if the unique(for the moment) incoming call asked to be autoanswered + if(call) + return sal_call_autoanswer_asked(call->op); + else + return FALSE; +} + int linphone_core_get_current_call_duration(const LinphoneCore *lc){ LinphoneCall *call=lc->call; if (call==NULL) return 0; @@ -2371,6 +2383,19 @@ bool_t linphone_core_in_call(const LinphoneCore *lc){ return lc->call!=NULL; } +/** + * Returns The _LinphoneCall struct of the current call if one is in call + * + * @ingroup call_control +**/ +struct _LinphoneCall *linphone_core_get_current_call(LinphoneCore *lc) +{ + if(linphone_core_in_call(lc)) + return lc->call; + else + return NULL; +} + int linphone_core_send_publish(LinphoneCore *lc, LinphoneOnlineStatus presence_mode) { diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index e53022daf..9e2c20d23 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -78,8 +78,15 @@ char *linphone_address_as_string_uri_only(const LinphoneAddress *u); void linphone_address_destroy(LinphoneAddress *u); struct _SipSetupContext; -struct _LinphoneCall; +/** + * 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 @@ -453,12 +460,6 @@ typedef enum _LinphoneWaitingState{ typedef void * (*LinphoneWaitingCallback)(struct _LinphoneCore *lc, void *context, LinphoneWaitingState ws, const char *purpose, float progress); typedef struct _LinphoneCore LinphoneCore; - /*set this field to false if application manage network connection state - * In case of false, network state must be communicate to linphone core with method linphone_core_ - */ - bool_t auto_net_state_mon; - bool_t network_reachable; - int down_ptime; /* THE main API */ @@ -487,6 +488,8 @@ bool_t linphone_core_inc_invite_pending(LinphoneCore*lc); bool_t linphone_core_in_call(const LinphoneCore *lc); +LinphoneCall *linphone_core_get_current_call(LinphoneCore *lc); + int linphone_core_accept_call(LinphoneCore *lc, const char *url); int linphone_core_terminate_call(LinphoneCore *lc, const char *url); diff --git a/coreapi/private.h b/coreapi/private.h index d3da450b9..18ed34c74 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -62,7 +62,7 @@ typedef enum _LCState{ }LCState; -typedef struct _LinphoneCall +struct _LinphoneCall { struct _LinphoneCore *core; SalMediaDescription *localdesc; @@ -78,7 +78,7 @@ typedef struct _LinphoneCall time_t media_start_time; /*time at which it was accepted, media streams established*/ LCState state; bool_t media_pending; -} LinphoneCall; +}; LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to); LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, SalOp *op);