Adding a softphone to a deskphone

Hello,

How do you configure Asterisk when a user is given both a deskphone and a softphone, the later one being installed on user’s laptop ?

Do you allocate the same extension number to both devices, leaving PJSIP dealing with multiple AoRs or do you allocate two different extension numbers ?

Best regards

You mean endpoint names, not extension numbers. In both cases you use the same extension number, have two endpoint/AOR combinations,separated by &’s, in the Dial string, but in the first case there are two different endpoints,and in the second. you also include the AOR and the endpoints are the same. Also, in second case, you may use the dial contacts function to generate the dial string.

Do you allocate the same extension number to both devices, leaving PJSIP dealing with multiple AoRs or do you allocate two different extension numbers

“Extension” surely refers to an “endpoint.” Both are possible. It depends on the specific use case e.g. When using BLF, the “two AoRs and one endpoint” configuration is preferable. If one of the end devices is in use, BLF will function as expected. A call to the ‘endpoint’ will cause both devices to ring.

In Asterisk, extension refers to what appears in extensions.conf. In other environments, it is called a directory number. The endpoint would be called an equipment number, and it exists for both local phones, and shared connections to remote sites and external parties. There is, or was a document about security which advises not making the endpoint name the same as any extension name.

In my wife’s office are a desk phone and a cordless phone, extensions 104 and 114.

In pjsip.conf they are named 104X and 114X

I always define the extensions at the top so they are easy to update without touching the dialplan.

E104=PJSIP/104X
E114=PJSIP/114X
DIAL104=${E104}&${E114}

In the dialplan, dialing 104 runs this code:

exten => 104, 1, dial(${DIAL104}, 40)
same => voicemail(104@default)
same => n, hangup()

In my case what I show as 104X is a 205 character somewhat random string so all the scripts that try registering 100, 101,102, 1000, 1001, … can’t find anything to work against and the code send the easy to remember 104 to the extension I want.

  1. Locating extension number to sip endpoint map, at the head of extensions.conf is very smart. I’ll remember that.
  2. What do you mean by “104X is a 205 character somewhat random string” ? Do you mean X stands any random string like “abc" or just a random letter or digit ?

Sorry for not being very clear: by extension number, I meant endpoint.

Sorry, my extensions look something like 104_lsjdla7409YU0_hdkjwq. Makes it harder for a script kiddie looking for passwords for an extension. The only downside is sometimes that shows up as the calling number and looks odd. Since it’s only me and my wife I don’t consider it a big problem.