PJSIP Provision multiple devices with same extension

Hi guys,

I am using Asterisk 16 on an Ubuntu 16.04 machine.
In the pjsip_wizard, you have the possibility to provision phones.
But is it possible to provision multiple phones with one extension ?

Example :

This is my config now

[303](CONTEXT)
hint_exten = 303
endpoint/callerid = John Doe <303>
inbound_auth/username = 303
inbound_auth/password = NotARealPassword
has_phoneprov = yes
phoneprov/LABEL = John - 303
phoneprov/MAC = AXXNOTAREALMAC
phoneprov/LINE = 1

Maybe something like this is an option ?

[303](CONTEXT)
hint_exten = 303
endpoint/callerid = John Doe <303>
inbound_auth/username = 303
inbound_auth/password = NotARealPassword
has_phoneprov = yes
phoneprov/LABEL = John - 303
phoneprov/MAC = AXXNOTAREALMAC
phoneprov/MAC = AXXNOTAREALMACOFANOTHERPHONE
phoneprov/LINE = 1

I have tried multiple configurations but can’t seem to find the answer.
Thanks in advance !

All device technologies allow that , simply use & to separate the dialstrings for the devices in the first paramater of the dial application.

chan_pjsip additionally allows multiple devices to register with the same address of record, but I’m not familar with that.

Note htat making the address of record the same as the primary extension number, although a very common practice, is against the security guidelines.

I’m sorry but what is the difference between the address of records and the primary extension in this config ?

It’s just that my phoneprovisioning breaks if I add the second MAC and was looking for the right way to configure this then.

The address of record is the URI that the device uses to register, or the URI used to access a remote device. The primary extension is the number that appears after exten => in extensions .conf, for the the extension that is the most specific one for that device. In some caes it may not exist at all, e.g. if you are smulating an analogue plan 1 arrangement where all the phones are wired in parallel.

Best practice for local deivces is to tbase the address of record on the MAC address.

With pjsip, there are possibly two translations: extension to address of record and adress fo record to device indentity. Actually, strictly speaking that is also true for chan_sip, but hte second one is always one to one, at any given point in time.

Leaving phoneprov aside, the easiest way to do this is to allow more than 1 device to register to the same endpoint/aor. With the pjsip config wizard, you’d do something like…

aor/max_contacts = 2

This will allow 2 devices to register.

The problem is phoneprov though. Currently there’s no way to tell it to use the same config for more than 1 mac address.

1 Like

I finally did it like this :

[117](DPB)

hint_exten = 117

endpoint/callerid = John Doe <117>

inbound_auth/username = 117

inbound_auth/password = NotARealPassword
has_phoneprov = yes

phoneprov/LABEL = X - X

phoneprov/LINE = 1

[117a](117)

phoneprov/MAC = aXXXXXXX

[117b](117)

phoneprov/MAC = aXXXXXX2

This works like a charm !

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