Problem with outgoing caller id


I don’t know if this is an Asterisk problem or a FreePBX problem, or even both.

I recently upgraded to:

  • freePBX-2.8.1-17
  • asterisk-11.5.0-0
    as part of an Elastix upgrade.

After that, outgoing caller id stopped working. I have seen others report the same problem.

It seems that there is an issue with numeric caller ids.

I did a packet trace on the outgoing SIP and the FROM-header is missing a display name when the caller id is numeric.

For instance, set the outgoing caller id to 123456 and it will not be added to the FROM-header.
Set it to “123456” (note the quotes) and it will be added.
Set it to “Hi” or Hi and it will be added in both cases.

Conclusion, numeric caller ids get lost, alphanumeric or quoted numeric are fine.

You can “fix” the outgoing CID by quoting it. But when dialing out in response to an incoming call, asterisk/freepbx will take the incoming caller id and set it on the outgoing call and that will fail if the cid is numeric.


As far as I have been able to find out, the problem is with the Asterisk function CALLERID(datatype,CID), which used to be able to take number, but now requires a string.

Because Set(CALLERID(all)=“12345”)) works, but Set(CALLERID(all)=12345)) does not.

And macro-outbound-callerid has this line:
which, if forwarding, takes the caller id from an incoming call and uses it for the outgoing call, if Allow Any Cid is set as the CID option.
If that incoming cid is a number, the Set will fail.

It can be fixed by chaning:

I am not a FreePBX specialist, so I can’t tell if this is the best solution.

You also have to quote all CIDs that you set on trunks, extension and so on. Or change every FreePBX line to make sure a CID that is not is string is quoted.

Whether this change is a bug or a feature of Asterisk, I don’t know.

Sorry but few can help you here, elastix distribute a forked up version of a very old FreePBX, I suggest you either go to the elastix forum for support, or perhaps better for you, install a supported version of FreePBX.