There is a new type of SIP application being developed in the VoIP community that can handle prepaid calls while being able to modify the media and initiate session teardowns during established calls. This functionality is beyond the ability of standard SIP proxy servers; therefore, it is being implemented as a Back-to-Back User Agent (B2BUA).
The B2BUA is defined in the in the SIP standard as follows:
Back-To-Back User Agent:
Also known as a B2BUA, this is a logical entity that receives an invitation, and acts as a UAS to process it. In order to determine how the request should be answered, it acts as a UAC and initiates a call outwards. Unlike a proxy server, it maintains complete call state and must participate in all requests for a call. Since it is purely a concatenation of other logical functions, no explicit definitions are needed for its behavior.
One way of implementing the B2BUA for providing prepaid call control is to enable it to act as a User Agent server (UAS) in the caller-initiated call leg and have it create another call leg to the destination as a User Agent Client (UAC). After the call is set up, the B2BUA could be designed to send SIP messages to modify the caller’s media to convey call duration or billing-related information. It may also use HTTP messages to carry the same information. The B2BUA can be implemented to control the call by tearing it down when the caller’s prepaid time has expired.
In some other implementations, the B2BUA is being implemented ...