提交 0e76b635 authored 作者: Anthony Minessale's avatar Anthony Minessale

64 bit goodies

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@897 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 ce72c5d1
#CFLAGS += -I/usr/src/common/src CFLAGS += -I.
LDFLAGS += -leXosip2 -ljrtp LDFLAGS += -leXosip2 -ljrtp
OBJS=osip_rfc3264.o
ifeq ($(OSARCH),Darwin) ifeq ($(OSARCH),Darwin)
LINKER=g++ LINKER=g++
else else
LINKER=$(CC) LINKER=$(CC)
endif endif
all: depends $(MODNAME).$(DYNAMIC_LIB_EXTEN) all: depends $(OBJS) $(MODNAME).$(DYNAMIC_LIB_EXTEN)
depends: depends:
MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install jrtplib --prefix=$(PREFIX) --disable-gst MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install jrtplib --prefix=$(PREFIX) --disable-gst
...@@ -15,9 +15,12 @@ depends: ...@@ -15,9 +15,12 @@ depends:
MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libeXosip2-2.2.2.tar.gz --disable-josua --prefix=$(PREFIX) MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libeXosip2-2.2.2.tar.gz --disable-josua --prefix=$(PREFIX)
%.o: %.c
$(CC) -fPIC $(CFLAGS) -c -o $@ $<
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c $(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c
$(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o
$(LINKER) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(MODNAME).o $(LDFLAGS) $(LINKER) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(OBJS) $(MODNAME).o $(LDFLAGS)
clean: clean:
rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~ rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~
......
...@@ -35,8 +35,9 @@ ...@@ -35,8 +35,9 @@
#include <jrtplib3/jrtp4c.h> #include <jrtplib3/jrtp4c.h>
#include <eXosip2/eXosip.h> #include <eXosip2/eXosip.h>
#include <osip2/osip_mt.h> #include <osip2/osip_mt.h>
#include <osipparser2/osip_rfc3264.h> #include <osip_rfc3264.h>
#include <osipparser2/osip_port.h> #include <osipparser2/osip_port.h>
#define ENABLE_TRACE
static const char modname[] = "mod_exosip"; static const char modname[] = "mod_exosip";
#define STRLEN 15 #define STRLEN 15
...@@ -951,6 +952,9 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul ...@@ -951,6 +952,9 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
{ {
/* NOTE: **interface is **_interface because the common lib redefines interface to struct in some situations */ /* NOTE: **interface is **_interface because the common lib redefines interface to struct in some situations */
osip_trace_initialize(10, stdout);
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) { if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "OH OH no pool\n"); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "OH OH no pool\n");
return SWITCH_STATUS_TERM; return SWITCH_STATUS_TERM;
......
差异被折叠。
差异被折叠。
/*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
Copyright (C) 2001,2002,2003,2004,2005 Aymeric MOIZARD jack@atosc.org
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_RFC3264I_H__
#define __SDP_RFC3264I_H__
#include <osipparser2/osip_list.h>
#include <osipparser2/sdp_message.h>
#include <osipparser2/osip_rfc3264.h>
#ifndef DOXYGEN
typedef struct osip_rfc3264 osip_rfc3264_t;
struct osip_rfc3264
{
sdp_media_t *audio_medias[MAX_AUDIO_CODECS];
sdp_media_t *video_medias[MAX_VIDEO_CODECS];
sdp_media_t *t38_medias[MAX_T38_CODECS];
sdp_media_t *app_medias[MAX_APP_CODECS];
};
#endif
#endif
CFLAGS +=-I/usr/local/include -I/usr/src/libpri -I/usr/src/linux/include -I. -I/usr/include CFLAGS +=-I/usr/local/include -I/usr/src/libpri -I/usr/src/linux/include -I. -I/usr/include
CFLAGS +=-D__LINUX__ -D_REENTRANT -D_GNU_SOURCE -O6 -march=i686 -DAFT_A104 CFLAGS +=-D__LINUX__ -D_REENTRANT -D_GNU_SOURCE -DAFT_A104
LDFLAGS += -lsangoma LDFLAGS += -lsangoma
...@@ -12,6 +12,7 @@ endif ...@@ -12,6 +12,7 @@ endif
all: depends $(MODNAME).$(DYNAMIC_LIB_EXTEN) all: depends $(MODNAME).$(DYNAMIC_LIB_EXTEN)
depends: depends:
MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libsangoma --prefix=$(PREFIX)
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c $(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c
$(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o
......
...@@ -395,7 +395,9 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch ...@@ -395,7 +395,9 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "%s State Change %s -> %s\n", channel->name, switch_console_printf(SWITCH_CHANNEL_CONSOLE, "%s State Change %s -> %s\n", channel->name,
state_names[last_state], state_names[state]); state_names[last_state], state_names[state]);
channel->state = state; channel->state = state;
if (state < CS_DONE) {
switch_core_session_signal_state_change(channel->session); switch_core_session_signal_state_change(channel->session);
}
} else { } else {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "%s Invalid State Change %s -> %s\n", channel->name, switch_console_printf(SWITCH_CHANNEL_CONSOLE, "%s Invalid State Change %s -> %s\n", channel->name,
state_names[last_state], state_names[state]); state_names[last_state], state_names[state]);
...@@ -560,6 +562,7 @@ SWITCH_DECLARE(switch_status) switch_channel_hangup(switch_channel *channel) ...@@ -560,6 +562,7 @@ SWITCH_DECLARE(switch_status) switch_channel_hangup(switch_channel *channel)
if (channel->state < CS_HANGUP) { if (channel->state < CS_HANGUP) {
channel->times.hungup = switch_time_now(); channel->times.hungup = switch_time_now();
channel->state = CS_HANGUP; channel->state = CS_HANGUP;
switch_core_session_kill_channel(channel->session, SWITCH_SIG_KILL);
switch_core_session_signal_state_change(channel->session); switch_core_session_signal_state_change(channel->session);
} }
return channel->state; return channel->state;
......
...@@ -1723,13 +1723,13 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) ...@@ -1723,13 +1723,13 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
switch (state) { switch (state) {
case CS_NEW: /* Just created, Waiting for first instructions */ case CS_NEW: /* Just created, Waiting for first instructions */
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "State NEW\n"); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "(%s) State NEW\n", switch_channel_get_name(session->channel));
break; break;
case CS_DONE: case CS_DONE:
continue; continue;
break; break;
case CS_HANGUP: /* Deactivate and end the thread */ case CS_HANGUP: /* Deactivate and end the thread */
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "State HANGUP\n"); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "(%s) State HANGUP\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_hangup || if (!driver_state_handler->on_hangup ||
(driver_state_handler->on_hangup && (driver_state_handler->on_hangup &&
driver_state_handler->on_hangup(session) == SWITCH_STATUS_SUCCESS && driver_state_handler->on_hangup(session) == SWITCH_STATUS_SUCCESS &&
...@@ -1768,7 +1768,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) ...@@ -1768,7 +1768,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
midstate = switch_channel_get_state(session->channel); midstate = switch_channel_get_state(session->channel);
break; break;
case CS_INIT: /* Basic setup tasks */ case CS_INIT: /* Basic setup tasks */
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "State INIT\n"); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "(%s) State INIT\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_init || if (!driver_state_handler->on_init ||
(driver_state_handler->on_init && (driver_state_handler->on_init &&
driver_state_handler->on_init(session) == SWITCH_STATUS_SUCCESS && driver_state_handler->on_init(session) == SWITCH_STATUS_SUCCESS &&
...@@ -1804,7 +1804,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) ...@@ -1804,7 +1804,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
} }
break; break;
case CS_RING: /* Look for a dialplan and find something to do */ case CS_RING: /* Look for a dialplan and find something to do */
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "State RING\n"); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "(%s) State RING\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_ring || if (!driver_state_handler->on_ring ||
(driver_state_handler->on_ring && (driver_state_handler->on_ring &&
driver_state_handler->on_ring(session) == SWITCH_STATUS_SUCCESS && driver_state_handler->on_ring(session) == SWITCH_STATUS_SUCCESS &&
...@@ -1840,7 +1840,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) ...@@ -1840,7 +1840,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
} }
break; break;
case CS_EXECUTE: /* Execute an Operation */ case CS_EXECUTE: /* Execute an Operation */
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "State EXECUTE\n"); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "(%s) State EXECUTE\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_execute || if (!driver_state_handler->on_execute ||
(driver_state_handler->on_execute && (driver_state_handler->on_execute &&
driver_state_handler->on_execute(session) == SWITCH_STATUS_SUCCESS && driver_state_handler->on_execute(session) == SWITCH_STATUS_SUCCESS &&
...@@ -1876,7 +1876,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) ...@@ -1876,7 +1876,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
} }
break; break;
case CS_LOOPBACK: /* loop all data back to source */ case CS_LOOPBACK: /* loop all data back to source */
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "State LOOPBACK\n"); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "(%s) State LOOPBACK\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_loopback || if (!driver_state_handler->on_loopback ||
(driver_state_handler->on_loopback && (driver_state_handler->on_loopback &&
driver_state_handler->on_loopback(session) == SWITCH_STATUS_SUCCESS && driver_state_handler->on_loopback(session) == SWITCH_STATUS_SUCCESS &&
...@@ -1912,7 +1912,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) ...@@ -1912,7 +1912,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
} }
break; break;
case CS_TRANSMIT: /* send/recieve data to/from another channel */ case CS_TRANSMIT: /* send/recieve data to/from another channel */
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "State TRANSMIT\n"); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "(%s) State TRANSMIT\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_transmit || if (!driver_state_handler->on_transmit ||
(driver_state_handler->on_transmit && (driver_state_handler->on_transmit &&
driver_state_handler->on_transmit(session) == SWITCH_STATUS_SUCCESS && driver_state_handler->on_transmit(session) == SWITCH_STATUS_SUCCESS &&
...@@ -1957,12 +1957,11 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) ...@@ -1957,12 +1957,11 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
laststate = midstate; laststate = midstate;
} }
if (state < CS_DONE && midstate == switch_channel_get_state(session->channel)) { if (state < CS_DONE && midstate == switch_channel_get_state(session->channel)) {
switch_thread_cond_wait(session->cond, session->mutex); switch_thread_cond_wait(session->cond, session->mutex);
} }
} }
session->thread_running = 0; session->thread_running = 0;
} }
...@@ -2071,9 +2070,8 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread *thread ...@@ -2071,9 +2070,8 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread *thread
switch_core_hash_insert(runtime.session_table, session->uuid_str, session); switch_core_hash_insert(runtime.session_table, session->uuid_str, session);
switch_core_session_run(session); switch_core_session_run(session);
switch_core_hash_delete(runtime.session_table, session->uuid_str); switch_core_hash_delete(runtime.session_table, session->uuid_str);
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Session %ld (%s) Ended\n", id, switch_channel_get_name(session->channel));
switch_core_session_destroy(&session); switch_core_session_destroy(&session);
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Session %ld Ended\n", id);
return NULL; return NULL;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论