• Home
  • Sangoma Solutions
    • PBXact IPPBX
    • PBXact Cloud
    • FreePBX IPPBX
      • The FreePBX Appliance
      • FreeHMS Hotel PMS
    • Sangoma Phones
    • Vega gateways
    • Zulu UC
    • Asterisk
  • Hardware & Phones
    • IPPBXs
      • Sangoma PBXact
      • PBXact Cloud
      • FreePBX
        • Freepbx 60
        • Freepbx 100
        • Freepbx 300
        • Freepbx 1000
        • Sangoma Phones
      • Building FreePBX CallCenters
    • Voip Handsets
      • Sangoma System Handsets
      • Gigaset Pro
        • Gigaset Maxwell C DECT Desk Phone
        • Gigaset Pro R650H
        • Gigaset A540
        • Gigaset N300
        • Gigaset N870IP DECT
        • Gigaset N720 IP PRO
      • Conference Phones
        • Snom C520 Conference Set
        • CP960 Conference Phone
        • CP920 Conference Phone
    • Headsets
    • Peripherals
  • Lines & Support
    • Connectivity
      • Calls and Lines
        • Call charges and Bundles.
      • Fibre
      • FTTC
    • Support Contracts
      • Maintenance Terms & Conditions
    • System Monitoring
    • Number Porting
      • Porting Help
    • Case Studies
    • Major Fault Reports
  • Knowledge Base
    • Asterisk Support
    • Security
    • Knowledge Base
  • Contact
    • Contact Us
    • Invoice Payments
    • Privacy Policy
    • Your Rights under GDPR
  • Submit Support Ticket
  • Special Offers

Catching the IP of anonymous callers on Asterisk servers



Hi just sharing a simple bit of dialplan to catch anon callers ip addresses when using freepbx and Anonymous callers is set to yes, which is needed for some suppliers.

Normally I would say lock your firewall to only known IPs, but in some cases this isn’t possible

Im sure if you have a Asterisk server with a public IP you will have seen calls on the console screen where the call is to a destination but the callers are exten@yourserver . Well this little bit of dialplan at the end of you default sip context should catch them and log them with the ip of the originating server

In extensions_custom.conf add the dialplan below

[catchall]
exten => s,1,Noop(Dead calls rising)
exten => s,n,Set(uri=${SIPCHANINFO(uri)})
exten => s,n,Verbose(3,Unknown call from ${uri} to ${EXTEN})
exten => s,n,System(echo "[${STRFTIME(${EPOCH},,%b %d %H:%M:%S)}] SECURITY[] Unknown Call from ${CALLERIDNUM} to ${FROM_DID} IPdetails ${uri}" >> /var/log/asterisk/sipsec.log)
exten => s,n,Hangup()

Then in Custom Destinations add a destination as  catchall,s,1

so you now get in your logs

[May 1 00:11:06] SECURITY[] Unknown Call from  to 900441516014742 IPdetails sip:101@37.75.209.113:21896

 I hope this is some help to you, It allows other scripts to pick up this address and add it to your firewall.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Facebook (Opens in new window)
Asterisk Support, Knowledge Base, Security    Asterisk, digium, Elastix, freePBX, Linux, security, support, Technical, VOIP, xorcom
Similar posts
  • Grab a free* Snom Conference Phone ! ... — On our lead up to Christmas, we have teamed up with ...
  • Recording Announcements in FreePBX 13... — This was recorded a while ago as an aid to a customer, I...
  • The Gigaset N670 IP PRO grows with th... — LAUNCH OFFER ! SINGLE BASE INC VAT AND DELIVERY FOR £13...
  • Gigaset N300 — The DECT IP base station that brings communication to ne...
  • Snom C520 Conference Set — Thanks to advanced DECT and Bluetooth technology, the C5...
← DNS issues affecting calls and routing
Changing the root or any other mysql password →
Sangoma

Links

  • Gradwell Account
  • Asterisk Forum
  • FreePBX Forum
  • FreePBX WIKI
  • IT Store
  • Blog
TunnelBear
Remote Access with TeamViewer choose "TeamViewer QuickSupport" when page loads
Yealink Reseller

Top Posts & Pages

  • FreeHMS , A Web based call management package for small Hotels and Serviced offices
  • Sip debugging with wireshark
  • The Gigaset N670 IP PRO grows with the company Mod…
  • Gigaset N300 IP, N300A IP, N510 IP PRO - Firmware update 12/2012 (version 075) released
  • How to transfer the directory of your Gigaset phone
  • Multiple Dynamic features with Asterisk Applicationmaps
  • Zulu UC – The Ultimate Desktop and Softphone integration for your Business
2018 Cyber-Cottage.co.uk

EvoLve Pro theme by Theme4Press  •  Powered by WordPress
Sangoma, FreePBX and VoIP sales and support

Back to Top
This website uses cookies
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Necessary Always Enabled