Since all channels must be owned by some process, when no process takes ownership of a channel, the default owner becomes the channel owner. All in-service channels are owned by their default owner; the default owner is AD. Alternate default owners can be created.
Primarily, the default owner handles IRE_NEWCALL events. The IRE_NEWCALL event indicates that a new call has arrived. Assuming AD is the default owner, the AD tables are queried based on the channel number, dialed number identification number (DNIS), or automatic number identification (ANI) values. Through this query, a process to which ownership of the channel should be given is identified and the channel is irExec(3IRAPI)'ed to that process. After being irExec(3IRAPI)'ed, the IRP_SERVICE_NAME parameter is set to the value indicated during service definition.
The default owner holds all idle, in-service channels. An idle channel is any channel whose service state is IRD_INACTIVE and whose library state is IRS_IDLE. When processes request channels owned by the default owner, the channel is typically relinquished upon request. Control over relinquishing idle channels is enabled through the IRP_CHAN_NEGOTIATION parameter.
All out-of-service channels are owned by MTC_PROXY rather than the default owner. MTC_PROXY takes ownership of out-of-service channels and does not relinquish ownership of the channel unless instructed to do so by the MTC process. MTC_PROXY may also forcibly seize channels from AD or other owners when in-service channels are being taken out-of-service.
When a process relinquishes ownership of a channel and there are no other processes pending for ownership of that channel, channel ownership is returned to the default owner. The default owner receives the IRE_DEFOWN event when channel ownership is returned. After receiving the IRE_DEFOWN event, the default owner should take ownership of the channel via irInit(3IRAPI).