dect
/
asterisk
Archived
13
0
Fork 0

added misdn port down to send a L1 Deactivate to a NT Port. changed some default values regarding jitterbuffer.

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@12288 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
crichter 2006-03-07 11:16:56 +00:00
parent f320a81034
commit 145279b5f1
3 changed files with 91 additions and 7 deletions

View File

@ -515,6 +515,20 @@ static int misdn_port_up (int fd, int argc, char *argv[])
return 0;
}
static int misdn_port_down (int fd, int argc, char *argv[])
{
int port;
if (argc != 4)
return RESULT_SHOWUSAGE;
port = atoi(argv[3]);
misdn_lib_get_port_down(port);
return 0;
}
static int misdn_show_config (int fd, int argc, char *argv[])
{
@ -1031,6 +1045,15 @@ static struct ast_cli_entry cli_port_up =
"Usage: misdn port up <port>\n"
};
static struct ast_cli_entry cli_port_down =
{ {"misdn","port","down", NULL},
misdn_port_down,
"Tries to deacivate the L1 on the given port",
"Usage: misdn port up <port>\n"
};
static struct ast_cli_entry cli_show_stacks =
{ {"misdn","show","stacks", NULL},
misdn_show_stacks,
@ -2807,9 +2830,7 @@ static void release_chan(struct misdn_bchannel *bc) {
default:
chan_misdn_log(2, bc->port, "* --> In State Default\n");
chan_misdn_log(2, bc->port, "* --> Queue Hangup\n");
if (ast && MISDN_ASTERISK_PVT(ast)) {
if (ast) {
ast_queue_hangup(ast);
} else {
chan_misdn_log (0, bc->port, "!! Not really queued!\n");
@ -3735,6 +3756,7 @@ int load_module(void)
ast_cli_register(&cli_restart_port);
ast_cli_register(&cli_port_up);
ast_cli_register(&cli_port_down);
ast_cli_register(&cli_set_debug);
ast_cli_register(&cli_set_crypt_debug);
ast_cli_register(&cli_reload);
@ -3789,6 +3811,7 @@ int unload_module(void)
ast_cli_unregister(&cli_show_stacks);
ast_cli_unregister(&cli_restart_port);
ast_cli_unregister(&cli_port_up);
ast_cli_unregister(&cli_port_down);
ast_cli_unregister(&cli_set_debug);
ast_cli_unregister(&cli_set_crypt_debug);
ast_cli_unregister(&cli_reload);

View File

@ -192,7 +192,7 @@ 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, int c1, void *c2, int c2_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);
void manager_bchannel_cleanup (struct misdn_bchannel *bc);
@ -596,6 +596,49 @@ static int newteid=0;
#define MAXPROCS 0x100
int misdn_lib_get_l1_down(struct misdn_stack *stack)
{
/* Pull Up L1 */
iframe_t act;
act.prim = PH_DEACTIVATE | REQUEST;
act.addr = (stack->upper_id | FLG_MSG_DOWN) ;
act.dinfo = 0;
act.len = 0;
return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC);
}
int misdn_lib_get_l2_down(struct misdn_stack *stack)
{
if (stack->ptp && (stack->nt) ) {
msg_t *dmsg;
/* L2 */
dmsg = create_l2msg(DL_RELEASE| REQUEST, 0, 0);
if (stack->nst.manager_l3(&stack->nst, dmsg))
free_msg(dmsg);
} else {
iframe_t act;
act.prim = DL_RELEASE| REQUEST;
act.addr = (stack->upper_id |FLG_MSG_DOWN) ;
act.dinfo = 0;
act.len = 0;
return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC);
}
return 0;
}
int misdn_lib_get_l1_up(struct misdn_stack *stack)
{
/* Pull Up L1 */
@ -1443,6 +1486,22 @@ int misdn_lib_get_port_up (int port)
}
int misdn_lib_get_port_down (int port)
{ /* Pull Down L1 */
struct misdn_stack *stack;
for (stack=glob_mgr->stack_list;
stack;
stack=stack->next) {
if (stack->port == port) {
if (stack->l2link)
misdn_lib_get_l2_down(stack);
misdn_lib_get_l1_down(stack);
return 0;
}
}
return 0;
}
int misdn_lib_send_facility(struct misdn_bchannel *bc, enum facility_type fac, void *data)
{
switch (fac) {
@ -3246,7 +3305,7 @@ int misdn_lib_tx2misdn_frm(struct misdn_bchannel *bc, void *data, int len)
/*
* send control information to the channel (dsp-module)
*/
void manager_ph_control(struct misdn_bchannel *bc, int c1, int c2)
void manager_ph_control(struct misdn_bchannel *bc, long c1, long c2)
{
unsigned char buffer[mISDN_HEADER_LEN+2*sizeof(long)];
iframe_t *ctrl = (iframe_t *)buffer; /* preload data */
@ -3265,7 +3324,7 @@ void manager_ph_control(struct misdn_bchannel *bc, int c1, int c2)
/*
* send control information to the channel (dsp-module)
*/
void manager_ph_control_block(struct misdn_bchannel *bc, int c1, void *c2, int c2_len)
void manager_ph_control_block(struct misdn_bchannel *bc, long c1, void *c2, int c2_len)
{
unsigned char buffer[mISDN_HEADER_LEN+sizeof(long)+c2_len];
iframe_t *ctrl = (iframe_t *)buffer;

View File

@ -329,7 +329,7 @@ void manager_bchannel_deactivate(struct misdn_bchannel * bc);
int misdn_lib_tx2misdn_frm(struct misdn_bchannel *bc, void *data, int len);
void manager_ph_control(struct misdn_bchannel *bc, int c1, int c2);
void manager_ph_control(struct misdn_bchannel *bc, long c1, long c2);
int misdn_lib_port_restart(int port);
@ -337,6 +337,8 @@ int misdn_lib_get_port_info(int port);
int misdn_lib_port_up(int port, int notcheck);
int misdn_lib_get_port_down(int port);
int misdn_lib_get_port_up (int port) ;
int misdn_lib_maxports_get(void) ;