aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorcrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-18 09:31:27 +0000
committercrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-18 09:31:27 +0000
commit7188fd81cffe0cd2dcb2ea4f9bc87962d9e0e14b (patch)
treed99496be1c60b010957cde4236f18fee022b6e46 /channels
parent98059cd8247753754256f372d0de65f7ee3492cb (diff)
Merged revisions 58825-58826 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r58825 | crichter | 2007-03-12 13:43:24 +0100 (Mo, 12 Mär 2007) | 1 line added UU transceiving and corect handling for rdnis ................ r58826 | crichter | 2007-03-12 14:08:06 +0100 (Mo, 12 Mär 2007) | 21 lines Merged revisions 57034,57523,57753,58558 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57034 | crichter | 2007-02-28 17:09:27 +0100 (Mi, 28 Feb 2007) | 1 line fixed bugs.digium.com bugs: #9157 and bugs.beronet.com bugs: #302, #303, #304 ........ r57523 | crichter | 2007-03-02 19:32:51 +0100 (Fr, 02 Mar 2007) | 1 line fixed typo ........ r57753 | crichter | 2007-03-04 11:39:50 +0100 (So, 04 Mar 2007) | 1 line fixed another place where the out_cause was hardcoded to 16 ........ r58558 | crichter | 2007-03-09 15:43:58 +0100 (Fr, 09 Mar 2007) | 1 line we can free channel 31 as well, since we can occupy it ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@64951 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_misdn.c34
-rw-r--r--channels/misdn/ie.c4
-rw-r--r--channels/misdn/isdn_lib.c11
-rw-r--r--channels/misdn/isdn_lib.h4
-rw-r--r--channels/misdn/isdn_msg_parser.c18
5 files changed, 56 insertions, 15 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 38a2151f8..fefef85b7 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -2015,7 +2015,12 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
strncpy(newbc->dad,ast->exten, l);
newbc->dad[l-1] = 0;
}
- newbc->rad[0]=0;
+
+ if (ast->cid.cid_rdnis)
+ strcpy(newbc->rad, ast->cid.cid_rdnis);
+ else
+ newbc->rad[0]=0;
+
chan_misdn_log(3, port, " --> * adding2newbc callerid %s\n",ast->cid.cid_num);
if (ast_strlen_zero(newbc->oad) && ast->cid.cid_num ) {
@@ -2330,12 +2335,8 @@ static int misdn_indication(struct ast_channel *ast, int cond, const void *data,
chan_misdn_log(1, p->bc->port, " --> * IND :\tcongestion pid:%d\n",p->bc?p->bc->pid:-1);
p->bc->out_cause=42;
- if (p->state != MISDN_CONNECTED) {
- start_bc_tones(p);
- misdn_lib_send_event( p->bc, EVENT_RELEASE);
- } else {
- misdn_lib_send_event( p->bc, EVENT_DISCONNECT);
- }
+ start_bc_tones(p);
+ misdn_lib_send_event( p->bc, EVENT_DISCONNECT);
if (p->bc->nt) {
hanguptone_indicate(p);
@@ -3660,6 +3661,15 @@ void import_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_
if (tmp && (atoi(tmp) == 1)) {
bc->sending_complete=1;
}
+
+ ast_log(LOG_VERBOSE, "getting MISDN_USERUSER:\n");
+ tmp=pbx_builtin_getvar_helper(chan,"MISDN_USERUSER");
+ if (tmp) {
+ ast_log(LOG_VERBOSE, "MISDN_USERUSER: %s\n", tmp);
+ strcpy(bc->uu, tmp);
+ bc->uulen=strlen(bc->uu);
+ }
+
}
void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch)
@@ -3678,6 +3688,10 @@ void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_
sprintf(tmp,"%d",bc->urate);
pbx_builtin_setvar_helper(chan,"MISDN_URATE",tmp);
}
+
+ if (bc->uulen) {
+ pbx_builtin_setvar_helper(chan,"MISDN_USERUSER",bc->uu);
+ }
}
int add_in_calls(int port)
@@ -3850,7 +3864,9 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
if ( stop_tone ) {
stop_indicate(ch);
}
-
+
+ if (!ch->ast) break;
+
if (ch->state == MISDN_WAITING4DIGS ) {
/* Ok, incomplete Setup, waiting till extension exists */
@@ -4397,8 +4413,6 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
case EVENT_RELEASE:
{
- bc->out_cause=16;
-
hangup_chan(ch);
release_chan(bc);
diff --git a/channels/misdn/ie.c b/channels/misdn/ie.c
index af2d14019..3fbccab3e 100644
--- a/channels/misdn/ie.c
+++ b/channels/misdn/ie.c
@@ -1324,7 +1324,7 @@ static void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *p
/* IE_USERUSER */
-#if 0
+#if 1
static void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *user, int user_len, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
@@ -1366,7 +1366,7 @@ static void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, ch
}
#endif
-#if 0
+#if 1
static void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *user, int *user_len, int nt, struct misdn_bchannel *bc)
{
char debug[768];
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index 7294f8f56..530731102 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -463,7 +463,7 @@ static int find_free_chan_in_stack(struct misdn_stack *stack, struct misdn_bchan
static int empty_chan_in_stack(struct misdn_stack *stack, int channel)
{
- if (channel<=0 || channel>=MAX_BCHANS) {
+ if (channel<=0 || channel>MAX_BCHANS) {
cb_log(0,stack?stack->port:0, "empty_chan_in_stack: cannot empty channel %d\n",channel);
return -1;
}
@@ -618,6 +618,8 @@ static void empty_bc(struct misdn_bchannel *bc)
bc->dad[0] = 0;
bc->rad[0] = 0;
bc->orig_dad[0] = 0;
+ bc->uu[0]=0;
+ bc->uulen=0;
bc->fac_in.Function = Fac_None;
bc->fac_out.Function = Fac_None;
@@ -1533,8 +1535,10 @@ static int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_
if (bc->channel>0)
empty_chan_in_stack(stack,bc->channel);
int tmpcause=bc->cause;
+ int tmp_out_cause=bc->out_cause;
empty_bc(bc);
bc->cause=tmpcause;
+ bc->out_cause=tmp_out_cause;
clean_up_bc(bc);
break;
default:
@@ -3082,6 +3086,9 @@ struct misdn_bchannel* misdn_lib_get_free_bc(int port, int channel, int inout)
}
int maxnum=inout&&!stack->pri&&!stack->ptp?stack->b_num+1:stack->b_num;
+ //int maxnum=stack->b_num+1;
+
+ cb_log(0,0,"maxnum:%d",maxnum);
for (i = 0; i <maxnum; i++) {
if (!stack->bc[i].in_use) {
/* 3. channel on bri means CW*/
@@ -3322,8 +3329,10 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
if (bc->channel>0)
empty_chan_in_stack(stack,bc->channel);
int tmpcause=bc->cause;
+ int tmp_out_cause=bc->out_cause;
empty_bc(bc);
bc->cause=tmpcause;
+ bc->out_cause=tmp_out_cause;
clean_up_bc(bc);
}
break;
diff --git a/channels/misdn/isdn_lib.h b/channels/misdn/isdn_lib.h
index d5b466ccd..f8742f81e 100644
--- a/channels/misdn/isdn_lib.h
+++ b/channels/misdn/isdn_lib.h
@@ -335,7 +335,9 @@ struct misdn_bchannel {
/* unsigned char info_keypad[32]; */
/* unsigned char clisub[24]; */
/* unsigned char cldsub[24]; */
-/* unsigned char uu[256]; */
+
+ char uu[256];
+ int uulen;
int cause;
int out_cause;
diff --git a/channels/misdn/isdn_msg_parser.c b/channels/misdn/isdn_msg_parser.c
index 44661adff..6ce9ed92e 100644
--- a/channels/misdn/isdn_msg_parser.c
+++ b/channels/misdn/isdn_msg_parser.c
@@ -252,6 +252,14 @@ static void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchann
set_channel(bc,channel);
}
+
+ {
+ int protocol ;
+ dec_ie_useruser(setup->USER_USER, (Q931_info_t *)setup, &protocol, bc->uu, &bc->uulen, nt,bc);
+ if (bc->uulen) cb_log(1,bc->port,"USERUESRINFO:%s\n",bc->uu);
+ else
+ cb_log(1,bc->port,"NO USERUESRINFO\n");
+ }
dec_ie_progress(setup->PROGRESS, (Q931_info_t *)setup, &bc->progress_coding, &bc->progress_location, &bc->progress_indicator, nt, bc);
@@ -331,7 +339,15 @@ static msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, in
enc_ie_complete(&setup->BEARER,msg, bc->sending_complete, nt, bc);
}
-#ifdef DEBUG
+ {
+ int protocol=4;
+ enc_ie_useruser(&setup->USER_USER, msg, protocol, bc->uu, bc->uulen, nt,bc);
+ if (bc->uulen) cb_log(1,bc->port,"ENCODING USERUESRINFO:%s\n",bc->uu);
+ else
+ cb_log(1,bc->port,"NO USERUESRINFO ENCODED\n");
+ }
+
+#if DEBUG
printf("Building SETUP Msg\n");
#endif
return msg;