bmcollis
asked on
Simulate a SIP Phone request for config
I am having issues with the config for a sip phone (Aastra 6737i) and would like to manually download the config and look at it.
The basic settings I have are - directly from the phone;
Download Protocol - Http
HTTP Server - FQDN
HTTP Path - aastra6737i
HTTP Port - 80
I also know the MAC address of the phone and the SIP Username and Password
After some reading, I tried to use the Powershell "invoke-webrequest" command to download the file.
I have tried two different ways to pass the Username & Password.
Please Note - I did not write this code, but copied it from examples I found substituting my SIP username and Password
Method One
$username = "username"
$password = "password" | ConvertTo-SecureString -asPlainText -Force
$cred = New-Object System.Management.Automati on.PSCrede ntial($use rname,$pas sword)
invoke-webrequest -outfile mac.cfg http://fqdn/aastra6737i/mac.cfg -Credential $cred
Method Two
$user = 'username'
$pass = 'password'
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64 String([Sy stem.Text. Encoding]: :ASCII.Get Bytes($pai r))
$basicAuthValue = "Basic $encodedCreds"
$Headers = @{
Authorization = $basicAuthValue
}
invoke-webrequest -outfile mac.cfg http://fqdn/aastra6737i/mac.cfg -Headers $Headers
=== Again I did not write these scripts, and I am NOT a programmer.
However regardless of the script I get;
invoke-webrequest : Forbidden
You don't have permission to access /aastra6737i/mac.cfg on this server.
I know the file name "mac.cfg" that I am trying to download is correct
Does anyone know how a SIP phone contacts, authenticates and then downloads it config file and how this could be accomplished manually/programmably.
Thank you
Very much appreciated.
The basic settings I have are - directly from the phone;
Download Protocol - Http
HTTP Server - FQDN
HTTP Path - aastra6737i
HTTP Port - 80
I also know the MAC address of the phone and the SIP Username and Password
After some reading, I tried to use the Powershell "invoke-webrequest" command to download the file.
I have tried two different ways to pass the Username & Password.
Please Note - I did not write this code, but copied it from examples I found substituting my SIP username and Password
Method One
$username = "username"
$password = "password" | ConvertTo-SecureString -asPlainText -Force
$cred = New-Object System.Management.Automati
invoke-webrequest -outfile mac.cfg http://fqdn/aastra6737i/mac.cfg -Credential $cred
Method Two
$user = 'username'
$pass = 'password'
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64
$basicAuthValue = "Basic $encodedCreds"
$Headers = @{
Authorization = $basicAuthValue
}
invoke-webrequest -outfile mac.cfg http://fqdn/aastra6737i/mac.cfg -Headers $Headers
=== Again I did not write these scripts, and I am NOT a programmer.
However regardless of the script I get;
invoke-webrequest : Forbidden
You don't have permission to access /aastra6737i/mac.cfg on this server.
I know the file name "mac.cfg" that I am trying to download is correct
Does anyone know how a SIP phone contacts, authenticates and then downloads it config file and how this could be accomplished manually/programmably.
Thank you
Very much appreciated.
Did you try opening the URL in a web browser?
ASKER
Yes,
In IE - it comes back with a 403 error
The website declined to show this webpage
HTTP 403
Most likely causes:
•This website requires you to log in.
I am not prompted for a username and password
In IE - it comes back with a 403 error
The website declined to show this webpage
HTTP 403
Most likely causes:
•This website requires you to log in.
I am not prompted for a username and password
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Only giving a B as it was a work around rather than answering the actual question.
Split the points between Uros (because he did suggest the workaround) and myself (as I did the workaround prior to reading his suggestion)
Split the points between Uros (because he did suggest the workaround) and myself (as I did the workaround prior to reading his suggestion)