Код: Выделить всё
[my-diversion-context]
exten => s,1,Noop(Setting Diversion Header)
; Set the original caller number (Originating Party)
same => n,Set(REDIRECTING(orig-num)=1112223333)
; Set the number the call is being forwarded from (From Party)
same => n,Set(REDIRECTING(from-num)=4445556666)
; Set the destination number (To Party)
same => n,Set(REDIRECTING(to-num)=7778889999)
; Set the redirecting reason (e.g., "unconditional", "no-answer", "busy")
same => n,Set(REDIRECTING(reason)=unconditional)
; Increment the redirection counter
same => n,Set(REDIRECTING(count)=$[${REDIRECTING(count)} + 1])
; Set presentation information
same => n,Set(REDIRECTING(from-num-pres)=allowed)
same => n,Set(REDIRECTING(to-num-pres)=allowed)
; Dial the PJSIP endpoint/trunk. Asterisk will automatically generate the Diversion header
same => n,Dial(PJSIP/7778889999@my-pjsip-trunk)
same => n,Hangup()
Key Functions Explained:
REDIRECTING(orig-num): The initial calling number.
REDIRECTING(from-num): The number from which the call is being forwarded (the number on your system that received the call initially).
REDIRECTING(to-num): The final destination number the call is being diverted to.
REDIRECTING(reason): Specifies why the call is being diverted (e.g., cfu for call forward unconditional, no-answer).
REDIRECTING(count): Tracks the number of redirections to prevent infinite loops.
Но провайдер не должен выпустиь чужой callerid, который получается при срабатыванит follow me.