Sonetel pjsip convertion

trunk
Tags: #<Tag:0x00007f7028337080>

(Namerp) #1

Hello, I try to convert our currently working sonetel chan_sip connection to pjsip.

Incoming:

USER Context: asterisk123@domain.com

type=friend
secret=asdasdasdasd
registertimeout=600
qualifyfreq=600
qualify=yes
nat=yes
host=sip.sonetel.com
fromdomain=sip.sonetel.com
disallow=all
context=from-trunk
allow=ulaw&alaw&g722&gsm

Register String: asterisk123@domain.com:asdasdasdasd@sip.sonetel.com

Outgoing:

username=asterisk
type=friend
secret=asdasdasdasd-x
remotesecret=asdasdasdasd-x
registertimeout=660
qualifyfreq=600
qualify=yes
outboundproxy=sip.sonetel.com
nat=yes
insecure=port,invite
host=sip.sonetel.com
fromuser=asterisk123
fromdomain=domain.com
dtmfmode=rfc2833
disallow=All
allow=alaw&ulaw&gsm

I think my main problem is the registration string. I have no idea how to convert asterisk123@domain.com:asdasdasdasd@sip.sonetel.com to something that pjsip understands (isn’t working without either) res_pjsip_outbound_registration.c: '404' fatal response received from 'sip:sip.sonetel.com:5060' on registration attempt to .

For the asterisk123@domain.com part I found no way of converting because @ is not allowed res_pjsip/pjsip_configuration.c: Error configuring endpoint 'sonetel' - 'from_user' field contains invalid character '@':slight_smile:

Already tried the typical combinations and also followed https://wiki.asterisk.org/wiki/display/AST/Migrating+from+chan_sip+to+res_pjsip#Migratingfromchan_siptores_pjsip-ExampleSIPTrunkConfiguration but it looks like sonetel wants asterisk123@domain.com.


(Namerp) #2

Tried again some variations, if I put just "asterisk123@domain.com" at the username and basically empty config it shows a different error

res_pjsip_outbound_registration.c: Invalid client URI 'sip:asterisk123@domain.com@sip.sonetel.com:5060' specified on outbound registration 'sonetel'
res_sorcery_config.c: Could not create an object of type 'registration' with id 'sonetel' from configuration file 'pjsip.conf'

manually entering the client uri didn’t worked either with the same error message

sip:asterisk123@domain.com@sip.sonetel.com:5060
sip:"asterisk123@domain.com"@sip.sonetel.com:5060
sip:asterisk123\ @domain.com@sip.sonetel.com:5060


(Joshua C. Colp) #3

Your username isn’t "asterisk123@domain.com". Your username is asterisk123, for domain domain.com using outbound proxy sip.sonetel.com

I don’t know how that maps into FreePBX configuration but in pure Asterisk it would be possible. For outbound registration I think it would map to something like:

[mytrunk]
type=registration
outbound_auth=mytrunk
server_uri=sip:domain.com
client_uri=sip:asterisk123@domain.com
outbound_proxy=sip:sip.sonetel.com

Which means “send REGISTER to sip.sonetel.com telling it to go to domain domain.com and register to account asterisk123”. That’s just a rough guess, never heard of this provider before or know the details.

For endpoint it would be similar.

[mytrunk]
type=endpoint
from_user=asterisk123
from_domain=domain.com
outbound_proxy=sip:sip.sonetel.com

[mytrunk]
type=aor
contact=sip:domain.com
outbound_proxy=sip:sip.sonetel.com