Logging the CID from the Privacy Manager
Tags: asterisk, call detail records, callerid, exten, information, linux, Logging, privacy manager, system logs, Verbose
Hi folks,
My v1.6 Asterisk system logs all Call Detail Records to a PostgreSQL
database, including those handled by the Privacy Manager.
Unfortunately, even though I can use the CLI to see the information
being submitted by anonymous callers to satisfy the demands of the the
Privacy Manager, that information is not recorded in the database.
Instead, all that is written to it:
clid: “Privacy Manager”
src: anonymous
Can the number submitted to the Privacy Manager somehow be recorded in
the database, instead of “anonymous”?
Thanks,
Jaap
PS — Currently, the configuration I’m using in the dialplan for the
Privacy Manager looks like this:
exten => jw,1,Verbose( — CID is <${CALLERID(num)}>)
exten => jw,n,GotoIf($[${CALLERID(num)}=anonymous]?true:false)
exten => jw,n(true),Set(CALLERID(num)=)
exten => jw,n(false),NoOp()
exten => jw,n,Verbose( — CID is <${CALLERID(num)}>)
exten => jw,n,PrivacyManager(3,10)
exten => jw,n,GotoIf($[${PRIVACYMGRSTATUS}=FAILED]?bad)
exten => jw,n,Verbose( — CID is <${CALLERID(num)}>)
exten => jw,n,Dial(SIP/1000,60,w)
exten => jw,n(bad),Playback(im-sorry)
exten => jw,n,Playback(vm-goodbye)
exten => jw,n,Hangup()
Matt Riddell said:
Aug 31, 10 at 10:52 pmMaybe you could do:
Set(CDR(userfield)=${CALLERID(num)})
Before dialing SIP/1000
Jaap Winius said:
Sep 01, 10 at 6:39 amQuoting Matt Riddell:
That looks so simple — and it actually works! — although exactly not
in the way that I was expecting. Instead of replacing the contents of
one of the existing fields, a new field, “userfield”, appeared at the
end of the record containing the number submitted by the caller.
I did try to use the same method to change one of the existing fields,
e.g. “src”, like this:
Set(CDR(src)=${CALLERID(num)})
But, then I received this error:
[Sep 1 12:26:15] ERROR[12562]: cdr.c:303 ast_cdr_setvar:
Attempt to set the ‘src’ read-only variable!.
That doesn’t seem to be possible. So, I’m happy with your solution.
Thanks, Matt!
Cheers,
Jaap