Browse code

reindented everything, and stopped that indentation mess

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1849 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Stefan Sayer authored on 27/04/2010 13:36:45
Showing 7 changed files
... ...
@@ -126,7 +126,7 @@ void AmB2BSession::onB2BEvent(B2BEvent* ev)
126 126
 	  } 
127 127
 	} else {
128 128
 	  ERROR("Request with CSeq %u not found in recvd_req.\n",
129
-	      reply_ev->reply.cseq);
129
+		reply_ev->reply.cseq);
130 130
 	}
131 131
       }
132 132
     }
... ...
@@ -154,13 +154,13 @@ void AmB2BSession::onB2BEvent(B2BEvent* ev)
154 154
 	trans_ticket tt; // empty transaction ticket
155 155
 	relayed_body_req[dlg.cseq] = AmSipTransaction("INVITE", body_ev->r_cseq, tt);
156 156
 	if (dlg.reinvite("", body_ev->content_type, body_ev->body)) {
157
-	   ERROR("sending reinvite with relayed body\n");
158
-	   relayed_body_req.erase(dlg.cseq);
159
-	   // TODO?: relay error back instead?
160
-	   // tear down:
161
-	   DBG("error sending reinvite - terminating this and the other leg\n");
162
-	   terminateOtherLeg();	   
163
-	   terminateLeg();
157
+	  ERROR("sending reinvite with relayed body\n");
158
+	  relayed_body_req.erase(dlg.cseq);
159
+	  // TODO?: relay error back instead?
160
+	  // tear down:
161
+	  DBG("error sending reinvite - terminating this and the other leg\n");
162
+	  terminateOtherLeg();	   
163
+	  terminateLeg();
164 164
 	}
165 165
       } else {
166 166
 	// is_answer - send 200 ACK
... ...
@@ -188,7 +188,7 @@ void AmB2BSession::onSipRequest(const AmSipRequest& req)
188 188
   if(!fwd)
189 189
     AmSession::onSipRequest(req);
190 190
   else {
191
-      //dlg.updateStatus(req);
191
+    //dlg.updateStatus(req);
192 192
     recvd_req.insert(std::make_pair(req.cseq,req));
193 193
   }
194 194
 
... ...
@@ -217,8 +217,8 @@ void AmB2BSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
217 217
     }
218 218
   } else {
219 219
     bool relay_body = 
220
-    // is a reply to request we sent, 
221
-    // even though we are in sip_relay_only  mode
220
+      // is a reply to request we sent, 
221
+      // even though we are in sip_relay_only  mode
222 222
       (sip_relay_only && 
223 223
        // positive reply
224 224
        (200 <= reply.code) && (reply.code < 300) 
... ...
@@ -254,7 +254,7 @@ void AmB2BSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
254 254
 	AmSession::onSipReply(reply, old_dlg_status);
255 255
       }      
256 256
     } else {
257
-	AmSession::onSipReply(reply, old_dlg_status);
257
+      AmSession::onSipReply(reply, old_dlg_status);
258 258
     }
259 259
     relayEvent(new B2BSipReplyEvent(reply,false));
260 260
   }
... ...
@@ -262,7 +262,7 @@ void AmB2BSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
262 262
 
263 263
 void AmB2BSession::onInvite2xx(const AmSipReply& reply)
264 264
 {
265
-    // do not send the 200 ACK yet...
265
+  // do not send the 200 ACK yet...
266 266
 }
267 267
 
268 268
 void AmB2BSession::relayEvent(AmEvent* ev)
... ...
@@ -307,7 +307,7 @@ void AmB2BSession::terminateOtherLeg()
307 307
 void AmB2BSession::relaySip(const AmSipRequest& req)
