Asterisk: HOWTO forward DNIS to remote party

Dialed Number Identification Service (DNIS) is a service that lets determine which telephone number was dialed by a customer.

Usually dialed number is known for subscriber, because each DID corresponds unique extension.
It is not a case for transfered calls, because information about DID will be lost. To inform far side about original dialed number the SIP protocol provides the Diversion header.
To set the Diversion field you have to set rdnis variable in dialplan. E.g.


;catch all extension
exten=>_.,n,Set(CALLERID(rdnis)=${EXTEN})

;in the macro
exten=>s,n,Set(CALLERID(rdnis)=${MACRO_EXTEN})

; or hardcoded
exten=>_.,n,Set(CALLERID(rdnis)=123456789)

Enjoy!

No comments:

Asterisk AST_SORCERY function

 AST_SORCERY gets a field from a sorcery object. Sorcery is always created for PJSIP aors, endpoints and identifies in asterisk. It allows y...