reindented everything, and stopped that indentation mess

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1849 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 17 years ago
parent 23f9b88d55
commit 5d82971221

@ -126,7 +126,7 @@ void AmB2BSession::onB2BEvent(B2BEvent* ev)
}
} else {
ERROR("Request with CSeq %u not found in recvd_req.\n",
reply_ev->reply.cseq);
reply_ev->reply.cseq);
}
}
}
@ -154,13 +154,13 @@ void AmB2BSession::onB2BEvent(B2BEvent* ev)
trans_ticket tt; // empty transaction ticket
relayed_body_req[dlg.cseq] = AmSipTransaction("INVITE", body_ev->r_cseq, tt);
if (dlg.reinvite("", body_ev->content_type, body_ev->body)) {
ERROR("sending reinvite with relayed body\n");
relayed_body_req.erase(dlg.cseq);
// TODO?: relay error back instead?
// tear down:
DBG("error sending reinvite - terminating this and the other leg\n");
terminateOtherLeg();
terminateLeg();
ERROR("sending reinvite with relayed body\n");
relayed_body_req.erase(dlg.cseq);
// TODO?: relay error back instead?
// tear down:
DBG("error sending reinvite - terminating this and the other leg\n");
terminateOtherLeg();
terminateLeg();
}
} else {
// is_answer - send 200 ACK
@ -188,7 +188,7 @@ void AmB2BSession::onSipRequest(const AmSipRequest& req)
if(!fwd)
AmSession::onSipRequest(req);
else {
//dlg.updateStatus(req);
//dlg.updateStatus(req);
recvd_req.insert(std::make_pair(req.cseq,req));
}
@ -217,8 +217,8 @@ void AmB2BSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
}
} else {
bool relay_body =
// is a reply to request we sent,
// even though we are in sip_relay_only mode
// is a reply to request we sent,
// even though we are in sip_relay_only mode
(sip_relay_only &&
// positive reply
(200 <= reply.code) && (reply.code < 300)
@ -254,7 +254,7 @@ void AmB2BSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
AmSession::onSipReply(reply, old_dlg_status);
}
} else {
AmSession::onSipReply(reply, old_dlg_status);
AmSession::onSipReply(reply, old_dlg_status);
}
relayEvent(new B2BSipReplyEvent(reply,false));
}
@ -262,7 +262,7 @@ void AmB2BSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
void AmB2BSession::onInvite2xx(const AmSipReply& reply)
{
// do not send the 200 ACK yet...
// do not send the 200 ACK yet...
}
void AmB2BSession::relayEvent(AmEvent* ev)
@ -307,7 +307,7 @@ void AmB2BSession::terminateOtherLeg()
void AmB2BSession::relaySip(const AmSipRequest& req)
{
if (req.method != "ACK") {
relayed_req[dlg.cseq] = AmSipTransaction(req.method,req.cseq,req.tt);
relayed_req[dlg.cseq] = AmSipTransaction(req.method,req.cseq,req.tt);
dlg.sendRequest(req.method,"application/sdp",req.body,req.hdrs,SIP_FLAGS_VERBATIM);
} else {
// its a (200) ACK
@ -550,7 +550,7 @@ void AmB2BCalleeSession::onB2BEvent(B2BEvent* ev)
dlg.remote_uri = co_ev->remote_uri;
if (co_ev->relayed_invite) {
relayed_req[dlg.cseq] = AmSipTransaction("INVITE", co_ev->r_cseq, trans_ticket());
relayed_req[dlg.cseq] = AmSipTransaction("INVITE", co_ev->r_cseq, trans_ticket());
}
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)
}
void AmSession::setAudioLocal(unsigned int dir,
bool local) {
bool local) {
assert(dir<2);
use_local_audio[dir] = local;
}
@ -499,7 +499,7 @@ void AmSession::finalize() {
#ifndef SESSION_THREADPOOL
void AmSession::on_stop()
#else
void AmSession::stop()
void AmSession::stop()
#endif
{
DBG("AmSession::stop()\n");
@ -637,8 +637,8 @@ void AmSession::process(AmEvent* ev)
AmAudioEvent* audio_ev = dynamic_cast<AmAudioEvent*>(ev);
if(audio_ev){
onAudioEvent(audio_ev);
return;
onAudioEvent(audio_ev);
return;
}
AmDtmfEvent* dtmf_ev = dynamic_cast<AmDtmfEvent*>(ev);
@ -671,7 +671,7 @@ void AmSession::onSipEvent(AmSipEvent* sip_ev)
AmSipRequestEvent* req_ev = dynamic_cast<AmSipRequestEvent*>(sip_ev);
if(req_ev) {
//onSipRequest(req_ev->req);
//onSipRequest(req_ev->req);
dlg.updateStatus(req_ev->req);
return;
}
@ -679,7 +679,7 @@ void AmSession::onSipEvent(AmSipEvent* sip_ev)
AmSipReplyEvent* reply_ev = dynamic_cast<AmSipReplyEvent*>(sip_ev);
if(reply_ev) {
//onSipReply(reply_ev->reply);
//onSipReply(reply_ev->reply);
dlg.updateStatus(reply_ev->reply);
return;
}
@ -736,8 +736,8 @@ void AmSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
{
CALL_EVENT_H(onSipReply,reply);
// int status = dlg.getStatus();
// dlg.updateStatus(reply);
// int status = dlg.getStatus();
// dlg.updateStatus(reply);
if (old_dlg_status != dlg.getStatus())
DBG("Dialog status changed %s -> %s (stopped=%s) \n",
@ -766,8 +766,8 @@ void AmSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
onSessionStart(reply);
if(input || output || local_input || local_output)
AmMediaProcessor::instance()->addSession(this,
callgroup);
AmMediaProcessor::instance()->addSession(this,
callgroup);
else {
DBG("no audio input and output set. "
"Session will not be attached to MediaProcessor.\n");
@ -828,14 +828,14 @@ void AmSession::onSipReply(const AmSipReply& reply, int old_dlg_status)
void AmSession::onInvite2xx(const AmSipReply& reply)
{
AmSipTransaction* t = dlg.get_uac_trans(reply.cseq);
if(t) dlg.send_200_ack(*t);
AmSipTransaction* t = dlg.get_uac_trans(reply.cseq);
if(t) dlg.send_200_ack(*t);
}
void AmSession::onAudioEvent(AmAudioEvent* audio_ev)
{
if (audio_ev->event_id == AmAudioEvent::cleared)
setStopped();
if (audio_ev->event_id == AmAudioEvent::cleared)
setStopped();
}
void AmSession::onInvite(const AmSipRequest& req)
@ -1069,7 +1069,13 @@ void AmSession::onZRTPEvent(zrtp_event_t event, zrtp_stream_ctx_t *stream_ctx) {
INFO("unknown ZRTP_EVENT\n");
break;
} // end events case
}
#endif
/** EMACS **
* Local variables:
* mode: c++
* c-basic-offset: 2
* End:
*/

@ -530,7 +530,10 @@ inline AmRtpAudio* AmSession::RTPStream() {
#endif
// Local Variables:
// mode:C++
// End:
/** EMACS **
* Local variables:
* mode: c++
* c-basic-offset: 2
* End:
*/

@ -715,3 +715,11 @@ int AmSipDialog::send_200_ack(const AmSipTransaction& t,
return 0;
}
/** EMACS **
* Local variables:
* mode: c++
* c-basic-offset: 2
* End:
*/

@ -45,18 +45,18 @@ using std::string;
/** \brief SIP transaction representation */
struct AmSipTransaction
{
string method;
unsigned int cseq;
trans_ticket tt;
string method;
unsigned int cseq;
trans_ticket tt;
// last reply code
// (sent or received)
//int reply_code;
AmSipTransaction(const string& method, unsigned int cseq, const trans_ticket& tt)
: method(method),
cseq(cseq),
tt(tt)
AmSipTransaction(const string& method, unsigned int cseq, const trans_ticket& tt)
: method(method),
cseq(cseq),
tt(tt)
{}
AmSipTransaction()
@ -70,35 +70,35 @@ typedef std::map<int,AmSipTransaction> TransMap;
*/
class AmSipDialogEventHandler
{
public:
/** Hook called when a request has been received */
virtual void onSipRequest(const AmSipRequest& req)=0;
/** Hook called when a reply has been received */
virtual void onSipReply(const AmSipReply& reply, int old_dlg_status)=0;
/** Hook called before a request is sent */
virtual void onSendRequest(const string& method,
const string& content_type,
const string& body,
string& hdrs,
int flags,
unsigned int cseq)=0;
public:
/** Hook called before a reply is sent */
virtual void onSendReply(const AmSipRequest& req,
unsigned int code,
const string& reason,
/** Hook called when a request has been received */
virtual void onSipRequest(const AmSipRequest& req)=0;
/** Hook called when a reply has been received */
virtual void onSipReply(const AmSipReply& reply, int old_dlg_status)=0;
/** Hook called before a request is sent */
virtual void onSendRequest(const string& method,
const string& content_type,
const string& body,
string& hdrs,
int flags)=0;
int flags,
unsigned int cseq)=0;
/** Hook called when a local INVITE request has been replied with 2xx */
virtual void onInvite2xx(const AmSipReply& reply)=0;
/** Hook called before a reply is sent */
virtual void onSendReply(const AmSipRequest& req,
unsigned int code,
const string& reason,
const string& content_type,
const string& body,
string& hdrs,
int flags)=0;
/** Hook called when a local INVITE request has been replied with 2xx */
virtual void onInvite2xx(const AmSipReply& reply)=0;
virtual ~AmSipDialogEventHandler() {};
virtual ~AmSipDialogEventHandler() {};
};
/**
@ -223,3 +223,10 @@ class AmSipDialog
#endif
/** EMACS **
* Local variables:
* mode: c++
* c-basic-offset: 2
* End:
*/

@ -117,16 +117,16 @@ bool removeHeader(string& hdrs, const string& hdr_name) {
}
/* Print Member */
#define _PM(member, name) \
do { \
if (! member.empty()) \
#define _PM(member, name) \
do { \
if (! member.empty()) \
buf += string(name) + ":" + member + ";"; \
} while (0)
/* Print Member in Brackets */
#define _PMB(member, name) \
do { \
if (! member.empty()) \
buf += string(name) + ":" + "[" + member + "]" + ";"; \
#define _PMB(member, name) \
do { \
if (! member.empty()) \
buf += string(name) + ":" + "[" + member + "]" + ";"; \
} while (0)
string AmSipRequest::print()
@ -182,3 +182,10 @@ string AmSipReply::print()
#undef _PM
#undef _PMB
/** EMACS **
* Local variables:
* mode: c++
* c-basic-offset: 2
* End:
*/

@ -9,25 +9,25 @@ using std::string;
/* enforce common naming in Req&Rpl */
class _AmSipMsgInDlg
{
public:
string method;
string route;
public:
string method;
string route;
string contact;
string content_type;
string contact;
string content_type;
string hdrs;
string body;
unsigned int cseq;
string callid;
string hdrs;
string body;
unsigned int cseq;
string callid;
// transaction ticket from sip stack
trans_ticket tt;
// transaction ticket from sip stack
trans_ticket tt;
_AmSipMsgInDlg() : cseq(0) { }
virtual ~_AmSipMsgInDlg() { };
_AmSipMsgInDlg() : cseq(0) { }
virtual ~_AmSipMsgInDlg() { };
virtual string print() = 0;
virtual string print() = 0;
};
/** \brief represents a SIP reply */
@ -43,7 +43,7 @@ class AmSipReply : public _AmSipMsgInDlg
string local_tag;
AmSipReply() : code(0), _AmSipMsgInDlg() { }
AmSipReply() : code(0), _AmSipMsgInDlg() { }
~AmSipReply() { }
string print();
};
@ -64,7 +64,7 @@ class AmSipRequest : public _AmSipMsgInDlg
string from_tag;
string to_tag;
AmSipRequest() : _AmSipMsgInDlg() { }
AmSipRequest() : _AmSipMsgInDlg() { }
~AmSipRequest() { }
string print();
@ -85,3 +85,11 @@ bool findHeader(const string& hdrs,const string& hdr_name,
bool removeHeader(string& hdrs, const string& hdr_name);
#endif /* __AMSIPMSG_H__ */
/** EMACS **
* Local variables:
* mode: c++
* c-basic-offset: 2
* End:
*/

Loading…
Cancel
Save