diff --git a/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.c b/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.c index 8d512f5394..be3d86313f 100644 --- a/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.c +++ b/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.c @@ -78,7 +78,29 @@ pcap_t *pcaphandle = NULL; char *pcapfn = NULL; int do_q931ToPcap= 0; +/*Predefined Ethernet Frame with Q931-over-IP encapsulated - From remote TDM host to FreeSWITCH*/ +L3UCHAR recFrame[SNAPLEN]= { + /*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/ + 2,0,1,0xAA,0xAA,0xAA,2,0,1,0xBB,0xBB,0xBB,0x81,0,0xE0,0,0x08,0, + /*IPv4 Header (minimal size; no options)*/ + 0x45,0,0,44,0,0,0,0,64,6,0,0,2,2,2,2,1,1,1,1, + /*TCP-Header*/ + 0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0, + /*TPKT-Header RFC 1006*/ + 3,0,0,0 + }; +/*Predefined Ethernet Frame with Q931-over-IP encapsulated - Frome FreeSWITCH to remote TDM host*/ +L3UCHAR sendFrame[SNAPLEN]= { + /*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/ + 2,0,1,0xBB,0xBB,0xBB,2,0,1,0xAA,0xAA,0xAA,0x81,0,0xE0,0,0x08,0, + /*IPv4 Header (minimal size; no options)*/ + 0x45,0,0,44,0,0,0,0,64,6,0,0,1,1,1,1,2,2,2,2, + /*TCP-Header*/ + 0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0, + /*TPKT-Header RFC 1006*/ + 3,0,0,0 + }; static zap_status_t openPcapFile(void) { @@ -144,29 +166,6 @@ static zap_status_t writeQ931PacketToPcap(L3UCHAR* q931buf, L3USHORT q931size, L spanid=span_id; - /*Predefined Ethernet Frame with Q931-over-IP encapsulated - From remote TDM host to FreeSWITCH*/ - L3UCHAR recFrame[SNAPLEN]= { - /*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/ - 2,0,1,0xAA,0xAA,0xAA,2,0,1,0xBB,0xBB,0xBB,0x81,0,0xE0,0,0x08,0, - /*IPv4 Header (minimal size; no options)*/ - 0x45,0,0,44,0,0,0,0,64,6,0,0,2,2,2,2,1,1,1,1, - /*TCP-Header*/ - 0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0, - /*TPKT-Header RFC 1006*/ - 3,0,0,0 - }; - - /*Predefined Ethernet Frame with Q931-over-IP encapsulated - Frome FreeSWITCH to remote TDM host*/ - L3UCHAR sendFrame[SNAPLEN]= { - /*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/ - 2,0,1,0xBB,0xBB,0xBB,2,0,1,0xAA,0xAA,0xAA,0x81,0,0xE0,0,0x08,0, - /*IPv4 Header (minimal size; no options)*/ - 0x45,0,0,44,0,0,0,0,64,6,0,0,1,1,1,1,2,2,2,2, - /*TCP-Header*/ - 0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0, - /*TPKT-Header RFC 1006*/ - 3,0,0,0 - }; /*The total length of the ethernet frame generated by this function has a min length of 66 so we don't have to care about padding :)*/