diff options
author | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-16 14:34:21 +0000 |
---|---|---|
committer | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-16 14:34:21 +0000 |
commit | 5e278d383617beac2df4e1848bd084cf5d02a111 (patch) | |
tree | 58cbe7e1abe6c8393c2a75d3cb39afad0a4306db /channels/misdn | |
parent | 6222b59ec530bceebe05d3df01cae4eabf8b1ad6 (diff) |
fixed very bad memory overwrite which leaded to segfaults on some systems. removed redundant buffer betweend mISDN reading thread and ast_read in favour of the already existing pipe, this clarifies the way a voice frame takes between mISDN and asterisk a lot. centralized debugging of NumberPlan. removed a compiler warning.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@27346 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/misdn')
-rw-r--r-- | channels/misdn/isdn_lib.c | 44 | ||||
-rw-r--r-- | channels/misdn/isdn_lib.h | 14 | ||||
-rw-r--r-- | channels/misdn/isdn_msg_parser.c | 3 |
3 files changed, 7 insertions, 54 deletions
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c index 7da2d1eee..1db8d8e96 100644 --- a/channels/misdn/isdn_lib.c +++ b/channels/misdn/isdn_lib.c @@ -19,42 +19,6 @@ void misdn_join_conf(struct misdn_bchannel *bc, int conf_id); void misdn_split_conf(struct misdn_bchannel *bc, int conf_id); -void misdn_free_ibuffer(void *ibuf) -{ - free_ibuffer((ibuffer_t*)ibuf); -} - - -void misdn_clear_ibuffer(void *ibuf) -{ - clear_ibuffer( (ibuffer_t*)ibuf); -} - -void *misdn_init_ibuffer(int len) -{ - return init_ibuffer(len); -} - -int misdn_ibuf_freecount(void *buf) -{ - return ibuf_freecount( (ibuffer_t*)buf); -} - -int misdn_ibuf_usedcount(void *buf) -{ - return ibuf_usedcount( (ibuffer_t*)buf); -} - -void misdn_ibuf_memcpy_r(char *to, void *buf, int len) -{ - ibuf_memcpy_r( to, (ibuffer_t*)buf, len); -} - -void misdn_ibuf_memcpy_w(void *buf, char *from, int len) -{ - ibuf_memcpy_w((ibuffer_t*)buf, from, len); -} - struct misdn_stack* get_misdn_stack( void ); @@ -196,7 +160,6 @@ int te_lib_init( void ) ; /* returns midev */ void te_lib_destroy(int midev) ; struct misdn_bchannel *manager_find_bc_by_pid(int pid); struct misdn_bchannel *manager_find_bc_holded(struct misdn_bchannel* bc); -unsigned char * manager_flip_buf_bits ( unsigned char * buf , int len); void manager_ph_control_block(struct misdn_bchannel *bc, long c1, void *c2, int c2_len); void manager_clean_bc(struct misdn_bchannel *bc ); void manager_bchannel_setup (struct misdn_bchannel *bc); @@ -2031,6 +1994,7 @@ void misdn_tx_jitter(struct misdn_bchannel *bc, int len) jlen=cb_jb_empty(bc,&buf[mISDN_HEADER_LEN],len); if (jlen) { + flip_buf_bits( &buf[mISDN_HEADER_LEN], jlen); if (jlen < len) { cb_log(5,bc->port,"Jitterbuffer Underrun.\n"); @@ -3586,8 +3550,10 @@ int misdn_lib_tx2misdn_frm(struct misdn_bchannel *bc, void *data, int len) frm->len = len; memcpy(&buf[mISDN_HEADER_LEN], data,len); - - if ( ! misdn_cap_is_speech(bc->capability)) + + if ( misdn_cap_is_speech(bc->capability) ) + flip_buf_bits( &buf[mISDN_HEADER_LEN], len); + else cb_log(6, stack->port, "Writing %d data bytes\n",len); cb_log(9, stack->port, "Writing %d bytes 2 mISDN\n",len); diff --git a/channels/misdn/isdn_lib.h b/channels/misdn/isdn_lib.h index c6324d37e..9cd091e8a 100644 --- a/channels/misdn/isdn_lib.h +++ b/channels/misdn/isdn_lib.h @@ -371,18 +371,6 @@ void manager_ec_disable(struct misdn_bchannel *bc); void get_show_stack_details(int port, char *buf); -/** Ibuf interface **/ -int misdn_ibuf_usedcount(void *buf); -int misdn_ibuf_freecount(void *buf); -void misdn_ibuf_memcpy_r(char *to, void *from, int len); -void misdn_ibuf_memcpy_w(void *buf, char *from, int len); - -void misdn_free_ibuffer(void *ibuf); -void misdn_clear_ibuffer(void *ibuf); -void *misdn_init_ibuffer(int len); - -/** Ibuf interface End **/ - void misdn_lib_tone_generator_start(struct misdn_bchannel *bc); void misdn_lib_tone_generator_stop(struct misdn_bchannel *bc); @@ -394,8 +382,6 @@ void misdn_lib_split_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel void misdn_lib_echo(struct misdn_bchannel *bc, int onoff); -unsigned char * flip_buf_bits ( unsigned char * buf , int len); - int misdn_lib_is_ptp(int port); #define PRI_TRANS_CAP_SPEECH 0x0 diff --git a/channels/misdn/isdn_msg_parser.c b/channels/misdn/isdn_msg_parser.c index 9cd7f2656..2fb43eb86 100644 --- a/channels/misdn/isdn_msg_parser.c +++ b/channels/misdn/isdn_msg_parser.c @@ -874,6 +874,8 @@ msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { + +#ifdef FACILITY_DECODE int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; FACILITY_t *facility=(FACILITY_t*)((unsigned long)(msg->data+HEADER_LEN)); Q931_info_t *qi=(Q931_info_t*)(msg->data+HEADER_LEN); @@ -882,7 +884,6 @@ void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel * printf("Parsing FACILITY Msg\n"); #endif -#ifdef FACILITY_DECODE { fac_dec(facility->FACILITY, qi, &bc->fac_type, &bc->fac, bc); } |