# Different internal and external caller IDs?

**URL:** <https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783>\
**Category:** Asterisk Support\
**Created:** [February 28, 2019, 3:16pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783 "2019-02-28T15:16:16Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![octopodes](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@octopodes](https://community.asterisk.org/u/octopodes)\
**Post date:** [February 28, 2019, 3:16pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/1 "2019-02-28T15:16:16Z")

</div>

I have ~100 phones set up in `/etc/asterisk/users.conf`, each of which has its own internal extension (i.e. dialing 101 will call Phone 101, dialing 144 will call Phone 144). However, every phone needs to have the same caller ID when placing external calls (i.e. when Phone 144 calls a cell phone, the caller ID should read “John Smith 555-5555”). So far this is accomplished by setting `callerid` in `/etc/asterisk/users.conf` to `"John Smith" <555-5555>` for all 100 phones.

This has led to a lot of confusion for internal callers because even internal calls show the same “John Smith 555-5555” caller ID. I’d like it to show the actual internal caller, such as “Phone 144 x144”. Setting `callerid` to `"Phone 144" <144>` accomplishes this on internal calls, but totally messes up external caller ID.

Is there some way to tell Asterisk: “I don’t care what is set in `/etc/asterisk/users`, ALL external calls should use this caller ID”? If it helps, users must dial 1 before an external number to place an external call but I’m not sure which config file sets this.

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [February 28, 2019, 3:31pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/2 "2019-02-28T15:31:28Z")

</div>

Set the caller ID in the dialplan.

---

<div class="post-metadata">

**Author:** ![shuaib](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/shuaib/32/3611_2.png) [@shuaib](https://community.asterisk.org/u/shuaib)\
**Post date:** [February 28, 2019, 4:14pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/3 "2019-02-28T16:14:26Z")

</div>

I don’t think you can set custom external caller ID because external caller ID provided by the service provider.

---

<div class="post-metadata">

**Author:** ![octopodes](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@octopodes](https://community.asterisk.org/u/octopodes)\
**Post date:** [February 28, 2019, 4:34pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/4 "2019-02-28T16:34:34Z")

</div>

Hi @david551, thank you for your reply! I’ve tried setting [CALLERID](https://www.voip-info.org/setting-callerid/) in `/etc/asterisk/extensions.conf`:

```auto
exten => 144,1,Dial(${phone144},25,hkt)
exten => 144,n,Set(CALLERID(all)="Phone 144" <144>)

```

However, it still displays the full external caller ID when placing an internal call. Did I use `Set(CALLERID(all)` incorrectly? I didn’t realize this was an option to set in the dialplan.

---

<div class="post-metadata">

**Author:** ![johnkiniston](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/johnkiniston/32/28_2.png) [@johnkiniston](https://community.asterisk.org/u/johnkiniston)\
**Post date:** [February 28, 2019, 4:43pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/5 "2019-02-28T16:43:55Z")

</div>

Can you provide us with a example endpoint configuration from your users.conf?

For example I set an account code on my endpoints and on my internal to internal dialing I set callerID based on the account code.

```auto
same => n,Set(caller1=${CDR(accountcode)})
same => n,Set(CALLERID(num)=${CUT(caller1,-,3)})

```

---

<div class="post-metadata">

**Author:** ![octopodes](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@octopodes](https://community.asterisk.org/u/octopodes)\
**Post date:** [February 28, 2019, 4:47pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/6 "2019-02-28T16:47:38Z")

</div>

Sure @johnkiniston, here’s Phone 144’s entry in `/etc/asterisk/users.conf`:

```auto
[phone144]; videophone
secret = XXXXXXXX
fullname = phone144
hasvoicemail = no
hassip = yes
hasiax = no
callwaiting = no
context = internals
requirecalltoken = no
host = dynamic
nat = yes
allow = g722
allow = h264
videosupport = yes
callerid = "John Smith" <+1 555-5555>
linenumber = 1
encryption = yes

```

---

<div class="post-metadata">

**Author:** ![jcoutu](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcoutu/32/3309_2.png) [@jcoutu](https://community.asterisk.org/u/jcoutu)\
**Post date:** [February 28, 2019, 4:54pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/7 "2019-02-28T16:54:54Z")

</div>

This is very doable. I have 6 different callerIds that are used depending on which region my users are calling (so I can provide a local caller id for them to return calls to)

It’s a question of when to set the value, there is a portion of your dialplan that deals with connecting to your outbound trunk, change the callerID there aswell and you are golden.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [February 28, 2019, 4:58pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/8 "2019-02-28T16:58:22Z")

</div>

Dialplan is executed in sequence, so you need to change the callerid BEFORE you dial.

---

<div class="post-metadata">

**Author:** ![octopodes](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@octopodes](https://community.asterisk.org/u/octopodes)\
**Post date:** [February 28, 2019, 5:05pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/9 "2019-02-28T17:05:23Z")

</div>

Hi @jcolp, I’m not sure what you mean (I inherited a finished Asterisk setup with no training). I tried switching the lines in my earlier example to read like so:

```auto
exten => 144,1,Set(CALLERID(all)="Phone 144" <144>)
exten => 144,n,Dial(${phone144},25,hkt)

```

This didn’t produce any change in internal caller ID however.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [February 28, 2019, 5:05pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/10 "2019-02-28T17:05:56Z")

</div>

After changing did you reload the configuration? And did you confirm in the Asterisk console the logic which was executed?

---

<div class="post-metadata">

**Author:** ![octopodes](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@octopodes](https://community.asterisk.org/u/octopodes)\
**Post date:** [February 28, 2019, 5:16pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/11 "2019-02-28T17:16:33Z")

</div>

Yep, I’ve reloaded the config. I can see `== Setting global variable 'phone144' to 'SIP/phone144'`. To be honest I’m not sure what else to look for. Other changes, such as setting Phone 144 to a different extension, did work.

---

<div class="post-metadata">

**Author:** ![johnkiniston](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/johnkiniston/32/28_2.png) [@johnkiniston](https://community.asterisk.org/u/johnkiniston)\
**Post date:** [February 28, 2019, 6:17pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/12 "2019-02-28T18:17:19Z")

</div>

OK, so just to verify, you are editing users.conf yourself correct? It’s not being managed by FreePBX or any other tools?

Do you only ever send one caller ID out for external calls? Are they all ‘555-555-5555’ or could one user have ‘555-555-1234’ ?

---

<div class="post-metadata">

**Author:** ![octopodes](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@octopodes](https://community.asterisk.org/u/octopodes)\
**Post date:** [February 28, 2019, 6:34pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/13 "2019-02-28T18:34:32Z")

</div>

Yep, all changes are made manually by editing config files. They are all using the exact same 555-5555 number, no need to add other numbers.

---

<div class="post-metadata">

**Author:** ![johnkiniston](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/johnkiniston/32/28_2.png) [@johnkiniston](https://community.asterisk.org/u/johnkiniston)\
**Post date:** [February 28, 2019, 7:24pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/14 "2019-02-28T19:24:38Z")

</div>

OK, in my mind the easiest thing to do would be to change the caller ID for all your phones in users.conf to be in the format of

`callerid = "John Smith" <144>"`

Then in your extensions.conf wherever you dial out to the PSTN do a

exten =\> s,n,Set(CALLERID(NUM)=5555555555) before the dial.

---

<div class="post-metadata">

**Author:** ![octopodes](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@octopodes](https://community.asterisk.org/u/octopodes)\
**Post date:** [February 28, 2019, 10:36pm UTC](https://community.asterisk.org/t/different-internal-and-external-caller-ids/78783/16 "2019-02-28T22:36:26Z")

</div>

Thanks @johnkiniston, you were absolutely right! The trick is finding the correct spot in your dial plan.

Thank you everyone for your help!
