Launch a call – click2dial

This function can be used to launch a call. Basically it connects 2 call legs. The function establishes a call to the users’ phone or to the source number. Once it has been connected the function tries to call the destination number. The function sets the correct SIP headers to flag the call as auto answer.

Parameters

  • Script: click2dial.php
  • username: sip username
  • password: extension password
  • number: the number you want to call (encode ‘+’ as ‘%2B’)
  • source: an optional parameter to bridge the call between the source and number instead of the user and number
  • anonymous: set it to 1 to hide your callerid [optional]
API Call:
http[s]://<server>/click2dial.php?username=<sipUsername>&password=<sipPassword>&number=<destination>[&source=<sourceUser>][&anonymous=1]

Return

  • 200: Call has been launched
  • 403: No or wrong login data
  • 404: No number provided
  • 500: General error

Example:

https://192.168.1.2/click2dial.php?username=myusername_100&password=mypassword100&number=%2B&anonymous=1

Answer a call – click2answer

This function can be used to answer an incoming call.

Parameters

  • Script: click2answer.php
  • username: sip username
  • password: extension password
API Call:
http[s]://<server>/click2answer.php?username=<sipUsername>&password=<sipPassword>

Return

  • 200: Call has been answered
  • 403: No or wrong login data
  • 500: General error

Example:

https://192.168.1.2/click2answer.php?username=myusername_100&password=mypassword100

Hangup a call – click2hangup

This function can be used to hangup an ongoing call.

Parameters

  • Script: click2hangup.php
  • Username: sip username
  • Password: extensions password
API Call:
http[s]://<server>/click2hangup.php?username=<sipUsername>&password=<sipPassword>

Return

  • 200: Call has been hangup
  • 403: No or wrong login data
  • 500: General error

Example:

https://192.168.1.2/click2hangup.php?username=myusername_100&password=mypassword100