Using CDR() function in Pre_bridge Handlers

Im trying to log the IP Address of the ‘callee’… i.e the end point that ultimately answers the call.
I am trying to write this into a custom field in the cdr logs.

Im using the pre-bridge handlers in the Dial function to call a macro that does the following:

exten => s,1,Set(callee_uri=${CHANNEL(uri)})
exten => s,n,Set(CDR(originate_dst)=${callee_uri})
exten => s,n,MacroExit

On the asterisk console I can see that it captures the ip address information correctly however it does not seem to be saving it the the ‘originate_dst’ field in the cdr table.

Calling this Macro before the dial function (as a test) works correctly - although it logs the URI details of the originating channel and not that of the target channel (the one established with the endpoint that ultimately answered the call).

Any idea if it is even possible to use the CDR() function to set cdr values within the Pre-Bridge Handlers?

I think the answer to your question is found here

I think what your saying is “read the damn manual” :slight_smile:

From researching this matter, I understand that CDR function requests will
not work “after the Dial function has returned” - This is why I have not
bothered with hangup handlers. However why does it not work when used in
Pre-Bridge handlers?