#include <iax2ep.h>
Inheritance diagram for IAX2EndPoint:
|
|
Create the endpoint, and define local variables |
|
Destroy the endpoint, and all associated connections |
|
The TokenTranslationDict may need a new entry. Examine the list of active connections, to see if any match this frame. If any do, then we add a new translation entry in tokenTable; If a matching connection is found in connectionsActive, create a new translation entry and return TRUE. The connection, after processing the frame, will then delete the frame. |
|
A simple test to report if the connection associated with this frame is still alive. This test is used when transmitting the frame. If the connection is gone, don't bother transmitting the frame. There are exceptins to this rule, such as when a hangup packet is sent (which is after the connections has died. |
|
Return True if a connection (which matches this Frame ) can be found. This check is called prior to transmission of this frame. |
|
Copy to the supplied OpalMediaList the media formats we support |
|
Create a connection for the IAX endpoint. The default implementation is to create a IAX2Connection.
|
|
Given a remote party name of the format: [proto:][alias@][transport$]address[/extension] pull the string apart and get the components. The compoents are stored in a PStringList, indexed by the enum RemoteAddressFields |
|
Get the frame size (bytes) and frame duration (ms) for compressed data from this codec |
|
Report the number used by the computer running this program |
|
Report the local username |
|
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. Implements OpalEndPoint. |
|
Get out sequence number to use on status query frames |
|
Report the password |
|
Return the bitmask which specifies the preferred codec |
|
Return the bitmask which specifies the possible codecs we support |
|
Handle a received IAX frame. This may be a mini frame or full frame |
|
Setup the Endpoint internval variables, which is called at program startup. |
|
Report the port in use for IAX calls |
|
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: [iax2:]{username@][transport$]address[/extension][+context] 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 FALSE is returned. This function usually returns almost immediately with the connection continuing to occur in a new background thread. If FALSE 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.
Implements OpalEndPoint. |
|
Handle new incoming connection from listener. A return value of TRUE indicates that the transport object should be deleted by the caller. FALSE indicates that something else (eg the connection) has taken over responsibility for deleting the transport. Well, that is true of Opal. In iax2, we do all the work of creating a new connection etc. The transport arguement is ignore. In Iax2, this method is void, as no value is returned. Further, in iax2, we process the incoming frame.
|
|
Handle new incoming connection from listener. The default behaviour does nothing.
Reimplemented from OpalEndPoint. |
|
Request a new src call number, one that is different to all other src call numbers for this invocation of the program. |
|
Call back for when a connection has closed |
|
Call back for when a connections is established (we have received the first media packet) Reimplemented from OpalEndPoint. |
|
For the supplied IAX2Frame, pass it to a connection in the connectionsActive structure. If no matching connection is found, return FALSE; If a matching connections is found, give the frame to the connection (for the connection to process) and return TRUE; |
|
Pull frames off the incoming list, and pass on to the relevant connection. If no matching connection found, delete the frame. Repeat the process until no frames are left. |
|
Write the token of all connections in the connectionsActive structure to the trace file |
|
Report on the frames in the current transmitter class, which are pending transmission |
|
Set the local (on this host) number to some value |
|
Set the username to some value |
|
Set the password to some value |
|
We have an incoming call. Do we accept ? |
|
lock on access to call numbers variable |
|
Number of active calls |
|
Thread safe counter which keeps track of the calls created by this endpoint. This value is used when giving outgoing calls a unique ID |
|
Time when a call was started |
|
Thread which transfers frames from the Receiver to the appropriate connection. It momentarily locks the connection list, searches through, and then completes the trasnsfer. If need be, this thread will create a new conneciton (to cope with a new incoming call) and add the new connections to the internal list. |
|
Local copy of the media types we can handle |
|
Number, as used by the computer on the host running this program |
|
Name of this user, which is used as the IeCallingNumber |
|
Threading mutex on the variable tokenTable |
|
List of iax packets which has been read from the ethernet, and is to be sent to the matching IAX2Connection |
|
Password for this user, which is used when processing an authentication request |
|
Pointer to the receiver class, which is always valid |
|
The socket on which all data is sent/received. |
|
Pointer to the Processor class which handles special packets (eg lagrq) that have no destination call to handle them. |
|
Counter to use for sending on status query frames |
|
Mutex for the statusQueryCounter |
|
tokenTable is a hack to allow IAX2 to fit in with one of the demands of the opal library. Opal demands that at connection setup, we know the unique ID which this call will use. Since the unique ID is remote ip adress + remote's Source Call number, this is unknown if we are initiating the call. Consequently, this table is needed, as it provides a translation between the initial (or psuedo) token and the token that is later adopted |
|
Pointer to the transmitter class, which is always valid |