missing myisdn
authorSuper User <root@isdn.jolly.ten>
Thu, 24 Apr 2008 17:14:09 +0000 (19:14 +0200)
committerSuper User <root@isdn.jolly.ten>
Thu, 24 Apr 2008 17:14:09 +0000 (19:14 +0200)
modified:   mISDN.cpp
new file:   myisdn.h

mISDN.cpp
myisdn.h [new file with mode: 0644]

index e8e7692..bfac919 100644 (file)
--- a/mISDN.cpp
+++ b/mISDN.cpp
@@ -3780,7 +3780,7 @@ void PmISDN::txfromup(unsigned char *data, int length)
 #ifdef SOCKET_MISDN
                hh->prim = DL_DATA_REQ; 
                hh->id = 0;
-               memcpy(buf+MISDN_HEADER_LEN, data, ISDN_LOAD);
+               memset(buf+MISDN_HEADER_LEN, (options.law=='a')?0x2a:0xff, ISDN_LOAD);
                ret = sendto(p_m_mISDNport->b_socket[p_m_b_index], buf, MISDN_HEADER_LEN+ISDN_LOAD, 0, NULL, 0);
                if (!ret)
                        PERROR("Failed to send to socket %d\n", p_m_mISDNport->b_socket[p_m_b_index]);
@@ -3789,7 +3789,7 @@ void PmISDN::txfromup(unsigned char *data, int length)
                frm->addr = p_m_mISDNport->b_addr[p_m_b_index] | FLG_MSG_DOWN;
                frm->dinfo = 0;
                frm->len = ISDN_LOAD;
-               memcpy(buf+mISDN_HEADER_LEN, data, ISDN_LOAD);
+               memset(buf+MISDN_HEADER_LEN, (options.law=='a')?0x2a:0xff, ISDN_LOAD);
                mISDN_write(mISDNdevice, frm, mISDN_HEADER_LEN+ISDN_LOAD, TIMEOUT_1SEC);
 #endif
                p_m_load += ISDN_LOAD;
diff --git a/myisdn.h b/myisdn.h
new file mode 100644 (file)
index 0000000..7e4173e
--- /dev/null
+++ b/myisdn.h
@@ -0,0 +1,95 @@
+/*****************************************************************************\
+**                                                                           **
+** PBX4Linux                                                                 **
+**                                                                           **
+**---------------------------------------------------------------------------**
+** Copyright: Andreas Eversberg                                              **
+**                                                                           **
+** information elements support header                                       **
+**                                                                           **
+\*****************************************************************************/ 
+
+
+#ifndef SOCKET_MISDN
+
+#define MT_ALERTING             0x01
+#define MT_CALL_PROCEEDING      0x02
+#define MT_CONNECT              0x07
+#define MT_CONNECT_ACKNOWLEDGE  0x0f
+#define MT_PROGRESS             0x03
+#define MT_SETUP                0x05
+#define MT_SETUP_ACKNOWLEDGE    0x0d
+#define MT_RESUME               0x26
+#define MT_RESUME_ACKNOWLEDGE   0x2e
+#define MT_RESUME_REJECT        0x22
+#define MT_SUSPEND              0x25
+#define MT_SUSPEND_ACKNOWLEDGE  0x2d
+#define MT_SUSPEND_REJECT       0x21
+#define MT_USER_INFORMATION     0x20
+#define MT_DISCONNECT           0x45
+#define MT_RELEASE              0x4d
+#define MT_RELEASE_COMPLETE     0x5a
+#define MT_RESTART              0x46
+#define MT_RESTART_ACKNOWLEDGE  0x4e
+#define MT_SEGMENT              0x60
+#define MT_CONGESTION_CONTROL   0x79
+#define MT_INFORMATION          0x7b
+#define MT_FACILITY             0x62
+#define MT_NOTIFY               0x6e
+#define MT_STATUS               0x7d
+#define MT_STATUS_ENQUIRY       0x75
+#define MT_HOLD                 0x24
+#define MT_HOLD_ACKNOWLEDGE     0x28
+#define MT_HOLD_REJECT          0x30
+#define MT_RETRIEVE             0x31
+#define MT_RETRIEVE_ACKNOWLEDGE 0x33
+#define MT_RETRIEVE_REJECT      0x37
+
+#define IE_SEGMENT      0x00
+#define IE_BEARER       0x04
+#define IE_CAUSE        0x08
+#define IE_CALL_ID      0x10
+#define IE_CALL_STATE   0x14
+#define IE_CHANNEL_ID   0x18
+#define IE_FACILITY     0x1c
+#define IE_PROGRESS     0x1e
+#define IE_NET_FAC      0x20
+#define IE_NOTIFY       0x27
+#define IE_DISPLAY      0x28
+#define IE_DATE         0x29
+#define IE_KEYPAD       0x2c
+#define IE_SIGNAL       0x34
+#define IE_INFORATE     0x40
+#define IE_E2E_TDELAY   0x42
+#define IE_TDELAY_SEL   0x43
+#define IE_PACK_BINPARA 0x44
+#define IE_PACK_WINSIZE 0x45
+#define IE_PACK_SIZE    0x46
+#define IE_CUG          0x47
+#define IE_REV_CHARGE   0x4a
+#define IE_CONNECT_PN   0x4c
+#define IE_CONNECT_SUB  0x4d
+#define IE_CALLING_PN   0x6c
+#define IE_CALLING_SUB  0x6d
+#define IE_CALLED_PN    0x70
+#define IE_CALLED_SUB   0x71
+#define IE_REDIR_NR     0x74
+#define IE_REDIR_DN     0x76
+#define IE_TRANS_SEL    0x78
+#define IE_RESTART_IND  0x79
+#define IE_LLC          0x7c
+#define IE_HLC          0x7d
+#define IE_USER_USER    0x7e
+#define IE_ESCAPE       0x7f
+#define IE_CNIP                0x80    /* siemens centrex extension */
+#define IE_SHIFT        0x90
+#define IE_MORE_DATA    0xa0
+#define IE_COMPLETE     0xa1
+#define IE_CONGESTION   0xb0
+#define IE_REPEAT       0xd0
+
+#endif
+
+#define CENTREX_FAC    0x88
+#define CENTREX_ID     0xa1
+