You can set the CID Prefix in FreePBX, or directly in asterisk set the callerid name to be the DID number, and then use that in checkdir.php to create your popups.
So yes, it is possible, but you must alter the callerid field to pass the information.
Best regards,