How to play audio to called party (i.e. callee)?

Hi Guys,

Following what I was trying to do earlier (Need help with Custom Dynamic Feature <Activated By>), I’d like to play an audio message to the callee in a macro. How do I do this? I’m using a predial handler to activate a custom feature by callee’s channel and the callee implements the lines of the custom feature on the caller’s channel. If I add an audio message along with the custom feature, the caller hears it and not the callee.

Can anyone provide suggestions?

If you’d like to see the section of the code:

exten => s,1,NoOp()
same => n,Dial(${ARG1},5,b(test^callee_handler^1)) ; goes to [test] context to execute the lines under [test] on callee's channel
same => n,Return()

exten => callee_handler,1,NoOp()
same => n,Set(__DYNAMIC_FEATURES=apps) ;now dynamic features can be activated by the callee's channel only. The documentation says "The feature is activated by which channel DYNAMIC_FEATURES includes the feature is on". 
same => n,Return()

exten => s,1,Set(DB(blacklist/${CALLERID(num)})=1)
same => n,Set(Value=${DB(test/${CALLERID(num)})})
same => n,SayDigits(1234) ;I'd like to put a message like "block successful" but the caller hears this. I want the callee to hear it.
same => n, MacroExit ; 



Are you configuring the feature correctly in features.conf.
The Syntax is:
< FeatureName > => < DTMF_sequence >,< ActivateOn >[/< ActivatedBy >],
< Application >[(< AppArgument1 >,< AppArgument2 >)][,MOH_Class]

Basically need to check 2 parameters mentioned below:

; ActivateOn -> This is the channel of the call that the application will be executed
; on. Valid values are “self” and “peer”. “self” means run the
; application on the same channel that activated the feature. “peer”
; means run the application on the opposite channel from the one that
; has activated the feature.
; ActivatedBy -> This is which channel is allowed to activate this feature. Valid
; values are “caller”, “callee”, and “both”. “both” is the default.
; The “caller” is the channel that executed the Dial application, while
; the “callee” is the channel called by the Dial application.

Please check here that you are giving the right values.

Hi @vageesh,

The Activated By field is no longer honoured and hence couldn’t be used.

Activated On is specified as peer in my code as I want to retrieve the caller ID of the caller (peer => feature operates on the channel of the other party, so if callee activates it, the feature operates on caller’s channel and hence can retrieve caller ID of caller. If I specify self, ${CALLERID(num)} would return the caller ID of the callee, i.e. if the callee activates the feature, and not the caller)

I could not make out exactly what you are trying to do. It would help if you can explain in detail if possible.

You have to specify “peer” for activated on and if you want the caller to listen to whatever you play in your macro.
Is this not working?

ActivatedOn will apply to all channel operations. If you activate it on A, then you can only read A’s variables directly (although you can use ${IMPORT()} to get other channel’s variables) and anything you play will go to A.

You can’t directly read A’s variable but send media to B.

With regard to the question about what you are trying to de, please read first.

Sorry for not going in to too much detail. I didn’t want to confuse anybody.

What I’m trying to do is > Say a telemarketer calls me, I want to be able to blacklist him by pressing *9 during the call. This part was done already (see link in first post). The complication was that I wanted only myself to be able to activate the feature and not the caller. So, I had to use a predial handler to make this possible.

The second part is, once the caller gets blocked, I also wanted to play a message to myself so I know that the block was successful. However, playing a message in the macro goes to the caller, i.e. only caller hears it. I couldn’t figure out how to play the message on my channel.

My features.conf has the below


apps => *9,peer,Macro,appblock

Side notes (probably not relevant to this question) : ActivatedBy is no longer honoured. It made no difference when I tried specifying a value (“callee”) for it. ActivatedOn is peer as CALLERID(num) only returns the caller ID of the caller if the setting is peer. If I put self, CALLERID(num) will return my own caller ID (I don’t want to block my own caller ID!).

Thanks @david551 for the input. I’ll try and look into the IMPORT method. From what you said, does it mean that I will not be able to play message x to callee and message y to caller at the same time?

Wise words from your link which I think applies to my post :" Often, people who need technical help have a high-level goal in mind and get stuck on what they think is one particular path towards the goal. They come for help with the step, but don’t realize that the path is wrong. It can take substantial effort to get past this." - I realized that deep down I’m slightly reluctant to changing what I’ve done so far (which took some time and effort to figure out and can be seen over the last few posts), and more so because I’m closer to a deadline. But thanks for pointing it out - it’s changed my perspective.