Can't get PITCH_SHIFT() to work for outgoing calls

The following text placed in file extensions_custom.conf works, when a call is placed from outside and routed through asterisk through a trunk to extension 1030, the voice pitch is indeed changed. However when a call is placed from extension 1030, the voice pitch doesn’t change. I have experimented quite a bit but can’t figure out what context to use, or if there is something else I am doing wrong. Would anyone happen to be able to help?

exten => 1030,1,Set(PITCH_SHIFT(tx)=highest)

Howdy: … nheritance


I studied the link to Variable Inheritance but a solution to my problem did not jump right out at me. Thanks for the reply.

Read it again. The problem is obvious.

I have read it again, and tried to figure it out, I have tried several things, but it didnt work. I am not sure I stated the problem right, just to be sure, Incoming calls to the extension, the voice is changed, outgoing calls from the extension the voice is not changed. I have tried to prefix the variable with _ to get it be inherited this did not work. Perhaps I should explain that I am not an expert at dialplans, I use Freepbx to manage my asterisk server, because of this I don’t see the obvious solution, but promise I will do further study, if one can provide it. Thanks again for all your replies.

Sorry. This isn’t actually a variable, so the inheritence thing was a red herring.

As the documentation states, audio-hooks, like PITCH_SHIFT are applied to the channel on which the function is invoked. That is the channel from the unknown caller that invoked a caller to extension 1030.

Unfortunately, FreePBX confuses Asterisk extensions and Asterisk devices. You are trying to associate the hook with a device. SIP/1030 is not the same as extension 1030, and best practice is actually not to call it SIP/1030, but something unguessable. FreePBX doesn’t follow best practice in this respect.

To associate the hook with incoming calls from device SIP/1030, in pure Asterisk, you need to allocate a context to that device and include an extension/priority line in that context that is executed for all calls routed to that context. You will need to ask the FreePBX people how to do that on FreePBX.

Note you will need to use RX if TX was valid for an outgoing call.

I will try to work on fixing the problem with the suggestions that you made david55, thanks for your response. Does anyone else out there know of a more direct solution to this problem, or has anyone used this function for outbound calls from an extension? Again the below dialplan snippet works with inbound calls to the extension, but I can’t figure out how to adjust the dial plan to get outbound calls from the extension to implement the function and thus change the pitch on outbound calls. I am guessing I could dissect the dial plan that freepbx creates, study up on dialplan syntax and then figure it out from there. I am trying to implement this one function in a work environment for particular purpose, if anyone has done this before, your example dialplan snipet would be much appreciated.

exten => 1030,1,Set(PITCH_SHIFT(tx)=highest)

Asterisk has no concept of outbound calls from extensions. You need to use for how to do this for what FreePBX considers to be such calls.