Overriding extensions_additional with extensions_custom

Hello,

 Here's my ext-did in extensions_additional:

[ext-did]
include => ext-did-custom
exten => s,1,Set(FROM_DID=s)
exten => s,n,Goto(ext-group,511,1)
exten => _X.,1,Noop(Catch-All DID Match - Found ${EXTEN} - You probably want a DID for this.)
exten => _X.,n,Goto(ext-did,s,1)

; end of [ext-did]

 All I want to do is add "Playtones(ring)" do the beginning so my callers don't hear silence.  How can I add custom behavior using ext-did-custom?  Orielly's Asterisk book says:

“Asterisk will first try to match the extension in the current context. If unsuccessful, it will then try the first included context,and then continue to the other included contexts in the order in which they were included.”

 Since the ext-did in extensions_additional will match (it was generated by FreePBX after all), no matter what I do in ext-did-custom will be ignored, right?  How do I insert the "Playtones(ring)" command other than sticking it directly into extensions_additional, in which case it will be overwritten by FreePBX?

 Thanks for any help you can provide,

 -TM

This is a pretty fundamental question - doesn’t anyone know how to do this?

You’ve already provided yourself with the answer in your post. Put the code you want into ext-did-custom in extension_custom.conf. I understand wanting confirmation of this, but try it out first… If you can’t figure it out, then post to the forum. But you should at least try to solve the problem first. It it doesn’t work, you didn’t lose anything.

Also, you seem to be under the impression that Asterisk will ignore [ext-did-custom] because it is in extensions_custom.conf. This is not the case. The first line of [ext-did] is: include => ext-did-custom. This means that ext-did is including everything from ext-did-custom in it’s own context.

Alex

Hi Alex, thanks for replying!

I did try it, and it didn’t work. I’m hoping someone can tell me the right way to do it.

No, I think it will be ignored because the code within [ext-did] already is a perfect match. Again, Orielly’s Asterisk book says:

“Asterisk will first try to match the extension in the current context. If unsuccessful, it will then try the first included context,and then continue to the other included contexts in the order in which they were included.”

Since the ext-did in extensions_additional will match (it was generated by FreePBX after all), no matter what I do in ext-did-custom will be ignored, right?

Please tell me where I’ve gone wrong here.

 Thanks,

 -TM

Anyone?

I know extensions.conf is a stock file that will not get over-written. And [ext-did] is called right from this file by the [from-pstn] context.
So, you can include=>ext-did-custom below [from-pstn] but make sure it is above the existing include=>ext-did. Or better still, remove the [ext-did] if it is no longer needed.