#include <t38proto.h>
Public Member Functions | |
virtual PBoolean | MakeConnection (OpalCall &call, const PString &party, void *userData=NULL, unsigned int options=0, OpalConnection::StringOptions *stringOptions=NULL) |
virtual OpalFaxConnection * | CreateConnection (OpalCall &call, void *userData, OpalConnection::StringOptions *stringOptions, const PString &filename, bool receive, bool t38) |
virtual OpalMediaFormatList | GetMediaFormats () const |
Construction | |
OpalFaxEndPoint (OpalManager &manager, const char *g711Prefix="fax", const char *t38Prefix="t38") | |
~OpalFaxEndPoint () | |
User Interface operations | |
virtual void | AcceptIncomingConnection (const PString &connectionToken) |
virtual void | OnFaxCompleted (OpalFaxConnection &connection, bool failed) |
Member variable access | |
const PFilePath & | GetSpanDSP () const |
void | SetSpanDSP (const PString &path) |
const PString & | GetDefaultDirectory () const |
void | SetDefaultDirectory (const PString &dir) |
const PString & | GetT38Prefix () const |
Protected Attributes | |
PString | m_t38Prefix |
PFilePath | m_spanDSP |
PDirectory | m_defaultDirectory |
Fax Endpoint. This class represents connection that can take a standard group 3 fax TIFF file and produce tones represented by a stream of PCM. This may be directed to another endpoint such as OpalLineEndpoint which can send the TIFF file to a physical fax machine.
Relies on the presence of spandsp to do the hard work.
OpalFaxEndPoint::OpalFaxEndPoint | ( | OpalManager & | manager, | |
const char * | g711Prefix = "fax" , |
|||
const char * | t38Prefix = "t38" | |||
) |
Create a new endpoint.
manager | Manager of all endpoints. | |
g711Prefix | Prefix for URL style address strings | |
t38Prefix | Prefix for URL style address strings |
OpalFaxEndPoint::~OpalFaxEndPoint | ( | ) |
Destroy endpoint.
virtual void OpalFaxEndPoint::AcceptIncomingConnection | ( | const PString & | connectionToken | ) | [virtual] |
Accept the incoming connection.
connectionToken | Token of connection to accept call |
virtual OpalFaxConnection* OpalFaxEndPoint::CreateConnection | ( | OpalCall & | call, | |
void * | userData, | |||
OpalConnection::StringOptions * | stringOptions, | |||
const PString & | filename, | |||
bool | receive, | |||
bool | t38 | |||
) | [virtual] |
Create a connection for the fax endpoint.
call | Owner of connection | |
filename | filename to send/receive |
const PString& OpalFaxEndPoint::GetDefaultDirectory | ( | ) | const [inline] |
Get the default directory for received faxes.
References m_defaultDirectory.
virtual OpalMediaFormatList OpalFaxEndPoint::GetMediaFormats | ( | ) | const [virtual] |
Get the data formats this endpoint is capable of operating. This provides a list of media data format names that may be used by an OpalMediaStream may be created by a connection from this endpoint.
Note that a specific connection may not actually support all of the media formats returned here, but should return no more.
The default behaviour is pure.
Reimplemented from OpalEndPoint.
const PFilePath& OpalFaxEndPoint::GetSpanDSP | ( | ) | const [inline] |
Get the location of the spandsp executable.
References m_spanDSP.
const PString& OpalFaxEndPoint::GetT38Prefix | ( | ) | const [inline] |
References m_t38Prefix.
Referenced by OpalT38Connection::GetPrefixName().
virtual PBoolean OpalFaxEndPoint::MakeConnection | ( | OpalCall & | call, | |
const PString & | party, | |||
void * | userData = NULL , |
|||
unsigned int | options = 0 , |
|||
OpalConnection::StringOptions * | stringOptions = NULL | |||
) | [virtual] |
Set up a connection to a remote party. This is called from the OpalManager::MakeConnection() function once it has determined that this is the endpoint for the protocol.
The general form for this party parameter is:
[proto:][alias@][transport$]address[:port]
where the various fields will have meanings specific to the endpoint type. For example, with H.323 it could be "h323:Fred@site.com" which indicates a user Fred at gatekeeper size.com. Whereas for the PSTN endpoint it could be "pstn:5551234" which is to call 5551234 on the first available PSTN line.
The proto field is optional when passed to a specific endpoint. If it is present, however, it must agree with the endpoints protocol name or PFalse is returned.
This function usually returns almost immediately with the connection continuing to occur in a new background thread.
If PFalse is returned then the connection could not be established. For example if a PSTN endpoint is used and the assiciated line is engaged then it may return immediately. Returning a non-NULL value does not mean that the connection will succeed, only that an attempt is being made.
The default behaviour is pure.
call | Owner of connection | |
party | Remote party to call | |
userData | Arbitrary data to pass to connection | |
options | options to pass to conneciton |
Implements OpalEndPoint.
virtual void OpalFaxEndPoint::OnFaxCompleted | ( | OpalFaxConnection & | connection, | |
bool | failed | |||
) | [virtual] |
Fax transmission/receipt completed. Default behaviour releases the connection.
connection | Connection that completed. | |
failed | Fax ended with failure |
void OpalFaxEndPoint::SetDefaultDirectory | ( | const PString & | dir | ) | [inline] |
Set the default directory for received faxes.
dir | New directory for fax reception |
References m_defaultDirectory.
void OpalFaxEndPoint::SetSpanDSP | ( | const PString & | path | ) | [inline] |
Set the location of the spandsp executable.
path | New path for SpanDSP executable |
References m_spanDSP.
PDirectory OpalFaxEndPoint::m_defaultDirectory [protected] |
Referenced by GetDefaultDirectory(), and SetDefaultDirectory().
PFilePath OpalFaxEndPoint::m_spanDSP [protected] |
Referenced by GetSpanDSP(), and SetSpanDSP().
PString OpalFaxEndPoint::m_t38Prefix [protected] |
Referenced by GetT38Prefix().