Outbound external calls were missing from FreePBX call history

FixVOIPService
Shipped
27 أغسطس 2026 في 5:14 م UTC
Author
Kamo
Commit
8b09ad1

On an outbound external call FreePBX rewrites the CDR `src` to the trunk's outbound caller ID — the org's own DID — so a call ext 8080 placed to 9493747110 is recorded as src=9492989960, dst=9493747110. Neither side is the extension, and getCallHistory matched rows on `src`/`dst` alone, so every outbound external call was dropped from the member's history: placed, answered, recorded and billed, and shown nowhere. What survived the filter were the Local-channel legs the connect contexts produce, whose `src` is empty — which is why the tab looked like it logged calls without a number. The placing extension survives on `cnum`, now added to the fetchAllCdrs selection set. `cnum` is empty on every inbound row and on those Local legs, so it establishes the originator without ever relabelling an inbound call as outbound. The channel name is deliberately not consulted: Local/8080@from-internal names 8080 on legs ringing it, not placed by it. Row mapping is extracted to FreePBXProvider.toCallLogEntry so it can be pinned by test. Every CDR in the test is a verbatim row from the live K1M1 instance, because the defect was an assumption about what FreePBX puts in those fields.

All changes

مثل ما ترى الشحن؟?

كل واحد من هذه تحديثات الأراضي في مكان عملك تلقائيا. ابدأوا بالمجان وشاهدوها تنمو بعد أسبوع.

ابدأوا حراً للأبدخصخصة الفيو