ekiga r6259 - in trunk: . src/endpoints
- From: dsandras svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6259 - in trunk: . src/endpoints
- Date: Sat, 17 May 2008 18:40:06 +0000 (UTC)
Author: dsandras
Date: Sat May 17 18:40:06 2008
New Revision: 6259
URL: http://svn.gnome.org/viewvc/ekiga?rev=6259&view=rev
Log:
Changed architecture, a CallManager now uses ProtocolManagers to
handle actions and settings. Methods that need to be supported by
all implemented CallManagers and ProtocolManagers are defined in the
base classes. It is still a work in progress. It will allow to remove
horrors like GetSIPEndPoint and GetH323EndPoints. The GMManager is now
a CallManager handling SIP and H323 protocols using the SIP and H323
ProtocolManagers. Largely unfinished, be patient.
Modified:
trunk/ChangeLog
trunk/src/endpoints/h323.cpp
trunk/src/endpoints/h323.h
trunk/src/endpoints/manager.cpp
trunk/src/endpoints/manager.h
trunk/src/endpoints/opal-gmconf-bridge.cpp
trunk/src/endpoints/opal-main.cpp
trunk/src/endpoints/sip.cpp
trunk/src/endpoints/sip.h
Modified: trunk/src/endpoints/h323.cpp
==============================================================================
--- trunk/src/endpoints/h323.cpp (original)
+++ trunk/src/endpoints/h323.cpp Sat May 17 18:40:06 2008
@@ -64,17 +64,72 @@
udp_max = 5100;
tcp_min = 30000;
tcp_max = 30010;
- listen_port = 5060;
+ listen_port = 1720;
SetInitialBandwidth (40000);
+
+ uri_prefix = "h323:";
+ protocol_name = "h323";
+
+ start_listening ();
+}
+
+const std::string & GMH323Endpoint::get_protocol_name () const
+{
+ return protocol_name;
}
-GMH323Endpoint::~GMH323Endpoint ()
+const Ekiga::CallManager::Interface & GMH323Endpoint::get_interface () const
{
+ return interface;
+}
+
+
+bool GMH323Endpoint::populate_menu (Ekiga::Contact &contact,
+ Ekiga::MenuBuilder &builder)
+{
+ std::string name = contact.get_name ();
+ std::map<std::string, std::string> uris = contact.get_uris ();
+
+ return menu_builder_add_actions (name, uris, builder);
+}
+
+
+bool GMH323Endpoint::populate_menu (const std::string uri,
+ Ekiga::MenuBuilder & builder)
+{
+ std::map<std::string, std::string> uris;
+ uris [""] = uri;
+
+ return menu_builder_add_actions ("", uris, builder);
}
+bool GMH323Endpoint::menu_builder_add_actions (const std::string & /*fullname*/,
+ std::map<std::string,std::string> & uris,
+ Ekiga::MenuBuilder & builder)
+{
+ bool populated = false;
+
+ /* Add actions of type "call" for all uris */
+ for (std::map<std::string, std::string>::const_iterator iter = uris.begin ();
+ iter != uris.end ();
+ iter++) {
+
+ std::string action = _("Call");
+
+ if (!iter->first.empty ())
+ action = action + " [" + iter->first + "]";
+
+ builder.add_action ("call", action, sigc::bind (sigc::mem_fun (this, &GMH323Endpoint::on_dial), iter->second));
+
+ populated = true;
+ }
+
+ return populated;
+}
+
void
GMH323Endpoint::SetUserInputMode ()
{
@@ -333,9 +388,16 @@
std::stringstream str;
RemoveListener (NULL);
+ interface.publish = false;
+ interface.voip_protocol = protocol_name;
+ interface.protocol = "tcp";
+ interface.interface = "*";
+
str << "tcp$*:" << listen_port;
- if (StartListeners (PStringArray (str.str ().c_str ())))
+ if (StartListeners (PStringArray (str.str ().c_str ()))) {
+ interface.port = listen_port;
return true;
+ }
return false;
}
@@ -384,3 +446,7 @@
}
+void GMH323Endpoint::on_dial (std::string uri)
+{
+ endpoint.dial (uri);
+}
Modified: trunk/src/endpoints/h323.h
==============================================================================
--- trunk/src/endpoints/h323.h (original)
+++ trunk/src/endpoints/h323.h Sat May 17 18:40:06 2008
@@ -61,13 +61,21 @@
*/
GMH323Endpoint (GMManager &ep, Ekiga::ServiceCore & core);
-
- /* DESCRIPTION : The destructor.
- * BEHAVIOR : /
- * PRE : /
- */
- ~GMH323Endpoint ();
-
+ /**/
+ const std::string & get_protocol_name () const;
+
+ const Ekiga::CallManager::Interface & get_interface () const;
+
+ /**/
+ bool populate_menu (Ekiga::Contact &contact,
+ Ekiga::MenuBuilder &builder);
+
+ bool populate_menu (const std::string uri,
+ Ekiga::MenuBuilder & builder);
+
+ bool menu_builder_add_actions (const std::string & fullname,
+ std::map<std::string, std::string> & uris,
+ Ekiga::MenuBuilder & builder);
/* DESCRIPTION : /
* BEHAVIOR : Adds the User Input Mode following the
@@ -177,6 +185,7 @@
private:
+ void on_dial (std::string uri);
GMManager & endpoint;
Ekiga::ServiceCore & core;
@@ -191,6 +200,11 @@
unsigned udp_min;
unsigned udp_max;
unsigned listen_port;
+
+ Ekiga::CallManager::Interface interface;
+
+ std::string protocol_name;
+ std::string uri_prefix;
};
#endif
Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp (original)
+++ trunk/src/endpoints/manager.cpp Sat May 17 18:40:06 2008
@@ -51,45 +51,18 @@
#include "vidinput-info.h"
+#include "call-manager.h"
+
static bool same_codec_desc (Ekiga::CodecDescription a, Ekiga::CodecDescription b)
{
return (a.name == b.name && a.rate == b.rate);
}
-class dialer : public PThread
-{
- PCLASSINFO(dialer, PThread);
-
-public:
-
- dialer (const std::string & uri, GMManager & ep)
- : PThread (1000, AutoDeleteThread),
- dial_uri (uri),
- endpoint (ep)
- {
- this->Resume ();
- };
-
- void Main ()
- {
- PString token;
- endpoint.SetUpCall ("pc:*", dial_uri, token);
- };
-
-private:
- const std::string dial_uri;
- GMManager & endpoint;
-};
-
-
-// FIXME: we shouldnt call sound events here but signal to the frontend which then triggers them
-
/* The class */
GMManager::GMManager (Ekiga::ServiceCore & _core)
: core (_core),
- runtime (*(dynamic_cast<Ekiga::Runtime *> (core.get ("runtime")))),
- audiooutput_core (*(dynamic_cast<Ekiga::AudioOutputCore *> (_core.get ("audiooutput-core"))))
+ runtime (*(dynamic_cast<Ekiga::Runtime *> (core.get ("runtime"))))
{
/* Initialise the endpoint paramaters */
PIPSocket::SetDefaultIpAddressFamilyV4();
@@ -127,6 +100,8 @@
pcssEP->SetSoundChannelRecordDevice("EKIGA");
AddRouteEntry("h323:.* = pc:<db>");
AddRouteEntry("sip:.* = pc:<db>");
+ protocols.push_back (h323EP->get_protocol_name ());
+ protocols.push_back (sipEP->get_protocol_name ());
// Media formats
SetMediaFormatOrder (PStringArray ());
@@ -150,49 +125,37 @@
}
-bool GMManager::dial (const std::string uri)
+void GMManager::set_display_name (const std::string & name)
{
- PString token;
- std::stringstream ustr;
-
- if (uri.find ("sip:") == 0
- || uri.find ("h323:") == 0
- || uri.find (":") == string::npos) {
-
- if (uri.find (":") == string::npos)
- ustr << "sip:" << uri;
- else
- ustr << uri;
+ display_name = name;
- new dialer (ustr.str (), *this);
+ SetDefaultDisplayName (display_name);
- return true;
- }
-
- return false;
+ sipEP->SetDefaultDisplayName (display_name);
+ h323EP->SetDefaultDisplayName (display_name);
+ h323EP->SetLocalUserName (display_name);
}
-void GMManager::set_fullname (const std::string name)
-{
- SetDefaultDisplayName (name.c_str ());
-
- sipEP->SetDefaultDisplayName (name.c_str ());
- h323EP->SetDefaultDisplayName (name.c_str ());
- h323EP->SetLocalUserName (name.c_str ());
-}
-const std::string GMManager::get_fullname () const
+const std::string & GMManager::get_display_name () const
{
- return (const char*) GetDefaultDisplayName ();
+ return display_name;
}
-void GMManager::set_jitter_buffer_size (unsigned min_val,
- unsigned max_val)
+
+void GMManager::set_echo_cancellation (bool enabled)
{
- // Adjust general settings
- SetAudioJitterDelay (PMAX (min_val, 20), PMIN (max_val, 1000));
+ OpalEchoCanceler::Params ec;
- // Adjust setting for all sessions of all connections of all calls
+ // General settings
+ ec = GetEchoCancelParams ();
+ if (enabled)
+ ec.m_mode = OpalEchoCanceler::Cancelation;
+ else
+ ec.m_mode = OpalEchoCanceler::NoCancelation;
+ SetEchoCancelParams (ec);
+
+ // Adjust setting for all connections of all calls
for (PSafePtr<OpalCall> call = activeCalls;
call != NULL;
++call) {
@@ -201,44 +164,33 @@
i < 2;
i++) {
- PSafePtr<OpalRTPConnection> connection = PSafePtrCast<OpalConnection, OpalRTPConnection> (call->GetConnection (i));
+ PSafePtr<OpalConnection> connection = call->GetConnection (i);
if (connection) {
- RTP_Session *session =
- connection->GetSession (OpalMediaFormat::DefaultAudioSessionID);
-
- if (session != NULL) {
+ OpalEchoCanceler *echo_canceler = connection->GetEchoCanceler ();
- unsigned units = session->GetJitterTimeUnits ();
- session->SetJitterBufferSize (min_val * units,
- max_val * units,
- units);
- }
+ if (echo_canceler)
+ echo_canceler->SetParameters (ec);
}
}
}
}
-void GMManager::get_jitter_buffer_size (unsigned & min_val,
- unsigned & max_val)
+
+bool GMManager::get_echo_cancellation () const
{
- min_val = GetMinAudioJitterDelay ();
- max_val = GetMaxAudioJitterDelay ();
+ OpalEchoCanceler::Params ec = GetEchoCancelParams ();
+
+ return (ec.m_mode == OpalEchoCanceler::Cancelation);
}
-void GMManager::set_echo_cancelation (bool enabled)
+
+void GMManager::set_maximum_jitter (unsigned max_val)
{
- OpalEchoCanceler::Params ec;
-
- // General settings
- ec = GetEchoCancelParams ();
- if (enabled)
- ec.m_mode = OpalEchoCanceler::Cancelation;
- else
- ec.m_mode = OpalEchoCanceler::NoCancelation;
- SetEchoCancelParams (ec);
+ // Adjust general settings
+ SetAudioJitterDelay (20, PMIN (max_val, 1000));
- // Adjust setting for all connections of all calls
+ // Adjust setting for all sessions of all connections of all calls
for (PSafePtr<OpalCall> call = activeCalls;
call != NULL;
++call) {
@@ -247,25 +199,29 @@
i < 2;
i++) {
- PSafePtr<OpalConnection> connection = call->GetConnection (i);
+ PSafePtr<OpalRTPConnection> connection = PSafePtrCast<OpalConnection, OpalRTPConnection> (call->GetConnection (i));
if (connection) {
- OpalEchoCanceler *echo_canceler = connection->GetEchoCanceler ();
+ RTP_Session *session =
+ connection->GetSession (OpalMediaFormat::DefaultAudioSessionID);
- if (echo_canceler)
- echo_canceler->SetParameters (ec);
+ if (session != NULL) {
+
+ unsigned units = session->GetJitterTimeUnits ();
+ session->SetJitterBufferSize (20 * units, max_val * units, units);
+ }
}
}
}
}
-bool GMManager::get_echo_cancelation ()
-{
- OpalEchoCanceler::Params ec = GetEchoCancelParams ();
- return (ec.m_mode == OpalEchoCanceler::Cancelation);
+unsigned GMManager::get_maximum_jitter () const
+{
+ return GetMaxAudioJitterDelay ();
}
+
void GMManager::set_silence_detection (bool enabled)
{
OpalSilenceDetector::Params sd;
@@ -299,7 +255,8 @@
}
}
-bool GMManager::get_silence_detection ()
+
+bool GMManager::get_silence_detection () const
{
OpalSilenceDetector::Params sd;
@@ -308,28 +265,192 @@
return (sd.m_mode != OpalSilenceDetector::NoSilenceDetection);
}
-void GMManager::set_port_ranges (unsigned min_udp_port,
- unsigned max_udp_port,
- unsigned min_tcp_port,
- unsigned max_tcp_port)
-{
- SetTCPPorts (min_tcp_port, max_tcp_port);
- SetRtpIpPorts (min_udp_port, max_udp_port);
- SetUDPPorts (min_udp_port, max_udp_port);
-}
-
-void GMManager::get_port_ranges (unsigned & min_udp_port,
- unsigned & max_udp_port,
- unsigned & min_tcp_port,
- unsigned & max_tcp_port)
+
+void GMManager::set_reject_delay (unsigned delay)
+{
+ reject_delay = delay;
+}
+
+
+unsigned GMManager::get_reject_delay () const
{
- min_udp_port = GetUDPPortBase ();
- max_udp_port = GetUDPPortMax ();
+ return reject_delay;
+}
+
- min_tcp_port = GetTCPPortBase ();
- max_tcp_port = GetTCPPortMax ();
+const Ekiga::CodecList & GMManager::get_codecs () const
+{
+ return codecs;
}
+
+void GMManager::set_codecs (Ekiga::CodecList & _codecs)
+{
+ PStringArray initial_order;
+ PStringArray initial_mask;
+
+ OpalMediaFormatList all_media_formats;
+ OpalMediaFormatList media_formats;
+
+ PStringArray order;
+ PStringArray mask;
+
+ // What do we support
+ GetAllowedFormats (all_media_formats);
+ Ekiga::CodecList all_codecs = Opal::CodecList (all_media_formats);
+
+ //
+ // Clean the CodecList given as paramenter : remove unsupported codecs and
+ // add missing codecs at the end of the list
+ //
+
+ // Build the Ekiga::CodecList taken into account by the GMManager
+ // It contains codecs given as argument to set_codecs, and other codecs
+ // supported by the manager
+ for (Ekiga::CodecList::iterator it = all_codecs.begin ();
+ it != all_codecs.end ();
+ it++) {
+
+ Ekiga::CodecList::iterator i =
+ search_n (_codecs.begin (), _codecs.end (), 1, *it, same_codec_desc);
+ if (i == _codecs.end ()) {
+ _codecs.push_back (*it);
+ }
+ }
+
+ // Remove unsupported codecs
+ for (Ekiga::CodecList::iterator it = _codecs.begin ();
+ it != _codecs.end ();
+ it++) {
+
+ Ekiga::CodecList::iterator i =
+ search_n (all_codecs.begin (), all_codecs.end (), 1, *it, same_codec_desc);
+ if (i == _codecs.end ())
+ _codecs.erase (it);
+ }
+ codecs = _codecs;
+
+
+ //
+ // Update OPAL
+ //
+ Ekiga::CodecList::iterator codecs_it;
+ for (codecs_it = codecs.begin () ;
+ codecs_it != codecs.end () ;
+ codecs_it++) {
+
+ bool active = (*codecs_it).active;
+ std::string name = (*codecs_it).name;
+ unsigned rate = (*codecs_it).rate;
+ int j = 0;
+
+ // Find the OpalMediaFormat corresponding to the Ekiga::CodecDescription
+ if (active) {
+ for (j = 0 ;
+ j < all_media_formats.GetSize () ;
+ j++) {
+
+ if (name == (const char *) all_media_formats [j].GetEncodingName ()
+ && rate == all_media_formats [j].GetClockRate ()) {
+
+ // Found something
+ order += all_media_formats [j];
+ }
+ }
+ }
+ }
+
+ // Build the mask
+ all_media_formats = OpalTranscoder::GetPossibleFormats (pcssEP->GetMediaFormats ());
+ all_media_formats.Remove (order);
+
+ for (int i = 0 ;
+ i < all_media_formats.GetSize () ;
+ i++)
+ mask += all_media_formats [i];
+
+ // Update the OpalManager
+ SetMediaFormatMask (mask);
+ SetMediaFormatOrder (order);
+}
+
+
+const std::list<std::string> & GMManager::get_protocol_names () const
+{
+ return protocols;
+}
+
+
+const Ekiga::CallManager::InterfaceList GMManager::get_interfaces () const
+{
+ InterfaceList list;
+ list.push_back (sipEP->get_listen_interface ());
+
+ return list;
+}
+
+void GMManager::set_forward_on_busy (bool enabled)
+{
+}
+
+
+void GMManager::set_unconditional_forward (bool enabled)
+{
+}
+
+void GMManager::set_udp_ports (unsigned min_port,
+ unsigned max_port)
+{
+ if (min_port < max_port) {
+
+ SetUDPPorts (min_port, max_port);
+ SetRtpIpPorts (min_port, max_port);
+ }
+}
+
+
+void GMManager::get_udp_ports (unsigned & min_port,
+ unsigned & max_port) const
+{
+ min_port = GetUDPPortBase ();
+ max_port = GetUDPPortMax ();
+}
+
+void GMManager::set_tcp_ports (unsigned min_port,
+ unsigned max_port)
+{
+ if (min_port < max_port)
+ SetTCPPorts (min_port, max_port);
+}
+
+
+void GMManager::get_tcp_ports (unsigned & min_port,
+ unsigned & max_port) const
+{
+ min_port = GetTCPPortBase ();
+ max_port = GetTCPPortMax ();
+}
+
+
+bool GMManager::dial (const std::string & uri)
+{
+ if (uri.find ("sip:") == 0)
+ return sipEP->dial (uri);
+
+ return false;
+}
+
+
+bool GMManager::message (const std::string & _uri,
+ const std::string & _message)
+{
+ if (_uri.find ("sip:") == 0 || _uri.find (':') == string::npos)
+ return sipEP->message (_uri, _message);
+
+ return false;
+}
+
+
void GMManager::set_video_options (const GMManager::VideoOptions & options)
{
OpalMediaFormatList media_formats_list;
@@ -416,7 +537,7 @@
}
-void GMManager::get_video_options (GMManager::VideoOptions & options)
+void GMManager::get_video_options (GMManager::VideoOptions & options) const
{
OpalMediaFormatList media_formats_list;
OpalMediaFormat::GetAllRegisteredMediaFormats (media_formats_list);
@@ -450,103 +571,6 @@
}
-Ekiga::CodecList GMManager::get_codecs ()
-{
- return codecs;
-}
-
-
-void GMManager::set_codecs (Ekiga::CodecList & _codecs)
-{
- PStringArray initial_order;
- PStringArray initial_mask;
-
- OpalMediaFormatList all_media_formats;
- OpalMediaFormatList media_formats;
-
- PStringArray order;
- PStringArray mask;
-
- // What do we support
- GetAllowedFormats (all_media_formats);
- Ekiga::CodecList all_codecs = Opal::CodecList (all_media_formats);
-
- //
- // Clean the CodecList given as paramenter : remove unsupported codecs and
- // add missing codecs at the end of the list
- //
-
- // Build the Ekiga::CodecList taken into account by the GMManager
- // It contains codecs given as argument to set_codecs, and other codecs
- // supported by the manager
- for (Ekiga::CodecList::iterator it = all_codecs.begin ();
- it != all_codecs.end ();
- it++) {
-
- Ekiga::CodecList::iterator i =
- search_n (_codecs.begin (), _codecs.end (), 1, *it, same_codec_desc);
- if (i == _codecs.end ()) {
- _codecs.push_back (*it);
- }
- }
-
- // Remove unsupported codecs
- for (Ekiga::CodecList::iterator it = _codecs.begin ();
- it != _codecs.end ();
- it++) {
-
- Ekiga::CodecList::iterator i =
- search_n (all_codecs.begin (), all_codecs.end (), 1, *it, same_codec_desc);
- if (i == _codecs.end ())
- _codecs.erase (it);
- }
- codecs = _codecs;
-
-
- //
- // Update OPAL
- //
- Ekiga::CodecList::iterator codecs_it;
- for (codecs_it = codecs.begin () ;
- codecs_it != codecs.end () ;
- codecs_it++) {
-
- bool active = (*codecs_it).active;
- std::string name = (*codecs_it).name;
- unsigned rate = (*codecs_it).rate;
- int j = 0;
-
- // Find the OpalMediaFormat corresponding to the Ekiga::CodecDescription
- if (active) {
- for (j = 0 ;
- j < all_media_formats.GetSize () ;
- j++) {
-
- if (name == (const char *) all_media_formats [j].GetEncodingName ()
- && rate == all_media_formats [j].GetClockRate ()) {
-
- // Found something
- order += all_media_formats [j];
- }
- }
- }
- }
-
- // Build the mask
- all_media_formats = OpalTranscoder::GetPossibleFormats (pcssEP->GetMediaFormats ());
- all_media_formats.Remove (order);
-
- for (int i = 0 ;
- i < all_media_formats.GetSize () ;
- i++)
- mask += all_media_formats [i];
-
- // Update the OpalManager
- SetMediaFormatMask (mask);
- SetMediaFormatOrder (order);
-}
-
-
GMH323Endpoint *
GMManager::GetH323Endpoint ()
{
@@ -626,6 +650,7 @@
Ekiga::Call *call = NULL;
call = new Opal::Call (*this, core);
+ call_core->add_call (call, this);
return dynamic_cast<OpalCall *> (call);
}
Modified: trunk/src/endpoints/manager.h
==============================================================================
--- trunk/src/endpoints/manager.h (original)
+++ trunk/src/endpoints/manager.h Sat May 17 18:40:06 2008
@@ -56,7 +56,6 @@
#include "call-core.h"
#include "call-manager.h"
#include "call.h"
-#include "audiooutput-core.h"
#include <sigc++/sigc++.h>
#include <string>
@@ -75,6 +74,7 @@
class GMManager:
public Ekiga::Service,
+ public Ekiga::CallManager,
public OpalManager
{
PCLASSINFO(GMManager, OpalManager);
@@ -86,18 +86,8 @@
public:
- /* DESCRIPTION : The constructor.
- * BEHAVIOR : Creates the supported endpoints
- * and initialises the variables
- * PRE : /
- */
GMManager (Ekiga::ServiceCore & _core);
-
- /* DESCRIPTION : The destructor
- * BEHAVIOR : /
- * PRE : /
- */
~GMManager ();
/**/
@@ -106,169 +96,101 @@
const std::string get_description () const
{ return "\tObject bringing in Opal support (calls, text messaging, sip, h323, ...)"; }
-
- void set_jitter_buffer_size (unsigned min_val,
- unsigned max_val);
- void get_jitter_buffer_size (unsigned & min_val,
- unsigned & max_val);
+ /** Call Manager **/
+ bool dial (const std::string & uri);
+
+ void set_display_name (const std::string & name);
+ const std::string & get_display_name () const;
+
+ void set_echo_cancellation (bool enabled);
+ bool get_echo_cancellation () const;
+
+ void set_maximum_jitter (unsigned max_val);
+ unsigned get_maximum_jitter () const;
void set_silence_detection (bool enabled);
+ bool get_silence_detection () const;
- bool get_silence_detection ();
+ void set_reject_delay (unsigned delay);
+ unsigned get_reject_delay () const;
- void set_echo_cancelation (bool enabled);
-
- bool get_echo_cancelation ();
+ void set_codecs (Ekiga::CodecList & codecs);
+ const Ekiga::CodecList & get_codecs () const;
- void set_port_ranges (unsigned min_udp_port,
- unsigned max_udp_port,
- unsigned min_tcp_port,
- unsigned max_tcp_port);
-
- void get_port_ranges (unsigned & min_udp_port,
- unsigned & max_udp_port,
- unsigned & min_tcp_port,
- unsigned & max_tcp_port);
+ const std::list<std::string> & get_protocol_names () const;
+ const InterfaceList get_interfaces () const;
- struct VideoOptions
- {
- VideoOptions ()
- : size (0),
- maximum_frame_rate (0),
- temporal_spatial_tradeoff (0),
- maximum_received_bitrate (0),
- maximum_transmitted_bitrate (0) {};
-
- unsigned size;
- unsigned maximum_frame_rate;
- unsigned temporal_spatial_tradeoff;
- unsigned maximum_received_bitrate;
- unsigned maximum_transmitted_bitrate;
- };
+ /* Extended stuff, OPAL CallManager specific */
+ void set_forward_on_busy (bool enabled);
+ void set_unconditional_forward (bool enabled);
+ void set_udp_ports (unsigned min_port,
+ unsigned max_port);
- void set_video_options (const VideoOptions & option);
+ void get_udp_ports (unsigned & min_port,
+ unsigned & max_port) const;
- void get_video_options (VideoOptions & option);
+ void set_tcp_ports (unsigned min_port,
+ unsigned max_port);
+ void get_tcp_ports (unsigned & min_port,
+ unsigned & max_port) const;
- /**/
- bool dial (const std::string uri);
/**/
- void set_fullname (const std::string name);
- const std::string get_fullname () const;
+ bool message (const std::string & uri,
+ const std::string & message);
- OpalCall *CreateCall ();
+ /**/
+ struct VideoOptions
+ {
+ VideoOptions ()
+ : size (0),
+ maximum_frame_rate (0),
+ temporal_spatial_tradeoff (0),
+ maximum_received_bitrate (0),
+ maximum_transmitted_bitrate (0) {};
+
+ unsigned size;
+ unsigned maximum_frame_rate;
+ unsigned temporal_spatial_tradeoff;
+ unsigned maximum_received_bitrate;
+ unsigned maximum_transmitted_bitrate;
+ };
+ void set_video_options (const VideoOptions & options);
+ void get_video_options (VideoOptions & options) const;
- /** Return the list of available codecs
- * @return a set of the codecs and their descriptions
- */
- Ekiga::CodecList get_codecs ();
-
- /** Enable the given codecs
- * @param codecs is a set of the codecs and their descriptions
- */
- void set_codecs (Ekiga::CodecList & codecs);
-
-
- /* DESCRIPTION : /
- * BEHAVIOR : Returns the H.323 endpoint.
- * PRE : /
- */
+ /**/
GMH323Endpoint *GetH323Endpoint ();
-
- /* DESCRIPTION : /
- * BEHAVIOR : Returns the SIP endpoint.
- * PRE : /
- */
GMSIPEndpoint *GetSIPEndpoint ();
+ void Register (GmAccount * = NULL);
+
+ private:
+ OpalCall *CreateCall ();
- /* DESCRIPTION : /
- * BEHAVIOR : Create a STUN client.
- * PRE : First parameter : TRUE if a progress dialog should be
- * displayed.
- * Second parameter: TRUE if a config dialog should be
- * displayed to ask the user to use
- * STUN or not.
- * Third parameter : TRUE if should wait for the result
- * before returning.
- * Fourth parameter: Parent window for the other dialogs.
- */
void CreateSTUNClient (bool,
bool,
bool,
GtkWidget *);
-
- /* DESCRIPTION : /
- * BEHAVIOR : Remove the STUN client.
- * PRE : /
- */
void RemoveSTUNClient ();
-
- /* DESCRIPTION : /
- * BEHAVIOR : Register (or unregister) all accounts or the one provided.
- * It launches an accounts manager to register the given
- * account or all accounts.
- * PRE : /
- */
- void Register (GmAccount * = NULL);
-
- /* DESCRIPTION : /
- * BEHAVIOR : Remove the account manager.
- * PRE : /
- */
void RemoveAccountsEndpoint ();
-
-
- /* DESCRIPTION : /
- * BEHAVIOR : TRUE if the video should automatically be transmitted
- * when a call begins.
- * PRE : /
- */
- void SetAutoStartTransmitVideo (bool a) {autoStartTransmitVideo = a;}
-
- /* DESCRIPTION : /
- * BEHAVIOR : TRUE if the video should automatically be received
- * when a call begins.
- * PRE : /
- */
- void SetAutoStartReceiveVideo (bool a) {autoStartReceiveVideo = a;}
-
-
- /* DESCRIPTION : Callback called when OpenH323 opens a new logical channel
- * BEHAVIOR : Updates the log window with information about it, returns
- * FALSE if error, TRUE if OK
- * PRE : /
- */
virtual bool OnOpenMediaStream (OpalConnection &,
OpalMediaStream &);
-
- /* DESCRIPTION : Callback called when OpenH323 closes a new logical channel
- * BEHAVIOR : Close the channel and update the GUI..
- * PRE : /
- */
virtual void OnClosedMediaStream (const OpalMediaStream &);
- private:
void GetAllowedFormats (OpalMediaFormatList & full_list);
- /* Different channels */
- bool is_transmitting_video;
- bool is_transmitting_audio;
- bool is_receiving_video;
- bool is_receiving_audio;
-
+ std::list<std::string> protocols;
/* The various related endpoints */
GMH323Endpoint *h323EP;
@@ -280,13 +202,8 @@
GMAccountsEndpoint *manager;
GMStunClient *sc;
-
/* Various mutexes to ensure thread safeness around internal
variables */
- PMutex vg_access_mutex;
- PMutex tct_access_mutex;
- PMutex lid_access_mutex;
- PMutex rc_access_mutex;
PMutex manager_access_mutex;
PMutex sc_mutex;
@@ -295,7 +212,9 @@
Ekiga::ConfBridge *bridge;
Ekiga::CodecList codecs;
Ekiga::CallCore *call_core;
- Ekiga::AudioOutputCore & audiooutput_core;
+
+ std::string display_name;
+ unsigned reject_delay;
};
#endif
Modified: trunk/src/endpoints/opal-gmconf-bridge.cpp
==============================================================================
--- trunk/src/endpoints/opal-gmconf-bridge.cpp (original)
+++ trunk/src/endpoints/opal-gmconf-bridge.cpp Sat May 17 18:40:06 2008
@@ -142,15 +142,9 @@
//
// Jitter buffer configuration
//
- if (key == AUDIO_CODECS_KEY "minimum_jitter_buffer") {
-
- unsigned max = (unsigned) gm_conf_get_int (AUDIO_CODECS_KEY "maximum_jitter_buffer");
- manager.set_jitter_buffer_size (gm_conf_entry_get_int (entry), max);
- }
else if (key == AUDIO_CODECS_KEY "maximum_jitter_buffer") {
- unsigned min = (unsigned) gm_conf_get_int (AUDIO_CODECS_KEY "minimum_jitter_buffer");
- manager.set_jitter_buffer_size (min, gm_conf_entry_get_int (entry));
+ manager.set_maximum_jitter (gm_conf_entry_get_int (entry));
}
@@ -168,7 +162,7 @@
//
else if (key == AUDIO_CODECS_KEY "enable_echo_cancelation") {
- manager.set_echo_cancelation (gm_conf_entry_get_bool (entry));
+ manager.set_echo_cancellation (gm_conf_entry_get_bool (entry));
}
@@ -241,8 +235,7 @@
else if (key == SIP_KEY "forward_host") {
const gchar *str = gm_conf_entry_get_string (entry);
- if (str != NULL)
- manager.GetSIPEndpoint ()->set_forward_host (str);
+ manager.GetSIPEndpoint ()->set_forward_uri (str);
}
//
@@ -276,7 +269,7 @@
const gchar *str = gm_conf_entry_get_string (entry);
if (str != NULL)
- manager.set_fullname (str);
+ manager.set_display_name (str);
}
@@ -285,15 +278,15 @@
//
else if (key == CALL_FORWARDING_KEY "forward_on_busy") {
- manager.GetSIPEndpoint ()->set_forward_on_busy (gm_conf_entry_get_bool (entry));
+ manager.set_forward_on_busy (gm_conf_entry_get_bool (entry));
}
else if (key == CALL_FORWARDING_KEY "always_forward") {
- manager.GetSIPEndpoint ()->set_unconditional_forward (gm_conf_entry_get_bool (entry));
+ manager.set_unconditional_forward (gm_conf_entry_get_bool (entry));
}
else if (key == CALL_OPTIONS_KEY "no_answer_timeout") {
- manager.GetSIPEndpoint ()->set_no_answer_timeout (gm_conf_entry_get_int (entry));
+ manager.set_reject_delay (gm_conf_entry_get_int (entry));
}
@@ -325,13 +318,11 @@
if (couple && couple [1])
max_port = atoi (couple [1]);
- if (key == PORTS_KEY "udp_port_range") {
-
- manager.GetSIPEndpoint ()->set_udp_ports (min_port, max_port);
- manager.GetH323Endpoint ()->set_udp_ports (min_port, max_port);
- }
+ if (key == PORTS_KEY "udp_port_range")
+ manager.set_udp_ports (min_port, max_port);
else
- manager.GetH323Endpoint ()->set_tcp_ports (min_port, max_port);
+ manager.set_tcp_ports (min_port, max_port);
+
g_free (couple);
}
}
Modified: trunk/src/endpoints/opal-main.cpp
==============================================================================
--- trunk/src/endpoints/opal-main.cpp (original)
+++ trunk/src/endpoints/opal-main.cpp Sat May 17 18:40:06 2008
@@ -74,7 +74,7 @@
GMManager *manager = new GMManager (core);
GMSIPEndpoint *sipEP = manager->GetSIPEndpoint ();
- call_core->add_manager (*sipEP);
+ call_core->add_manager (*manager);
core.add (*manager); // FIXME temporary
if (contact_core != NULL)
Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp (original)
+++ trunk/src/endpoints/sip.cpp Sat May 17 18:40:06 2008
@@ -45,6 +45,31 @@
#include "presence-core.h"
#include "personal-details.h"
+class dialer : public PThread
+{
+ PCLASSINFO(dialer, PThread);
+
+public:
+
+ dialer (const std::string & uri, GMManager & ep)
+ : PThread (1000, AutoDeleteThread),
+ dial_uri (uri),
+ endpoint (ep)
+ {
+ this->Resume ();
+ };
+
+ void Main ()
+ {
+ PString token;
+ endpoint.SetUpCall ("pc:*", dial_uri, token);
+ };
+
+private:
+ const std::string dial_uri;
+ GMManager & endpoint;
+};
+
/* The class */
GMSIPEndpoint::GMSIPEndpoint (GMManager & ep, Ekiga::ServiceCore & _core)
@@ -72,42 +97,20 @@
/* Update the User Agent */
SetUserAgent ("Ekiga/" PACKAGE_VERSION);
+ /* NAT Binding */
+ SetNATBindingRefreshMethod (SIPEndPoint::EmptyRequest);
+
Ekiga::PersonalDetails *details = dynamic_cast<Ekiga::PersonalDetails *> (_core.get ("personal-details"));
if (details)
publish (*details);
-
- /* Start listening */
- start_listening ();
-}
-
-
-GMSIPEndpoint::~GMSIPEndpoint ()
-{
-}
-
-
-bool GMSIPEndpoint::dial (const std::string uri)
-{
- return endpoint.dial (uri);
}
-const std::string & GMSIPEndpoint::get_protocol_name () const
-{
- return protocol_name;
-}
-
-
-const Ekiga::CallManager::Interface & GMSIPEndpoint::get_interface () const
+bool GMSIPEndpoint::message (const std::string & _uri,
+ const std::string & _message)
{
- return interface;
-}
-
-
-bool GMSIPEndpoint::send_message (const std::string uri, const std::string message)
-{
- if (!uri.empty () && !message.empty ()) {
- Message (uri.c_str (), message.c_str ());
+ if (!_uri.empty () && (_uri.find ("sip:") == 0 || _uri.find (':') == string::npos) && !_message.empty ()) {
+ Message (_uri.c_str (), _message.c_str ());
return true;
}
@@ -116,17 +119,6 @@
}
-Ekiga::CodecList GMSIPEndpoint::get_codecs ()
-{
- return endpoint.get_codecs ();
-}
-
-
-void GMSIPEndpoint::set_codecs (Ekiga::CodecList & _codecs)
-{
- endpoint.set_codecs (_codecs);
-}
-
bool GMSIPEndpoint::populate_menu (Ekiga::Contact &contact,
Ekiga::MenuBuilder &builder)
{
@@ -266,22 +258,66 @@
}
}
+bool GMSIPEndpoint::dial (const std::string & uri)
+{
+ PString token;
+ std::stringstream ustr;
+
+ if (uri.find ("sip:") == 0 || uri.find (":") == string::npos) {
-void
-GMSIPEndpoint::set_outbound_proxy (const std::string & uri)
+ if (uri.find (":") == string::npos)
+ ustr << "sip:" << uri;
+ else
+ ustr << uri;
+
+ new dialer (ustr.str (), endpoint);
+
+ return true;
+ }
+
+ return false;
+}
+
+const std::string & GMSIPEndpoint::get_protocol_name () const
+{
+ return protocol_name;
+}
+
+void GMSIPEndpoint::set_forward_uri (const std::string & uri)
{
- SIPEndPoint::SetProxy (uri.c_str ());
+ forward_uri = uri;
}
-void
-GMSIPEndpoint::set_dtmf_mode (unsigned int mode)
+const std::string & GMSIPEndpoint::get_forward_uri () const
+{
+ return forward_uri;
+}
+
+
+void GMSIPEndpoint::set_outbound_proxy (const std::string & uri)
+{
+ outbound_proxy = uri;
+ SetProxy (SIPURL (outbound_proxy));
+}
+
+
+const std::string & GMSIPEndpoint::get_outbound_proxy () const
{
- switch (mode)
- {
+ return outbound_proxy;
+}
+
+
+void GMSIPEndpoint::set_dtmf_mode (unsigned mode)
+{
+ switch (mode) {
+
+ // SIP Info
case 0:
SetSendUserInputMode (OpalConnection::SendUserInputAsTone);
break;
+
+ // RFC2833
case 1:
SetSendUserInputMode (OpalConnection::SendUserInputAsInlineRFC2833);
break;
@@ -289,111 +325,75 @@
break;
}
}
-
-
-void
-GMSIPEndpoint::set_nat_binding_delay (unsigned int delay)
-{
- SIPEndPoint::SetNATBindingTimeout (PTimeInterval (0, delay));
-}
-bool GMSIPEndpoint::start_listening ()
+unsigned GMSIPEndpoint::get_dtmf_mode () const
{
- unsigned port = listen_port;
- std::stringstream str;
- RemoveListener (NULL);
-
- interface.protocol = "udp";
- interface.interface = "*";
-
- str << "udp$*:" << port;
- if (!StartListeners (PStringArray (str.str ().c_str ()))) {
-
- port = udp_min;
- str << "udp$*:" << port;
- while (port <= udp_max) {
-
- if (StartListeners (PStringArray (str.str ().c_str ()))) {
+ // SIP Info
+ if (GetSendUserInputMode () == OpalConnection::SendUserInputAsTone)
+ return 0;
- interface.port = port;
- return true;
- }
- port++;
- }
- }
- else
- interface.port = port;
+ // RFC2833
+ if (GetSendUserInputMode () == OpalConnection::SendUserInputAsInlineRFC2833)
+ return 1;
- return false;
+ return 1;
}
-bool GMSIPEndpoint::set_udp_ports (const unsigned min, const unsigned max)
+bool GMSIPEndpoint::set_listen_port (unsigned port)
{
- if (min > 0 && max > 0 && min + 12 < max) {
+ interface.protocol = "udp";
+ interface.interface = "*";
+ if (port > 0 && port >= udp_min && port <= udp_max) {
- udp_min = min;
- udp_max = max;
- endpoint.SetRtpIpPorts (udp_min, udp_max);
- endpoint.SetUDPPorts (udp_min, udp_max);
+ std::stringstream str;
+ RemoveListener (NULL);
- return start_listening ();
- }
+ str << "udp$*:" << port;
+ if (!StartListeners (PStringArray (str.str ()))) {
- return false;
-}
+ port = udp_min;
+ str << "udp$*:" << port;
+ while (port <= udp_max) {
+ if (StartListeners (PStringArray (str.str ()))) {
-bool GMSIPEndpoint::set_listen_port (const unsigned listen)
-{
- if (listen > 0 && listen >= udp_min && listen <= udp_max) {
+ interface.port = port;
+ return true;
+ }
- listen_port = listen;
- return start_listening ();
+ port++;
+ }
+ }
}
return false;
}
-void
-GMSIPEndpoint::set_forward_host (const std::string & uri)
+const Ekiga::CallManager::Interface & GMSIPEndpoint::get_listen_interface () const
{
- forward_uri = uri;
+ return interface;
}
-void
-GMSIPEndpoint::set_forward_on_busy (bool enabled)
-{
- forward_on_busy = enabled;
-}
-void
-GMSIPEndpoint::set_unconditional_forward (bool enabled)
+void GMSIPEndpoint::GMSIPEndpoint::set_nat_binding_delay (unsigned delay)
{
- unconditional_forward = enabled;
+ SetNATBindingTimeout (PTimeInterval (0, delay));
}
-void
-GMSIPEndpoint::set_forward_on_no_answer (bool enabled)
-{
- forward_on_no_answer = enabled;
-}
-void
-GMSIPEndpoint::set_no_answer_timeout (const unsigned timeout)
+unsigned GMSIPEndpoint::GMSIPEndpoint::get_nat_binding_delay ()
{
- no_answer_timeout = timeout;
+ return GetNATBindingTimeout ().GetSeconds ();
}
-
-void
-GMSIPEndpoint::Register (const PString & _aor,
- const PString & authUserName,
- const PString & password,
- unsigned int expires,
- bool unregister)
+void GMSIPEndpoint::Register (const PString & _aor,
+ const PString & authUserName,
+ const PString & password,
+ unsigned int expires,
+ bool unregister)
{
std::string aor = (const char *) _aor;
std::stringstream strm;
@@ -408,7 +408,7 @@
strm << aor;
/* Signal */
- runtime.run_in_main (sigc::bind (registration_event.make_slot (),
+ runtime.run_in_main (sigc::bind (endpoint.registration_event.make_slot (),
aor,
Ekiga::CallCore::Processing,
std::string ()));
@@ -491,7 +491,7 @@
}
/* Signal */
- runtime.run_in_main (sigc::bind (registration_event.make_slot (),
+ runtime.run_in_main (sigc::bind (endpoint.registration_event.make_slot (),
strm.str (),
was_registering ? Ekiga::CallCore::Registered : Ekiga::CallCore::Unregistered,
std::string ()));
@@ -724,31 +724,13 @@
SIPEndPoint::OnRegistrationFailed (strm.str ().c_str (), r, wasRegistering);
/* Signal */
- runtime.run_in_main (sigc::bind (registration_event.make_slot (),
+ runtime.run_in_main (sigc::bind (endpoint.registration_event.make_slot (),
aor,
wasRegistering ? Ekiga::CallCore::RegistrationFailed : Ekiga::CallCore::UnregistrationFailed,
info));
}
-SIPConnection *GMSIPEndpoint::CreateConnection (OpalCall & _call,
- const PString & token,
- void * userData,
- const SIPURL & destination,
- OpalTransport *transport,
- SIP_PDU *invite,
- unsigned int options,
- OpalConnection::StringOptions *stringOptions)
-{
- Ekiga::Call *call = dynamic_cast<Ekiga::Call *> (&_call);
- Ekiga::CallCore *call_core = dynamic_cast<Ekiga::CallCore *> (core.get ("call-core"));
- if (call_core)
- call_core->add_call (call, this);
-
- return SIPEndPoint::CreateConnection (_call, token, userData, destination, transport, invite, options, stringOptions);
-}
-
-
bool
GMSIPEndpoint::OnIncomingConnection (OpalConnection &connection,
unsigned options,
@@ -768,7 +750,7 @@
}
else
return SIPEndPoint::OnIncomingConnection (connection, options, stroptions);
-
+
return false;
}
@@ -778,7 +760,7 @@
G_GNUC_UNUSED SIPSubscribe::MWIType type,
const PString & msgs)
{
- runtime.run_in_main (sigc::bind (mwi_event.make_slot (),
+ runtime.run_in_main (sigc::bind (endpoint.mwi_event.make_slot (),
(const char *) account,
(const char *) msgs));
}
@@ -810,9 +792,9 @@
std::string display_name = (const char *) uri.GetDisplayName ();
uri.AdjustForRequestURI ();
std::string message_uri = (const char *) uri.AsString ();
- std::string message = (const char *) pdu.GetEntityBody ();
+ std::string _message = (const char *) pdu.GetEntityBody ();
- runtime.run_in_main (sigc::bind (im_received.make_slot (), display_name, message_uri, message));
+ runtime.run_in_main (sigc::bind (endpoint.im_received.make_slot (), display_name, message_uri, _message));
}
}
@@ -824,7 +806,7 @@
SIPURL to = messageUrl;
to.AdjustForRequestURI ();
std::string uri = (const char *) to.AsString ();
- runtime.run_in_main (sigc::bind (im_failed.make_slot (), uri,
+ runtime.run_in_main (sigc::bind (endpoint.im_failed.make_slot (), uri,
_("Could not send message")));
}
@@ -838,8 +820,8 @@
SIPURL to = _to;
to.AdjustForRequestURI ();
std::string uri = (const char *) to.AsString ();
- std::string message = (const char *) body;
- runtime.run_in_main (sigc::bind (im_sent.make_slot (), uri, message));
+ std::string _message = (const char *) body;
+ runtime.run_in_main (sigc::bind (endpoint.im_sent.make_slot (), uri, _message));
}
@@ -899,22 +881,6 @@
void
-GMSIPEndpoint::OnEstablished (OpalConnection &connection)
-{
- PTRACE (3, "GMSIPEndpoint\t SIP connection established");
- SIPEndPoint::OnEstablished (connection);
-}
-
-
-void
-GMSIPEndpoint::OnReleased (OpalConnection &connection)
-{
- PTRACE (3, "GMSIPEndpoint\t SIP connection released");
- SIPEndPoint::OnReleased (connection);
-}
-
-
-void
GMSIPEndpoint::OnPresenceInfoReceived (const PString & user,
const PString & basic,
const PString & note)
@@ -969,5 +935,5 @@
void GMSIPEndpoint::on_message (std::string name,
std::string uri)
{
- runtime.run_in_main (sigc::bind (new_chat.make_slot (), name, uri));
+ runtime.run_in_main (sigc::bind (endpoint.new_chat.make_slot (), name, uri));
}
Modified: trunk/src/endpoints/sip.h
==============================================================================
--- trunk/src/endpoints/sip.h (original)
+++ trunk/src/endpoints/sip.h Sat May 17 18:40:06 2008
@@ -47,6 +47,7 @@
#include "manager.h"
#include "presence-core.h"
#include "call-manager.h"
+#include "protocol-manager.h"
PDICTIONARY (msgDict, PString, PString);
@@ -55,11 +56,11 @@
class GMSIPEndpoint
: public SIPEndPoint,
+ public Ekiga::ProtocolManager,
public Ekiga::PresenceFetcher,
public Ekiga::PresencePublisher,
public Ekiga::PresentityDecorator,
- public Ekiga::ContactDecorator,
- public Ekiga::CallManager
+ public Ekiga::ContactDecorator
{
PCLASSINFO(GMSIPEndpoint, SIPEndPoint);
@@ -67,21 +68,9 @@
GMSIPEndpoint (GMManager &ep, Ekiga::ServiceCore & core);
- ~GMSIPEndpoint ();
-
/**/
- bool dial (const std::string uri);
-
- const std::string & get_protocol_name () const;
-
- const Ekiga::CallManager::Interface & get_interface () const;
-
- bool send_message (const std::string uri,
- const std::string message);
-
- Ekiga::CodecList get_codecs ();
-
- void set_codecs (Ekiga::CodecList & codecs);
+ bool message (const std::string & uri,
+ const std::string & message);
/***/
bool populate_menu (Ekiga::Contact &contact,
@@ -93,146 +82,71 @@
bool menu_builder_add_actions (const std::string & fullname,
std::map<std::string, std::string> & uris,
Ekiga::MenuBuilder & builder);
- /***/
/***/
void fetch (const std::string uri);
void unfetch (const std::string uri);
void publish (const Ekiga::PersonalDetails & details);
- /***/
+ /* ProtocolManager */
+ bool dial (const std::string & uri);
+
+ const std::string & get_protocol_name () const;
+
+ void set_dtmf_mode (unsigned mode);
+ unsigned get_dtmf_mode () const;
+
+ bool set_listen_port (unsigned port);
+ const Ekiga::CallManager::Interface & get_listen_interface () const;
+
+ /* SIP ProtocolManager */
+ void set_nat_binding_delay (unsigned delay);
+ unsigned get_nat_binding_delay ();
+
void set_outbound_proxy (const std::string & uri);
- void set_dtmf_mode (unsigned int mode);
- void set_nat_binding_delay (unsigned int delay);
+ const std::string & get_outbound_proxy () const;
- /***/
- /* TODO:
- * It is probably needed to move some of those functions
- * in the core
- */
- bool start_listening ();
- bool set_udp_ports (const unsigned min, const unsigned max);
- bool set_listen_port (const unsigned listen);
- void set_forward_host (const std::string & uri);
- void set_forward_on_busy (const bool enabled);
- void set_unconditional_forward (const bool enabled);
- void set_forward_on_no_answer (const bool enabled);
- void set_no_answer_timeout (const unsigned timeout);
-
-
- /* DESCRIPTION : /
- * BEHAVIOR : Register the SIP endpoint to the given SIP server.
- * PRE : Correct parameters.
- */
+ void set_forward_uri (const std::string & uri);
+ const std::string & get_forward_uri () const;
+
+
+ /* OPAL STUFF */
void Register (const PString & aor,
const PString & authUserName,
const PString & password,
unsigned int expires,
bool unregister);
-
- /* DESCRIPTION : Called when the registration is successful.
- * BEHAVIOR : Displays a message in the status bar and history.
- * PRE : /
- */
void OnRegistered (const PString & aor,
bool wasRegistering);
-
- /* DESCRIPTION : Called when the registration fails.
- * BEHAVIOR : Displays a message in the status bar and history.
- * PRE : /
- */
void OnRegistrationFailed (const PString & aor,
SIP_PDU::StatusCodes reason,
bool wasRegistering);
- SIPConnection *CreateConnection (OpalCall & call,
- const PString & token,
- void * userData,
- const SIPURL & destination,
- OpalTransport * transport,
- SIP_PDU * invite,
- unsigned int options = 0,
- OpalConnection::StringOptions * stringOptions = NULL);
-
-
- /* DESCRIPTION : Called when there is an incoming SIP connection.
- * BEHAVIOR : Checks if the connection must be rejected or forwarded
- * and call the manager function of the same name
- * to update the GUI and take the appropriate action
- * on the connection. If the connection is not forwarded,
- * or rejected, OnShowIncoming will be called on the PCSS
- * endpoint, allowing to auto-answer the call or do further
- * updates of the GUI and internal timers.
- * PRE : /
- */
bool OnIncomingConnection (OpalConnection &connection,
unsigned options,
OpalConnection::StringOptions * stroptions);
-
- /* DESCRIPTION : Called when there is a MWI.
- * BEHAVIOR : /
- * PRE : /
- */
void OnMWIReceived (const PString & to,
SIPSubscribe::MWIType type,
const PString & msgs);
-
- /* DESCRIPTION : Called when presence information has been received.
- * BEHAVIOR : Updates the roster.
- * PRE : /
- */
virtual void OnPresenceInfoReceived (const PString & user,
const PString & basic,
const PString & note);
-
- /* DESCRIPTION : Called when a message has been received.
- * BEHAVIOR : Checks if we already received the message and call
- * OnMessageReceived.
- * PRE : /
- */
virtual void OnReceivedMESSAGE (OpalTransport & transport,
SIP_PDU & pdu);
-
- /* DESCRIPTION : Called when sending a message fails.
- * BEHAVIOR : /
- * PRE : /
- */
void OnMessageFailed (const SIPURL & messageUrl,
SIP_PDU::StatusCodes reason);
void Message (const PString & to,
const PString & body);
-
- /* DESCRIPTION : /
- * BEHAVIOR : Returns the account to use for outgoing PDU's.
- * PRE : /
- */
SIPURL GetRegisteredPartyName (const SIPURL & host);
-
- /* DESCRIPTION : This callback is called when the connection is
- * established and everything is ok.
- * BEHAVIOR : Stops the timers.
- * PRE : /
- */
- void OnEstablished (OpalConnection &);
-
-
- /* DESCRIPTION : This callback is called when a connection to a remote
- * endpoint is cleared.
- * BEHAVIOR : Stops the timers.
- * PRE : /
- */
- void OnReleased (OpalConnection &);
-
-
private:
void on_dial (std::string uri);
@@ -257,10 +171,12 @@
std::string protocol_name;
std::string uri_prefix;
std::string forward_uri;
+ std::string outbound_proxy;
bool forward_on_busy;
bool unconditional_forward;
bool forward_on_no_answer;
+
unsigned no_answer_timeout;
unsigned udp_min;
unsigned udp_max;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]