powershell: launching phone numbers to default voip program

1.3k Views Asked by At

I am writing a program that pulls multiple client details from get-aduser

one property i grab is get-aduser.phonenumber

I am displaying the number correctly to a link label.

my question is how do i get the link to dial to the default voip program on the machine.

  $ADUser = get-aduser $user -properties *
$script:PhoneNumber= $ADuser.PhoneNumber 
$PhoneLabel = New-Object System.Windows.Forms.LinkLabel
$PhoneLabel.Location = New-Object System.Drawing.Size(795,100)
$PhoneLabel.Size = New-Object System.Drawing.Size(300,20)
$PhoneLabel.LinkColor = "Blue"
$PhoneLabel.ActiveLinkColor = "RED"
$PhoneLabel.Text = ''
$Form.Controls.Add($PhoneLabel)

$PhoneLabel.text = $script:PhoneNumber
$PhoneLabel.add_Click({DialPhone})

function DialPhone
{
 # and im totaly lost at this point???????
}

any help would greatly be appreciated.

2

There are 2 best solutions below

3
On BEST ANSWER

I doubt if anything can be called "default voip program", but using protocol handler mechanism (tel:, callto:, sip: and many others) is popular. You have to refer to softphone documentation and/or look at related registry entries.

Other option is TAPI, but I guess it is less popular these days except for company-wide PABX systems.

Some applications have custom interfaces (Skype: text protocol, WM_COPYDATA).

0
On

Have you looked at MicroSIP softphone? That might be able to do this.

Command line
Call a number: microsip.exe number
Hang up all calls: microsip.exe /hangupall
Answer a call: microsip.exe /answer
Start minimized: microsip.exe /minimized
Exit: microsip.exe /exit

I am not sure if this is going to help you though.