BLF not working when extensions are in custom context

Hello,

I’ve put all of my internal extensions in a custom context, [from-internal-mine], which is defined in extensions_custom.conf. There are only 2 lines in this context:
[from-internal-mine]
exten => _[*#0-9].,1,Set(TIMEOUT(absolute)=7200)
same => n,Goto(from-internal,${EXTEN},1)

As you can see, the above context simply sets a time limit for the call and then passes control to the standard [from-internal] context. The problem is that with this setup in place, all my BLFs stop working. If I change the extensions to the [from-internal] context, the BLFs work fine. The Asterisk log indicates BLF registration errors because the extension is either not defined in [from-internal-mine] (not the case), or there is no associated hint.

I’m not sure how to resolve this. Any suggestions? The closest I’ve come to a solution is a forum post suggesting to add a line in my custom context as follows:

[from-internal-mine]
exten => _[*#0-9].,1,Set(TIMEOUT(absolute)=7200)
same => hint,PJSIP/${EXTEN}
same => n,Goto(from-internal,${EXTEN},1)

When I do this, the BLFs register successfully, but all calls between extensions fail. Would appreciate some pointers, as I’m still a novice at custom contexts…

Thanks!

1 Like

You can only subscribe to hints that are part of your context, which is from-internal by default. You could add [from-internal-custom] context and then include=> from-internal-mine which should get it into the context for you.

Thanks, I will try this. I guess I could just move my code directly into [from-internal-custom] instead of separately including [from-internal-mine]?

I don’t like the idea of putting that in from-internal-custom, it will either loop or supersede generated dialplan. You might try including from-internal in your custom context, or the better solution is to abandon your context and use a dialplan hook: Hooking for fun and income

2 Likes

Thanks Lorne, this worked perfectly! Here is the code I ended up with:

; Outbound calls
[macro-dialout-trunk-predial-hook]
exten => s,1,Set(TIMEOUT(absolute)=7200)
same => n,MacroExit

; Inbound calls to ring group with ringall strategy
[macro-dial-ringall-predial-hook]
exten => s,1,Set(TIMEOUT(absolute)=7200)
same => n,MacroExit

; Internal calls
[macro-dialout-one-predial-hook]
exten => s,1,Set(TIMEOUT(absolute)=7200)
same => n,MacroExit
1 Like

How does this solve the BLF issue?

It allows me to put my extensions back into the default [from-internal] context instead of the custom [from-internal-mine] context. This, in turn, allows the BLF subscriptions to work properly since the context is the same.

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