Home Ask Login Register

Developers Planet

Your answer is one click away!

Michu93 February 2016

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"/>

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.


Stanislav Sinyagin February 2016

condition uses regular expressions for matching, so you need to use a dot (.) instead of "x". You can also use something like ^5022\d{4}$

gf_ February 2016

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

Post Status

Asked in February 2016
Viewed 2,348 times
Voted 12
Answered 2 times


Leave an answer

Quote of the day: live life