[asterisk-commits] nadi: branch crichter/0.4.0 r38852 - in /team/crichter/0.4.0/channels: ./ misdn/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Aug 4 08:56:33 MST 2006


Author: nadi
Date: Fri Aug  4 10:56:32 2006
New Revision: 38852

URL: http://svn.digium.com/view/asterisk?rev=38852&view=rev
Log:
implemented first bits for encoding ISDN facility information elements via ASN.1 descriptions

Added:
    team/crichter/0.4.0/channels/misdn/asn1.c   (with props)
    team/crichter/0.4.0/channels/misdn/asn1.h   (with props)
Modified:
    team/crichter/0.4.0/channels/chan_misdn.c
    team/crichter/0.4.0/channels/misdn/Makefile
    team/crichter/0.4.0/channels/misdn/fac.c
    team/crichter/0.4.0/channels/misdn/fac.h
    team/crichter/0.4.0/channels/misdn/isdn_msg_parser.c

Modified: team/crichter/0.4.0/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.4.0/channels/chan_misdn.c?rev=38852&r1=38851&r2=38852&view=diff
==============================================================================
--- team/crichter/0.4.0/channels/chan_misdn.c (original)
+++ team/crichter/0.4.0/channels/chan_misdn.c Fri Aug  4 10:56:32 2006
@@ -3509,7 +3509,7 @@
 		chan_misdn_log(2,bc->port," --> bc_state:%s\n",bc_state2str(bc->bc_state));
 	}
 	
