1 #ifndef _Am100rel_h_
2 #define _Am100rel_h_
3 
4 #include "AmSipMsg.h"
5 
6 class AmSipDialog;
7 class AmSipDialogEventHandler;
8 
9 class Am100rel
10 {
11 
12 public:
13   /** enable the reliability of provisional replies? */
14   enum State {
15     REL100_DISABLED=0,
16     REL100_SUPPORTED,
17     REL100_REQUIRE,
18     //REL100_PREFERED, //TODO
19     REL100_IGNORED,
20     REL100_MAX
21   };
22 
23 private:
24   State reliable_1xx;
25 
26   unsigned rseq;          // RSeq for next request
27   bool rseq_confirmed;    // latest RSeq is confirmed
28   unsigned rseq_1st;      // value of first RSeq (init value)
29 
30   AmSipDialog* dlg;
31   AmSipDialogEventHandler* hdl;
32 
33 public:
34   Am100rel(AmSipDialog* dlg, AmSipDialogEventHandler* hdl);
35 
setState(State s)36   void setState(State s) { reliable_1xx = s; }
getState()37   State getState() { return reliable_1xx; }
38 
39   int  onRequestIn(const AmSipRequest& req);
40   int  onReplyIn(const AmSipReply& reply);
41   void onRequestOut(AmSipRequest& req);
42   void onReplyOut(AmSipReply& reply);
43 
44   void onTimeout(const AmSipRequest& req, const AmSipReply& rpl);
45 };
46 
47 #endif
48