S
S
Shing2014-11-03 17:02:47
Asterisk
Shing, 2014-11-03 17:02:47

How to edit extensions_custom.conf correctly?

Task: so that the name of the trunk (or its prefix) is visible when an incoming call is made, so that it is clear which number the subscriber dialed) and for some trunks the Pitch (timbre) function is enabled.
I have this option extensions_custom.conf
Each trunk has its own context=name1, context=name2, etc.

;
;
;incoming

[from-trunk-name1]
exten => _X.,1,NoOP(---> from ${CUT(CUT(SIP_HEADER(From),\:,2),@,1)} to ${CUT(CUT(SIP_HEADER(To),\:,2),@,1)} )
same => n,Set(CALLERID(name)=Name1)
same => n,Goto(from-trunk,${EXTEN},1)
same => n,Hangup()

[from-trunk-name2]
exten => _X.,1,NoOP(---> from ${CUT(CUT(SIP_HEADER(From),\:,2),@,1)} to ${CUT(CUT(SIP_HEADER(To),\:,2),@,1)} )
same => n,Set(CALLERID(name)=Name2)
same => n,Set(PITCH_SHIFT(tx)=1.4)
same => n,Goto(from-trunk,${EXTEN},1)
same => n,Hangup()

But why doesn’t it work for me correctly, now for example I’m calling on name1 and on name2, and the phone shows that name2 is always calling.
UPD.
Although it seems that you can see the "name" of the calling trunk by specifying the "Prefix for the number ID" in the Incoming routing.
I delete the lines about the name from the file extensions_custom.conf same => n,Set(CALLERID(name)=Name2)
And I still get the name of the trunks or this prefix.
But in this case, for some reason, it also shows only Name2, that is, it still always displays one thing.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2014-11-03
@rostel

you just have several peers of one operator,
all calls from it will fall into one context

L
lobodesov, 2014-11-27
@lobodesov

Comrade writes correctly.
I also thought why it was so, but it is exactly so.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question