Search code examples
freeswitch

Block annoying numbers on freeswitch


I use freeswitch and I would like to block some annoying numbers. So far I tried modify inbound_call.xml like this

<extension name="annoying1">
  <condition field="destination_number" expression="^5022xxxx$">
    <action application="log" data="NOTICE To jest Rozmowa przych (testowo muzyczka).: ${destination_number}"/>
    <action application="answer"/>
    <action application="playback" data="/home/mwalko/przywitanie.wav"/>
    <action application="hangup"/>
  </condition>
</extension>

It doesn't work, should I change this "destination_number"? How can I recognize if for example 5022xxxx calls?

Seems like this "destination_number" points the number which someone called, not the calling one.


Solution

  • destination_number contains the digits entered by the caller, so try out caller_id_number. But keep in mind, that this can be faked.