Inbound call is allowed to make transfer


I am really puzzled by a problem I face. I got a SIP trunk with a SIP provider. If I let the context to context=from-trunk then the caller can’t make a transfer (*2 or ##). If I change the contect to context=add-9 then the caller can make transfers. I am refering solely to inbound calls.

The context is really simple

exten => _X!,1,Set(CALLERID(num)=9${CALLERID(num)})
include => from-trunk

It basicaly adds a 9 at the incoming number so phones can call back with redial.

Why is this happening? Can anyone enlighten me?

Thank you,

look at the advanced settings. you can disable caller transfer there

You might try the more orthodox

exten => _X.,1,Set(CALLERID(num)=9${CALLERID(num)})
exten => _X.,n,Goto(from-pstn,${EXTEN},1)
exten => s,1,Goto(from-pstn,${EXTEN},1)

@bksales It is disabled thats why I am puzzled

@dicko Ill try this, thank you

EDIT: @dicko suggestion works and does not allow *2 or ## for the caller

In order to understand what you experienced, you have to know how Asterisk uses the include statement. In the normal from-trunk context, the very first line (i.e. priority = 1) sets a channel variable DIRECTION to a value of INBOUND, it is this channel variable that identifies the call as inbound, and blocks callers from accessing the in-call transfer feature codes.

With your modification, you have a different priority 1 line, which sets CALLERID, then the include. With this arrangement, your priority 1 gets run, then Asterisk proceeds to priority 2 of from-trunk, skipping over the critical priority 1 line in from-trunk.

1 Like

Thank you, this is exactly what I needed to understand why this happened.

1 Like

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