Browse code

removed "#if 0" dead code

removed code disabled during development of 100rel extension

bpintea authored on 01/08/2010 16:38:56
Showing 11 changed files
... ...
@@ -127,13 +127,8 @@ class SIPRegistration : public AmSipDialogEventHandler,
127 127
   void onSipReply(const AmSipReply& reply, int old_dlg_status);
128 128
   void onSipRequest(const AmSipRequest& req) {}
129 129
   void onInvite2xx(const AmSipReply&) {}
130
-#if 0
131
-  void onNo2xxACK(unsigned int) {}
132
-  void onNoErrorACK(unsigned int) {}
133
-#else
134 130
   void onNoAck(unsigned int) {}
135 131
   void onNoPrack(const AmSipRequest &, const AmSipReply &) {}
136
-#endif
137 132
 
138 133
   /** is this registration registered? */
139 134
   bool active; 
... ...
@@ -906,18 +906,6 @@ void AmSession::onInvite2xx(const AmSipReply& reply)
906 906
   if(t) dlg.send_200_ack(*t);
907 907
 }
908 908
 
909
-#if 0
910
-void AmSession::onNo2xxACK(unsigned int cseq)
911
-{
912
-  dlg.bye();
913
-  setStopped();
914
-}
915
-
916
-void AmSession::onNoErrorACK(unsigned int cseq)
917
-{
918
-  setStopped();
919
-}
920
-#else
921 909
 void AmSession::onNoAck(unsigned int cseq)
922 910
 {
923 911
   if (dlg.getStatus() == AmSipDialog::Connected)
... ...
@@ -939,8 +927,6 @@ void AmSession::onNoPrack(const AmSipRequest &req, const AmSipReply &rpl)
939 927
   }
940 928
 }
941 929
 
942
-#endif
943
-
944 930
 void AmSession::onAudioEvent(AmAudioEvent* audio_ev)
945 931
 {
946 932
   if (audio_ev->event_id == AmAudioEvent::cleared)
... ...
@@ -498,12 +498,6 @@ public:
498 498
   virtual void onSipRequest(const AmSipRequest& req);
499 499
   /** Entry point for SIP Replies   */
500 500
   virtual void onSipReply(const AmSipReply& reply, int old_dlg_status);
501
-#if 0
502
-  /** There was a timeout receiving a reply for the given SIP request */
503
-  virtual void onSipReqTimeout(const AmSipRequest &req);
504
-  /** There was a timeout receiving a request (PR-/ACK) for given SIP reply */
505
-  virtual void onSipRplTimeout(const AmSipRequest &req, const AmSipReply &rpl);
506
-#endif
507 501
 
508 502
   /** 2xx reply has been received for an INVITE transaction */
509 503
   virtual void onInvite2xx(const AmSipReply& reply);
... ...
@@ -307,22 +307,10 @@ void AmSipDialog::uasTimeout(AmSipTimeoutEvent* to_ev)
307 307
   assert(to_ev);
308 308
 
309 309
   switch(to_ev->type){
310
-#if 0
311
-  case AmSipTimeoutEvent::no2xxACK:
312
-    DBG("Timeout: missing 2xx-ACK\n");
313
-    if(hdl) hdl->onNo2xxACK(to_ev->cseq);
314
-    break;
315
-
316
-  case AmSipTimeoutEvent::noErrorACK:
317
-    DBG("Timeout: missing non-2xx-ACK\n");
318
-    if(hdl) hdl->onNoErrorACK(to_ev->cseq);
319
-    break;
320
-#else
321 310
   case AmSipTimeoutEvent::noACK:
322 311
     DBG("Timeout: missing ACK\n");
323 312
     if(hdl) hdl->onNoAck(to_ev->cseq);
324 313
     break;
325
-#endif
326 314
 
327 315
   case AmSipTimeoutEvent::noPRACK:
328 316
     DBG("Timeout: missing PRACK\n");
... ...
@@ -96,19 +96,11 @@ class AmSipDialogEventHandler
96 96
   /** Hook called when a local INVITE request has been replied with 2xx */
97 97
   virtual void onInvite2xx(const AmSipReply& reply)=0;
98 98
 
99
-#if 0
100
-  /** Hook called when a UAS INVITE transaction did not receive a 2xx-ACK */
101
-  virtual void onNo2xxACK(unsigned int cseq)=0;
102
-
103
-  /** Hook called when a UAS INVITE transaction did not receive a non-2xx-ACK */
104
-  virtual void onNoErrorACK(unsigned int cseq)=0;
105
-#else
106 99
   /** Hook called when a UAS INVITE transaction did not receive the ACK */
107 100
   virtual void onNoAck(unsigned int)=0;
108 101
 
109 102
   /** Hook called when a UAS INVITE transaction did not receive the PRACK */
110 103
   virtual void onNoPrack(const AmSipRequest &, const AmSipReply &)=0;
111
-#endif
112 104
 
113 105
   virtual ~AmSipDialogEventHandler() {};
114 106
 };
... ...
@@ -7,26 +7,6 @@ void AmSipTimeoutEvent::operator() (AmSipDialog* dlg)
7 7
     dlg->uasTimeout(this);
8 8
 }
