Custom extension not recognized in macro-user-callerid

My asterisk pbx is coupled with a isdn pri pbx, to which a number of phones are connected. In Freepbx these phones are defined as custom extensions. For the largest part this works fine, we can dial in to those phones and dial out with those phones.

There is a problem, however, when we want these custom extensions to make use of some special extension related features, like dictation (*34) and telling the extension (*65 ?). .

This problem is related to the fact that the pri pbx uses the did-number of the phone (like 346290915) in stead of the extension number (like 115) as callerid . It looks like the macro-user-callerid assumes that the callerid is always based on the extension, and uses this to find the extension in the device database. It can’t find the extension there (since it is entered as e.g. 115, not 346290915), and therefor also the extension based settings, like dictation, are not properly retrieved.

How can I let the macro-user-callerid retrieve the correct entry from the database? Probably I need to convert the passed callerid to the extension, like Set(CallerId(num)=xxx) where xxx is the intended extension. Can I use a dialpattern in the expression? The dialpattern would be like 1+3462909|XX

This problem might bear some resemblance to the ‘Call recording does not work’ problem, where there were also entries not found in the database.