Allows reception of incoming calls.
PhoneCall objects
objectname.AllowReceivingCalls ( allow )
Argument |
Description |
---|---|
objectname |
The name of the PhoneCall object that will be allowed to receive calls |
allow |
A boolean indicating whether incoming calls will be accepted |
Integer. Returns 1 for success and a negative value if an error occurs.
The AllowReceivingCalls function is typically called immediately after a PhoneCall object has been initialized.
In the following script for the cb_allow button, if the call has been initialized, the AllowReceivingCalls function is called and the cb_allow button’s text is toggled between “Disable Receive” and “Enable Receive”. The g_phInit global variable is set to 1 in the pcall_1 object’s constructor:
// Global variables: Long g_phInit = 0 // boolean gb_Allow integer li_ret if ( g_phInit > 0) then li_ret = pcall_1.AllowReceivingCalls(gb_Allow) if ( gb_Allow = true) then this.text = "Disable Receive" gb_Allow = false else this.text = "Enable Receive" gb_Allow = true end if else sle_1.text = "Call not initialized" end if