mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 19:16:46 +00:00
added UU transceiving and corect handling for rdnis
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1947,7 +1947,12 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
|
|||||||
strncpy(newbc->dad,ast->exten, l);
|
strncpy(newbc->dad,ast->exten, l);
|
||||||
newbc->dad[l-1] = 0;
|
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_P(ast));
|
chan_misdn_log(3, port, " --> * adding2newbc callerid %s\n",AST_CID_P(ast));
|
||||||
if (ast_strlen_zero(newbc->oad) && AST_CID_P(ast) ) {
|
if (ast_strlen_zero(newbc->oad) && AST_CID_P(ast) ) {
|
||||||
|
|
||||||
@@ -3581,6 +3586,15 @@ void import_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_
|
|||||||
if (tmp && (atoi(tmp) == 1)) {
|
if (tmp && (atoi(tmp) == 1)) {
|
||||||
bc->sending_complete=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)
|
void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch)
|
||||||
@@ -3599,6 +3613,10 @@ void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_
|
|||||||
sprintf(tmp,"%d",bc->urate);
|
sprintf(tmp,"%d",bc->urate);
|
||||||
pbx_builtin_setvar_helper(chan,"MISDN_URATE",tmp);
|
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)
|
int add_in_calls(int port)
|
||||||
|
@@ -1324,7 +1324,7 @@ static void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *p
|
|||||||
|
|
||||||
|
|
||||||
/* IE_USERUSER */
|
/* 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)
|
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;
|
unsigned char *p;
|
||||||
@@ -1366,7 +1366,7 @@ static void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, ch
|
|||||||
}
|
}
|
||||||
#endif
|
#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)
|
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];
|
char debug[768];
|
||||||
|
@@ -617,6 +617,8 @@ static void empty_bc(struct misdn_bchannel *bc)
|
|||||||
bc->dad[0] = 0;
|
bc->dad[0] = 0;
|
||||||
bc->rad[0] = 0;
|
bc->rad[0] = 0;
|
||||||
bc->orig_dad[0] = 0;
|
bc->orig_dad[0] = 0;
|
||||||
|
bc->uu[0]=0;
|
||||||
|
bc->uulen=0;
|
||||||
|
|
||||||
bc->fac_in.Function = Fac_None;
|
bc->fac_in.Function = Fac_None;
|
||||||
bc->fac_out.Function = Fac_None;
|
bc->fac_out.Function = Fac_None;
|
||||||
@@ -3086,6 +3088,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=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++) {
|
for (i = 0; i <maxnum; i++) {
|
||||||
if (!stack->bc[i].in_use) {
|
if (!stack->bc[i].in_use) {
|
||||||
/* 3. channel on bri means CW*/
|
/* 3. channel on bri means CW*/
|
||||||
|
@@ -334,7 +334,9 @@ struct misdn_bchannel {
|
|||||||
/* unsigned char info_keypad[32]; */
|
/* unsigned char info_keypad[32]; */
|
||||||
/* unsigned char clisub[24]; */
|
/* unsigned char clisub[24]; */
|
||||||
/* unsigned char cldsub[24]; */
|
/* unsigned char cldsub[24]; */
|
||||||
/* unsigned char uu[256]; */
|
|
||||||
|
char uu[256];
|
||||||
|
int uulen;
|
||||||
|
|
||||||
int cause;
|
int cause;
|
||||||
int out_cause;
|
int out_cause;
|
||||||
|
@@ -252,6 +252,14 @@ static void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchann
|
|||||||
|
|
||||||
set_channel(bc,channel);
|
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);
|
dec_ie_progress(setup->PROGRESS, (Q931_info_t *)setup, &bc->progress_coding, &bc->progress_location, &bc->progress_indicator, nt, bc);
|
||||||
|
|
||||||
@@ -331,6 +339,14 @@ 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);
|
enc_ie_complete(&setup->BEARER,msg, bc->sending_complete, nt, bc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
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
|
#if DEBUG
|
||||||
printf("Building SETUP Msg\n");
|
printf("Building SETUP Msg\n");
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user