9 9
 
10
-
11
-#if 0
12
-  AmSipReqTimeoutEvent *req_tout_ev = 
13
-    dynamic_cast<AmSipReqTimeoutEvent *>(sip_ev);
14
-  if (req_tout_ev) {
15
-    CALL_EVENT_H(onSipReqTimeout, req_tout_ev->req);
16
-    onSipReqTimeout(req_tout_ev->req);
17
-    return;
18
-  }
19
-
20
-  AmSipRplTimeoutEvent *rpl_tout_ev = 
21
-    dynamic_cast<AmSipRplTimeoutEvent *>(sip_ev);
22
-  if (rpl_tout_ev) {
23
-    CALL_EVENT_H(onSipRplTimeout, rpl_tout_ev->req, rpl_tout_ev->rpl);
24
-    onSipRplTimeout(rpl_tout_ev->req, rpl_tout_ev->rpl);
25
-    return;
26
-  }
27
-#endif
28
-
29
-
30 10
 void AmSipRequestEvent::operator() (AmSipDialog* dlg)
31 11
 {
32 12
     assert(dlg);
... ...
@@ -48,30 +48,6 @@ class AmSipEvent: public AmEvent
48 48
   virtual void operator() (AmSipDialog* dlg)=0;
49 49
 };
50 50
 
51
-#if 0
52
-/** \brief UAS reply re-transmission timeout event */
53
-class AmSipTimeoutEvent: public AmSipEvent
54
-{
55
- public:
56
-
57
-  enum EvType {
58
-    _noEv=0,
59
-    no2xxACK,
60
-    noErrorACK,
61
-    noPRACK
62
-  };
63
-
64
-  EvType       type;
65
-
66
-  unsigned int cseq;
67
-
68
-  AmSipTimeoutEvent(EvType t, unsigned int cseq_num)
69
-    : AmSipEvent(), type(t)
70
-   {}
71
-
72
-  virtual void operator() (AmSipDialog* dlg);
73
-};
74
-#else
75 51
 /** \brief UAS reply re-transmission timeout event */
76 52
 class AmSipTimeoutEvent: public AmSipEvent
77 53
 {
... ...
@@ -98,7 +74,6 @@ class AmSipTimeoutEvent: public AmSipEvent
98 74
 
99 75
   virtual void operator() (AmSipDialog* dlg);
100 76
 };
101
-#endif
102 77
 
103 78
 /** \brief SIP request event */
104 79
 class AmSipRequestEvent: public AmSipEvent
... ...
@@ -126,37 +101,5 @@ class AmSipReplyEvent: public AmSipEvent
126 101
 };
127 102
 
128 103
 
129
-#if 0
130
-// TODO: have a single AmSipT.outEv. class, with type and a _AmSipMsgInDlg
131
-// ptr: it will save the dynamic_cast efforts later.
132
-
133
-class AmSipTimeoutEvent: public AmSipEvent
134
-{
135
-  public:
136
-    AmSipTimeoutEvent(int id = -1) 
137
-      : AmSipEvent(-1)
138
-    {}
139
-};
140
-
141
-class AmSipReqTimeoutEvent : public AmSipTimeoutEvent
142
-{
143
-  public:
144
-    AmSipRequest req;
145
-    AmSipReqTimeoutEvent(AmSipRequest &r):
146
-      AmSipTimeoutEvent(), req(r)
147
-    {}
148
-};
149
-
150
-class AmSipRplTimeoutEvent : public AmSipTimeoutEvent
151
-{
152
-  public:
153
-    AmSipRequest req;
154
-    AmSipReply   rpl;
155
-    AmSipRplTimeoutEvent(AmSipRequest &_req, AmSipReply &_rpl):
156
-      AmSipTimeoutEvent(), req(_req), rpl(_rpl)
157
-    {}
158
-};
159
-#endif
160
-
161 104
 
162 105
 #endif
