Pickup problem with CDR, ringing extension is CDR(dst)


Problem: when I pick up a call, I want to reflect in the CDR(dst) field the extension who picked up the call.


Call is ringing in ext 200
I pick it up in the 201 extension,
Then the CDR(dst) is “200”, and I want to be 201

I tried to modify CDR(dst) prior the PickupChan() call without success.
Then I tried to set a variable that I can handle in the ‘h’ extension after hangup and update there CDR(dst), at h CDR(dst) is updated.

The problem with this approach is that the variables are not inherited in the picked up channel.

I tried in several ways but none of them are inherited:

exten => **200,1,Set(SHARED(PICKEDUP)=${CALLERID(num)})
   same => n,Set(MYVAR1=111)
   same => n,Set(_MYVAR2=222)
   same => n,Set(__MYVAR3=333)
   same => n,DumpChan()
   same => n,PickupChan(PJSIP/200)

I’m using asterisk v18

How can update CDR(dst) before the pickup?
Or how can I pass a variable to the picked up channel?

Best regards!

I don’t think you meant the extension that picked it up, which would be “**200” in this case.

I think you would need to create a new context, then channel redirect it to an extension that reflects the caller ID of the channel that you want to connect (201), and have that use Bridge, to connect to the the channel for 201.

I don’t refer to ${EXTEN}, I mean that the extension should reflect in CDR is the picking up extension, 201 in this case. “**200” is the directed call pick up extension which picks up channel of PJSIP/200

I tried some things with Bridge app but I don’t know how to achieve that I’m looking for.
If I try to Bridge with the PJSIP/200 channel, I get a Everyone is busy/congested at this time.

Also I changed the configuration to replace PickupChan with Pickup but I have the same problem, vars are not inherited:




exten => **200,1,Set(SHARED(PICKEDUP)=${CALLERID(num)})
   same => n,Set(__PRUEBA=222)
   same => n,Set(_PROBANDO=333)
   same => n,Pickup(200@PICKUPMARK)

201 is a device not an extension, in Asterisk terms.

The rest of my original reply still stands.

Yes, it’s a device that answers the call, then it should be in CDR(dst) field.

I’ll try to make more testing with Bridge trying to achieve my goal but for now I couldn’t make it work.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.