Commit f2c5aab9 authored by Simon Morlat's avatar Simon Morlat
Browse files

remove unused files

parent bd34d8a6
/*
linphone
Copyright (C) 2000 Simon MORLAT (simon.morlat@free.fr)
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef EXEVENTS_H
#define EXEVENTS_H
#include <eXosip2/eXosip.h>
#include "sdphandler.h"
void linphone_core_process_event(LinphoneCore *lc, eXosip_event_t *ev);
/* these are the SdpHandler callbacks: we are called in to be aware of the content
of the SDP messages exchanged */
int linphone_set_audio_offer(sdp_context_t *ctx);
int linphone_set_video_offer(sdp_context_t *ctx);
int linphone_accept_audio_offer(sdp_context_t *ctx,sdp_payload_t *payload);
int linphone_accept_video_offer(sdp_context_t *ctx,sdp_payload_t *payload);
int linphone_read_audio_answer(sdp_context_t *ctx,sdp_payload_t *payload);
int linphone_read_video_answer(sdp_context_t *ctx,sdp_payload_t *payload);
void linphone_core_text_received(LinphoneCore *lc, eXosip_event_t *ev);
#endif
/****************************************************************************
*
* File: general_state.c
*
* Copyright (C) 2006, 2007 Thomas Reitmayr <treitmayr@yahoo.com>
*
****************************************************************************
*
* 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 Library 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 "linphonecore.h"
#include "private.h"
#if 0
static const char *_gstates_text[] = {
"GSTATE_POWER_OFF", /* 0 */
"GSTATE_POWER_STARTUP", /* 1 */
"GSTATE_POWER_ON", /* 2 */
"GSTATE_POWER_SHUTDOWN", /* 3 */
NULL, NULL, NULL, NULL, NULL, NULL,
"GSTATE_REG_NONE", /* 10 */
"GSTATE_REG_OK", /* 11 */
"GSTATE_REG_FAILED", /* 12 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"GSTATE_CALL_IDLE", /* 20 */
"GSTATE_CALL_OUT_INVITE", /* 21 */
"GSTATE_CALL_OUT_CONNECTED", /* 22 */
"GSTATE_CALL_IN_INVITE", /* 23 */
"GSTATE_CALL_IN_CONNECTED", /* 24 */
"GSTATE_CALL_END", /* 25 */
"GSTATE_CALL_ERROR" /* 26 */
};
#endif
/* set the initial states */
void gstate_initialize(LinphoneCore *lc) {
lc->gstate_power = GSTATE_POWER_OFF;
lc->gstate_reg = GSTATE_REG_NONE;
lc->gstate_call = GSTATE_CALL_IDLE;
}
gstate_t linphone_core_get_state(const LinphoneCore *lc, gstate_group_t group){
switch(group){
case GSTATE_GROUP_POWER:
return lc->gstate_power;
case GSTATE_GROUP_REG:
return lc->gstate_reg;
case GSTATE_GROUP_CALL:
return lc->gstate_call;
}
return GSTATE_INVALID;
}
static void linphone_core_set_state(LinphoneCore *lc, gstate_group_t group, gstate_t new_state){
switch(group){
case GSTATE_GROUP_POWER:
lc->gstate_power=new_state;
break;
case GSTATE_GROUP_REG:
lc->gstate_reg=new_state;
break;
case GSTATE_GROUP_CALL:
lc->gstate_call=new_state;
break;
}
}
void gstate_new_state(struct _LinphoneCore *lc,
gstate_t new_state,
LinphoneGeneralStateContext gctx,
const char *message) {
LinphoneGeneralState states_arg;
/* determine the affected group */
if (new_state < GSTATE_REG_NONE)
states_arg.group = GSTATE_GROUP_POWER;
else if (new_state < GSTATE_CALL_IDLE)
states_arg.group = GSTATE_GROUP_REG;
else
states_arg.group = GSTATE_GROUP_CALL;
/* store the new state while remembering the old one */
states_arg.new_state = new_state;
states_arg.old_state = linphone_core_get_state(lc,states_arg.group);
linphone_core_set_state(lc, states_arg.group,new_state);
states_arg.message = message;
/*printf("gstate_new_state: %s\t-> %s\t(%s)\n",
_gstates_text[states_arg.old_state],
_gstates_text[states_arg.new_state],
message);*/
/* call the virtual method */
if (lc->vtable.general_state)
lc->vtable.general_state(lc, &states_arg, gctx);
/* immediately proceed to idle state */
if (new_state == GSTATE_CALL_END ||
new_state == GSTATE_CALL_ERROR)
gstate_new_state(lc, GSTATE_CALL_IDLE, gctx, NULL);
}
This diff is collapsed.
/*
* Linphone is sip (RFC3261) compatible internet phone.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SDP_HANDLER_H
#define SDP_HANDLER_H
#include <osipparser2/sdp_message.h>
#include "linphonecore.h"
typedef struct _sdp_payload
{
int line; /* the index of the m= line */
int pt; /*payload type */
int localport;
int remoteport;
int b_as_bandwidth; /* application specific bandwidth */
char *proto;
char *c_nettype;
char *c_addrtype;
char *c_addr;
char *c_addr_multicast_ttl;
char *c_addr_multicast_int;
char *a_rtpmap;
char *a_fmtp;
char *relay_host;
int relay_port;
char *relay_session_id;
int a_ptime;
} sdp_payload_t;
typedef struct _sdp_context sdp_context_t;
typedef int (*sdp_handler_read_codec_func_t) (struct _sdp_context *,
sdp_payload_t *);
typedef int (*sdp_handler_write_codec_func_t) (struct _sdp_context *);
typedef struct _sdp_handler
{
sdp_handler_read_codec_func_t accept_audio_codecs; /*from remote sdp */
sdp_handler_read_codec_func_t accept_video_codecs; /*from remote sdp */
sdp_handler_write_codec_func_t set_audio_codecs; /*to local sdp */
sdp_handler_write_codec_func_t set_video_codecs; /*to local sdp */
sdp_handler_read_codec_func_t get_audio_codecs; /*from incoming answer */
sdp_handler_read_codec_func_t get_video_codecs; /*from incoming answer */
} sdp_handler_t;
typedef enum _sdp_context_state
{
SDP_CONTEXT_STATE_INIT,
SDP_CONTEXT_STATE_NEGOCIATION_OPENED,
SDP_CONTEXT_STATE_NEGOCIATION_CLOSED
} sdp_context_state_t;
struct _sdp_context
{
sdp_handler_t *handler;
char *localip;
char *username;
void *reference;
sdp_message_t *offer; /* the local sdp to be used for outgoing request */
char *offerstr;
sdp_message_t *answer; /* the local sdp generated from an inc request */
char *answerstr;
char *relay;
char *relay_session_id;
int negoc_status; /* in sip code */
int incb;
sdp_context_state_t state;
};
/* create a context for a sdp negociation: localip is the ip address to be used in the sdp message, can
be a firewall address.
It can be null when negociating for an incoming offer; In that case it will be guessed. */
sdp_context_t *sdp_handler_create_context(sdp_handler_t *handler, const char *localip, const char *username, const char *relay);
void sdp_context_set_user_pointer(sdp_context_t * ctx, void* up);
void *sdp_context_get_user_pointer(sdp_context_t * ctx);
void sdp_context_add_audio_payload( sdp_context_t * ctx, sdp_payload_t * payload);
void sdp_context_add_video_payload( sdp_context_t * ctx, sdp_payload_t * payload);
char * sdp_context_get_offer(sdp_context_t *ctx);
char * sdp_context_get_answer(sdp_context_t* ctx, sdp_message_t *remote_offer);
int sdp_context_get_status(sdp_context_t* ctx);
void sdp_context_read_answer(sdp_context_t *ctx, sdp_message_t *remote_answer);
void sdp_context_free(sdp_context_t *ctx);
int sdp_payload_init (sdp_payload_t * payload);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment