[asterisk-commits] branch crichter/0.3.0 - r8121 in
/team/crichter/0.3.0: channels/ channels/mis...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Jan 17 05:06:18 MST 2006
Author: crichter
Date: Tue Jan 17 06:06:12 2006
New Revision: 8121
URL: http://svn.digium.com/view/asterisk?rev=8121&view=rev
Log:
* removed unnecessary config elements, from the engine and from the sample config
* removed clear_l3 functions, they make no sense with mqueue anymore
* rmeoved l1_ok stuff, also because mqueue works correct now
* fixed the calling presentation setting in misdn.conf
* moved some debug prints to higher debug levels
* added debugging for screen / presentation
* in connected state ignore AST_CONTROL_RINGING (why do we get this from asterisk ??)
* added handler for AST_CONTROL_PROCEEDING
Modified:
team/crichter/0.3.0/channels/chan_misdn.c
team/crichter/0.3.0/channels/chan_misdn_config.c
team/crichter/0.3.0/channels/misdn/chan_misdn_config.h
team/crichter/0.3.0/channels/misdn/isdn_lib.c
team/crichter/0.3.0/channels/misdn/isdn_lib.h
team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c
team/crichter/0.3.0/configs/misdn.conf.sample
Modified: team/crichter/0.3.0/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_misdn.c?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn.c Tue Jan 17 06:06:12 2006
@@ -1233,10 +1233,19 @@
/* Will be overridden by asterisk in head! */
{
- int pres;
-
- misdn_cfg_get( port, MISDN_CFG_PRES, &pres, sizeof(int));
- bc->pres=pres?0:1;
+ char pres[128];
+
+ misdn_cfg_get( port, MISDN_CFG_PRES, &pres, 128);
+ ast_log(LOG_NOTICE,"pres: %s\n",pres);
+ if (!strcasecmp("not_screened",pres)) {
+ bc->pres=1;
+ bc->screen=1;
+ ast_log(LOG_NOTICE,"pres: NOT SCREENED!\n");
+ } else {
+ bc->pres=0;
+ bc->screen=0;
+ ast_log(LOG_NOTICE,"pres: allowed!\n");
+ }
}
@@ -1689,24 +1698,22 @@
chan_misdn_log(1, p->bc->port, " --> * IND :\tring pid:%d\n",p->bc?p->bc->pid:-1);
break;
case AST_CONTROL_RINGING:
- if ( p->state == MISDN_ALERTING) {
- chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d but I ws Ringing before, so ignoreing it\n",p->bc?p->bc->pid:-1);
- break;
- }
- p->state=MISDN_ALERTING;
-
- chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
-
- misdn_lib_send_event( p->bc, EVENT_ALERTING);
-
- tone_indicate(p, TONE_ALERTING);
- //tone_indicate(p->bc, TONE_NONE);
-
-
- chan_misdn_log(1, p->bc->port, " --> * SEND: State Ring pid:%d\n",p->bc?p->bc->pid:-1);
- ast_setstate(ast,AST_STATE_RINGING);
- break;
-
+ switch (p->state) {
+ case MISDN_ALERTING:
+ chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d but I was Ringing before, so ignoreing it\n",p->bc?p->bc->pid:-1);
+ break;
+ case MISDN_CONNECTED:
+ chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d but I was Connected before, so ignoreing it\n",p->bc?p->bc->pid:-1);
+ break;
+ default:
+ p->state=MISDN_ALERTING;
+ chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
+ misdn_lib_send_event( p->bc, EVENT_ALERTING);
+ tone_indicate(p, TONE_ALERTING);
+ chan_misdn_log(1, p->bc->port, " --> * SEND: State Ring pid:%d\n",p->bc?p->bc->pid:-1);
+ ast_setstate(ast,AST_STATE_RINGING);
+ }
+ break;
case AST_CONTROL_ANSWER:
chan_misdn_log(1, p->bc->port, " --> * IND :\tanswer pid:%d\n",p->bc?p->bc->pid:-1);
break;
@@ -1722,8 +1729,10 @@
case AST_CONTROL_PROGRESS:
chan_misdn_log(1, p->bc->port, " --> * IND :\tprogress pid:%d\n",p->bc?p->bc->pid:-1);
break;
+ case AST_CONTROL_PROCEEDING:
+ chan_misdn_log(1, p->bc->port, " --> * IND :\tproceeding pid:%d\n",p->bc?p->bc->pid:-1);
+ break;
case AST_CONTROL_CONGESTION:
-
chan_misdn_log(1, p->bc->port, " --> * IND :\tcongestion pid:%d\n",p->bc?p->bc->pid:-1);
p->bc->out_cause=42;
@@ -2259,17 +2268,16 @@
misdn_cfg_get(port, MISDN_CFG_GROUPNAME, cfg_group, BUFFERSIZE);
if (!strcasecmp(cfg_group, group)) {
- int l1, port_up;
+ int port_up;
- misdn_cfg_get( 0, MISDN_GEN_L1_INFO_OK, &l1, sizeof(l1));
port_up = misdn_lib_port_up(port);
- if ((l1 && port_up) || !l1) {
+ if ( port_up ) {
newbc = misdn_lib_get_free_bc(port, robin_channel);
if (newbc) {
chan_misdn_log(4, port, " Success! Found port:%d channel:%d\n", newbc->port, newbc->channel);
if (port_up)
- chan_misdn_log(4, port, "def_l1:%d, portup:%d\n", l1, port_up);
+ chan_misdn_log(4, port, "ortup:%d\n", port_up);
rr->port = newbc->port;
rr->channel = newbc->channel;
break;
@@ -2290,14 +2298,13 @@
misdn_cfg_get( port, MISDN_CFG_GROUPNAME, cfg_group, BUFFERSIZE);
if (!strcasecmp(cfg_group, group)) {
- int l1, port_up;
+ int port_up;
- misdn_cfg_get( 0, MISDN_GEN_L1_INFO_OK, &l1, sizeof(l1));
port_up = misdn_lib_port_up(port);
- chan_misdn_log(4, port, "def_l1:%d, portup:%d\n", l1, port_up);
+ chan_misdn_log(4, port, "portup:%d\n", port_up);
- if ((l1 && port_up) || !l1) {
+ if ( port_up ) {
newbc = misdn_lib_get_free_bc(port, 0);
if (newbc)
break;
@@ -3524,12 +3531,6 @@
*******************************************/
-static int clearl3_true ( void ) {
- int default_clearl3;
- misdn_cfg_get( 0, MISDN_GEN_CLEAR_L3, &default_clearl3, sizeof(int));
- return default_clearl3;
-}
-
static int g_config_initialized=0;
int load_module(void)
@@ -3578,7 +3579,6 @@
.cb_event = cb_events,
.cb_log = chan_misdn_log,
.cb_jb_empty = chan_misdn_jb_empty,
- .cb_clearl3_true = clearl3_true
};
if (misdn_lib_init(ports, &iface, NULL))
chan_misdn_log(0, 0, "No te ports initialized\n");
Modified: team/crichter/0.3.0/channels/chan_misdn_config.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_misdn_config.c?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn_config.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn_config.c Tue Jan 17 06:06:12 2006
@@ -96,7 +96,7 @@
{ "localdialplan", MISDN_CFG_LOCALDIALPLAN, MISDN_CTYPE_INT, "0", NONE },
{ "nationalprefix", MISDN_CFG_NATPREFIX, MISDN_CTYPE_STR, "0", NONE },
{ "internationalprefix", MISDN_CFG_INTERNATPREFIX, MISDN_CTYPE_STR, "00", NONE },
- { "pres", MISDN_CFG_PRES, MISDN_CTYPE_BOOL, "yes", NONE },
+ { "presentation", MISDN_CFG_PRES, MISDN_CTYPE_STR, "allowed", NONE },
{ "always_immediate", MISDN_CFG_ALWAYS_IMMEDIATE, MISDN_CTYPE_BOOL, "no", NONE },
{ "immediate", MISDN_CFG_IMMEDIATE, MISDN_CTYPE_BOOL, "no", NONE },
{ "senddtmf", MISDN_CFG_SENDDTMF, MISDN_CTYPE_BOOL, "no", NONE },
@@ -120,8 +120,6 @@
{ "bridging", MISDN_GEN_BRIDGING, MISDN_CTYPE_BOOL, "yes", NONE },
{ "stop_tone_after_first_digit", MISDN_GEN_STOP_TONE, MISDN_CTYPE_BOOL, "yes", NONE },
{ "append_digits2exten", MISDN_GEN_APPEND_DIGITS2EXTEN, MISDN_CTYPE_BOOL, "yes", NONE },
- { "l1_info_ok", MISDN_GEN_L1_INFO_OK, MISDN_CTYPE_BOOL, "yes", NONE },
- { "clear_l3", MISDN_GEN_CLEAR_L3, MISDN_CTYPE_BOOL, "no", NONE },
{ "dynamic_crypt", MISDN_GEN_DYNAMIC_CRYPT, MISDN_CTYPE_BOOL, "no", NONE },
{ "crypt_prefix", MISDN_GEN_CRYPT_PREFIX, MISDN_CTYPE_STR, NO_DEFAULT, NONE },
{ "crypt_keys", MISDN_GEN_CRYPT_KEYS, MISDN_CTYPE_STR, NO_DEFAULT, NONE }
Modified: team/crichter/0.3.0/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/chan_misdn_config.h?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/chan_misdn_config.h (original)
+++ team/crichter/0.3.0/channels/misdn/chan_misdn_config.h Tue Jan 17 06:06:12 2006
@@ -61,8 +61,6 @@
MISDN_GEN_BRIDGING, /* int (bool) */
MISDN_GEN_STOP_TONE, /* int (bool) */
MISDN_GEN_APPEND_DIGITS2EXTEN, /* int (bool) */
- MISDN_GEN_L1_INFO_OK, /* int (bool) */
- MISDN_GEN_CLEAR_L3, /* int (bool) */
MISDN_GEN_DYNAMIC_CRYPT, /* int (bool) */
MISDN_GEN_CRYPT_PREFIX, /* char[] */
MISDN_GEN_CRYPT_KEYS, /* char[] */
Modified: team/crichter/0.3.0/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.c?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.c Tue Jan 17 06:06:12 2006
@@ -388,7 +388,7 @@
int i;
for (i=0; i <stack->b_num; i++) {
- cb_log(3, stack->port, "Idx:%d stack->cchan:%d Chan:%d\n",i,stack->channels[i], i+1);
+ cb_log(5, stack->port, "Idx:%d stack->cchan:%d Chan:%d\n",i,stack->channels[i], i+1);
}
}
@@ -1773,10 +1773,6 @@
cb_log(4, stack->port, "%% GOT L2 DeActivate Info.\n");
stack->l2link = 0;
- /** Clean the L3 here **/
- if (cb_clearl3_true())
- clear_l3(stack);
-
free_msg(msg);
return 0;
}
@@ -2628,6 +2624,8 @@
bc->dnumplan>=0?'0'+bc->dnumplan:' ',
bc->rnumplan>=0?'0'+bc->rnumplan:' '
);
+ cb_log(3, stack->port, " --> screen:%d --> pres:%d\n",
+ bc->screen, bc->pres);
cb_log(2, stack->port, " --> channel:%d caps:%s pi:%x keypad:%s\n", bc->channel, bearer2str(bc->capability),bc->progress_indicator, bc->keypad);
@@ -3036,7 +3034,6 @@
cb_log = iface->cb_log;
cb_event = iface->cb_event;
cb_jb_empty = iface->cb_jb_empty;
- cb_clearl3_true = iface->cb_clearl3_true;
glob_mgr = mgr;
Modified: team/crichter/0.3.0/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.h?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.h (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.h Tue Jan 17 06:06:12 2006
@@ -296,7 +296,6 @@
enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data);
void (*cb_log) (int level, int port, char *tmpl, ...);
-int (*cb_clearl3_true)(void);
int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
struct misdn_lib_iface {
@@ -304,7 +303,6 @@
enum event_response_e (*cb_event)(enum event_e event, struct misdn_bchannel *bc, void *user_data);
void (*cb_log)(int level, int port, char *tmpl, ...);
int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
- int (*cb_clearl3_true)(void);
};
/***** USER IFACE **********/
Modified: team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c Tue Jan 17 06:06:12 2006
@@ -1156,7 +1156,7 @@
for (i=0; i< msgs_max; i++)
if ( event == msgs[i].event) return i;
- cb_log(4,0, "get_index: EVENT NOT FOUND!!\n");
+ cb_log(10,0, "get_index: event not found!\n");
return -1;
}
Modified: team/crichter/0.3.0/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/configs/misdn.conf.sample?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- team/crichter/0.3.0/configs/misdn.conf.sample (original)
+++ team/crichter/0.3.0/configs/misdn.conf.sample Tue Jan 17 06:06:12 2006
@@ -58,20 +58,6 @@
; default value: yes
;
append_digits2exten=yes
-
-; set this to yes if you have jollys mISDN which sends correct L1 Infos
-;
-; default value: yes
-;
-l1_info_ok=yes
-
-; set this to yes if you want to clear the l3 in case the l2 deactivates
-; some environments have a flickering l2 which causes this option to
-; damage active calls .. highly experimental
-;
-; default value: no
-;
-clear_l3=no
;;; CRYPTION STUFF
More information about the asterisk-commits
mailing list