Limit call duration to / from an internal extension

We have an extension for a door intercom, the problem is that some users forget to disconnect the call and/or place a call on hold after they’ve done.

This timeout would only effect calls to / from specific internal extension(s) (not a trunk wide rule as described elsewhere). Any help would be greatly appreciated.

Thank you,
Gene

You can set the TIMEOUT(absolute) on the channel

1 Like

Termination of bad users will fix that.

Edit: The above is absolutely on topic. It is a people problem, not a technical problem.

Thanks @dicko, I’ve saw it mentioned for calls on the trunk level. Can you suggest the best way (which config file needs to be edited) to apply the setting on the channel level?

Haha, @sorvani, alas HR and IT are different departments here :wink:

1 Like

It prevails for all calls if added to the context in which they are made, likely you will need a custom context for such calls as they are ‘exceptional’ to regular calls that are better constrained.

So, it seems that I’ll need to somehow modify the from-internal context to apply the timeout in case the destination matches the door extension. Do I understand this correctly? Creating a custom context for the door itself should apply timeout to the call from the door, but not visa versa (such as secretary calling the door to talk to the person knocking).

I think a dialplan hook that activates with calls to and from the door phone: Hooking for fun and income

1 Like

Thanks @lgaetz, your suggestion may have been just what was needed, I’ve added the following to extensions_custom.conf:

[macro-dialout-one-predial-hook]
exten => s,1,Noop(Checking for calls to the door)
; calls to the door extension (250 as an example) would get 25 second timeout
exten => s,n,GotoIf($[“${EXTTOCALL}”=“250”]?s25)
; calls from the door would get a longer timeout to allow time to pick up
exten => s,n,GotoIf($[“${AMPUSER}”=“250”]?s45)
exten => s,n,MacroExit
exten => s,n(s25),NoOp(Limiting maximum call duration to 25 seconds)
exten => s,n,Set(TIMEOUT(absolute)=25)
exten => s,n,MacroExit
exten => s,n(s45),NoOp(Limiting maximum call duration to 45 seconds)
exten => s,n,Set(TIMEOUT(absolute)=45)
exten => s,n,MacroExit

I’ve checked (via log), and it seems that my “macro-dialout-one-predial-hook” was a simple exit before this change, that being said asterisk does complain that method already exists, thus original could not be loaded. Would be nice to know where the original hook was, as to verify that contents where not needlessly lost.

Does anyone have a suggestion as to what can be added so that the call would be dropped as soon as it was placed on hold? In our case, putting the door on hold is usually done by mistake and I would like it to work almost like an end call button.

I’m using a door phone, and there is a parameter defining a max time for calls.
I don’t know if your device incluses this kind of setting.

However, you can create a custom context with an absolute timeout to do it.

1 Like

Ignore it. The macro is in extensions.conf which you can’t edit. The context exists only for you to reuse, there is nothing that fpbx uses it for.

1 Like

@danardf We are using 8028 SIP Doorphone (G2) and the setting was staring me in the face in Basic Settings > Features tab. There is indeed a “Maximum Call Duration” setting which I somehow kept missing (don’t I feel silly). I’m still glad I’ve reached out to the community as I can now define timeout to a much greater degree (door controller only allows time limit to be defined in 30 second intervals).

@lgaetz, thank you for all of your input. The hook is working as expected and it’s great that time can be adjustable independently depending if the call goes to or coming from the door.

1 Like

Glad to help you sir :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.