I want to dial a SIP phone on my LAN which has never registered with Asterisk. Which I assume means I need to dial by IP address (since Asterisk doesn’t yet know how to connect to the phone).
Scenario 1: Assume the phone has not registered with asterisk and is not setup in pjsip.conf ; it was just plugged into the network. I found this in the docs:
but since the phone is on my LAN, there is no “mytrunk”. Would I use:
DIAL(PJSIP/sip:123@1.1.1.1:5060)
I found this post that creates a generic PJSIP trunk (to place in “mytrunk” name field) and then per first example above, but that seems overly complex to setup a trunk just for that. Also, since this phone is configured for multiple phone accounts (e.g. 123 & 345), I assume I need to put the 123@ in the dial string to ensure I ring the right line on the phone…
Scenario 2: Assume the phone is setup in Asterisk (pjsip.conf), but the phone does not register. How would I dial that phone using info from PJSIP? I read that pjsip can have a contact line like this for each phone:
You must specify an endpoint. It doesn’t have to have an AOR associated with it, but you must specify an endpoint. It defines the configuration (codecs, encryption, etc) to use. You do it like the first Dial line, specifying an endpoint. You can not just dial a SIP URI without an endpoint.
Yes, you can specify a contact in the configuration and dialing the endpoint would call it (provided the endpoint references the AOR).
but leave out the auth= and aors= lines because you mentioned I don’t need an AOR? Or (which I suspect), do you mean I need to do both of the above?
And my first example above does not include trunk name (mytrunk), so just to confirm it’s correct to use PJSIP/sip:123 in front of the @, with no “trunk” in that part of the dial string?
You have to create an endpoint entry in pjsip.conf. You don’t need to specify a transport. You then specify it in the dial line: PJSIP/123/sip:123@1.1.1.1