Forwarding affects how the switch or network treats incoming calls destined for a given address. The application can specify call forwarding conditions based on the origin of the call (internal, external, selective based on caller ID); the status of the address (busy, no answer, unconditionally); and the destination address where calls are to be forwarded. When the specified conditions are met for an incoming call, the switch deflects the incoming call to the specified destination number. Because the switch performs the forwarding action, the application will typically not know when a call has been forwarded.
The lineForward function provides a combination of call forwarding (by setting call-forwarding requests) and a do-not-disturb feature. The lineForward function can also cancel any or all of the forwarding requests currently in effect. Some switches require that a call be established to the forwarding address for call forwarding to be initiated. On such systems, lineForward allocates a consultation call and returns the handle for it to the application. The consultation call can be used as any other call. After the connection is established, forwarding confirmation is received from the switch, the call is dropped (using lineDrop), and forwarding is in effect. A LINE_ADDRESSSTATE message with a forwarding indication informs the application about changes in the forwarding status of an address.
Note It may be impossible for a service provider to know at all times what forwarding is in effect for an address. Forwarding can be canceled or changed in ways that make it impossible for a service provider to be informed of this fact.