9 #pragma disable_warning 85
10 #pragma disable_warning 88
14 #define UCHAR unsigned char
15 #define USHORT unsigned short
16 #define ULONG unsigned long
17 //#define BOOLEAN unsigned char
20 #define PCHAR unsigned char *
21 #define PSHORT unsigned short *
22 #define PLONG unsigned long *
25 #define NULL (void *)0
32 #define RTP_SSRC_LEN 4
33 #define MAX_USER_NAME_LEN 32
34 #define MAX_USER_NUMBER_LEN 32
35 #define MAX_TAG_LEN 16
37 typedef struct _CALL_TIME
48 UCHAR iBankOffset
; /* Bank offset of call back function */
49 USHORT sCallBack
; /* Address of call back function */
51 UCHAR pDstIP
[IP_ALEN
];
55 typedef struct ucb
* UDP_SOCKET
;
57 typedef struct sip_lcb
* SIP_LCB_HANDLE
;
58 typedef struct sip_tcb
* SIP_TCB_HANDLE
;
64 UCHAR pDstIP
[IP_ALEN
];
77 UCHAR iState
; // State of this line
78 BOOLEAN bCallee
; // Caller or callee
79 UCHAR iTimer
; // No answer timer
80 UCHAR iRemoteRb
; // ringback tone type
82 BOOLEAN bEarlyDlg
; // already received a 1xx response
84 UCHAR iVoiceCoder
; // voice coder used by this line
86 UCHAR iRemoteMode
; // remote voice transmission mode
87 UCHAR pRtpDstIP
[IP_ALEN
]; // RTP dst IP
88 USHORT sRtpDstPort
; // RTP dst port
89 UCHAR iCoderPayload
; // Peer's coder payload
90 UCHAR iDtmfPayload
; // Peer's DTMF payload
92 UCHAR iLocalMode
; // local voice transmission mode
94 UCHAR pSdpSessionId
[9];
96 UDP_SOCKET pRtpSocket
;
97 USHORT sRtpPort
; // local RTP port
98 USHORT sRtpSeq
; // RTP sequence
99 UCHAR pRtpSSRC
[RTP_SSRC_LEN
];
100 UCHAR pRtpDstSSRC
[RTP_SSRC_LEN
];
101 ULONG lRtpTimeStamp
; // RTP timestamp
104 BOOLEAN bSendingKey
; // RFC2833 send key
105 UCHAR iSendKey
; // Key being sent
106 USHORT sSendKeyLen
; // Duration in timestamp
108 UCHAR pKeyTimeStamp
[4];
110 UCHAR pDstIP
[IP_ALEN
]; // Dst IP of this call
111 USHORT sDstPort
; // Dst port of this call
112 ULONG lRseq
; // RSEQ for PRACK
113 ULONG lCurSeq
; // Current sequence of this call
114 ULONG lInvSeq
; // Sequence of INVITE request
115 PCHAR pInvUri
; // Original request Uri of this call
116 PCHAR pReqUri
; // Request URI of this call
117 PCHAR pBranch
; // Invite branch
118 PCHAR pCallId
; // Call-ID header of this call
119 PCHAR pFrom
; // From header of this call
120 PCHAR pTo
; // To header
121 PCHAR pFromTag
; // Local tag
122 PCHAR pToTag
; // Remote tag
123 PCHAR pProxyAuth
; // Proxy-Authenticate information
124 PCHAR pWWWAuth
; // WWW-Authenticate information
125 PCHAR pRoute
; // Route header to be included in request
126 PCHAR pInvHeader
; // Invite header to be included in response
127 SIP_TCB_HANDLE pInvTcb
; // Transaction control block of INVITE request
129 UCHAR pRespDstIP
[IP_ALEN
];
133 UCHAR iXferPart
; // which role do we play? transferor, transferee or transfer-to?
136 ULONG lSessionExpires
;
140 UCHAR pPeerName
[MAX_USER_NAME_LEN
];
141 UCHAR pPeerNumber
[MAX_USER_NUMBER_LEN
];
143 UCHAR pKeyOut
[MAX_USER_NUMBER_LEN
];
148 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
149 __xdata
struct sip_lcb l
;
150 extern SIP_LCB_HANDLE Sip_pCurLcb
= &l
;
152 void line_start(PCHAR pDst
) {}
153 void sip_add_local_uri(BOOLEAN bIP
, BOOLEAN bPort
) {}
154 void sip_new_token(PCHAR pDst
, UCHAR iLen
) {}
155 void sip_add_token(PCHAR pToken
, PCHAR pValue
) {}
156 void dummy_free(void *p
) {}
157 PCHAR
heap_save_str(PCHAR pStr
) { return ((PCHAR
) 42);}
158 BOOLEAN Sys_bRegister
;
159 const UCHAR _cTokenTag
[] = "";
168 UCHAR pTag
[MAX_TAG_LEN
+1];
171 sip_add_local_uri(!Sys_bRegister
, FALSE
);
172 sip_new_token(pTag
, MAX_TAG_LEN
);
173 sip_add_token(_cTokenTag
, pTag
);
174 dummy_free(Sip_pCurLcb
->pFrom
);
175 Sip_pCurLcb
->pFrom
= heap_save_str(pBuf
);
176 dummy_free(Sip_pCurLcb
->pFromTag
);
177 Sip_pCurLcb
->pFromTag
= heap_save_str(pTag
);
184 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
185 l
.pFrom
= (PCHAR
) 23;
187 ASSERT (l
.pFrom
== (PCHAR
) 42);