-	if (event != EVENT_SETUP) {
+	if (event != EVENT_SETUP && event != EVENT_FACILITY) {
 		if (!ch) {
 			if (event == EVENT_RELEASE_COMPLETE) {
 				chan_misdn_log(1, bc->port, " --> no Ch, so we've already released.\n");
@@ -4328,7 +4328,7 @@
 		
 		break;
 		default:
-			chan_misdn_log(1, bc->port," --> not yet handled\n");
+			chan_misdn_log(1, bc->port," --> not yet handled: facility type:%p\n", bc->fac_type);
 		}
 		
 		break;

Modified: team/crichter/0.4.0/channels/misdn/Makefile
URL: http://svn.digium.com/view/asterisk/team/crichter/0.4.0/channels/misdn/Makefile?rev=38852&r1=38851&r2=38852&view=diff
==============================================================================
--- team/crichter/0.4.0/channels/misdn/Makefile (original)
+++ team/crichter/0.4.0/channels/misdn/Makefile Fri Aug  4 10:56:32 2006
@@ -11,7 +11,7 @@
 endif
 SOURCES		= isdn_lib.c isdn_msg_parser.c 
 OBJDIR		= .
-OBJS		= isdn_lib.o isdn_msg_parser.o fac.o
+OBJS		= isdn_lib.o isdn_msg_parser.o fac.o asn1.o
 
 
 all: chan_misdn_lib.a 
@@ -19,7 +19,7 @@
 
 %.o: %.c
 	$(CC) $(CFLAGS) -o $@ $<
-	
+#-DFACILITY_DEBUG
 
 chan_misdn_lib.a:	$(OBJS)
 	ar crv $@ $(OBJS)

Added: team/crichter/0.4.0/channels/misdn/asn1.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.4.0/channels/misdn/asn1.c?rev=38852&view=auto
==============================================================================
--- team/crichter/0.4.0/channels/misdn/asn1.c (added)
+++ team/crichter/0.4.0/channels/misdn/asn1.c Fri Aug  4 10:56:32 2006
@@ -1,0 +1,72 @@
+
+#include "asn1.h"
+#include <string.h>
+
+int _enc_null (__u8 *dest, int tag)
+{
+	dest[0] = tag;
+	dest[1] = 0;
+	return 2;
+}
+
+int _enc_bool (__u8 *dest, __u32 i, int tag)
+{
+	dest[0] = tag;
+	dest[1] = 1;
+	dest[2] = i ? 1:0;
+	return 3;
+}
+
+int _enc_int (__u8 *dest, __u32 i, int tag)
+{
+	__u8 *p;
+	dest[0] = tag;
+	p = &dest[2];
+	do {
+		*p++ = i;
+		i >>= 8;
+	} while (i);
+	dest[1] = p - &dest[2];
+	return p - dest;
+}
+
+int _enc_enum (__u8 *dest, __u32 i, int tag)
+{
+	__u8 *p;
+
+	dest[0] = tag;
+	p = &dest[2];
+	do {
+		*p++ = i;
+		i >>= 8;
+	} while (i);
+	dest[1] = p - &dest[2];
+	return p - dest;
+}
+
+int _enc_num_string (__u8 *dest, __u8 *nd, __u8 len, int tag)
+{
+	__u8 *p;
+	int i;
+
+	dest[0] = tag;
+	p = &dest[2];
+	for (i = 0; i < len; i++)
+		*p++ = *nd++;
+	dest[1] = p - &dest[2];
+	return p - dest;
+}
+
+int _enc_sequence_start (__u8 *dest, __u8 **id, int tag)
+{
+	dest[0] = tag;
+	*id = &dest[1];
+	return 2;
+}
+
+int _enc_sequence_end (__u8 *dest, __u8 *id, int tag_dummy)
+{
+	*id = dest - id - 1;
+	return 0;
+}
+

Propchange: team/crichter/0.4.0/channels/misdn/asn1.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/crichter/0.4.0/channels/misdn/asn1.c
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/crichter/0.4.0/channels/misdn/asn1.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/crichter/0.4.0/channels/misdn/asn1.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.4.0/channels/misdn/asn1.h?rev=38852&view=auto
==============================================================================
--- team/crichter/0.4.0/channels/misdn/asn1.h (added)
+++ team/crichter/0.4.0/channels/misdn/asn1.h Fri Aug  4 10:56:32 2006
@@ -1,0 +1,42 @@
+#ifndef __ASN1_H__
+#define __ASN1_H__
+
+#include <asm/types.h>
+
+#define ASN1_TAG_BOOLEAN           (0x01)
+#define ASN1_TAG_INTEGER           (0x02)
+#define ASN1_TAG_BIT_STRING        (0x03)
+#define ASN1_TAG_OCTET_STRING      (0x04)
+#define ASN1_TAG_NULL              (0x05)
+#define ASN1_TAG_OBJECT_IDENTIFIER (0x06)
+#define ASN1_TAG_ENUM              (0x0a)
+#define ASN1_TAG_SEQUENCE          (0x30)
+#define ASN1_TAG_SET               (0x31)
+#define ASN1_TAG_NUMERIC_STRING    (0x12)
+#define ASN1_TAG_PRINTABLE_STRING  (0x13)
+#define ASN1_TAG_IA5_STRING        (0x16)
+#define ASN1_TAG_UTC_TIME          (0x17)
+#define ASN1_TAG_CONSTRUCTED       (0x20)
+#define ASN1_TAG_CONTEXT_SPECIFIC  (0x80)
+#define ASN1_TAG_EXPLICIT          (0x100)
+#define ASN1_TAG_OPT               (0x200)
+#define ASN1_NOT_TAGGED            (0x400)
+
+#define enc_null(dest) _enc_null(dest,ASN1_TAG_NULL)
+#define enc_bool(dest,i) _enc_bool(dest,i,ASN1_TAG_BOOLEAN)
+#define enc_int(dest,i) _enc_int(dest,i,ASN1_TAG_INTEGER)
+#define enc_enum(dest,i) _enc_enum(dest,i,ASN1_TAG_ENUM)
+#define enc_num_string(dest,num,len) _enc_num_string(dest,num,len,ASN1_TAG_NUMERIC_STRING)
+#define enc_sequence_start(dest,id) _enc_sequence_start(dest,id,ASN1_TAG_SEQUENCE)
+#define enc_sequence_end(dest,id) _enc_sequence_end(dest,id,ASN1_TAG_SEQUENCE)
+
+int _enc_null (__u8 *dest, int tag);
+int _enc_bool (__u8 *dest, __u32 i, int tag);
+int _enc_int (__u8 *dest, __u32 i, int tag);
+int _enc_enum (__u8 *dest, __u32 i, int tag);
+int _enc_num_string (__u8 *dest, __u8 *nd, __u8 len, int tag);
+int _enc_sequence_start (__u8 *dest, __u8 **id, int tag);
+int _enc_sequence_end (__u8 *dest, __u8 *id, int tag_dummy);
+
+#endif
+

Propchange: team/crichter/0.4.0/channels/misdn/asn1.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/crichter/0.4.0/channels/misdn/asn1.h
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/crichter/0.4.0/channels/misdn/asn1.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/crichter/0.4.0/channels/misdn/fac.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.4.0/channels/misdn/fac.c?rev=38852&r1=38851&r2=38852&view=diff
==============================================================================
--- team/crichter/0.4.0/channels/misdn/fac.c (original)
+++ team/crichter/0.4.0/channels/misdn/fac.c Fri Aug  4 10:56:32 2006
@@ -1,313 +1,158 @@
 
-#include "isdn_lib_intern.h"
-#include "isdn_lib.h"
+#include "fac.h"
+#include "asn1.h"
 
-#include "string.h"
+#if 0
++-------------------------------
+| IE_IDENTIFIER
++-------------------------------
+| {length}
++-------------------------------
+|   +---------------------------
+|   | SERVICE_DISCRIMINATOR
+|   +---------------------------
+|   | COMPONENT_TYPE_TAG
+|   +---------------------------
+|   | {length}
+|   +---------------------------
+|   |	+-----------------------
+|   |   | INVOKE_IDENTIFIER_TAG (0x2)
+|   |   +-----------------------
+|   |   | {length}              (0x1)
+|   |   +-----------------------
+|   |   | {value}               (odd integer 0-127)
+|   |   +-----------------------
+|   |   +-----------------------
+|   |   | OPERATION_VALUE_TAG   (0x2)
+|   |   +-----------------------
+|   |   | {length}              (0x1)
+|   |   +-----------------------
+|   |   | {value}
+|   |   +-----------------------
+|   |	+-----------------------
+|   |	| ASN.1 data
++---+---+-----------------------
+#endif
 
+enum {
+	SUPPLEMENTARY_SERVICE 	= 0x91,
+} SERVICE_DISCRIMINATOR;
 
+enum {
+	INVOKE 					= 0xa1,
+	RETURN_RESULT 			= 0xa2,
+	RETURN_ERROR 			= 0xa3,
+	REJECT 					= 0xa4,
+} COMPONENT_TYPE_TAG;
 
+enum {
+	INVOKE_IDENTIFIER 		= 0x02,
+	LINKED_IDENTIFIER 		= 0x80,
+	NULL_IDENTIFIER 		= 0x05,
+} INVOKE_IDENTIFIER_TAG;
 
-#define CENTREX_ID      0xa1
-#define CALLDEFLECT_ID      0xa1
+enum {
+	OPERATION_VALUE 		= 0x02,
+} OPERATION_VALUE_TAG;
 
-/**
-   This file covers the encoding and decoding of facility messages and
-   facility information elements.
+enum {
+	VALUE_QUERY 			= 0x8c,
+	SET_VALUE 				= 0x8d,
+	REQUEST_FEATURE 		= 0x8f,
+	ABORT 					= 0xbe,
+	REDIRECT_CALL 			= 0xce,
+	CALLING_PARTY_TO_HOLD 	= 0xcf,
+	CALLING_PARTY_FROM_HOLD = 0x50,
+	DROP_TARGET_PARTY 		= 0xd1,
+	USER_DATA_TRANSFER 		= 0xd3,
+	APP_SPECIFIC_STATUS 	= 0xd2,
 
-   There will be 2 Functions as Interface:
-   
-   fac_enc( char **ntmsg, msg_t * msg, enum facility_type type,  union facility fac, struct misdn_bchannel *bc)
-   fac_dec( unsigned char *p, Q931_info_t *qi, enum facility_type *type,  union facility *fac, struct misdn_bchannel *bc);
+	/* not from document */
+	CALL_DEFLECT 			= 0x0d,
+} OPERATION_CODE;
 
-   Those will either read the union facility or fill it.
+enum {
+	Q931_IE_TAG 			= 0x40,
+} ARGUMENT_TAG;
 
-   internally, we will have deconding and encoding functions for each facility
-   IE.
-   
-**/
+#ifdef FACILITY_DEBUG
+#define FAC_DUMP(fac,len,bc) fac_dump(fac,len,bc)
+static void fac_dump (unsigned char *facility, unsigned int fac_len, struct misdn_bchannel *bc)
+{
+	int i;
+	cb_log(0, bc->port, "    --- facility dump start\n");
+	for (i = 0; i < fac_len; ++i)
+		if ((facility[i] >= 'a' && facility[i] <= 'z') || (facility[i] >= 'A' && facility[i] <= 'Z') ||
+			(facility[i] >= '0' && facility[i] <= '9'))
+			cb_log(0, bc->port, "    --- %d: %04p (char:%c)\n", i, facility[i], facility[i]);
+		else
+			cb_log(0, bc->port, "    --- %d: %04p\n", i, facility[i]);
+	cb_log(0, bc->port, "    --- facility dump end\n");
+}
+#else
+#define FAC_DUMP(fac,len,bc)
+#endif
 
+static int enc_fac_calldeflect (__u8 *dest, char *number, int pres)
+{
+	__u8 *body_len,
+		 *p = dest,
+		 *seq1, *seq2;
 
-/* support stuff */
-static void strnncpy(unsigned char *dest, unsigned char *src, int len, int dst_len)
-{
-	if (len > dst_len-1)
-		len = dst_len-1;
-	strncpy((char *)dest, (char *)src, len);
-	dest[len] = '\0';
+	*p++ = SUPPLEMENTARY_SERVICE;
+	*p++ = INVOKE;
+
+	body_len = p++;
+
+	p += _enc_int(p, 0x1 /* some odd integer in (0..127) */, INVOKE_IDENTIFIER);
+	p += _enc_int(p, CALL_DEFLECT, OPERATION_VALUE);
+	p += enc_sequence_start(p, &seq1);
+	  p += enc_sequence_start(p, &seq2);
+	    p += _enc_num_string(p, number, strlen(number), ASN1_TAG_CONTEXT_SPECIFIC);
+	  p += enc_sequence_end(p, seq2);
+	  p += enc_bool(p, pres);
+    p += enc_sequence_end(p, seq1);
+	
+	*body_len = p - &body_len[1];
+	
+	return p - dest;
 }
 
+static void enc_ie_facility (unsigned char **ntmode, msg_t *msg, unsigned char *facility, int facility_len, struct misdn_bchannel *bc)
+{
+	__u8 *ie_fac;
+	
+	Q931_info_t *qi;
 
-
-
-/**********************/
-/*** FACILITY STUFF ***/
-/**********************/
-
-
-/* IE_FACILITY */
-void enc_ie_facility(unsigned char **ntmode, msg_t *msg, unsigned char *facility, int facility_len, int nt, struct misdn_bchannel *bc)
-{
-	unsigned char *p;
-	Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
-	int l;
-
-
-	if (!facility || facility_len<=0)
-	{
-		return;
+	ie_fac = msg_put(msg, facility_len + 2);
+	if (bc->nt) {
+		*ntmode = ie_fac + 1;
+	} else {
+		qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
+		qi->QI_ELEMENT(facility) = ie_fac - (unsigned char *)qi - sizeof(Q931_info_t);
 	}
 
-	
-	l = facility_len;
-	p = msg_put(msg, l+2);
-	if (nt)
-		*ntmode = p+1;
-	else
-		qi->QI_ELEMENT(facility) = p - (unsigned char *)qi - sizeof(Q931_info_t);
-	p[0] = IE_FACILITY;
-	p[1] = l;
-	memcpy(p+2, facility, facility_len);
+	ie_fac[0] = IE_FACILITY;
+	ie_fac[1] = facility_len;
+	memcpy(ie_fac + 2, facility, facility_len);
+
+	FAC_DUMP(ie_fac, facility_len + 2, bc);
 }
 
+void fac_enc (unsigned char **ntmsg, msg_t * msg, enum facility_type type,  union facility fac, struct misdn_bchannel *bc)
+{
+	__u8 facility[256];
+	int len;
 
-/* facility for siemens CENTEX (known parts implemented only) */
-void enc_ie_facility_centrex(unsigned char **ntmode, msg_t *msg, unsigned char *cnip, int setup, int nt, struct misdn_bchannel *bc)
-{
-	unsigned char centrex[256];
-	int i = 0;
-
-	if (!cnip)
-		return;
-
-	/* centrex facility */
-	centrex[i++] = FACILITY_CENTREX;
-	centrex[i++] = CENTREX_ID;
-
-	/* cnip */
-	if (strlen((char *)cnip) > 15)
-	{
-/* 		if (options.deb & DEBUG_PORT) */
-		cb_log(1,0,"%s: CNIP/CONP text too long (max 13 chars), cutting.\n", __FUNCTION__);
-		cnip[15] = '\0';
-	}
-	/*  dunno what the 8 bytes mean */
-	if (setup)
-	{
-		centrex[i++] = 0x17;
-		centrex[i++] = 0x02;
-		centrex[i++] = 0x02;
-		centrex[i++] = 0x44;
-		centrex[i++] = 0x18;
-		centrex[i++] = 0x02;
-		centrex[i++] = 0x01;
-		centrex[i++] = 0x09;
-	} else
-	{
-		centrex[i++] = 0x18;
-		centrex[i++] = 0x02;
-		centrex[i++] = 0x02;
-		centrex[i++] = 0x81;
-		centrex[i++] = 0x09;
-		centrex[i++] = 0x02;
-		centrex[i++] = 0x01;
-		centrex[i++] = 0x0a;
-	}
-
-	centrex[i++] = 0x80;
-	centrex[i++] = strlen((char *)cnip);
-	strcpy((char *)(&centrex[i]), (char *)cnip);
-	i += strlen((char *)cnip);
-	cb_log(4,0,"    cnip='%s'\n", cnip);
-
-	/* encode facility */
-	enc_ie_facility(ntmode, msg, centrex, i, nt , bc);
-}
-
-void dec_ie_facility_centrex(unsigned char *p, Q931_info_t *qi, unsigned char *centrex, int facility_len, unsigned char *cnip, int cnip_len, int nt, struct misdn_bchannel *bc)
-{
-
-	int i = 0;
-	*cnip = '\0';
-	
-	if (facility_len >= 2)
-	{
-		if (centrex[i++] != FACILITY_CENTREX)
-			return;
-		if (centrex[i++] != CENTREX_ID)
-			return;
-	}
-
-	/* loop sub IEs of facility */
-	while(facility_len > i+1)
-	{
-		if (centrex[i+1]+i+1 > facility_len)
-		{
-			printf("%s: ERROR: short read of centrex facility.\n", __FUNCTION__);
-			return;
-		}
-		switch(centrex[i])
-		{
-		case 0x80:
-			strnncpy(cnip, &centrex[i+2], centrex[i+1], cnip_len);
-			cb_log(4,0,"    CENTREX cnip='%s'\n", cnip);
-			break;
-		}
-		i += 1+centrex[i+1];
+	switch (type) {
+	case FACILITY_CALLDEFLECT:
+		len = enc_fac_calldeflect(facility, fac.calldeflect_nr, 1);
+		enc_ie_facility(ntmsg, msg, facility, len, bc);
+	case FACILITY_CENTREX:
+	case FACILITY_NONE:
+		break;
 	}
 }
 
-
-
-
-/* facility for CALL Deflect (known parts implemented only) */
-void enc_ie_facility_calldeflect(unsigned char **ntmode, msg_t *msg, unsigned char *nr, int nt, struct misdn_bchannel *bc)
-{
-	unsigned char fac[256];
-	
-	if (!nr)
-		return;
-
-	int len = strlen(nr);
-	/* calldeflect facility */
-	
-	/* cnip */
-	if (strlen((char *)nr) > 15)
-	{
-/* 		if (options.deb & DEBUG_PORT) */
-		cb_log(1,0,"%s: NR text too long (max 13 chars), cutting.\n", __FUNCTION__);
-		nr[15] = '\0';
-	}
-	
-	fac[0]=FACILITY_CALLDEFLECT;	// ..
-	fac[1]=CALLDEFLECT_ID;
-	fac[2]=0x0f + len;	// strlen destination + 15 = 26
-	fac[3]=0x02;
-	fac[4]=0x01;
-	//fac[5]=0x70;
-	fac[5]=0x09;
-	fac[6]=0x02;
-	fac[7]=0x01;
-	fac[8]=0x0d;
-	fac[9]=0x30;
-	fac[10]=0x07 + len;	// strlen destination + 7 = 18
-	fac[11]=0x30;	// ...hm 0x30
-	fac[12]=0x02+ len;	// strlen destination + 2	
-	fac[13]=0x80;	// CLIP
-	fac[14]= len;	//  strlen destination 
-	
-	memcpy((unsigned char *)fac+15,nr,len);
-	fac[15+len]=0x01; //sending complete
-	fac[16+len]=0x01;
-	fac[17+len]=0x80;
-	
-	enc_ie_facility(ntmode, msg, fac, 17+len +1 , nt , bc);
-}
-
-
-void dec_ie_facility_calldeflect(unsigned char *p, Q931_info_t *qi, unsigned char *fac, int fac_len, unsigned char *cd_nr,  int nt, struct misdn_bchannel *bc)
-{
-	*cd_nr = '\0';
-	
-	if (fac_len >= 15)
-	{
-		if (fac[0] != FACILITY_CALLDEFLECT)
-			return;
-		if (fac[1] != CALLDEFLECT_ID)
-			return;
-	} else {
-		cb_log(1,bc->port, "IE too short: FAC_CALLDEFLECT\n");
-		return ;
-	}
-	
-	
-	
-	{
-		int dest_len=fac[2]-0x0f;
-		
-		if (dest_len <0 || dest_len > 15) {
-			cb_log(1,bc->port, "IE is garbage: FAC_CALLDEFLECT\n");
-			return ;
-		}
-		
-		if (fac_len < 15+dest_len) {
-			cb_log(1,bc->port, "IE too short: FAC_CALLDEFLECT\n");
-			return ;
-		}
-		
-		memcpy(cd_nr, &fac[15],dest_len);
-		cd_nr[dest_len]=0;
-		
-		cb_log(5,bc->port, "--> IE CALLDEFLECT NR: %s\n",cd_nr);
-	}
-}
-
-
-
-void fac_enc( unsigned char **ntmsg, msg_t * msg, enum facility_type type,  union facility fac, struct misdn_bchannel *bc)
-{
-	switch (type) {
-	case FACILITY_CENTREX:
-	{
-		int setup=0;
-		enc_ie_facility_centrex(ntmsg, msg, fac.cnip, setup, bc->nt, bc);
-	}
-		break;
-	case FACILITY_CALLDEFLECT:
-		enc_ie_facility_calldeflect(ntmsg, msg, fac.calldeflect_nr, bc->nt, bc);
-		break;
-	default:
-		cb_log(1,0,"Don't know how handle this facility: %d\n", type);
-	}
-}
-
-void fac_dec( unsigned char *p, Q931_info_t *qi, enum facility_type *type,  union facility *fac, struct misdn_bchannel *bc)
-{
-	int i, fac_len=0;
-	unsigned char facility[256];
-	
-	if (! (bc->nt) )
-	{
-		p = NULL;
-		if (qi->QI_ELEMENT(facility))
-			p = (unsigned char *)qi + sizeof(Q931_info_t) + qi->QI_ELEMENT(facility) + 1;
-	}
-	if (!p)
-		return;
-	
-	fac_len = p[0];
-	memcpy(facility, p+1, fac_len);
-	
-	
-	switch(facility[0]) {
-	case FACILITY_CENTREX:
-	{
-		int cnip_len=15;
-		
-		dec_ie_facility_centrex(p, qi,facility, fac_len, fac->cnip, cnip_len, bc->nt, bc);
-		
-		*type=FACILITY_CENTREX;
-	}
-	break;
-	case FACILITY_CALLDEFLECT:
-		dec_ie_facility_calldeflect(p, qi,facility, fac_len, fac->calldeflect_nr,  bc->nt, bc);
-		
-		*type=FACILITY_CALLDEFLECT;
-		break;
-	default:
-		cb_log(3, bc->port, "Unknown Facility received: ");
-		i = 0;
-		while(i < fac_len)
-		{
-			cb_log(3, bc->port, " %02x", facility[i]);
-			i++;
-		}
-		cb_log(3, bc->port, "    facility\n");
-		
-		*type=FACILITY_NONE;
-	}
-	
-	
-}
-
-/*** FACILITY END **/
-
+void fac_dec (unsigned char *p, Q931_info_t *qi, enum facility_type *type,  union facility *fac, struct misdn_bchannel *bc)
+{}

Modified: team/crichter/0.4.0/channels/misdn/fac.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.4.0/channels/misdn/fac.h?rev=38852&r1=38851&r2=38852&view=diff
==============================================================================
--- team/crichter/0.4.0/channels/misdn/fac.h (original)
+++ team/crichter/0.4.0/channels/misdn/fac.h Fri Aug  4 10:56:32 2006
@@ -1,8 +1,10 @@
-#ifndef FAC_H
-#define FAC_H
+#ifndef __FAC_H__
+#define __FAC_H__
 
-void fac_enc( unsigned char **ntmsg, msg_t * msg, enum facility_type type,  union facility fac, struct misdn_bchannel *bc);
+#include "isdn_lib_intern.h"
 
-void fac_dec( unsigned char *p, Q931_info_t *qi, enum facility_type *type,  union facility *fac, struct misdn_bchannel *bc);
+void fac_enc (unsigned char **ntmsg, msg_t *msg, enum facility_type type, union facility fac, struct misdn_bchannel *bc);
+void fac_dec (unsigned char *p, Q931_info_t *qi, enum facility_type *type, union facility *fac, struct misdn_bchannel *bc);
 
 #endif
+

Modified: team/crichter/0.4.0/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.4.0/channels/misdn/isdn_msg_parser.c?rev=38852&r1=38851&r2=38852&view=diff
==============================================================================
--- team/crichter/0.4.0/channels/misdn/isdn_msg_parser.c (original)
+++ team/crichter/0.4.0/channels/misdn/isdn_msg_parser.c Fri Aug  4 10:56:32 2006
@@ -880,7 +880,7 @@
 void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) 
 {
 
-#ifdef FACILITY_DECODE
+#ifdef FACILITY_DEBUG
 	int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
 	FACILITY_t *facility=(FACILITY_t*)((unsigned long)(msg->data+HEADER_LEN)); 
 	Q931_info_t *qi=(Q931_info_t*)(msg->data+HEADER_LEN);  



More information about the asterisk-commits mailing list