[asterisk-commits] branch oej/test-this-branch r17445 - in
/team/oej/test-this-branch: ./ channe...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Apr 4 14:12:43 MST 2006
Author: oej
Date: Tue Apr 4 16:12:39 2006
New Revision: 17445
URL: http://svn.digium.com/view/asterisk?rev=17445&view=rev
Log:
Reset, resolve, go
Modified:
team/oej/test-this-branch/ (props changed)
team/oej/test-this-branch/channels/chan_misdn.c
team/oej/test-this-branch/channels/misdn/Makefile
team/oej/test-this-branch/channels/misdn/isdn_lib.c
team/oej/test-this-branch/channels/misdn/isdn_msg_parser.c
team/oej/test-this-branch/enum.c
Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Apr 4 16:12:39 2006
@@ -1,1 +1,1 @@
-/trunk:1-17398
+/trunk:1-17443
Modified: team/oej/test-this-branch/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_misdn.c?rev=17445&r1=17444&r2=17445&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_misdn.c (original)
+++ team/oej/test-this-branch/channels/chan_misdn.c Tue Apr 4 16:12:39 2006
@@ -1218,6 +1218,9 @@
}
ch->jb=misdn_jb_init(len, threshold);
+
+ if (!ch->jb )
+ bc->nojitter=1;
}
}
@@ -1930,7 +1933,6 @@
release_unlock;
-
{
const char *varcause=NULL;
bc->cause=ast->hangupcause?ast->hangupcause:16;
@@ -2012,6 +2014,7 @@
}
+
chan_misdn_log(1, bc->port, "Channel: %s hanguped\n",ast->name);
return 0;
@@ -2107,7 +2110,7 @@
}
if ( ! ch->bc->addr ) {
- chan_misdn_log(4, ch->bc->port, "misdn_write: no addr for bc dropping:%d\n", frame->samples);
+ chan_misdn_log(8, ch->bc->port, "misdn_write: no addr for bc dropping:%d\n", frame->samples);
return 0;
}
@@ -4227,7 +4230,19 @@
jb->state_empty = 0;
jb->bytes_wrote = 0;
jb->samples = (char *)malloc(size*sizeof(char));
+
+ if (!jb->samples) {
+ chan_misdn_log(-1,0,"No free Mem for jb->samples\n");
+ return NULL;
+ }
+
jb->ok = (char *)malloc(size*sizeof(char));
+
+ if (!jb->ok) {
+ chan_misdn_log(-1,0,"No free Mem for jb->ok\n");
+ return NULL;
+ }
+
for(i=0; i<size; i++)
jb->ok[i]=0;
@@ -4240,7 +4255,6 @@
void misdn_jb_destroy(struct misdn_jb *jb)
{
ast_mutex_destroy(&jb->mutexjb);
-
free(jb->samples);
free(jb);
@@ -4374,7 +4388,8 @@
{
if (! ((0 <= port) && (port <= max_ports))) {
ast_log(LOG_WARNING, "cb_log called with out-of-range port number! (%d)\n", port);
- port=-1;
+ port=0;
+ level=-1;
}
va_list ap;
Modified: team/oej/test-this-branch/channels/misdn/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/misdn/Makefile?rev=17445&r1=17444&r2=17445&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/misdn/Makefile (original)
+++ team/oej/test-this-branch/channels/misdn/Makefile Tue Apr 4 16:12:39 2006
@@ -5,7 +5,7 @@
#
# Verify those options with main Makefile
-CFLAGS = -pipe -c -Wall
+CFLAGS = -pipe -c -Wall -ggdb
ifeq ($(shell uname -m),x86_64)
CFLAGS += -fPIC
endif
Modified: team/oej/test-this-branch/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/misdn/isdn_lib.c?rev=17445&r1=17444&r2=17445&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/misdn/isdn_lib.c (original)
+++ team/oej/test-this-branch/channels/misdn/isdn_lib.c Tue Apr 4 16:12:39 2006
@@ -880,6 +880,11 @@
struct misdn_stack *stack=get_stack_by_bc(bc);
+
+ if (!stack) {
+ cb_log(-1, bc->port, "setup_bc: NO STACK FOUND!!\n");
+ return -1;
+ }
int midev=stack->midev;
int channel=bc->channel-1-(bc->channel>16);
@@ -2790,7 +2795,12 @@
if (!bc) goto ERR;
struct misdn_stack *stack=get_stack_by_bc(bc);
-
+
+ if (!stack) {
+ cb_log(-1,bc->port,"SENDEVENT: no Stack for event:%s oad:%s dad:%s \n", isdn_get_info(msgs_g, event, 0), bc->oad, bc->dad);
+ return -1;
+ }
+
cb_log(6,stack->port,"SENDEVENT: stack->nt:%d stack->uperid:%x\n",stack->nt, stack->upper_id);
if ( stack->nt && !stack->l1link) {
@@ -2938,6 +2948,43 @@
}
+int handle_err(msg_t *msg)
+{
+ iframe_t *frm = (iframe_t*) msg->data;
+ unsigned char buff[32];
+
+ switch (frm->prim) {
+ case DL_DATA|INDICATION:
+ {
+ struct misdn_stack *stack=find_stack_by_port( (frm->addr&MASTER_ID_MASK) >> 8);
+ if (!stack) {
+ cb_log(-1,0,"BCHAN DATA without having a Chan Object (addr:%x) probably we died before closing..\n",frm->addr);
+ return 0;
+ }
+ cb_log(-1,stack->port,"BCHAN DATA without having a Chan Object (addr:%x) probably we died before closing..\n",frm->addr);
+
+ if (stack->l1link)
+ misdn_lib_get_l1_down(stack);
+#if 0
+ iframe_t dact;
+ dact.prim = DL_RELEASE | REQUEST;
+ dact.addr = frm->addr | FLG_MSG_DOWN;
+ dact.dinfo = 0;
+ dact.len = 0;
+
+ mISDN_write(glob_mgr->midev, &dact, mISDN_HEADER_LEN+dact.len, TIMEOUT_1SEC);
+
+ mISDN_write_frame(glob_mgr->midev, buff, frm->addr|FLG_MSG_DOWN, MGR_DELLAYER | REQUEST, 0, 0, NULL, TIMEOUT_1SEC);
+#endif
+ free_msg(msg);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
int manager_isdn_handler(iframe_t *frm ,msg_t *msg)
{
@@ -2971,6 +3018,9 @@
if (handle_frm(msg))
return 0 ;
+ if (handle_err(msg))
+ return 0 ;
+
cb_log(-1, 0, "Unhandled Message: prim %x len %d from addr %x, dinfo %x on this port.\n",frm->prim, frm->len, frm->addr, frm->dinfo);
free_msg(msg);
@@ -3322,7 +3372,8 @@
struct misdn_stack *stack=get_stack_by_bc(bc);
if (!stack) {
- cb_log(-1, stack->port, "bchannel_activate: Stack not found !");
+ cb_log(-1, bc->port, "bchannel_activate: Stack not found !");
+ return ;
}
if (!msg) {
@@ -3370,7 +3421,6 @@
void manager_bchannel_deactivate(struct misdn_bchannel * bc)
{
- iframe_t dact;
struct misdn_stack *stack=get_stack_by_bc(bc);
@@ -3391,6 +3441,7 @@
bc->generate_tone=0;
+ iframe_t dact;
dact.prim = DL_RELEASE | REQUEST;
dact.addr = bc->addr | FLG_MSG_DOWN;
dact.dinfo = 0;
Modified: team/oej/test-this-branch/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/misdn/isdn_msg_parser.c?rev=17445&r1=17444&r2=17445&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/misdn/isdn_msg_parser.c (original)
+++ team/oej/test-this-branch/channels/misdn/isdn_msg_parser.c Tue Apr 4 16:12:39 2006
@@ -333,10 +333,17 @@
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CONNECT_t *connect=(CONNECT_t*)((unsigned long)(msg->data+HEADER_LEN));
+ int type,plan,pres,screen;
+ char connected_pn[32];
+
bc->ces = connect->ces;
bc->ces = connect->ces;
dec_ie_progress(connect->PROGRESS, (Q931_info_t *)connect, &bc->progress_coding, &bc->progress_location, &bc->progress_indicator, nt, bc);
+
+ dec_ie_connected_pn(connect->CONNECT_PN,(Q931_info_t *)connect, &type, &plan, &pres, &screen, connected_pn, 31, nt, bc);
+
+ cb_log(1,bc->port,"CONNETED PN: %s cpn_dialplan:%d\n", connected_pn, type);
#if DEBUG
printf("Parsing CONNECT Msg\n");
Modified: team/oej/test-this-branch/enum.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/enum.c?rev=17445&r1=17444&r2=17445&view=diff
==============================================================================
--- team/oej/test-this-branch/enum.c (original)
+++ team/oej/test-this-branch/enum.c Tue Apr 4 16:12:39 2006
@@ -65,8 +65,7 @@
#define T_TXT 16
#endif
-/* The IETF Enum standard root, managed by the ITU */
-#define TOPLEV "e164.arpa."
+#define TOPLEV "e164.arpa." /*!< The IETF Enum standard root, managed by the ITU */
/* Linked list from config file */
static struct enum_search {
@@ -798,43 +797,42 @@
ret = 0;
}
- if (context.naptr_rrs_count >= context.position && ! (context.options & ENUMLOOKUP_OPTIONS_COUNT)) {
- /* sort array by NAPTR order/preference */
- for (k=0; k<context.naptr_rrs_count; k++) {
- for (i=0; i<context.naptr_rrs_count; i++) {
- /* use order first and then preference to compare */
- if ((ntohs(context.naptr_rrs[k].naptr.order) < ntohs(context.naptr_rrs[i].naptr.order)
- && context.naptr_rrs[k].sort_pos > context.naptr_rrs[i].sort_pos)
- || (ntohs(context.naptr_rrs[k].naptr.order) > ntohs(context.naptr_rrs[i].naptr.order)
- && context.naptr_rrs[k].sort_pos < context.naptr_rrs[i].sort_pos)){
- z = context.naptr_rrs[k].sort_pos;
- context.naptr_rrs[k].sort_pos = context.naptr_rrs[i].sort_pos;
- context.naptr_rrs[i].sort_pos = z;
- continue;
- }
- if (ntohs(context.naptr_rrs[k].naptr.order) == ntohs(context.naptr_rrs[i].naptr.order)) {
- if ((ntohs(context.naptr_rrs[k].naptr.pref) < ntohs(context.naptr_rrs[i].naptr.pref)
- && context.naptr_rrs[k].sort_pos > context.naptr_rrs[i].sort_pos)
- || (ntohs(context.naptr_rrs[k].naptr.pref) > ntohs(context.naptr_rrs[i].naptr.pref)
- && context.naptr_rrs[k].sort_pos < context.naptr_rrs[i].sort_pos)){
- z = context.naptr_rrs[k].sort_pos;
- context.naptr_rrs[k].sort_pos = context.naptr_rrs[i].sort_pos;
- context.naptr_rrs[i].sort_pos = z;
- }
- }
- }
- }
- for (k=0; k<context.naptr_rrs_count; k++) {
- if (context.naptr_rrs[k].sort_pos == context.position-1) {
- ast_copy_string(context.dst, context.naptr_rrs[k].result, dstlen);
- ast_copy_string(context.tech, context.naptr_rrs[k].tech, techlen);
- break;
- }
- }
- } else if (!(context.options & ENUMLOOKUP_OPTIONS_COUNT)) {
- context.dst[0] = 0;
- }
-
+ if (context.naptr_rrs_count >= context.position && ! (context.options & ENUMLOOKUP_OPTIONS_COUNT)) {
+ /* sort array by NAPTR order/preference */
+ for (k=0; k<context.naptr_rrs_count; k++) {
+ for (i=0; i<context.naptr_rrs_count; i++) {
+ /* use order first and then preference to compare */
+ if ((ntohs(context.naptr_rrs[k].naptr.order) < ntohs(context.naptr_rrs[i].naptr.order)
+ && context.naptr_rrs[k].sort_pos > context.naptr_rrs[i].sort_pos)
+ || (ntohs(context.naptr_rrs[k].naptr.order) > ntohs(context.naptr_rrs[i].naptr.order)
+ && context.naptr_rrs[k].sort_pos < context.naptr_rrs[i].sort_pos)){
+ z = context.naptr_rrs[k].sort_pos;
+ context.naptr_rrs[k].sort_pos = context.naptr_rrs[i].sort_pos;
+ context.naptr_rrs[i].sort_pos = z;
+ continue;
+ }
+ if (ntohs(context.naptr_rrs[k].naptr.order) == ntohs(context.naptr_rrs[i].naptr.order)) {
+ if ((ntohs(context.naptr_rrs[k].naptr.pref) < ntohs(context.naptr_rrs[i].naptr.pref)
+ && context.naptr_rrs[k].sort_pos > context.naptr_rrs[i].sort_pos)
+ || (ntohs(context.naptr_rrs[k].naptr.pref) > ntohs(context.naptr_rrs[i].naptr.pref)
+ && context.naptr_rrs[k].sort_pos < context.naptr_rrs[i].sort_pos)){
+ z = context.naptr_rrs[k].sort_pos;
+ context.naptr_rrs[k].sort_pos = context.naptr_rrs[i].sort_pos;
+ context.naptr_rrs[i].sort_pos = z;
+ }
+ }
+ }
+ }
+ for (k=0; k<context.naptr_rrs_count; k++) {
+ if (context.naptr_rrs[k].sort_pos == context.position-1) {
+ ast_copy_string(context.dst, context.naptr_rrs[k].result, dstlen);
+ ast_copy_string(context.tech, context.naptr_rrs[k].tech, techlen);
+ break;
+ }
+ }
+ } else if (!(context.options & ENUMLOOKUP_OPTIONS_COUNT)) {
+ context.dst[0] = 0;
+ }
if (chan)
ret |= ast_autoservice_stop(chan);
@@ -900,7 +898,8 @@
break;
}
if (ret < 0) {
- ast_log(LOG_DEBUG, "No such number found: %s (%s)\n", tmp, strerror(errno));
+ if (option_debug > 1)
+ ast_log(LOG_DEBUG, "No such number found in ENUM: %s (%s)\n", tmp, strerror(errno));
ret = 0;
}
if (chan)
@@ -908,7 +907,7 @@
return ret;
}
-/*! \brief Add enum tree to linked list ---*/
+/*! \brief Add enum tree to linked list */
static struct enum_search *enum_newtoplev(char *s)
{
struct enum_search *tmp;
More information about the asterisk-commits
mailing list