/* callhandler.c generated by valac 0.14.2, the Vala compiler
 * generated from callhandler.vala, do not modify */

/*
 * Copyright (C) 2011 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <fsogsm.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <gisicomm.h>
#include <fsobasics.h>
#include <call.h>
#include <freesmartphone.h>
#include <gio/gio.h>


#define FSO_GSM_TYPE_ISI_CALL_HANDLER (fso_gsm_isi_call_handler_get_type ())
#define FSO_GSM_ISI_CALL_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_ISI_CALL_HANDLER, FsoGsmIsiCallHandler))
#define FSO_GSM_ISI_CALL_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FSO_GSM_TYPE_ISI_CALL_HANDLER, FsoGsmIsiCallHandlerClass))
#define FSO_GSM_IS_ISI_CALL_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_ISI_CALL_HANDLER))
#define FSO_GSM_IS_ISI_CALL_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FSO_GSM_TYPE_ISI_CALL_HANDLER))
#define FSO_GSM_ISI_CALL_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FSO_GSM_TYPE_ISI_CALL_HANDLER, FsoGsmIsiCallHandlerClass))

typedef struct _FsoGsmIsiCallHandler FsoGsmIsiCallHandler;
typedef struct _FsoGsmIsiCallHandlerClass FsoGsmIsiCallHandlerClass;
typedef struct _FsoGsmIsiCallHandlerPrivate FsoGsmIsiCallHandlerPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _fso_gsm_call_unref0(var) ((var == NULL) ? NULL : (var = (fso_gsm_call_unref (var), NULL)))
#define _fso_gsm_constants_unref0(var) ((var == NULL) ? NULL : (var = (fso_gsm_constants_unref (var), NULL)))
typedef struct _fso_gsm_isi_call_handler_cancelOutgoingWithIdData fso_gsm_isi_call_handler_cancelOutgoingWithIdData;
typedef struct _fso_gsm_isi_call_handler_rejectIncomingWithIdData fso_gsm_isi_call_handler_rejectIncomingWithIdData;
typedef struct _Block1Data Block1Data;
typedef struct _FsoGsmIsiCallHandlerActivateData FsoGsmIsiCallHandlerActivateData;
typedef struct _Block2Data Block2Data;
typedef struct _FsoGsmIsiCallHandlerInitiateData FsoGsmIsiCallHandlerInitiateData;
typedef struct _FsoGsmIsiCallHandlerHoldData FsoGsmIsiCallHandlerHoldData;
typedef struct _Block3Data Block3Data;
typedef struct _FsoGsmIsiCallHandlerReleaseData FsoGsmIsiCallHandlerReleaseData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _fso_gsm_isi_call_handler_releaseAllData fso_gsm_isi_call_handler_releaseAllData;
typedef struct _fso_gsm_isi_call_handler_listCallsData fso_gsm_isi_call_handler_listCallsData;

struct _FsoGsmIsiCallHandler {
	FsoGsmAbstractCallHandler parent_instance;
	FsoGsmIsiCallHandlerPrivate * priv;
	GeeHashMap* calls;
};

struct _FsoGsmIsiCallHandlerClass {
	FsoGsmAbstractCallHandlerClass parent_class;
};

struct _fso_gsm_isi_call_handler_cancelOutgoingWithIdData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmIsiCallHandler* self;
	gint id;
};

struct _fso_gsm_isi_call_handler_rejectIncomingWithIdData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmIsiCallHandler* self;
	gint id;
};

struct _Block1Data {
	int _ref_count_;
	FsoGsmIsiCallHandler * self;
	gpointer _async_data_;
};

struct _FsoGsmIsiCallHandlerActivateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmIsiCallHandler* self;
	gint id;
	Block1Data* _data1_;
	GIsiCommModemAccess* _tmp0_;
	GIsiCommCall* _tmp1_;
	gint _tmp2_;
};

struct _Block2Data {
	int _ref_count_;
	FsoGsmIsiCallHandler * self;
	gpointer _async_data_;
};

struct _FsoGsmIsiCallHandlerInitiateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmIsiCallHandler* self;
	gchar* number;
	gchar* ctype;
	gint result;
	Block2Data* _data2_;
	const gchar* _tmp0_;
	GError* _tmp1_;
	guint8 ntype;
	FsoGsmConstants* _tmp2_;
	FsoGsmConstants* _tmp3_;
	const gchar* _tmp4_;
	guint8 _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* gsmnumber;
	GIsiCommModemAccess* _tmp8_;
	GIsiCommCall* _tmp9_;
	GError * _inner_error_;
};

struct _FsoGsmIsiCallHandlerHoldData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmIsiCallHandler* self;
	GError* _tmp0_;
	GError * _inner_error_;
};

struct _Block3Data {
	int _ref_count_;
	FsoGsmIsiCallHandler * self;
	gpointer _async_data_;
};

struct _FsoGsmIsiCallHandlerReleaseData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmIsiCallHandler* self;
	gint id;
	Block3Data* _data3_;
	GeeHashMap* _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_;
	GError* _tmp3_;
	GeeHashMap* _tmp4_;
	gint _tmp5_;
	gpointer _tmp6_;
	FsoGsmCall* _tmp7_;
	FreeSmartphoneGSMCallDetail _tmp8_;
	FreeSmartphoneGSMCallStatus _tmp9_;
	gboolean _tmp10_;
	GError* _tmp11_;
	GIsiCommModemAccess* _tmp12_;
	GIsiCommCall* _tmp13_;
	gint _tmp14_;
	GError * _inner_error_;
};

struct _fso_gsm_isi_call_handler_releaseAllData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmIsiCallHandler* self;
	GeeHashMap* _tmp0_;
	GeeCollection* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	GeeIterator* _tmp4_;
	GeeIterator* _tmp5_;
	GeeIterator* _call_it;
	GeeIterator* _tmp6_;
	gboolean _tmp7_;
	GeeIterator* _tmp8_;
	gpointer _tmp9_;
	FsoGsmCall* call;
	FsoGsmCall* _tmp10_;
	FreeSmartphoneGSMCallDetail _tmp11_;
	FreeSmartphoneGSMCallStatus _tmp12_;
	FsoGsmCall* _tmp13_;
	FreeSmartphoneGSMCallDetail _tmp14_;
	gint _tmp15_;
	GError* err;
	GError * _inner_error_;
};

struct _fso_gsm_isi_call_handler_listCallsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmIsiCallHandler* self;
	FreeSmartphoneGSMCallDetail* result;
	gint result_length1;
	FreeSmartphoneGSMCallDetail* _tmp0_;
	FreeSmartphoneGSMCallDetail* ret;
	gint ret_length1;
	gint _ret_size_;
	GeeHashMap* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	GeeCollection* _tmp4_;
	GeeIterator* _tmp5_;
	GeeIterator* _tmp6_;
	GeeIterator* _call_it;
	GeeIterator* _tmp7_;
	gboolean _tmp8_;
	GeeIterator* _tmp9_;
	gpointer _tmp10_;
	FsoGsmCall* call;
	FsoGsmCall* _tmp11_;
	FreeSmartphoneGSMCallDetail _tmp12_;
	FreeSmartphoneGSMCallStatus _tmp13_;
	FreeSmartphoneGSMCallDetail* _tmp14_;
	gint _tmp14__length1;
	FsoGsmCall* _tmp15_;
	FreeSmartphoneGSMCallDetail _tmp16_;
	FreeSmartphoneGSMCallDetail _tmp17_;
	FreeSmartphoneGSMCallDetail* _tmp18_;
	gint _tmp18__length1;
};


static gpointer fso_gsm_isi_call_handler_parent_class = NULL;
extern GIsiCommModemAccess* nokia_isi_isimodem;
static GType fso_gsm_isi_call_handler_type_id = 0;

GType fso_gsm_isi_call_handler_get_type (void) G_GNUC_CONST;
GType fso_gsm_isi_call_handler_register_type (GTypeModule * module);
enum  {
	FSO_GSM_ISI_CALL_HANDLER_DUMMY_PROPERTY
};
FsoGsmIsiCallHandler* fso_gsm_isi_call_handler_new (void);
FsoGsmIsiCallHandler* fso_gsm_isi_call_handler_construct (GType object_type);
static gchar* fso_gsm_isi_call_handler_real_repr (FsoFrameworkAbstractObject* base);
void fso_gsm_isi_call_handler_handleStatusUpdate (FsoGsmIsiCallHandler* self, GIsiCommCallISI_CallStatus* istatus);
static GVariant* _variant_new1 (const gchar* value);
static GVariant* _variant_new2 (gchar* value);
static GVariant* _variant_new3 (const gchar* value);
static GVariant* _variant_new4 (gchar* value);
const gchar* CALL_status_to_string (guint8 self);
static const char* _CALL_status_to_string (guint8 value);
static void fso_gsm_isi_call_handler_real_handleIncomingCall (FsoGsmAbstractCallHandler* base, FsoGsmCallInfo* call_info);
static void fso_gsm_isi_call_handler_real_handleConnectingCall (FsoGsmAbstractCallHandler* base, FsoGsmCallInfo* call_info);
static void fso_gsm_isi_call_handler_real_handleEndingCall (FsoGsmAbstractCallHandler* base, FsoGsmCallInfo* call_info);
static void fso_gsm_isi_call_handler_real_addSupplementaryInformation (FsoGsmAbstractCallHandler* base, const gchar* direction, const gchar* info);
static void fso_gsm_isi_call_handler_real_cancelOutgoingWithId_data_free (gpointer _data);
static void fso_gsm_isi_call_handler_real_cancelOutgoingWithId (FsoGsmAbstractCallHandler* base, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_isi_call_handler_real_cancelOutgoingWithId_co (fso_gsm_isi_call_handler_cancelOutgoingWithIdData* _data_);
static void fso_gsm_isi_call_handler_real_rejectIncomingWithId_data_free (gpointer _data);
static void fso_gsm_isi_call_handler_real_rejectIncomingWithId (FsoGsmAbstractCallHandler* base, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_isi_call_handler_real_rejectIncomingWithId_co (fso_gsm_isi_call_handler_rejectIncomingWithIdData* _data_);
static void fso_gsm_isi_call_handler_real_startTimeoutIfNecessary (FsoGsmAbstractCallHandler* base);
static void fso_gsm_isi_call_handler_real_activate_data_free (gpointer _data);
static void fso_gsm_isi_call_handler_real_activate (FsoGsmAbstractCallHandler* base, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_isi_call_handler_real_activate_co (FsoGsmIsiCallHandlerActivateData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static void __lambda0_ (Block1Data* _data1_, GIsiCommErrorCode _error_);
static void ___lambda0__gisi_comm_void_result_func (GIsiCommErrorCode _error_, gpointer self);
static void fso_gsm_isi_call_handler_real_initiate_data_free (gpointer _data);
static void fso_gsm_isi_call_handler_real_initiate (FsoGsmAbstractCallHandler* base, const gchar* number, const gchar* ctype, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_isi_call_handler_real_initiate_co (FsoGsmIsiCallHandlerInitiateData* _data_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (Block2Data* _data2_);
static void __lambda1_ (Block2Data* _data2_, GIsiCommErrorCode _error_, gint id);
static void ___lambda1__gisi_comm_int_result_func (GIsiCommErrorCode _error_, gint _result_, gpointer self);
static void fso_gsm_isi_call_handler_real_hold_data_free (gpointer _data);
static void fso_gsm_isi_call_handler_real_hold (FsoGsmAbstractCallHandler* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_isi_call_handler_real_hold_co (FsoGsmIsiCallHandlerHoldData* _data_);
static void fso_gsm_isi_call_handler_real_release_data_free (gpointer _data);
static void fso_gsm_isi_call_handler_real_release (FsoGsmAbstractCallHandler* base, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_isi_call_handler_real_release_co (FsoGsmIsiCallHandlerReleaseData* _data_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (Block3Data* _data3_);
static void __lambda2_ (Block3Data* _data3_, GIsiCommErrorCode _error_);
static void ___lambda2__gisi_comm_void_result_func (GIsiCommErrorCode _error_, gpointer self);
static void fso_gsm_isi_call_handler_real_releaseAll_data_free (gpointer _data);
static void fso_gsm_isi_call_handler_real_releaseAll (FsoGsmAbstractCallHandler* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_isi_call_handler_real_releaseAll_co (fso_gsm_isi_call_handler_releaseAllData* _data_);
static void _vala_FreeSmartphoneGSMCallDetail_array_free (FreeSmartphoneGSMCallDetail* array, gint array_length);
static void fso_gsm_isi_call_handler_listCalls_data_free (gpointer _data);
void fso_gsm_isi_call_handler_listCalls (FsoGsmIsiCallHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
FreeSmartphoneGSMCallDetail* fso_gsm_isi_call_handler_listCalls_finish (FsoGsmIsiCallHandler* self, GAsyncResult* _res_, int* result_length1, GError** error);
static gboolean fso_gsm_isi_call_handler_listCalls_co (fso_gsm_isi_call_handler_listCallsData* _data_);
static void _vala_array_add1 (FreeSmartphoneGSMCallDetail** array, int* length, int* size, const FreeSmartphoneGSMCallDetail* value);
static void fso_gsm_isi_call_handler_finalize (GObject* obj);


FsoGsmIsiCallHandler* fso_gsm_isi_call_handler_construct (GType object_type) {
	FsoGsmIsiCallHandler * self = NULL;
	GeeHashMap* _tmp0_;
	self = (FsoGsmIsiCallHandler*) fso_gsm_abstract_call_handler_construct (object_type);
	_tmp0_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, FSO_GSM_TYPE_CALL, (GBoxedCopyFunc) fso_gsm_call_ref, fso_gsm_call_unref, NULL, NULL, NULL);
	_g_object_unref0 (self->calls);
	self->calls = _tmp0_;
	return self;
}


FsoGsmIsiCallHandler* fso_gsm_isi_call_handler_new (void) {
	return fso_gsm_isi_call_handler_construct (FSO_GSM_TYPE_ISI_CALL_HANDLER);
}


static gchar* fso_gsm_isi_call_handler_real_repr (FsoFrameworkAbstractObject* base) {
	FsoGsmIsiCallHandler * self;
	gchar* result = NULL;
	gchar* _tmp0_;
	self = (FsoGsmIsiCallHandler*) base;
	_tmp0_ = g_strdup ("<>");
	result = _tmp0_;
	return result;
}


static const gchar* string_to_string (const gchar* self) {
	const gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}


static GVariant* _variant_new1 (const gchar* value) {
	return g_variant_ref_sink (g_variant_new_string (value));
}


static GVariant* _variant_new2 (gchar* value) {
	return g_variant_ref_sink (g_variant_new_string (value));
}


static GVariant* _variant_new3 (const gchar* value) {
	return g_variant_ref_sink (g_variant_new_string (value));
}


static GVariant* _variant_new4 (gchar* value) {
	return g_variant_ref_sink (g_variant_new_string (value));
}


static const char* _CALL_status_to_string (guint8 value) {
	switch (value) {
		case CALL_STATUS_IDLE:
		return "CALL_STATUS_IDLE";
		case CALL_STATUS_CREATE:
		return "CALL_STATUS_CREATE";
		case CALL_STATUS_COMING:
		return "CALL_STATUS_COMING";
		case CALL_STATUS_PROCEEDING:
		return "CALL_STATUS_PROCEEDING";
		case CALL_STATUS_MO_ALERTING:
		return "CALL_STATUS_MO_ALERTING";
		case CALL_STATUS_MT_ALERTING:
		return "CALL_STATUS_MT_ALERTING";
		case CALL_STATUS_WAITING:
		return "CALL_STATUS_WAITING";
		case CALL_STATUS_ANSWERED:
		return "CALL_STATUS_ANSWERED";
		case CALL_STATUS_ACTIVE:
		return "CALL_STATUS_ACTIVE";
		case CALL_STATUS_MO_RELEASE:
		return "CALL_STATUS_MO_RELEASE";
		case CALL_STATUS_MT_RELEASE:
		return "CALL_STATUS_MT_RELEASE";
		case CALL_STATUS_HOLD_INITIATED:
		return "CALL_STATUS_HOLD_INITIATED";
		case CALL_STATUS_HOLD:
		return "CALL_STATUS_HOLD";
		case CALL_STATUS_RETRIEVE_INITIATED:
		return "CALL_STATUS_RETRIEVE_INITIATED";
		case CALL_STATUS_RECONNECT_PENDING:
		return "CALL_STATUS_RECONNECT_PENDING";
		case CALL_STATUS_TERMINATED:
		return "CALL_STATUS_TERMINATED";
		case CALL_STATUS_SWAP_INITIATED:
		return "CALL_STATUS_SWAP_INITIATED";
	}
	return NULL;
}


void fso_gsm_isi_call_handler_handleStatusUpdate (FsoGsmIsiCallHandler* self, GIsiCommCallISI_CallStatus* istatus) {
	FsoGsmCall* call = NULL;
	GeeHashMap* _tmp0_;
	GIsiCommCallISI_CallStatus _tmp1_;
	guint8 _tmp2_;
	gboolean _tmp3_ = FALSE;
	GIsiCommCallISI_CallStatus _tmp31_;
	guint8 _tmp32_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (istatus != NULL);
	_tmp0_ = self->calls;
	_tmp1_ = *istatus;
	_tmp2_ = _tmp1_.id;
	_tmp3_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, GINT_TO_POINTER ((gint) _tmp2_));
	if (_tmp3_) {
		FsoFrameworkLogger* _tmp4_;
		GIsiCommCallISI_CallStatus _tmp5_;
		guint8 _tmp6_;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_;
		gboolean _tmp11_ = FALSE;
		GeeHashMap* _tmp12_;
		GIsiCommCallISI_CallStatus _tmp13_;
		guint8 _tmp14_;
		gpointer _tmp15_ = NULL;
		_tmp4_ = ((FsoFrameworkAbstractObject*) self)->logger;
		_tmp5_ = *istatus;
		_tmp6_ = _tmp5_.id;
		_tmp7_ = g_strdup_printf ("%hhu", _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strconcat ("existing call with id ", _tmp8_, NULL);
		_tmp10_ = _tmp9_;
		_tmp11_ = fso_framework_logger_debug (_tmp4_, _tmp10_);
		g_assert (_tmp11_);
		_g_free0 (_tmp10_);
		_g_free0 (_tmp8_);
		_tmp12_ = self->calls;
		_tmp13_ = *istatus;
		_tmp14_ = _tmp13_.id;
		_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp12_, GINT_TO_POINTER ((gint) _tmp14_));
		_fso_gsm_call_unref0 (call);
		call = (FsoGsmCall*) _tmp15_;
	} else {
		FsoFrameworkLogger* _tmp16_;
		GIsiCommCallISI_CallStatus _tmp17_;
		guint8 _tmp18_;
		gchar* _tmp19_ = NULL;
		gchar* _tmp20_;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_;
		gboolean _tmp23_ = FALSE;
		GIsiCommCallISI_CallStatus _tmp24_;
		guint8 _tmp25_;
		FsoGsmCall* _tmp26_;
		GeeHashMap* _tmp27_;
		GIsiCommCallISI_CallStatus _tmp28_;
		guint8 _tmp29_;
		FsoGsmCall* _tmp30_;
		_tmp16_ = ((FsoFrameworkAbstractObject*) self)->logger;
		_tmp17_ = *istatus;
		_tmp18_ = _tmp17_.id;
		_tmp19_ = g_strdup_printf ("%hhu", _tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = g_strconcat ("new call with id ", _tmp20_, NULL);
		_tmp22_ = _tmp21_;
		_tmp23_ = fso_framework_logger_debug (_tmp16_, _tmp22_);
		g_assert (_tmp23_);
		_g_free0 (_tmp22_);
		_g_free0 (_tmp20_);
		_tmp24_ = *istatus;
		_tmp25_ = _tmp24_.id;
		_tmp26_ = fso_gsm_call_new_newFromId ((gint) _tmp25_);
		_fso_gsm_call_unref0 (call);
		call = _tmp26_;
		_tmp27_ = self->calls;
		_tmp28_ = *istatus;
		_tmp29_ = _tmp28_.id;
		_tmp30_ = call;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp27_, GINT_TO_POINTER ((gint) _tmp29_), _tmp30_);
	}
	_tmp31_ = *istatus;
	_tmp32_ = _tmp31_.status;
	switch (_tmp32_) {
		case CALL_STATUS_COMING:
		{
			FsoFrameworkLogger* _tmp33_;
			GIsiCommCallISI_CallStatus _tmp34_;
			guint8 _tmp35_;
			gchar* _tmp36_ = NULL;
			gchar* _tmp37_;
			GIsiCommCallISI_CallStatus _tmp38_;
			const gchar* _tmp39_;
			const gchar* _tmp40_ = NULL;
			gchar* _tmp41_ = NULL;
			gchar* _tmp42_;
			gboolean _tmp43_ = FALSE;
			FsoGsmCall* _tmp44_;
			FreeSmartphoneGSMCallDetail _tmp45_;
			GHashTable* _tmp46_;
			gchar* _tmp47_;
			GVariant* _tmp48_;
			FsoGsmCall* _tmp49_;
			FreeSmartphoneGSMCallDetail _tmp50_;
			GHashTable* _tmp51_;
			gchar* _tmp52_;
			FsoGsmConstants* _tmp53_ = NULL;
			FsoGsmConstants* _tmp54_;
			GIsiCommCallISI_CallStatus _tmp55_;
			const gchar* _tmp56_;
			GIsiCommCallISI_CallStatus _tmp57_;
			guint8 _tmp58_;
			gchar* _tmp59_ = NULL;
			GVariant* _tmp60_;
			FsoGsmCall* _tmp61_;
			_tmp33_ = ((FsoFrameworkAbstractObject*) self)->logger;
			_tmp34_ = *istatus;
			_tmp35_ = _tmp34_.id;
			_tmp36_ = g_strdup_printf ("%hhu", _tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = *istatus;
			_tmp39_ = _tmp38_.number;
			_tmp40_ = string_to_string (_tmp39_);
			_tmp41_ = g_strconcat ("incoming call with id ", _tmp37_, " from ", _tmp40_, NULL);
			_tmp42_ = _tmp41_;
			_tmp43_ = fso_framework_logger_debug (_tmp33_, _tmp42_);
			g_assert (_tmp43_);
			_g_free0 (_tmp42_);
			_g_free0 (_tmp37_);
			_tmp44_ = call;
			_tmp45_ = _tmp44_->detail;
			_tmp46_ = _tmp45_.properties;
			_tmp47_ = g_strdup ("direction");
			_tmp48_ = _variant_new1 ("incoming");
			g_hash_table_insert (_tmp46_, _tmp47_, _tmp48_);
			_tmp49_ = call;
			_tmp50_ = _tmp49_->detail;
			_tmp51_ = _tmp50_.properties;
			_tmp52_ = g_strdup ("peer");
			_tmp53_ = fso_gsm_constants_instance ();
			_tmp54_ = _tmp53_;
			_tmp55_ = *istatus;
			_tmp56_ = _tmp55_.number;
			_tmp57_ = *istatus;
			_tmp58_ = _tmp57_.ntype;
			_tmp59_ = fso_gsm_constants_phonenumberTupleToString (_tmp54_, _tmp56_, (gint) _tmp58_);
			_tmp60_ = _variant_new2 (_tmp59_);
			g_hash_table_insert (_tmp51_, _tmp52_, _tmp60_);
			_fso_gsm_constants_unref0 (_tmp54_);
			_tmp61_ = call;
			fso_gsm_call_update_status (_tmp61_, FREE_SMARTPHONE_GSM_CALL_STATUS_INCOMING);
			break;
		}
		case CALL_STATUS_CREATE:
		{
			FsoFrameworkLogger* _tmp62_;
			GIsiCommCallISI_CallStatus _tmp63_;
			guint8 _tmp64_;
			gchar* _tmp65_ = NULL;
			gchar* _tmp66_;
			GIsiCommCallISI_CallStatus _tmp67_;
			const gchar* _tmp68_;
			const gchar* _tmp69_ = NULL;
			gchar* _tmp70_ = NULL;
			gchar* _tmp71_;
			gboolean _tmp72_ = FALSE;
			FsoGsmCall* _tmp73_;
			FreeSmartphoneGSMCallDetail _tmp74_;
			GHashTable* _tmp75_;
			gchar* _tmp76_;
			GVariant* _tmp77_;
			FsoGsmCall* _tmp78_;
			FreeSmartphoneGSMCallDetail _tmp79_;
			GHashTable* _tmp80_;
			gchar* _tmp81_;
			FsoGsmConstants* _tmp82_ = NULL;
			FsoGsmConstants* _tmp83_;
			GIsiCommCallISI_CallStatus _tmp84_;
			const gchar* _tmp85_;
			GIsiCommCallISI_CallStatus _tmp86_;
			guint8 _tmp87_;
			gchar* _tmp88_ = NULL;
			GVariant* _tmp89_;
			FsoGsmCall* _tmp90_;
			_tmp62_ = ((FsoFrameworkAbstractObject*) self)->logger;
			_tmp63_ = *istatus;
			_tmp64_ = _tmp63_.id;
			_tmp65_ = g_strdup_printf ("%hhu", _tmp64_);
			_tmp66_ = _tmp65_;
			_tmp67_ = *istatus;
			_tmp68_ = _tmp67_.number;
			_tmp69_ = string_to_string (_tmp68_);
			_tmp70_ = g_strconcat ("outgoing call with id ", _tmp66_, " to ", _tmp69_, NULL);
			_tmp71_ = _tmp70_;
			_tmp72_ = fso_framework_logger_debug (_tmp62_, _tmp71_);
			g_assert (_tmp72_);
			_g_free0 (_tmp71_);
			_g_free0 (_tmp66_);
			_tmp73_ = call;
			_tmp74_ = _tmp73_->detail;
			_tmp75_ = _tmp74_.properties;
			_tmp76_ = g_strdup ("direction");
			_tmp77_ = _variant_new3 ("outgoing");
			g_hash_table_insert (_tmp75_, _tmp76_, _tmp77_);
			_tmp78_ = call;
			_tmp79_ = _tmp78_->detail;
			_tmp80_ = _tmp79_.properties;
			_tmp81_ = g_strdup ("peer");
			_tmp82_ = fso_gsm_constants_instance ();
			_tmp83_ = _tmp82_;
			_tmp84_ = *istatus;
			_tmp85_ = _tmp84_.number;
			_tmp86_ = *istatus;
			_tmp87_ = _tmp86_.ntype;
			_tmp88_ = fso_gsm_constants_phonenumberTupleToString (_tmp83_, _tmp85_, (gint) _tmp87_);
			_tmp89_ = _variant_new4 (_tmp88_);
			g_hash_table_insert (_tmp80_, _tmp81_, _tmp89_);
			_fso_gsm_constants_unref0 (_tmp83_);
			_tmp90_ = call;
			fso_gsm_call_update_status (_tmp90_, FREE_SMARTPHONE_GSM_CALL_STATUS_OUTGOING);
			break;
		}
		case CALL_STATUS_ACTIVE:
		{
			FsoFrameworkLogger* _tmp91_;
			GIsiCommCallISI_CallStatus _tmp92_;
			guint8 _tmp93_;
			gchar* _tmp94_ = NULL;
			gchar* _tmp95_;
			gchar* _tmp96_ = NULL;
			gchar* _tmp97_;
			gboolean _tmp98_ = FALSE;
			FsoGsmCall* _tmp99_;
			_tmp91_ = ((FsoFrameworkAbstractObject*) self)->logger;
			_tmp92_ = *istatus;
			_tmp93_ = _tmp92_.id;
			_tmp94_ = g_strdup_printf ("%hhu", _tmp93_);
			_tmp95_ = _tmp94_;
			_tmp96_ = g_strconcat ("call with id ", _tmp95_, " is active now", NULL);
			_tmp97_ = _tmp96_;
			_tmp98_ = fso_framework_logger_debug (_tmp91_, _tmp97_);
			g_assert (_tmp98_);
			_g_free0 (_tmp97_);
			_g_free0 (_tmp95_);
			_tmp99_ = call;
			fso_gsm_call_update_status (_tmp99_, FREE_SMARTPHONE_GSM_CALL_STATUS_ACTIVE);
			break;
		}
		case CALL_STATUS_HOLD:
		{
			FsoFrameworkLogger* _tmp100_;
			GIsiCommCallISI_CallStatus _tmp101_;
			guint8 _tmp102_;
			gchar* _tmp103_ = NULL;
			gchar* _tmp104_;
			gchar* _tmp105_ = NULL;
			gchar* _tmp106_;
			gboolean _tmp107_ = FALSE;
			FsoGsmCall* _tmp108_;
			_tmp100_ = ((FsoFrameworkAbstractObject*) self)->logger;
			_tmp101_ = *istatus;
			_tmp102_ = _tmp101_.id;
			_tmp103_ = g_strdup_printf ("%hhu", _tmp102_);
			_tmp104_ = _tmp103_;
			_tmp105_ = g_strconcat ("call with id ", _tmp104_, " is on hold now", NULL);
			_tmp106_ = _tmp105_;
			_tmp107_ = fso_framework_logger_debug (_tmp100_, _tmp106_);
			g_assert (_tmp107_);
			_g_free0 (_tmp106_);
			_g_free0 (_tmp104_);
			_tmp108_ = call;
			fso_gsm_call_update_status (_tmp108_, FREE_SMARTPHONE_GSM_CALL_STATUS_HELD);
			break;
		}
		case CALL_STATUS_IDLE:
		{
			FsoFrameworkLogger* _tmp109_;
			GIsiCommCallISI_CallStatus _tmp110_;
			guint8 _tmp111_;
			gchar* _tmp112_ = NULL;
			gchar* _tmp113_;
			gchar* _tmp114_ = NULL;
			gchar* _tmp115_;
			gboolean _tmp116_ = FALSE;
			FsoGsmCall* _tmp117_;
			_tmp109_ = ((FsoFrameworkAbstractObject*) self)->logger;
			_tmp110_ = *istatus;
			_tmp111_ = _tmp110_.id;
			_tmp112_ = g_strdup_printf ("%hhu", _tmp111_);
			_tmp113_ = _tmp112_;
			_tmp114_ = g_strconcat ("call with id ", _tmp113_, " is released", NULL);
			_tmp115_ = _tmp114_;
			_tmp116_ = fso_framework_logger_debug (_tmp109_, _tmp115_);
			g_assert (_tmp116_);
			_g_free0 (_tmp115_);
			_g_free0 (_tmp113_);
			_tmp117_ = call;
			fso_gsm_call_update_status (_tmp117_, FREE_SMARTPHONE_GSM_CALL_STATUS_RELEASE);
			break;
		}
		default:
		{
			FsoFrameworkLogger* _tmp118_;
			GIsiCommCallISI_CallStatus _tmp119_;
			guint8 _tmp120_;
			const gchar* _tmp121_ = NULL;
			GIsiCommCallISI_CallStatus _tmp122_;
			guint8 _tmp123_;
			gchar* _tmp124_ = NULL;
			gchar* _tmp125_;
			gchar* _tmp126_ = NULL;
			gchar* _tmp127_;
			gboolean _tmp128_ = FALSE;
			_tmp118_ = ((FsoFrameworkAbstractObject*) self)->logger;
			_tmp119_ = *istatus;
			_tmp120_ = _tmp119_.status;
			_tmp121_ = _CALL_status_to_string (_tmp120_);
			_tmp122_ = *istatus;
			_tmp123_ = _tmp122_.id;
			_tmp124_ = g_strdup_printf ("%hhu", _tmp123_);
			_tmp125_ = _tmp124_;
			_tmp126_ = g_strconcat ("ignoring callstatus ", _tmp121_, " for call with id ", _tmp125_, NULL);
			_tmp127_ = _tmp126_;
			_tmp128_ = fso_framework_logger_debug (_tmp118_, _tmp127_);
			g_assert (_tmp128_);
			_g_free0 (_tmp127_);
			_g_free0 (_tmp125_);
			break;
		}
	}
	_fso_gsm_call_unref0 (call);
}


static void fso_gsm_isi_call_handler_real_handleIncomingCall (FsoGsmAbstractCallHandler* base, FsoGsmCallInfo* call_info) {
	FsoGsmIsiCallHandler * self;
	self = (FsoGsmIsiCallHandler*) base;
	g_return_if_fail (call_info != NULL);
}


static void fso_gsm_isi_call_handler_real_handleConnectingCall (FsoGsmAbstractCallHandler* base, FsoGsmCallInfo* call_info) {
	FsoGsmIsiCallHandler * self;
	self = (FsoGsmIsiCallHandler*) base;
	g_return_if_fail (call_info != NULL);
}


static void fso_gsm_isi_call_handler_real_handleEndingCall (FsoGsmAbstractCallHandler* base, FsoGsmCallInfo* call_info) {
	FsoGsmIsiCallHandler * self;
	self = (FsoGsmIsiCallHandler*) base;
	g_return_if_fail (call_info != NULL);
}


static void fso_gsm_isi_call_handler_real_addSupplementaryInformation (FsoGsmAbstractCallHandler* base, const gchar* direction, const gchar* info) {
	FsoGsmIsiCallHandler * self;
	self = (FsoGsmIsiCallHandler*) base;
	g_return_if_fail (direction != NULL);
	g_return_if_fail (info != NULL);
}


static void fso_gsm_isi_call_handler_real_cancelOutgoingWithId_data_free (gpointer _data) {
	fso_gsm_isi_call_handler_cancelOutgoingWithIdData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (fso_gsm_isi_call_handler_cancelOutgoingWithIdData, _data_);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void fso_gsm_isi_call_handler_real_cancelOutgoingWithId (FsoGsmAbstractCallHandler* base, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmIsiCallHandler * self;
	fso_gsm_isi_call_handler_cancelOutgoingWithIdData* _data_;
	FsoGsmIsiCallHandler* _tmp0_;
	gint _tmp1_;
	self = (FsoGsmIsiCallHandler*) base;
	_data_ = g_slice_new0 (fso_gsm_isi_call_handler_cancelOutgoingWithIdData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_isi_call_handler_real_cancelOutgoingWithId);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_isi_call_handler_real_cancelOutgoingWithId_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = id;
	_data_->id = _tmp1_;
	fso_gsm_isi_call_handler_real_cancelOutgoingWithId_co (_data_);
}


static void fso_gsm_isi_call_handler_real_cancelOutgoingWithId_finish (FsoGsmAbstractCallHandler* base, GAsyncResult* _res_, GError** error) {
	fso_gsm_isi_call_handler_cancelOutgoingWithIdData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean fso_gsm_isi_call_handler_real_cancelOutgoingWithId_co (fso_gsm_isi_call_handler_cancelOutgoingWithIdData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void fso_gsm_isi_call_handler_real_rejectIncomingWithId_data_free (gpointer _data) {
	fso_gsm_isi_call_handler_rejectIncomingWithIdData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (fso_gsm_isi_call_handler_rejectIncomingWithIdData, _data_);
}


static void fso_gsm_isi_call_handler_real_rejectIncomingWithId (FsoGsmAbstractCallHandler* base, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmIsiCallHandler * self;
	fso_gsm_isi_call_handler_rejectIncomingWithIdData* _data_;
	FsoGsmIsiCallHandler* _tmp0_;
	gint _tmp1_;
	self = (FsoGsmIsiCallHandler*) base;
	_data_ = g_slice_new0 (fso_gsm_isi_call_handler_rejectIncomingWithIdData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_isi_call_handler_real_rejectIncomingWithId);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_isi_call_handler_real_rejectIncomingWithId_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = id;
	_data_->id = _tmp1_;
	fso_gsm_isi_call_handler_real_rejectIncomingWithId_co (_data_);
}


static void fso_gsm_isi_call_handler_real_rejectIncomingWithId_finish (FsoGsmAbstractCallHandler* base, GAsyncResult* _res_, GError** error) {
	fso_gsm_isi_call_handler_rejectIncomingWithIdData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean fso_gsm_isi_call_handler_real_rejectIncomingWithId_co (fso_gsm_isi_call_handler_rejectIncomingWithIdData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void fso_gsm_isi_call_handler_real_startTimeoutIfNecessary (FsoGsmAbstractCallHandler* base) {
	FsoGsmIsiCallHandler * self;
	self = (FsoGsmIsiCallHandler*) base;
}


static void fso_gsm_isi_call_handler_real_activate_data_free (gpointer _data) {
	FsoGsmIsiCallHandlerActivateData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FsoGsmIsiCallHandlerActivateData, _data_);
}


static void fso_gsm_isi_call_handler_real_activate (FsoGsmAbstractCallHandler* base, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmIsiCallHandler * self;
	FsoGsmIsiCallHandlerActivateData* _data_;
	FsoGsmIsiCallHandler* _tmp0_;
	gint _tmp1_;
	self = (FsoGsmIsiCallHandler*) base;
	_data_ = g_slice_new0 (FsoGsmIsiCallHandlerActivateData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_isi_call_handler_real_activate);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_isi_call_handler_real_activate_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = id;
	_data_->id = _tmp1_;
	fso_gsm_isi_call_handler_real_activate_co (_data_);
}


static void fso_gsm_isi_call_handler_real_activate_finish (FsoGsmAbstractCallHandler* base, GAsyncResult* _res_, GError** error) {
	FsoGsmIsiCallHandlerActivateData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (Block1Data* _data1_) {
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_object_unref0 (_data1_->self);
		g_slice_free (Block1Data, _data1_);
	}
}


static void __lambda0_ (Block1Data* _data1_, GIsiCommErrorCode _error_) {
	FsoGsmIsiCallHandler * self;
	GIsiCommErrorCode _tmp0_;
	GError * _inner_error_ = NULL;
	self = _data1_->self;
	_tmp0_ = _error_;
	if (_tmp0_ == GISI_COMM_ERROR_CODE_OK) {
		fso_gsm_isi_call_handler_real_activate_co (_data1_->_async_data_);
	} else {
		GError* _tmp1_;
		_tmp1_ = g_error_new_literal (FREE_SMARTPHONE_GSM_ERROR, FREE_SMARTPHONE_GSM_ERROR_DEVICE_FAILED, "Unknown ISI Error");
		_inner_error_ = _tmp1_;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ___lambda0__gisi_comm_void_result_func (GIsiCommErrorCode _error_, gpointer self) {
	__lambda0_ (self, _error_);
}


static gboolean fso_gsm_isi_call_handler_real_activate_co (FsoGsmIsiCallHandlerActivateData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data1_ = g_slice_new0 (Block1Data);
	_data_->_data1_->_ref_count_ = 1;
	_data_->_data1_->self = g_object_ref (_data_->self);
	_data_->_data1_->_async_data_ = _data_;
	_data_->_tmp0_ = nokia_isi_isimodem;
	_data_->_tmp1_ = _data_->_tmp0_->call;
	_data_->_tmp2_ = _data_->id;
	gisi_comm_call_answerVoiceCall (_data_->_tmp1_, (guint8) _data_->_tmp2_, ___lambda0__gisi_comm_void_result_func, _data_->_data1_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	block1_data_unref (_data_->_data1_);
	_data_->_data1_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void fso_gsm_isi_call_handler_real_initiate_data_free (gpointer _data) {
	FsoGsmIsiCallHandlerInitiateData* _data_;
	_data_ = _data;
	_g_free0 (_data_->number);
	_g_free0 (_data_->ctype);
	_g_object_unref0 (_data_->self);
	g_slice_free (FsoGsmIsiCallHandlerInitiateData, _data_);
}


static void fso_gsm_isi_call_handler_real_initiate (FsoGsmAbstractCallHandler* base, const gchar* number, const gchar* ctype, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmIsiCallHandler * self;
	FsoGsmIsiCallHandlerInitiateData* _data_;
	FsoGsmIsiCallHandler* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	self = (FsoGsmIsiCallHandler*) base;
	_data_ = g_slice_new0 (FsoGsmIsiCallHandlerInitiateData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_isi_call_handler_real_initiate);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_isi_call_handler_real_initiate_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = number;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->number = _tmp2_;
	_tmp3_ = ctype;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->ctype = _tmp4_;
	fso_gsm_isi_call_handler_real_initiate_co (_data_);
}


static gint fso_gsm_isi_call_handler_real_initiate_finish (FsoGsmAbstractCallHandler* base, GAsyncResult* _res_, GError** error) {
	gint result;
	FsoGsmIsiCallHandlerInitiateData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return 0;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	return result;
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (Block2Data* _data2_) {
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		_g_object_unref0 (_data2_->self);
		g_slice_free (Block2Data, _data2_);
	}
}


static void __lambda1_ (Block2Data* _data2_, GIsiCommErrorCode _error_, gint id) {
	FsoGsmIsiCallHandler * self;
	GIsiCommErrorCode _tmp0_;
	GError * _inner_error_ = NULL;
	self = _data2_->self;
	_tmp0_ = _error_;
	if (_tmp0_ == GISI_COMM_ERROR_CODE_OK) {
		fso_gsm_isi_call_handler_real_initiate_co (_data2_->_async_data_);
	} else {
		GError* _tmp1_;
		_tmp1_ = g_error_new_literal (FREE_SMARTPHONE_GSM_ERROR, FREE_SMARTPHONE_GSM_ERROR_DEVICE_FAILED, "Unknown ISI Error");
		_inner_error_ = _tmp1_;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ___lambda1__gisi_comm_int_result_func (GIsiCommErrorCode _error_, gint _result_, gpointer self) {
	__lambda1_ (self, _error_, _result_);
}


static gboolean fso_gsm_isi_call_handler_real_initiate_co (FsoGsmIsiCallHandlerInitiateData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data2_ = g_slice_new0 (Block2Data);
	_data_->_data2_->_ref_count_ = 1;
	_data_->_data2_->self = g_object_ref (_data_->self);
	_data_->_data2_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->ctype;
	if (g_strcmp0 (_data_->_tmp0_, "voice") != 0) {
		_data_->_tmp1_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INVALID_PARAMETER, "This modem only supports voice calls");
		_data_->_inner_error_ = _data_->_tmp1_;
		if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = fso_gsm_constants_instance ();
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = _data_->number;
	_data_->_tmp5_ = 0U;
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = fso_gsm_constants_phonenumberStringToRealTuple (_data_->_tmp3_, _data_->_tmp4_, &_data_->_tmp5_);
	_data_->ntype = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->_tmp6_;
	_fso_gsm_constants_unref0 (_data_->_tmp3_);
	_data_->gsmnumber = _data_->_tmp7_;
	_data_->_tmp8_ = nokia_isi_isimodem;
	_data_->_tmp9_ = _data_->_tmp8_->call;
	gisi_comm_call_initiateVoiceCall (_data_->_tmp9_, _data_->gsmnumber, _data_->ntype, CALL_GSM_PRESENTATION_DEFAULT, ___lambda1__gisi_comm_int_result_func, _data_->_data2_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->result = 0;
	_g_free0 (_data_->gsmnumber);
	block2_data_unref (_data_->_data2_);
	_data_->_data2_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->gsmnumber);
	block2_data_unref (_data_->_data2_);
	_data_->_data2_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void fso_gsm_isi_call_handler_real_hold_data_free (gpointer _data) {
	FsoGsmIsiCallHandlerHoldData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FsoGsmIsiCallHandlerHoldData, _data_);
}


static void fso_gsm_isi_call_handler_real_hold (FsoGsmAbstractCallHandler* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmIsiCallHandler * self;
	FsoGsmIsiCallHandlerHoldData* _data_;
	FsoGsmIsiCallHandler* _tmp0_;
	self = (FsoGsmIsiCallHandler*) base;
	_data_ = g_slice_new0 (FsoGsmIsiCallHandlerHoldData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_isi_call_handler_real_hold);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_isi_call_handler_real_hold_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	fso_gsm_isi_call_handler_real_hold_co (_data_);
}


static void fso_gsm_isi_call_handler_real_hold_finish (FsoGsmAbstractCallHandler* base, GAsyncResult* _res_, GError** error) {
	FsoGsmIsiCallHandlerHoldData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean fso_gsm_isi_call_handler_real_hold_co (FsoGsmIsiCallHandlerHoldData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INTERNAL_ERROR, "Not yet implemented");
	_data_->_inner_error_ = _data_->_tmp0_;
	if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void fso_gsm_isi_call_handler_real_release_data_free (gpointer _data) {
	FsoGsmIsiCallHandlerReleaseData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FsoGsmIsiCallHandlerReleaseData, _data_);
}


static void fso_gsm_isi_call_handler_real_release (FsoGsmAbstractCallHandler* base, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmIsiCallHandler * self;
	FsoGsmIsiCallHandlerReleaseData* _data_;
	FsoGsmIsiCallHandler* _tmp0_;
	gint _tmp1_;
	self = (FsoGsmIsiCallHandler*) base;
	_data_ = g_slice_new0 (FsoGsmIsiCallHandlerReleaseData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_isi_call_handler_real_release);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_isi_call_handler_real_release_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = id;
	_data_->id = _tmp1_;
	fso_gsm_isi_call_handler_real_release_co (_data_);
}


static void fso_gsm_isi_call_handler_real_release_finish (FsoGsmAbstractCallHandler* base, GAsyncResult* _res_, GError** error) {
	FsoGsmIsiCallHandlerReleaseData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}


static void block3_data_unref (Block3Data* _data3_) {
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		_g_object_unref0 (_data3_->self);
		g_slice_free (Block3Data, _data3_);
	}
}


static void __lambda2_ (Block3Data* _data3_, GIsiCommErrorCode _error_) {
	FsoGsmIsiCallHandler * self;
	GIsiCommErrorCode _tmp0_;
	GError * _inner_error_ = NULL;
	self = _data3_->self;
	_tmp0_ = _error_;
	if (_tmp0_ == GISI_COMM_ERROR_CODE_OK) {
		fso_gsm_isi_call_handler_real_release_co (_data3_->_async_data_);
	} else {
		GError* _tmp1_;
		_tmp1_ = g_error_new_literal (FREE_SMARTPHONE_GSM_ERROR, FREE_SMARTPHONE_GSM_ERROR_DEVICE_FAILED, "Unknown ISI Error");
		_inner_error_ = _tmp1_;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ___lambda2__gisi_comm_void_result_func (GIsiCommErrorCode _error_, gpointer self) {
	__lambda2_ (self, _error_);
}


static gboolean fso_gsm_isi_call_handler_real_release_co (FsoGsmIsiCallHandlerReleaseData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data3_ = g_slice_new0 (Block3Data);
	_data_->_data3_->_ref_count_ = 1;
	_data_->_data3_->self = g_object_ref (_data_->self);
	_data_->_data3_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->calls;
	_data_->_tmp1_ = _data_->id;
	_data_->_tmp2_ = FALSE;
	_data_->_tmp2_ = gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp0_, GINT_TO_POINTER (_data_->_tmp1_));
	if (!_data_->_tmp2_) {
		_data_->_tmp3_ = g_error_new_literal (FREE_SMARTPHONE_GSM_ERROR, FREE_SMARTPHONE_GSM_ERROR_CALL_NOT_FOUND, "Call with specified id is not available");
		_data_->_inner_error_ = _data_->_tmp3_;
		if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			block3_data_unref (_data_->_data3_);
			_data_->_data3_ = NULL;
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			block3_data_unref (_data_->_data3_);
			_data_->_data3_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp4_ = _data_->self->calls;
	_data_->_tmp5_ = _data_->id;
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp4_, GINT_TO_POINTER (_data_->_tmp5_));
	_data_->_tmp7_ = (FsoGsmCall*) _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_->detail;
	_data_->_tmp9_ = _data_->_tmp8_.status;
	_data_->_tmp10_ = _data_->_tmp9_ == FREE_SMARTPHONE_GSM_CALL_STATUS_RELEASE;
	_fso_gsm_call_unref0 (_data_->_tmp7_);
	if (_data_->_tmp10_) {
		_data_->_tmp11_ = g_error_new_literal (FREE_SMARTPHONE_GSM_ERROR, FREE_SMARTPHONE_GSM_ERROR_CALL_NOT_FOUND, "No active call with that id found");
		_data_->_inner_error_ = _data_->_tmp11_;
		if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			block3_data_unref (_data_->_data3_);
			_data_->_data3_ = NULL;
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			block3_data_unref (_data_->_data3_);
			_data_->_data3_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp12_ = nokia_isi_isimodem;
	_data_->_tmp13_ = _data_->_tmp12_->call;
	_data_->_tmp14_ = _data_->id;
	gisi_comm_call_releaseVoiceCall (_data_->_tmp13_, (guint8) _data_->_tmp14_, CALL_CAUSE_TYPE_CLIENT, CALL_CAUSE_RELEASE_BY_USER, ___lambda2__gisi_comm_void_result_func, _data_->_data3_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	block3_data_unref (_data_->_data3_);
	_data_->_data3_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void fso_gsm_isi_call_handler_real_releaseAll_data_free (gpointer _data) {
	fso_gsm_isi_call_handler_releaseAllData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (fso_gsm_isi_call_handler_releaseAllData, _data_);
}


static void fso_gsm_isi_call_handler_real_releaseAll (FsoGsmAbstractCallHandler* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmIsiCallHandler * self;
	fso_gsm_isi_call_handler_releaseAllData* _data_;
	FsoGsmIsiCallHandler* _tmp0_;
	self = (FsoGsmIsiCallHandler*) base;
	_data_ = g_slice_new0 (fso_gsm_isi_call_handler_releaseAllData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_isi_call_handler_real_releaseAll);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_isi_call_handler_real_releaseAll_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	fso_gsm_isi_call_handler_real_releaseAll_co (_data_);
}


static void fso_gsm_isi_call_handler_real_releaseAll_finish (FsoGsmAbstractCallHandler* base, GAsyncResult* _res_, GError** error) {
	fso_gsm_isi_call_handler_releaseAllData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean fso_gsm_isi_call_handler_real_releaseAll_co (fso_gsm_isi_call_handler_releaseAllData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->calls;
		_data_->_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _data_->_tmp0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_g_object_unref0 (_data_->_tmp3_);
		_data_->_call_it = _data_->_tmp5_;
		while (TRUE) {
			_data_->_tmp6_ = _data_->_call_it;
			_data_->_tmp7_ = FALSE;
			_data_->_tmp7_ = gee_iterator_next (_data_->_tmp6_);
			if (!_data_->_tmp7_) {
				break;
			}
			_data_->_tmp8_ = _data_->_call_it;
			_data_->_tmp9_ = NULL;
			_data_->_tmp9_ = gee_iterator_get (_data_->_tmp8_);
			_data_->call = (FsoGsmCall*) _data_->_tmp9_;
			_data_->_tmp10_ = _data_->call;
			_data_->_tmp11_ = _data_->_tmp10_->detail;
			_data_->_tmp12_ = _data_->_tmp11_.status;
			if (_data_->_tmp12_ != FREE_SMARTPHONE_GSM_CALL_STATUS_RELEASE) {
				{
					_data_->_tmp13_ = _data_->call;
					_data_->_tmp14_ = _data_->_tmp13_->detail;
					_data_->_tmp15_ = _data_->_tmp14_.id;
					fso_gsm_abstract_call_handler_release ((FsoGsmAbstractCallHandler*) _data_->self, _data_->_tmp15_, NULL, NULL);
				}
				goto __finally1;
				__catch1_g_error:
				{
					_data_->err = _data_->_inner_error_;
					_data_->_inner_error_ = NULL;
					_g_error_free0 (_data_->err);
				}
				__finally1:
				if (_data_->_inner_error_ != NULL) {
					if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						_fso_gsm_call_unref0 (_data_->call);
						_g_object_unref0 (_data_->_call_it);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						_fso_gsm_call_unref0 (_data_->call);
						_g_object_unref0 (_data_->_call_it);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
			}
			_fso_gsm_call_unref0 (_data_->call);
		}
		_g_object_unref0 (_data_->_call_it);
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _vala_FreeSmartphoneGSMCallDetail_array_free (FreeSmartphoneGSMCallDetail* array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			free_smartphone_gsm_call_detail_destroy (&array[i]);
		}
	}
	g_free (array);
}


static void fso_gsm_isi_call_handler_listCalls_data_free (gpointer _data) {
	fso_gsm_isi_call_handler_listCallsData* _data_;
	_data_ = _data;
	_data_->result = (_vala_FreeSmartphoneGSMCallDetail_array_free (_data_->result, _data_->result_length1), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (fso_gsm_isi_call_handler_listCallsData, _data_);
}


void fso_gsm_isi_call_handler_listCalls (FsoGsmIsiCallHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	fso_gsm_isi_call_handler_listCallsData* _data_;
	FsoGsmIsiCallHandler* _tmp0_;
	_data_ = g_slice_new0 (fso_gsm_isi_call_handler_listCallsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_isi_call_handler_listCalls);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_isi_call_handler_listCalls_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	fso_gsm_isi_call_handler_listCalls_co (_data_);
}


FreeSmartphoneGSMCallDetail* fso_gsm_isi_call_handler_listCalls_finish (FsoGsmIsiCallHandler* self, GAsyncResult* _res_, int* result_length1, GError** error) {
	FreeSmartphoneGSMCallDetail* result;
	fso_gsm_isi_call_handler_listCallsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	*result_length1 = _data_->result_length1;
	_data_->result = NULL;
	return result;
}


static void _vala_array_add1 (FreeSmartphoneGSMCallDetail** array, int* length, int* size, const FreeSmartphoneGSMCallDetail* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (FreeSmartphoneGSMCallDetail, *array, *size);
	}
	(*array)[(*length)++] = *value;
}


static gboolean fso_gsm_isi_call_handler_listCalls_co (fso_gsm_isi_call_handler_listCallsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = g_new0 (FreeSmartphoneGSMCallDetail, 0);
	_data_->ret = _data_->_tmp0_;
	_data_->ret_length1 = 0;
	_data_->_ret_size_ = _data_->ret_length1;
	{
		_data_->_tmp1_ = _data_->self->calls;
		_data_->_tmp2_ = gee_abstract_map_get_values ((GeeMap*) _data_->_tmp1_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = NULL;
		_data_->_tmp5_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		_g_object_unref0 (_data_->_tmp4_);
		_data_->_call_it = _data_->_tmp6_;
		while (TRUE) {
			_data_->_tmp7_ = _data_->_call_it;
			_data_->_tmp8_ = FALSE;
			_data_->_tmp8_ = gee_iterator_next (_data_->_tmp7_);
			if (!_data_->_tmp8_) {
				break;
			}
			_data_->_tmp9_ = _data_->_call_it;
			_data_->_tmp10_ = NULL;
			_data_->_tmp10_ = gee_iterator_get (_data_->_tmp9_);
			_data_->call = (FsoGsmCall*) _data_->_tmp10_;
			_data_->_tmp11_ = _data_->call;
			_data_->_tmp12_ = _data_->_tmp11_->detail;
			_data_->_tmp13_ = _data_->_tmp12_.status;
			if (_data_->_tmp13_ != FREE_SMARTPHONE_GSM_CALL_STATUS_RELEASE) {
				_data_->_tmp14_ = _data_->ret;
				_data_->_tmp14__length1 = _data_->ret_length1;
				_data_->_tmp15_ = _data_->call;
				_data_->_tmp16_ = _data_->_tmp15_->detail;
				memset (&_data_->_tmp17_, 0, sizeof (FreeSmartphoneGSMCallDetail));
				free_smartphone_gsm_call_detail_copy (&_data_->_tmp16_, &_data_->_tmp17_);
				_vala_array_add1 (&_data_->ret, &_data_->ret_length1, &_data_->_ret_size_, &_data_->_tmp17_);
			}
			_fso_gsm_call_unref0 (_data_->call);
		}
		_g_object_unref0 (_data_->_call_it);
	}
	_data_->_tmp18_ = _data_->ret;
	_data_->_tmp18__length1 = _data_->ret_length1;
	_data_->result_length1 = _data_->_tmp18__length1;
	_data_->result = _data_->_tmp18_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_data_->ret = (_vala_FreeSmartphoneGSMCallDetail_array_free (_data_->ret, _data_->ret_length1), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void fso_gsm_isi_call_handler_class_init (FsoGsmIsiCallHandlerClass * klass) {
	fso_gsm_isi_call_handler_parent_class = g_type_class_peek_parent (klass);
	FSO_FRAMEWORK_ABSTRACT_OBJECT_CLASS (klass)->repr = fso_gsm_isi_call_handler_real_repr;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->handleIncomingCall = fso_gsm_isi_call_handler_real_handleIncomingCall;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->handleConnectingCall = fso_gsm_isi_call_handler_real_handleConnectingCall;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->handleEndingCall = fso_gsm_isi_call_handler_real_handleEndingCall;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->addSupplementaryInformation = fso_gsm_isi_call_handler_real_addSupplementaryInformation;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->cancelOutgoingWithId = fso_gsm_isi_call_handler_real_cancelOutgoingWithId;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->cancelOutgoingWithId_finish = fso_gsm_isi_call_handler_real_cancelOutgoingWithId_finish;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->rejectIncomingWithId = fso_gsm_isi_call_handler_real_rejectIncomingWithId;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->rejectIncomingWithId_finish = fso_gsm_isi_call_handler_real_rejectIncomingWithId_finish;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->startTimeoutIfNecessary = fso_gsm_isi_call_handler_real_startTimeoutIfNecessary;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->activate = fso_gsm_isi_call_handler_real_activate;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->activate_finish = fso_gsm_isi_call_handler_real_activate_finish;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->initiate = fso_gsm_isi_call_handler_real_initiate;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->initiate_finish = fso_gsm_isi_call_handler_real_initiate_finish;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->hold = fso_gsm_isi_call_handler_real_hold;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->hold_finish = fso_gsm_isi_call_handler_real_hold_finish;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->release = fso_gsm_isi_call_handler_real_release;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->release_finish = fso_gsm_isi_call_handler_real_release_finish;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->releaseAll = fso_gsm_isi_call_handler_real_releaseAll;
	FSO_GSM_ABSTRACT_CALL_HANDLER_CLASS (klass)->releaseAll_finish = fso_gsm_isi_call_handler_real_releaseAll_finish;
	G_OBJECT_CLASS (klass)->finalize = fso_gsm_isi_call_handler_finalize;
}


static void fso_gsm_isi_call_handler_instance_init (FsoGsmIsiCallHandler * self) {
}


static void fso_gsm_isi_call_handler_finalize (GObject* obj) {
	FsoGsmIsiCallHandler * self;
	self = FSO_GSM_ISI_CALL_HANDLER (obj);
	_g_object_unref0 (self->calls);
	G_OBJECT_CLASS (fso_gsm_isi_call_handler_parent_class)->finalize (obj);
}


/**
 * @class IsiCallHandler
 **/
GType fso_gsm_isi_call_handler_get_type (void) {
	return fso_gsm_isi_call_handler_type_id;
}


GType fso_gsm_isi_call_handler_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (FsoGsmIsiCallHandlerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) fso_gsm_isi_call_handler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FsoGsmIsiCallHandler), 0, (GInstanceInitFunc) fso_gsm_isi_call_handler_instance_init, NULL };
	fso_gsm_isi_call_handler_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_ABSTRACT_CALL_HANDLER, "FsoGsmIsiCallHandler", &g_define_type_info, 0);
	return fso_gsm_isi_call_handler_type_id;
}



