My pjsip configuration tells me wrong password

hello this is my configuration in pjsip.conf is it ok?

trunk one

[trunk-soto]
type=registration
outbound_auth=trunk-soto
server_uri=sip:trunk-dextre@192.168.1.13:5070
client_uri=sip:trunk-soto@192.168.1.93
retry_interval=60

[trunk-soto]
type=auth
auth_type=userpass
password=123456
username=trunk-soto

[trunk-soto]
type=aor
contact=sip:trunk-soto@192.168.1.13:5070
max_contacts=1

[trunk-soto]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
allow=alaw
outbound_auth=trunk-soto
aors=trunk-soto

[trunk-soto]
type=identify
endpoint=trunk-soto
match=192.168.1.13

trunk two

[trunk-dextre]
type=registration
outbound_auth=trunk-dextre
server_uri=sip:trunk-soto@192.168.1.93:5070
client_uri=sip:trunk-dextre@192.168.1.13
retry_interval=60

[trunk-dextre]
type=auth
auth_type=userpass
password=123456
username=trunk-dextre

[trunk-dextre]
type=aor
contact=sip:trunk-dextre@192.168.1.93:5070
max_contacts=1

[trunk-dextre]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
allow=alaw
outbound_auth=trunk-dextre
aors=trunk-dextre

[trunk-dextre]
type=identify
endpoint=trunk-dextre
match=192.168.1.93

the result is wrong password but how is the logic to create a good trunk? thank you

It seems you miss transport description and each trunk should be pointed with transport value

hello, thank you for your answer, but I added transport=transport-udp and I get this one:

un 24 11:16:51] WARNING[1395]: res_pjsip_outbound_registration.c:1049 handle_registration_response: Fatal response ‘404’ received from ‘sip:trunk-soto@192.168.1.93:5070’ on registration attempt to ‘sip:trunk-dextre@192.168.1.13’, stopping outbound registration

You are not a user of the server. It can’t check a password until it knows the password, and it can’t know the password if it doesn’t know the user.

hello, I’am changing the options with password without password some time I get type of error but never register the trunk? maybe I hope you share your configuration between two host. thank you

hello, david551, let me tell you, this is just a test, I have created two virtual machines and I want to know how to make a trunk between two machines, because when I look for a configuration , I find they use mytrunk for everthing en when I go to create with other names the trunk doesn’t work, and is for that reazon I want to learn how. thank you.

If these configurations are on different machines, pointing at each other, you shouldn’t be using registration at all. Registration is to tell the peer your address.

Also, I believe you will need a matching auth= on the other side.

The fact that this was two machine configurations, not one, was important, but missing, information.

so it would be like this the configuration:

trunk one

[trunk-soto]
type=identify
endpoint=trunk-soto
match=192.168.1.13:5070
context=from-internal
disallow=all
allow=ulaw
allow=alaw

trunk-two

[trunk-soto]
type=identify
endpoint=trunk-soto
match=192.168.1.93:5070
context=from-internal
disallow=all
allow=ulaw
allow=alaw

something similar like a configuration sip.conf or not but like this doesn’t create the trunk each other, there is not comunication. maybe can you show your trunk’s configuration?

I’m pretty sure you always need a type=endpoint, but my real experience is with chan_sip, which is no longer recommended.

I think I misunderstood AOR, and it is necessary. I have a feeling the value you have for it is wrong, but I’ll leave that to the chan_pjsip experts.

You have a mixed of options that do not belong to the identify section, also if SIP peer have an static IP you can avoid registration section, try the following example

;==============TRANSPORTS
 
[simpletrans]
type=transport
protocol=udp
bind=0.0.0.0
 
;===============TRUNK
 
[mytrunk]
type=auth
auth_type=userpass
password=1234567890
username=1234567890
 
[mytrunk]
type=aor
contact=sip:sip.example.com:5060
 
[mytrunk]
type=endpoint
context=from-external
disallow=all
allow=ulaw
outbound_auth=mytrunk
auth=mytrunk
aors=mytrunk
 
[mytrunk]
type=identify
endpoint=mytrunk
match=sip.example.com

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