Retaining CID for Warm Transfer

Hello Everyone!

I’ve been working on a way to retain the CID information for callers despite Asterisk’s best efforts to obscure them. The below works - but I am sure it could use some TLC from the community and should only be used on your testing systems. Please help :smile:

The first thing I did was to create an RPID and XID field in my mysql database. With those fields, I could save the information I needed. The second thing I did was to save the CID information once it hits Asterisk.

So inside of extensions_custom.conf, I put this:

[outbound-allroutes-custom]
exten => _.,1,Set(__EXTERNAL_NUM=${EXTEN}
exten => _.,2,Set(CDR(type)=outbound)

[ext-did-custom]
exten => _.,1,Set(__EXTERNAL_NUM=${CALLERID(number)})
exten => _.,2,Set(CDR(type)=inbound)

And then in extensions_override_freepbx.conf, I put this in:

[macro-hangupcall]
exten => s,1,Set(CDR(rpid)=${CONNECTEDLINE(number)})
exten => s,2,Set(CDR(xid)=${EXTERNAL_NUM})

Like I said, this works, but it has some bugs. It will save the Caller ID information for Parked Calls and Warm Transfers. RPID is what I use for Parking and XID for Warm Transfers. I’d love for you guys to have a look and help me improve this. However, it seems to override the regular caller ID on calls transferred to cell phones and it won’t honor the extensions outbound CID settings.

Help is appreciated :slight_smile:

What precisely is the issue you are trying to solve? To get rpid working, it should be no more difficult than enabling the options for each extension and using supported endpoints.