308 308
 {
309 309
   if (req.method != "ACK") {
310
-      relayed_req[dlg.cseq] = AmSipTransaction(req.method,req.cseq,req.tt);
310
+    relayed_req[dlg.cseq] = AmSipTransaction(req.method,req.cseq,req.tt);
311 311
     dlg.sendRequest(req.method,"application/sdp",req.body,req.hdrs,SIP_FLAGS_VERBATIM);
312 312
   } else {
313 313
     // its a (200) ACK 
... ...
@@ -550,7 +550,7 @@ void AmB2BCalleeSession::onB2BEvent(B2BEvent* ev)
550 550
     dlg.remote_uri   = co_ev->remote_uri;
551 551
 
552 552
     if (co_ev->relayed_invite) {
553
-	relayed_req[dlg.cseq] = AmSipTransaction("INVITE", co_ev->r_cseq, trans_ticket());
553
+      relayed_req[dlg.cseq] = AmSipTransaction("INVITE", co_ev->r_cseq, trans_ticket());
554 554
     }
555 555
 
556 556
     dlg.sendRequest("INVITE",co_ev->content_type,co_ev->body,co_ev->hdrs,SIP_FLAGS_VERBATIM);
... ...
@@ -154,7 +154,7 @@ void AmSession::setLocalInOut(AmAudio* in,AmAudio* out)
154 154
 }
155 155
 
156 156
 void AmSession::setAudioLocal(unsigned int dir, 
157
-				     bool local) {
157
+			      bool local) {
158 158
   assert(dir<2);
159 159
   use_local_audio[dir] = local;
160 160
 }
... ...
@@ -499,7 +499,7 @@ void AmSession::finalize() {
499 499
 #ifndef SESSION_THREADPOOL
500 500
 void AmSession::on_stop() 
501 501
 #else
502
-void AmSession::stop()
502
+  void AmSession::stop()
503 503
 #endif  
504 504
 {
505 505
   DBG("AmSession::stop()\n");
... ...
@@ -637,8 +637,8 @@ void AmSession::process(AmEvent* ev)
637 637
 
638 638
   AmAudioEvent* audio_ev = dynamic_cast<AmAudioEvent*>(ev);
639 639
   if(audio_ev){
640
-      onAudioEvent(audio_ev);
641
-      return;
640
+    onAudioEvent(audio_ev);
641
+    return;
642 642
   }
643 643
 
644 644
   AmDtmfEvent* dtmf_ev = dynamic_cast<AmDtmfEvent*>(ev);
... ...
@@ -671,7 +671,7 @@ void AmSession::onSipEvent(AmSipEvent* sip_ev)
671 671
 
672 672
   AmSipRequestEvent* req_ev = dynamic_cast<AmSipRequestEvent*>(sip_ev);
673 673
   if(req_ev) {
674
-      //onSipRequest(req_ev->req);
674
+    //onSipRequest(req_ev->req);
675 675
     dlg.updateStatus(req_ev->req);
676 676
     return;
677 677
   }
... ...
@@ -679,7 +679,7 @@ void AmSession::onSipEvent(AmSipEvent* sip_ev)
679 679
 
680 680
   AmSipReplyEvent* reply_ev = dynamic_cast<AmSipReplyEvent*>(sip_ev);
681 681
   if(reply_ev) {
682
-      //onSipReply(reply_ev->reply);
682
+    //onSipReply(reply_ev->reply);
683 683
     dlg.updateStatus(reply_ev->reply);
684 684
     return;
685 685
   }
... ...
@@ -736,8 +736,8 @@ void AmSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
736 736
 {
737 737
   CALL_EVENT_H(onSipReply,reply);
738 738
 
739
-//   int status = dlg.getStatus();
740
-//   dlg.updateStatus(reply);
739
+  //   int status = dlg.getStatus();
740
+  //   dlg.updateStatus(reply);
741 741
 
742 742
   if (old_dlg_status != dlg.getStatus())
743 743
     DBG("Dialog status changed %s -> %s (stopped=%s) \n", 
... ...
@@ -766,8 +766,8 @@ void AmSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
766 766
 	    onSessionStart(reply);
767 767
 		  
768 768
 	    if(input || output || local_input || local_output)
769
-		AmMediaProcessor::instance()->addSession(this,
770
-							 callgroup); 
769
+	      AmMediaProcessor::instance()->addSession(this,
770
+						       callgroup); 
771 771
 	    else { 
772 772
 	      DBG("no audio input and output set. "
773 773
 		  "Session will not be attached to MediaProcessor.\n");
... ...
@@ -828,14 +828,14 @@ void AmSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
828 828
 
829 829
 void AmSession::onInvite2xx(const AmSipReply& reply)
830 830
 {
831
-    AmSipTransaction* t = dlg.get_uac_trans(reply.cseq);
832
-    if(t) dlg.send_200_ack(*t);
831
+  AmSipTransaction* t = dlg.get_uac_trans(reply.cseq);
832
+  if(t) dlg.send_200_ack(*t);
833 833
 }
834 834
 
835 835
 void AmSession::onAudioEvent(AmAudioEvent* audio_ev)
836 836
 {
837
-    if (audio_ev->event_id == AmAudioEvent::cleared)
838
-	setStopped();
837
+  if (audio_ev->event_id == AmAudioEvent::cleared)
838
+    setStopped();
839 839
 }
840 840
 
841 841
 void AmSession::onInvite(const AmSipRequest& req)
... ...
@@ -1069,7 +1069,13 @@ void AmSession::onZRTPEvent(zrtp_event_t event, zrtp_stream_ctx_t *stream_ctx) {
1069 1069
       INFO("unknown ZRTP_EVENT\n");
1070 1070
       break;
1071 1071
     } // end events case
1072
-  
1073 1072
 }
1074 1073
  
1075 1074
 #endif
1075
+
1076
+/** EMACS **
1077
+ * Local variables:
1078
+ * mode: c++
1079
+ * c-basic-offset: 2
1080
+ * End:
1081
+ */
... ...
@@ -530,7 +530,10 @@ inline AmRtpAudio* AmSession::RTPStream() {
530 530
 
531 531
 #endif
532 532
 
533
-// Local Variables:
534
-// mode:C++
535
-// End:
533
+/** EMACS **
534
+ * Local variables:
535
+ * mode: c++
536
+ * c-basic-offset: 2
537
+ * End:
538
+ */
536 539
 
... ...
@@ -715,3 +715,11 @@ int AmSipDialog::send_200_ack(const AmSipTransaction& t,
715 715
 
716 716
   return 0;
717 717
 }
718
+
719
+
720
+/** EMACS **
721
+ * Local variables:
722
+ * mode: c++
723
+ * c-basic-offset: 2
724
+ * End:
725
+ */
... ...
@@ -45,18 +45,18 @@ using std::string;
45 45
 /** \brief SIP transaction representation */
46 46
 struct AmSipTransaction
47 47
 {
48
-    string       method;
49
-    unsigned int cseq;
50
-    trans_ticket tt;
48
+  string       method;
49
+  unsigned int cseq;
50
+  trans_ticket tt;
51 51
 
52 52
   // last reply code
53 53
   // (sent or received)
54 54
   //int reply_code;
55 55
 
56
-    AmSipTransaction(const string& method, unsigned int cseq, const trans_ticket& tt)
57
-    : method(method),
58
-      cseq(cseq),
59
-      tt(tt)
56
+AmSipTransaction(const string& method, unsigned int cseq, const trans_ticket& tt)
57
+: method(method),
58
+    cseq(cseq),
59
+    tt(tt)
60 60
   {}
61 61
 
62 62
   AmSipTransaction()
... ...
@@ -70,35 +70,35 @@ typedef std::map<int,AmSipTransaction> TransMap;
70 70
  */
71 71
 class AmSipDialogEventHandler 
72 72
 {
73
-public:
74
-    
75
-    /** Hook called when a request has been received */
76
-    virtual void onSipRequest(const AmSipRequest& req)=0;
77
-
78
-    /** Hook called when a reply has been received */
79
-    virtual void onSipReply(const AmSipReply& reply, int old_dlg_status)=0;
80
-
81
-    /** Hook called before a request is sent */
82
-    virtual void onSendRequest(const string& method,
83
-			       const string& content_type,
84
-			       const string& body,
85
-			       string& hdrs,
86
-			       int flags,
87
-			       unsigned int cseq)=0;
73
+ public:
88 74
     
89
-    /** Hook called before a reply is sent */
90
-    virtual void onSendReply(const AmSipRequest& req,
91
-			     unsigned int  code,
92
-			     const string& reason,
75
+  /** Hook called when a request has been received */
76
+  virtual void onSipRequest(const AmSipRequest& req)=0;
77
+
78
+  /** Hook called when a reply has been received */
79
+  virtual void onSipReply(const AmSipReply& reply, int old_dlg_status)=0;
80
+
81
+  /** Hook called before a request is sent */
82
+  virtual void onSendRequest(const string& method,
93 83
 			     const string& content_type,
94 84
 			     const string& body,
95 85
 			     string& hdrs,
96
-			     int flags)=0;
86
+			     int flags,
87
+			     unsigned int cseq)=0;
97 88
     
98
-    /** Hook called when a local INVITE request has been replied with 2xx */
99
-    virtual void onInvite2xx(const AmSipReply& reply)=0;
89
+  /** Hook called before a reply is sent */
90
+  virtual void onSendReply(const AmSipRequest& req,
91
+			   unsigned int  code,
92
+			   const string& reason,
93
+			   const string& content_type,
94
+			   const string& body,
95
+			   string& hdrs,
96
+			   int flags)=0;
97
+    
98
+  /** Hook called when a local INVITE request has been replied with 2xx */
99
+  virtual void onInvite2xx(const AmSipReply& reply)=0;
100 100
 
101
-    virtual ~AmSipDialogEventHandler() {};
101
+  virtual ~AmSipDialogEventHandler() {};
102 102
 };
103 103
 
104 104
 /**
... ...
@@ -223,3 +223,10 @@ class AmSipDialog
223 223
 
224 224
 
225 225
 #endif
226
+
227
+/** EMACS **
228
+ * Local variables:
229
+ * mode: c++
230
+ * c-basic-offset: 2
231
+ * End:
232
+ */
... ...
@@ -117,16 +117,16 @@ bool removeHeader(string& hdrs, const string& hdr_name) {
117 117
 }
118 118
 
119 119
 /* Print Member */
120
-#define _PM(member, name) \
121
-  do { \
122
-    if (! member.empty()) \
120
+#define _PM(member, name)			\
121
+  do {						\
122
+    if (! member.empty())			\
123 123
       buf += string(name) + ":" + member + ";"; \
124 124
   } while (0)
125 125
 /* Print Member in Brackets */
126
-#define _PMB(member, name) \
127
-  do { \
128
-    if (! member.empty()) \
129
-      buf += string(name) + ":" + "[" + member + "]" + ";"; \
126
+#define _PMB(member, name)					\
127
+  do {								\
128
+    if (! member.empty())					\
129
+      buf += string(name) + ":" + "[" + member + "]" + ";";	\
130 130
   } while (0)
131 131
 
132 132
 string AmSipRequest::print()
... ...
@@ -182,3 +182,10 @@ string AmSipReply::print()
182 182
 
183 183
 #undef _PM
184 184
 #undef _PMB
185
+
186
+/** EMACS **
187
+ * Local variables:
188
+ * mode: c++
189
+ * c-basic-offset: 2
190
+ * End:
191
+ */
... ...
@@ -9,25 +9,25 @@ using std::string;
9 9
 /* enforce common naming in Req&Rpl */
10 10
 class _AmSipMsgInDlg
11 11
 {
12
-  public:
13
-    string       method;
14
-    string       route;
12
+ public:
13
+  string       method;
14
+  string       route;
15 15
 
16
-    string       contact;
17
-    string       content_type;
16
+  string       contact;
17
+  string       content_type;
18 18
 
19
-    string       hdrs;
20
-    string       body;
21
-    unsigned int cseq;
22
-    string       callid;
19
+  string       hdrs;
20
+  string       body;
21
+  unsigned int cseq;
22
+  string       callid;
23 23
 
24
-    // transaction ticket from sip stack
25
-    trans_ticket tt;
24
+  // transaction ticket from sip stack
25
+  trans_ticket tt;
26 26
 
27
-    _AmSipMsgInDlg() : cseq(0) { }
28
-    virtual ~_AmSipMsgInDlg() { };
27
+ _AmSipMsgInDlg() : cseq(0) { }
28
+  virtual ~_AmSipMsgInDlg() { };
29 29
 
30
-    virtual string print() = 0;
30
+  virtual string print() = 0;
31 31
 };
32 32
 
33 33
 /** \brief represents a SIP reply */
... ...
@@ -43,7 +43,7 @@ class AmSipReply : public _AmSipMsgInDlg
43 43
   string       local_tag;
44 44
 
45 45
 
46
-  AmSipReply() : code(0), _AmSipMsgInDlg() { }
46
+ AmSipReply() : code(0), _AmSipMsgInDlg() { }
47 47
   ~AmSipReply() { }
48 48
   string print();
49 49
 };
... ...
@@ -64,7 +64,7 @@ class AmSipRequest : public _AmSipMsgInDlg
64 64
   string from_tag;
65 65
   string to_tag;
66 66
 
67
-  AmSipRequest() : _AmSipMsgInDlg() { }
67
+ AmSipRequest() : _AmSipMsgInDlg() { }
68 68
   ~AmSipRequest() { }
69 69
   
70 70
   string print();
... ...
@@ -85,3 +85,11 @@ bool findHeader(const string& hdrs,const string& hdr_name,
85 85
 
86 86
 bool removeHeader(string& hdrs, const string& hdr_name);
87 87
 #endif /* __AMSIPMSG_H__ */
88
+
89
+
90
+/** EMACS **
91
+ * Local variables:
92
+ * mode: c++
93
+ * c-basic-offset: 2
94
+ * End:
95
+ */