Possible bug in call block: call block doesn't block calls the first time you add a rule unless you reload/rescan

Status
Not open for further replies.

iaindooley

New Member
Aug 16, 2024
17
0
1
48
Hi there,

Unfortunately I didn't upgrade from 5.2.4 yesterday as I planned, so this may already be fixed in the latest version. I won't be able to tell because it is working now.

I'm posting this here anyway because there are some spurious answers about changing the order of call_block in the Dialplan manager.

I didn't attempt to change the order of call_block, but as I was looking through the DEBUG log, I could see that call_block was never being executed.

The entry before that which was being executed was clear_sip_auto_answer so I disabled that, then did a reload/rescan from SIP Status.

The call_block then started being called, I could see it in the DEBUG log.

I then re-enabled clear_sip_auto_answer, and it still worked.

So I don't think it had anything to do with clear_sip_auto_answer, or changing the order, I think it was just that after the first time you add a new call block, if you don't reload/rescan then it never gets activated somehow. Maybe the XML doesn't save to the DB because it's empty until that point.

Probably if I either re-saved call_block from the dialplan or disabled/enabled that it may have worked, possibly it just needs reload/rescan, possibly it needs both.

It's difficult for me to tell, because it's working now, and of course I can't really tell if it will be the same on the latest version either, because it's working and will (hopefully) continue to work after I upgrade.

I also found that call block doesn't work when the call originates from the same server as the inbound number, however I will post that in a separate topic because it's probably expected behaviour and I just need advice on how it works.

Thanks,
Iain
 

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
FusionPBX 5.2.4 is not the current release. The latest release is 5.3.x.
 

iaindooley

New Member
Aug 16, 2024
17
0
1
48
Yes, that's why I opened with:

"Unfortunately I didn't upgrade from 5.2.4 yesterday as I planned, so this may already be fixed in the latest version. I won't be able to tell because it is working now."
 

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
The first entry in the call block enables the call_block dialplan for the current domain. After that its enabled for all future new entries for that domain.
 

iaindooley

New Member
Aug 16, 2024
17
0
1
48
Hi Mark, yep I assume that's expected behaviour.

However after that happens, you need to reload/rescan, which means that there are lots of answers on the web to the question "Why doesn't call block work" that say you should move it from order 40 to order 26 or some other voodoo.

In fact, that doesn't fix it, what fixes it is reloading/rescanning after you change the order.

In my case, I disabled clear_sip_auto_answer and then reloaded/rescanned and call_block started working.

So that means I would have started answering these forum questions "Why doesn't call block work" with the solution "Disable clear_sip_auto_answer" which isn't actually correct. Indeed, after it started working I tested by re-enabling clear_sip_auto_answer and found that call_block still worked.

Thus I assume that it is the reload/rescan after initially adding the first ever call block (regardless of domain) that makes it start working.

This maybe expected behaviour, but I think it's worth having this information publicly available is good because then people won't be changing the order of the call_block dialplan app.

It did occur to me that I could also answer one of those questions, but on the handful I looked at, they were closed to additional posts (on this forum and on Reddit).

It might also be possible to reload the XML and/or rescan (whatever is required) when someone first adds a call block for the first time ever on a domain so that it will start working.

Thanks,
Iain
 

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
The Number One Reason the call block doesn't work is to fill in the Caller ID Name as if it is a description. Most of the time the description is better off left blank.

I will test to see if it clears the cache after enabling it the first time.
 
  • Like
Reactions: iaindooley

iaindooley

New Member
Aug 16, 2024
17
0
1
48
The Number One Reason the call block doesn't work is to fill in the Caller ID Name as if it is a description. Most of the time the description is better off left blank.

I will test to see if it clears the cache after enabling it the first time.
In this case, the first thing we tried was just clicking "block" on a call from the list, rather than adding it manually.

Once I had done the thing disabling clear sip/reloading/scanning/testing/re-enabling etc. the exact same call block entry worked.

Not only that, but before I had done all that call_block didn't even appear in the log, it just wasn't being executed as part of the dialplan.

As soon as I had reloaded the config it showed up in the log file.

Thanks,
Iain
 
Status
Not open for further replies.