2006-04-02 16:22:23 +00:00
|
|
|
/*
|
2012-09-12 10:59:07 -04:00
|
|
|
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
|
2007-09-21 11:08:15 -04:00
|
|
|
* Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
|
2006-04-02 16:22:23 +00:00
|
|
|
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
|
|
|
|
* Author : Laurielle Lea <laurielle.lea@savoirfairelinux.com>
|
2005-12-19 00:11:35 +00:00
|
|
|
*
|
2006-04-02 16:22:23 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2008-01-11 12:52:43 -05:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2006-04-02 16:22:23 +00:00
|
|
|
* (at your option) any later version.
|
2005-12-19 00:11:35 +00:00
|
|
|
*
|
2006-04-02 16:22:23 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2005-12-19 00:11:35 +00:00
|
|
|
*
|
2006-04-02 16:22:23 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-09-12 11:47:20 -04:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2010-05-18 16:13:27 -04:00
|
|
|
*
|
|
|
|
* Additional permission under GNU GPL version 3 section 7:
|
|
|
|
*
|
|
|
|
* If you modify this program, or any covered work, by linking or
|
|
|
|
* combining it with the OpenSSL project's OpenSSL library (or a
|
|
|
|
* modified version of that library), containing parts covered by the
|
|
|
|
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
|
|
|
|
* grants you additional permission to convey the resulting work.
|
|
|
|
* Corresponding Source for a non-source form of such a combination
|
|
|
|
* shall include the source code for the parts of OpenSSL used as well
|
|
|
|
* as that of the covered work.
|
2005-12-19 00:11:35 +00:00
|
|
|
*/
|
2011-06-27 17:34:03 -04:00
|
|
|
#ifndef __SIPCALL_H__
|
|
|
|
#define __SIPCALL_H__
|
2005-12-19 00:11:35 +00:00
|
|
|
|
2012-01-26 18:58:53 -05:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2005-12-19 00:11:35 +00:00
|
|
|
#include "call.h"
|
2011-10-11 17:33:59 -04:00
|
|
|
#include "audio/audiortp/audio_rtp_factory.h"
|
2012-06-21 11:16:45 -04:00
|
|
|
#ifdef SFL_VIDEO
|
|
|
|
#include "video/video_rtp_session.h"
|
|
|
|
#endif
|
|
|
|
|
2011-11-15 14:51:55 -05:00
|
|
|
#include "noncopyable.h"
|
2009-08-06 17:52:28 -04:00
|
|
|
|
2013-05-28 12:00:43 -04:00
|
|
|
struct pjsip_evsub;
|
|
|
|
struct pj_caching_pool;
|
|
|
|
struct pj_pool_t;
|
|
|
|
struct pjsip_inv_session;
|
2011-08-11 10:06:27 -04:00
|
|
|
class Sdp;
|
2005-12-19 00:11:35 +00:00
|
|
|
|
2006-04-02 16:22:23 +00:00
|
|
|
/**
|
2008-04-18 14:44:15 -04:00
|
|
|
* @file sipcall.h
|
2010-08-04 10:15:30 -04:00
|
|
|
* @brief SIPCall are SIP implementation of a normal Call
|
2006-04-09 22:44:09 +00:00
|
|
|
*/
|
2011-10-11 13:43:26 -04:00
|
|
|
class SIPCall : public Call {
|
2010-08-04 10:15:30 -04:00
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
* @param id The call identifier
|
|
|
|
* @param type The type of the call. Could be Incoming
|
|
|
|
* Outgoing
|
|
|
|
*/
|
2013-06-03 14:09:48 -04:00
|
|
|
SIPCall(const std::string& id, Call::CallType type,
|
|
|
|
pj_caching_pool *caching_pool, const std::string &account_id);
|
2010-08-04 10:15:30 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
2011-10-11 13:43:26 -04:00
|
|
|
~SIPCall();
|
2010-08-04 10:15:30 -04:00
|
|
|
|
2011-02-25 10:41:33 -05:00
|
|
|
/**
|
|
|
|
* Return the local SDP session
|
|
|
|
*/
|
2011-10-12 17:44:27 -04:00
|
|
|
Sdp* getLocalSDP() {
|
2011-08-11 10:06:27 -04:00
|
|
|
return local_sdp_;
|
2010-08-04 10:15:30 -04:00
|
|
|
}
|
|
|
|
|
2011-02-25 10:41:33 -05:00
|
|
|
/**
|
|
|
|
* Returns a pointer to the AudioRtp object
|
|
|
|
*/
|
2011-10-12 17:44:27 -04:00
|
|
|
sfl::AudioRtpFactory & getAudioRtp() {
|
|
|
|
return audiortp_;
|
2010-08-04 10:15:30 -04:00
|
|
|
}
|
|
|
|
|
2012-01-25 16:28:53 -05:00
|
|
|
#ifdef SFL_VIDEO
|
2011-06-14 16:28:10 -04:00
|
|
|
/**
|
|
|
|
* Returns a pointer to the VideoRtp object
|
|
|
|
*/
|
2012-06-21 11:16:45 -04:00
|
|
|
sfl_video::VideoRtpSession &getVideoRtp () {
|
|
|
|
return videortp_;
|
2011-06-14 16:28:10 -04:00
|
|
|
}
|
2012-01-25 16:28:53 -05:00
|
|
|
#endif
|
2011-06-14 16:28:10 -04:00
|
|
|
|
2011-03-10 15:59:31 -05:00
|
|
|
/**
|
|
|
|
* Return the local memory pool for this call
|
|
|
|
*/
|
2011-10-12 17:44:27 -04:00
|
|
|
pj_pool_t *getMemoryPool() {
|
2011-08-09 11:05:55 -04:00
|
|
|
return pool_;
|
2011-03-10 15:59:31 -05:00
|
|
|
}
|
|
|
|
|
2012-09-27 15:19:02 -04:00
|
|
|
void answer();
|
2012-09-19 14:30:51 -04:00
|
|
|
|
2011-09-01 09:51:19 -04:00
|
|
|
/**
|
|
|
|
* The invite session to be reused in case of transfer
|
|
|
|
*/
|
|
|
|
pjsip_inv_session *inv;
|
|
|
|
|
2010-08-04 10:15:30 -04:00
|
|
|
private:
|
2012-08-03 11:49:33 -04:00
|
|
|
// override of Call::getDetails
|
|
|
|
std::map<std::string, std::string>
|
|
|
|
getDetails();
|
|
|
|
|
2012-08-14 14:48:05 -04:00
|
|
|
// override of Call::createHistoryEntry
|
|
|
|
std::map<std::string, std::string>
|
|
|
|
createHistoryEntry() const;
|
|
|
|
|
2011-11-15 14:51:55 -05:00
|
|
|
NON_COPYABLE(SIPCall);
|
2010-08-04 10:15:30 -04:00
|
|
|
|
2011-02-25 10:41:33 -05:00
|
|
|
/**
|
|
|
|
* Audio Rtp Session factory
|
|
|
|
*/
|
2011-10-12 17:44:27 -04:00
|
|
|
sfl::AudioRtpFactory audiortp_;
|
2010-08-04 10:15:30 -04:00
|
|
|
|
2012-01-25 16:28:53 -05:00
|
|
|
#ifdef SFL_VIDEO
|
2011-06-14 16:28:10 -04:00
|
|
|
/**
|
|
|
|
* Video Rtp Session factory
|
|
|
|
*/
|
2012-06-21 11:16:45 -04:00
|
|
|
sfl_video::VideoRtpSession videortp_;
|
2012-01-25 16:28:53 -05:00
|
|
|
#endif
|
2011-06-14 16:28:10 -04:00
|
|
|
|
2011-02-24 18:12:00 -05:00
|
|
|
/**
|
2011-02-25 10:41:33 -05:00
|
|
|
* The pool to allocate memory, released once call hang up
|
2011-02-24 18:12:00 -05:00
|
|
|
*/
|
2011-08-09 11:05:55 -04:00
|
|
|
pj_pool_t *pool_;
|
2009-07-23 15:06:40 -04:00
|
|
|
|
2011-02-24 18:12:00 -05:00
|
|
|
/**
|
2011-08-10 10:45:43 -04:00
|
|
|
* The SDP session
|
2011-02-24 18:12:00 -05:00
|
|
|
*/
|
2011-08-11 10:06:27 -04:00
|
|
|
Sdp *local_sdp_;
|
2005-12-19 00:11:35 +00:00
|
|
|
};
|
|
|
|
|
2011-06-27 17:34:03 -04:00
|
|
|
#endif // __SIPCALL_H__
|