Lost CDR Uniqueid

hi, guys thanks for time and help.

Issue: Lost CDR Uniqueid
Freepbx: 10.13.66-13
Asterisk: 11.23.1

i have appr running a macro when the user hit *100 i call a macro when i call the macro i get the next:
– Executing [s@macro-on:10] NoOp(“SIP/1000-00000d72”, “1476836678.4560”) in new stack
but when the call finish i get in the cdr record a diferent uniqueid
CDR Uniqued: 1476836678.4559

how i can have the same uniqueid of the cdr record in the macro when this run?

Note: this happens only white the incoming call from PSTN or other PBX Trunks when i run this command from extension to extension i get the same cdr uniqueid.

That would depend on your macro, the cdr records are actually NOT unique over UNIQUEID

I am sorry, I do not understand.
can you explain me better?

Not really, it is you that is calling macro-on , this is not part of anything I know of. Please post it . . .

You previously posted

this makes no sense.

this is a custom macro

this is the macro i call from /etc/asterisk/features_applicationmap_custom.conf

[macro-on]
exten => s,n,NoOp(Get Information)
exten => s,n,Set(ch=${CHANNEL(name)})
exten => s,n,Set(acc=${CDR(accountcode)})
exten => s,n,Set(name=${SYSTEMNAME})
exten => s,n,Set(datetime=${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)})
exten => s,n,Set(fdir=${STRFTIME(${EPOCH},%Y%m%d)})
exten => s,n,Set(enable=${CALLERID(num)})
exten => s,n,Set(uid=${UNIQUEID})
exten => s,n,NoOp(${CDR(uniqueid)})
exten => s,n,Set(context=${MACRO_CONTEXT})
exten => s,n,Set(ext=${MACRO_EXTEN})
exten => s,n,Agi(agi://localhost/index.agi)
exten => s,s,Playback(beep)
exten => s,n(off),MacroExit()

You get deeper in your rabbit hole with

exten => s,n,Agi(agi://localhost/index.agi)

i am running asterisk-java in the pbx as local server, when the macro start go to the index.agi and insert in to database the information from the macro.

Even deeper, what is asterisk-java ?

1 Like

The Asterisk-Java package consists of a set of Java classes that allow you to easily build Java applications that interact with an Asterisk PBX Server.

Asterisk Java

Then ask them why it is no longer working, no?

The Asterisk Java server is only for get the information, the problem is in the pbx whit cdr uniqueid

But apperantly no longer works, things change, you will REALLY have to ask the guys who wrote it. Does that make sense ?

Remember the uniqueid cdr is generate by asterisk in the macro context and when the call hangup

I know exactly what the uniqueid is it is based on the “unix-time” of the event generated all the way down to microseconds, you REALLY have to go to the authors here, I doubt anyone here can help you in your edge case

If your goal is to have two threads with the same uniqueid, you’ve missed the ‘unique’ part of the uniqueid. This isn’t a rabbit hole, it’s full on Mad Hatter (or The Caterpillar).

1 Like

Plug your various values into

http://www.unixtimestamp.com/index.php

to see why . . .

thanks all for the help and time!

As it turns out, Asterisk 12 removed all of this behaviour when it modified the bridging core to provide stable handles and lifetimes for channels/bridges. So, in 12+, the uniqueid for a channel will always remain the same - mostly because masquerades are no longer a visible operation.

Uniqueid Digium