summaryrefslogtreecommitdiffstats
path: root/bchannel.c
diff options
context:
space:
mode:
authorSuper User2008-05-01 10:35:20 +0200
committerSuper User2008-05-01 10:35:20 +0200
commit0efcf371b4a61fa1376e83d2b7404aeb47a36e26 (patch)
tree490134ca54abca5c1983b8d40648acdf03de3b39 /bchannel.c
parentwork (diff)
downloadlcr-0efcf371b4a61fa1376e83d2b7404aeb47a36e26.tar.gz
lcr-0efcf371b4a61fa1376e83d2b7404aeb47a36e26.tar.xz
lcr-0efcf371b4a61fa1376e83d2b7404aeb47a36e26.zip
work on chan_lcr
modified: Makefile modified: action.cpp modified: action_efi.cpp modified: action_vbox.cpp modified: apppbx.cpp modified: apppbx.h modified: bchannel.c modified: bchannel.h new file: callerid.c new file: callerid.h modified: chan_lcr.c modified: chan_lcr.h modified: crypt.cpp modified: endpoint.cpp modified: endpointapp.cpp modified: interface.c modified: join.cpp modified: joinpbx.cpp modified: joinremote.cpp modified: mISDN.cpp modified: mail.c modified: main.h modified: message.h modified: port.cpp modified: route.c modified: route.h modified: socket_server.c modified: todo.txt modified: vbox.cpp modified: watch.c
Diffstat (limited to 'bchannel.c')
-rw-r--r--bchannel.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/bchannel.c b/bchannel.c
index dbc11d7..02b6181 100644
--- a/bchannel.c
+++ b/bchannel.c
@@ -50,36 +50,14 @@ enum {
};
#ifdef SOCKET_MISDN
-int bchannel_socket = -1;
int bchannel_initialize(void)
{
- /* try to open raw socket to check kernel */
- bchannel_socket = socket(PF_ISDN, SOCK_RAW, ISDN_P_BASE);
- if (bchannel_socket < 0)
- {
- PERROR("Cannot open mISDN due to %s. (Does your Kernel support socket based mISDN?)\n", strerror(errno));
- return(-1);
- }
-
- mISDN_debug_init(global_debug, NULL, NULL, NULL);
-
- bchannel_pid = get_pid();
-
- /* init mlayer3 */
- init_layer3(4); // buffer of 4
-
return(0);
}
void bchannel_deinitialize(void)
{
- cleanup_layer3();
-
- mISDN_debug_close();
-
- if (bchannel_socket > -1)
- close(bchannel_socket);
}
#else
int bchannel_entity = 0; /* used for udevice */
@@ -850,7 +828,17 @@ void free_bchannel(struct bchannel *channel)
#else
if (channel->b_stid)
#endif
- bchannel_destroy(channel);
+ bchannel_destroy(channel);
+ if (channel->call)
+ {
+ if (channel->call->channel)
+ channel->call->channel = NULL;
+ }
+ if (channel->bridge_channel)
+ {
+ if (channel->bridge_channel->bridge_channel)
+ channel->bridge_channel->bridge_channel = NULL;
+ }
free(channel);
return;
}