... ...
@@ -571,57 +571,6 @@ void SipCtrlInterface::handle_sip_reply(sip_msg* msg)
571 571
     AmSipDispatcher::instance()->handleSipMsg(reply);
572 572
 }
573 573
 
574
-#if 0
575
-void SipCtrlInterface::timer_expired(sip_trans* trans, sip_timer_type tt)
576
-{
577
-    assert(trans);
578
-    assert(trans->type == TT_UAS);
579
-
580
-    AmSipTimeoutEvent::EvType ev = AmSipTimeoutEvent::_noEv;
581
-
582
-    DBG("tt=%i;state=%i\n",tt,trans->state);
583
-
584
-    //TODO: send an event to the SIP Dialog
585
-    switch(tt){
586
-	
587
-    case STIMER_H:
588
-	switch(trans->state){
589
-	case TS_TERMINATED_200: // missing 200-ACK
590
-	    ev = AmSipTimeoutEvent::no2xxACK;
591
-	    break;
592
-	case TS_COMPLETED: // missing error-ACK
593
-	    ev = AmSipTimeoutEvent::noErrorACK;
594
-	    break;
595
-
596
-	// TODO: missing PRACK
597
-	//case TS_???:
598
-	default:
599
-	    ERROR("timer H expired / transaction in undefined state\n");
600
-	    return;
601
-	}
602
-	break;
603
-
604
-    default:
605
-	return;
606
-    }
607
-
608
-    assert(trans->msg);
609
-    assert(trans->to_tag.len);
610
-    assert(trans->msg->cseq && trans->msg->cseq->p);
611
-
612
-    sip_cseq* cseq = dynamic_cast<sip_cseq*>(trans->msg->cseq->p);
613
-    
614
-    if(!cseq){
615
-	ERROR("missing CSeq\n");
616
-	return;
617
-    }
618
- 
619
-    AmEventDispatcher::instance()->post(c2stlstr(trans->to_tag),
620
-					new AmSipTimeoutEvent(ev, cseq->num));
621
-}
622
-#endif
623
-
624
-
625 574
 void SipCtrlInterface::handle_reply_timeout(AmSipTimeoutEvent::EvType evt,
626 575
     sip_trans *tr, trans_bucket *buk)
627 576
 {
... ...
@@ -109,9 +109,6 @@ public:
109 109
     void handle_sip_reply(sip_msg* msg);
110 110
     void handle_reply_timeout(AmSipTimeoutEvent::EvType evt,
111 111
         sip_trans *tr, trans_bucket *buk=0);
112
-#if 0
113
-    void timer_expired(sip_trans* trans, sip_timer_type tt);
114
-#endif
115 112
 };
116 113
 
117 114
 
... ...
@@ -44,11 +44,6 @@ public:
44 44
     //virtual void handle_request_timeout(const sip_msg *msg)=0;
45 45
     virtual void handle_reply_timeout(AmSipTimeoutEvent::EvType evt,
46 46
         sip_trans *tr, trans_bucket *buk=0)=0;
47
-
48
-#if 0
49
-    // UAS timer expired (UAC timers generate a local 408)
50
-    virtual void timer_expired(sip_trans* trans, sip_timer_type tt)=0;
51
-#endif
52 47
 };
53 48
 
54 49
 #endif
... ...
@@ -1072,31 +1072,6 @@ void trans_layer::received_msg(sip_msg* msg)
1072 1072
 	    }
1073 1073
 	}
1074 1074
 	else {
1075
-
1076
-#if 0
1077
-	    string t_id;
1078
-	    if(msg->u.request->method == sip_request::ACK){
1079
-		
1080
-		// non-2xx ACK??? drop!
1081
-		break;
1082
-	    }
1083
-	    else {
1084
-		// New transaction
1085
-		t = bucket->add_trans(msg, TT_UAS);
1086
-
1087
-		bucket->unlock();
1088
-		
1089
-		//  let's pass the request to
1090
-		//  the UA. 
1091
-		assert(ua);
1092
-
1093
-		ua->handle_sip_request(trans_ticket(t,bucket),msg);
1094
-		
1095
-		// forget the msg: it will be
1096
-		// owned by the new transaction
1097
-		return;
1098
-	    }
1099
-#else
1100 1075
              unsigned inv_h;
1101 1076
              trans_bucket* inv_bucket;
1102 1077
              sip_trans* inv_t;
... ...
@@ -1137,7 +1112,6 @@ void trans_layer::received_msg(sip_msg* msg)
1137 1112
                      // owned by the new transaction
1138 1113
                      return;
1139 1114
              }
1140
-#endif
1141 1115
 	}
1142 1116
 	break;
1143 1117