LINEDial

Purpose

This function dials the phone number given. If the line is currently in use, the error LINE_INUSE is returned.

The hangup parameter is used with the HomeSeer Phone switch. If this parameter is TRUE, the line is hung up immediately after dialing is complete. This will cause the switch box to reconnect the local phone.

Parameters

Parameter: Line
Type: Integer
Description: The phone line to access.

Parameter: Number
Type: String
Description: The phone number to dial. Note that the Windows dialing properties are used to alter the phone number. If the number given includes the area code, and the area code matches the one listed in the dialing properties, it is removed.

Parameter: Hangup
Type: Boolean
Descripton: If TRUE, causes the modem to hang up immediately after dialing the number.

Parameter: Nowait
Type: Boolean
Description: If TRUE, the call returns immediately regardless if the remote party has answered. This is useful if you are connected to a PBX system and you know the PBX answers immediately. This parameter is optional, and if omitted, the system assumes a FALSE value.

If FALSE, the system will wait up to 8 seconds for the remote party to connect. Since voice modems do not notify the system when a connection is made, the delay gives time for a connection. You may have to add more of a delay in your script.

Returns

Return value: Status
Type: Long (.NET Integer)
Description: Returns a value to indicate the status of the line:

0 = LINE_IDLE
1 = LINE_OFFERING
2 = LINE_RINGING
3 = LINE_CONNECTED
4 = LINE_INACTIVE
5 = LINE_BUSY
6 = LINE_INUSE
7 = LINE_TIMEOUT (for calling)
8 = LINE_ERROR (line error event)
9 = LINE_DIALING (dialing out)
10 = LINE_REORDER (fast busy, Hi-Phone only)

Examples

The following example dials a number and speaks over the phone.

sub main()

dim r

dim voice

r=hsp.LINEDial(1,"555-1212",false,false)

if r=5 then

' line is busy

hs.WriteLog "Dial Error","Line busy"

exit sub

end if

hsp.waitms 1000

hsp.speak 1,"hello on the phone, how are you today?",true

hsp.LINEHangup 1

end sub