UserEvent doesn't send uniqueid in message body

Hi all

I’m using asterisk manager interface and using UserEvents, all events looks like this (tcp capture)

Event: Newchannel
Privilege: call,all
Channel: SIP/20122-00000008
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: 20122
CallerIDName:
AccountCode:
Exten: 22
Context: context
Uniqueid: bender-1267714062.8

UserEvent looks like:

Event: UserEvent
Privilege: user,all
UserEvent: CallMove

Is there any way that asterisk also automaticly adds Uniqueid field?
I’ve ‘manually’ solver like:

exten => s,n,UserEvent(CallMove,Context: error-agi,Uniqueid: ${CDR(uniqueid)})

Not all events relate to a channel, so UniqueID isn’t relevant for them. User events can also be generated from AMI itself. One could argue that the dialplan application way of doing so always has a channel involved, but that channel might not have any meaning for the event. I suspect the same code is involved with both AMI originated user events and dialplan originated ones.

Incidentally, ${UNIQUEID} is probably simpler, and may be more accurate, than using ${CDR…

You could, of course, change the source code.

Nope, I i edit the source code, and it is a local function in app_userevent.c, which can be easily changed.
I didn’t even know an UserEvent can be generated in AMI, it’s interesting, who would receive that event? the other connected managers?

Remember one use of AMI is in call centres, and each agent may have their own AMI client. Sometimes one might want to use that interface to signal between agents.