# Caller location identification

**URL:** <https://community.asterisk.org/t/caller-location-identification/102575>\
**Category:** Asterisk Support\
**Created:** [May 21, 2024, 7:58am UTC](https://community.asterisk.org/t/caller-location-identification/102575 "2024-05-21T07:58:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![prathibhab](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/prathibhab/32/6753_2.png) [@prathibhab](https://community.asterisk.org/u/prathibhab)\
**Post date:** [May 21, 2024, 7:58am UTC](https://community.asterisk.org/t/caller-location-identification/102575/1 "2024-05-21T07:58:31Z")

</div>

How to get the location of the caller? I want to route the calls to asterisk server located in different locations? When User1 is in state A, the call should go the asterisk serverA. When the same user moves to stateZ, the call should go to the asterisk serverZ. How to acheive this requirement?

---

<div class="post-metadata">

**Author:** ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.asterisk.org/u/Pooh)\
**Post date:** [May 21, 2024, 8:20am UTC](https://community.asterisk.org/t/caller-location-identification/102575/2 "2024-05-21T08:20:50Z")

</div>

On Tuesday 21 May 2024 at 10:09:27, prathibhab via Asterisk Community wrote:

> How to get the location of the caller? I want to route the calls to  
> asterisk server located in different locations? When User1 is in state A,  
> the call should go the asterisk serverA. When the same user moves to  
> stateZ, the call should go to the asterisk serverZ. How to acheive this  
> requirement?

I assume you’re talking about North America here by your use of the word  
“state”, so I would start with something such as (this is just one example):

> **[List of North American Numbering Plan area codes](https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes)**
>
> The North American Numbering Plan (NANP) divides the territories of its members into geographic numbering plan areas (NPAs). Each NPA is identified by one or more numbering plan area codes (NPA codes, or area codes), consisting of three digits that are prefixed to each local telephone number having seven digits. A numbering plan area with multiple area codes is called an overlay. Area codes are also assigned for non-geographic purposes. The rules for numbering NPAs do not permit the digits 0 and...

and use that as the basis for deciding “if someone calls from here, I need to  
route them to there” (I have no idea how many “there” locations you have).

I’m not entirely sure what you mean by “when the user moves to state Z” - if  
you’re talking about mobile (GSM / “cell”) phones then you have no chance of  
finding out where they are.

Assuming you’re talking about geographic area codes, then personally I’d be  
inclined to do this using an ODBC lookup, passing in the caller’s area code,  
and getting back from the DB query the name of the server you want to pass  
that call onto.

This would mean you have a pretty efficient lookup process, it can be  
centralised across all your Asterisk servers (including as a distributed /  
replicated database), and it’s competely dynamic - any changes in the DB will  
be immediately reflected in functionality.

Antony.

–  
I love deadlines. I love the whooshing noise they make as they go by.

- Douglas Noel Adams

---

<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:** [May 21, 2024, 8:49am UTC](https://community.asterisk.org/t/caller-location-identification/102575/3 "2024-05-21T08:49:21Z")

</div>

> [@Pooh](#):
>
> I assume you’re talking about North America here by your use of the word  
> “state”

India also has states, and that would be consistent with the OPs name. The same principle applies, but with a different area code database.

> [@Pooh](#):
>
> if you’re talking about mobile (GSM / “cell”) phones

In, for example the UK, you can’t even tell the home area (or the current operator). I don’t know whether India works that way. (GSM should be in quotes, as it has, largely, been retired.)

---

<div class="post-metadata">

**Author:** ![prathibhab](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/prathibhab/32/6753_2.png) [@prathibhab](https://community.asterisk.org/u/prathibhab)\
**Post date:** [May 21, 2024, 9:31am UTC](https://community.asterisk.org/t/caller-location-identification/102575/4 "2024-05-21T09:31:53Z")

</div>

I am talking about data calls.

---

<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:** [May 21, 2024, 9:44am UTC](https://community.asterisk.org/t/caller-location-identification/102575/5 "2024-05-21T09:44:35Z")

</div>

Nor are we.

---

<div class="post-metadata">

**Author:** ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.asterisk.org/u/Pooh)\
**Post date:** [May 21, 2024, 9:53am UTC](https://community.asterisk.org/t/caller-location-identification/102575/6 "2024-05-21T09:53:24Z")

</div>

On Tuesday 21 May 2024 at 11:42:53, prathibhab via Asterisk Community wrote:

> I am not talking about data calls.

I’m not entirely sure what you mean by that, but I was talking about “normal  
phone calls where a person dials a number using a landline telephone and that  
call then comes in to one of your Asterisk servers”.

Antony.

–  
If you ask a Yorkshireman whether he knows the German word for “egg”,  
don’t be surprised if he just smiles and says “Aye”.

```
                                               Please reply to the list;
                                                     please *don't* CC me.

```

---

<div class="post-metadata">

**Author:** ![prathibhab](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/prathibhab/32/6753_2.png) [@prathibhab](https://community.asterisk.org/u/prathibhab)\
**Post date:** [May 21, 2024, 10:04am UTC](https://community.asterisk.org/t/caller-location-identification/102575/7 "2024-05-21T10:04:06Z")

</div>

It was a typo. I am talking about data calls.

---

<div class="post-metadata">

**Author:** ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.asterisk.org/u/Pooh)\
**Post date:** [May 21, 2024, 10:19am UTC](https://community.asterisk.org/t/caller-location-identification/102575/8 "2024-05-21T10:19:54Z")

</div>

On Tuesday 21 May 2024 at 12:14:59, prathibhab via Asterisk Community wrote:

> It was a typo. I am talking about data calls.

Please define precisely what you mean by that.

Antony.

–  
It may not seem obvious, but (6 x 5 + 5) x 5 - 55 equals 5!

```
                                               Please reply to the list;
                                                     please *don't* CC me.

```

---

<div class="post-metadata">

**Author:** ![prathibhab](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/prathibhab/32/6753_2.png) [@prathibhab](https://community.asterisk.org/u/prathibhab)\
**Post date:** [May 21, 2024, 10:31am UTC](https://community.asterisk.org/t/caller-location-identification/102575/9 "2024-05-21T10:31:37Z")

</div>

It is about browser to browser calls based on WebRTC.

---

<div class="post-metadata">

**Author:** ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.asterisk.org/u/Pooh)\
**Post date:** [May 21, 2024, 10:47am UTC](https://community.asterisk.org/t/caller-location-identification/102575/10 "2024-05-21T10:47:22Z")

</div>

On Tuesday 21 May 2024 at 12:42:38, prathibhab via Asterisk Community wrote:

> It is about browser to browser calls based on WebRTC.

In that case you need some sort of GeoIP database, but beyond that, I have no  
idea how to do this sort of thing, and specifically not in Asterisk.

Hopefully someone else can help.

Antony.

–  
I bought a book on memory techniques, but I’ve forgotten where I put it.

```
                                               Please reply to the list;
                                                     please *don't* CC me.

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [June 20, 2024, 10:48am UTC](https://community.asterisk.org/t/caller-location-identification/102575/11 "2024-06-20T10:48:08Z")

</div>

Closed on June 20, 2024, 10:48am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
