Beispiel #1
0
file_transfer::~file_transfer()
{
	stop_listen();

	mir_free(file);
	mir_free(message);
	mir_free(sn);

	mir_free(pfts.tszWorkingDir);
	if (!sending) mir_free(pfts.tszCurrentFile);

	if (success && pfts.ptszFiles) {
		for (int i = 0; pfts.ptszFiles[i]; i++)
			mir_free(pfts.ptszFiles[i]);

		mir_free(pfts.ptszFiles);
	}
	CloseHandle(hResumeEvent);
}
int BoardE1::KhompPvtISDN::doChannelAnswer(CommandRequest &cmd)
{
    try
    {
        ScopedPvtLock lock(this);

        // is this a collect call?
        bool has_recv_collect_call = _call->_collect_call;

        // do we have to drop collect calls?
        bool has_drop_collect_call = Opt::_drop_collect_call
            || _call->_flags.check(Kflags::DROP_COLLECT)
            || _call->_flags.check(Kflags::FILTER_COLLECT);

        // do we have to drop THIS call?
        bool do_drop_call = has_drop_collect_call && has_recv_collect_call;

        if(has_drop_collect_call) 
        {
            usleep(75000);

            DBG(FUNC, PVT_FMT(target(), "disconnecting collect call"));
            //TODO: Define what is SCE
            //        command(KHOMP_LOG,CM_DISCONNECT,SCE_HIDE);
            command(KHOMP_LOG,CM_DISCONNECT);

            // thou shalt not talk anymore!
            stop_listen();
            stop_stream();
            //TODO: Checar se retorna aqui
        }
    }
    catch (ScopedLockFailed & err)
    {
        K::Logger::Logg(C_ERROR, PVT_FMT(_target, "unable to lock %s!") % err._msg.c_str() );
        return ksFail;
    }

    KhompPvtE1::doChannelAnswer(cmd);
}