PJSIP one voip provider works and the other dosen’t

Answering that with any certainty requires understanding how your provider works, which I don’t really know. One is an outbound registration, and the other is for matching incoming traffic based on source IP address. Are they required/necessary? I don’t know. Maybe?

1 Like

I will give them a try, but have I added the correct info in each field as I am not sure.

You’d need to ask your provider. It would be more common to have:

server_uri = sip:voice.my.isp.com

but they may well not care about the user part.

You haven’t provided your dialplan. Contact user would generally be the same as the extension that handles incoming calls.

1 Like

Thank you for the helpful advice, I will use
server_uri = sip:voice.my.isp.com

Oh, I thought I had put up the dialplan, must have forgot.
extensions.conf file used with pjsip-

; ## Incoming calls ##
[Tan]
exten => my_phone_number,1,Goto(phones,111,1)

; ## Outgoing dials ##

[Phones]

exten => 111,1,Dial(PJSIP/home_KL)
same => n,Hangup

exten => 222,1,Dial(PJSIP/mobile-home)
same => n,Hangup

; # Dial Extension provider2 #
exten => _2X.,1,Goto(outgoing,${EXTEN:1},1)          ;press 2 for provider2

; # Dial Extension Tan #
exten => _X.,1,NoOp(${CALLERID(num)})
same => n,Set(CALLERID(num)=my_phone_number)
same => n,Goto(outgoing,${EXTEN},2)

; ## Outgoing calls ##

; # Outgoing Providers #
[outgoing]
exten => _X.,1,Dial(PJSIP/${EXTEN}@provider2)
exten => _X.,2,Dial(PJSIP/${EXTEN}@Tan)

I made it shorter than the sip one to make it easier.

contact_user should be my_phone_number, not Tan, for this to work reliably.

1 Like

Before I changed anything I started my device, tried an outgoing call and it worked, however incoming calls did not.

Log file for outgoing call (PJSIP) working-

PJSIP Logging enabled
<--- Received SIP request (1074 bytes) from UDP:111.111.111.11:5065 --->
INVITE sip:815123456@192.168.0.1:5060 SIP/2.0
From: "home_KL"<sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456"<sip:815123456@192.168.0.1:5060>
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
CSeq: 1 INVITE
Via: SIP/2.0/UDP 111.111.111.11:5065;rport;branch=z9hG4bK-f5-3c024-12d7ae72-b4454418
Max-Forwards: 70
Supported: replaces,100rel
Allow: INVITE, ACK, BYE, REFER, NOTIFY, CANCEL, UPDATE, OPTIONS, PRACK
User-Agent: MyRouter 123456 Build 555555 5555555 55555 -- 55 23 56 89 56
X-Serialnumber: 55 23 56 89 56
Contact: <sip:home_KL@111.111.111.11:5065>
Content-Type: application/sdp
Content-Length: 400

v=0
o=box 125485 45215 1256325 IN IP4 111.111.111.11
s=-
c=IN IP4 111.111.111.11
t=0 0
m=audio 56682 RTP/AVP 107 8 0 18 96 108
a=rtpmap:107 AMR-WB/16000
a=fmtp:107 channels=1;mode-change-capability=2;max-red=220
a=fmtp:18 annexb=no
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
a=rtpmap:108 telephone-event/16000
a=fmtp:108 0-15
a=maxptime:240
a=silenceSupp:off - - - -
a=ptime:20

<--- Transmitting SIP response (596 bytes) to UDP:111.111.111.11:5065 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 111.111.111.11:5065;rport=5065;received=111.111.111.11;branch=z9hG4bK-f5-3c024-12d7ae72-b4454418
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
From: "home_KL" <sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456" <sip:815123456@192.168.0.1>;tag=z9hG4bK-f5-3c024-12d7ae72-b4454418
CSeq: 1 INVITE
WWW-Authenticate: Digest  realm="asterisk",nonce="1741837800/1ef4cfc11888c66daafd0f93a90b0227",opaque="4c2b630d33916acf",algorithm=md5,qop="auth"
Server: Asterisk PBX 15.3.0
Content-Length:  0


<--- Received SIP request (641 bytes) from UDP:111.111.111.11:5065 --->
ACK sip:815123456@192.168.0.1:5060 SIP/2.0
From: "home_KL"<sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456"<sip:815123456@192.168.0.1>;tag=z9hG4bK-f5-3c024-12d7ae72-b4454418
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
CSeq: 1 ACK
Via: SIP/2.0/UDP 111.111.111.11:5065;rport;branch=z9hG4bK-f5-3c024-12d7ae72-b4454418
Max-Forwards: 70
Allow: INVITE, ACK, BYE, REFER, NOTIFY, CANCEL, UPDATE, OPTIONS, PRACK
User-Agent: MyRouter 123456 Build 555555 5555555 55555 -- 55 23 56 89 56
X-Serialnumber: 55 23 56 89 56
Contact: <sip:home_KL@111.111.111.11:5065>
Content-Length: 0


<--- Received SIP request (1341 bytes) from UDP:111.111.111.11:5065 --->
INVITE sip:815123456@192.168.0.1:5060 SIP/2.0
From: "home_KL"<sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456"<sip:815123456@192.168.0.1:5060>
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
CSeq: 2 INVITE
Via: SIP/2.0/UDP 111.111.111.11:5065;rport;branch=z9hG4bK-f5-3c02d-34bef130-b44545d8
Max-Forwards: 70
Supported: replaces,100rel
Allow: INVITE, ACK, BYE, REFER, NOTIFY, CANCEL, UPDATE, OPTIONS, PRACK
User-Agent: MyRouter 123456 Build 555555 5555555 55555 -- 55 23 56 89 56
X-Serialnumber: 55 23 56 89 56
Contact: <sip:home_KL@111.111.111.11:5065>
Authorization: Digest username="home_KL",realm="asterisk",nonce="1741837800/1ef4cfc11888c66daafd0f93a90b0227",uri="sip:815123456@192.168.0.1:5060",response="e38d1c4954c08bbce691e909e2c1a501",algorithm=MD5,cnonce="3c02e",opaque="4c2b630d33916acf",qop=auth,nc=00000001
Content-Type: application/sdp
Content-Length: 400

v=0
o=box 125485 45215 1256325 IN IP4 111.111.111.11
s=-
c=IN IP4 111.111.111.11
t=0 0
m=audio 56682 RTP/AVP 107 8 0 18 96 108
a=rtpmap:107 AMR-WB/16000
a=fmtp:107 channels=1;mode-change-capability=2;max-red=220
a=fmtp:18 annexb=no
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
a=rtpmap:108 telephone-event/16000
a=fmtp:108 0-15
a=maxptime:240
a=silenceSupp:off - - - -
a=ptime:20

  == Setting global variable 'SIPDOMAIN' to '192.168.0.1'
<--- Transmitting SIP response (404 bytes) to UDP:111.111.111.11:5065 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 111.111.111.11:5065;rport=5065;received=111.111.111.11;branch=z9hG4bK-f5-3c02d-34bef130-b44545d8
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
From: "home_KL" <sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456" <sip:815123456@192.168.0.1>
CSeq: 2 INVITE
Server: Asterisk PBX 15.3.0
Content-Length:  0


    -- Executing [815123456@Phones:1] NoOp("PJSIP/home_KL-00000004", "home_KL") in new stack
    -- Executing [815123456@Phones:2] Set("PJSIP/home_KL-00000004", "CALLERID(num)=my_phone_number") in new stack
    -- Executing [815123456@Phones:3] Goto("PJSIP/home_KL-00000004", "outgoing,815123456,2") in new stack
    -- Goto (outgoing,815123456,2)
    -- Executing [815123456@outgoing:2] Dial("PJSIP/home_KL-00000004", "PJSIP/815123456@Tan") in new stack
    -- Called PJSIP/815123456@Tan
<--- Transmitting SIP request (958 bytes) to UDP:222.222.222.22:5060 --->
INVITE sip:815123456@voice.my.isp.com SIP/2.0
Via: SIP/2.0/UDP 111.111.111.11:5060;rport;branch=z9hG4bKPjfeb946a5-de7c-4838-a15f-c27f508d1954
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>
Contact: <sip:my_phone_number@111.111.111.11:5060>
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26666 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 15.3.0
Content-Type: application/sdp
Content-Length:   261

v=0
o=- 1572166881 1572166881 IN IP4 111.111.111.11
s=Asterisk
c=IN IP4 111.111.111.11
t=0 0
m=audio 11740 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Received SIP response (346 bytes) from UDP:222.222.222.22:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 111.111.111.11:5060;received=111.111.111.11;branch=z9hG4bKPjfeb946a5-de7c-4838-a15f-c27f508d1954;rport=5060
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26666 INVITE


<--- Received SIP response (531 bytes) from UDP:222.222.222.22:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 111.111.111.11:5060;received=111.111.111.11;branch=z9hG4bKPjfeb946a5-de7c-4838-a15f-c27f508d1954;rport=5060
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>;tag=SDtggf899-1814147100-1741837801101
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26666 INVITE
WWW-Authenticate: DIGEST realm="voice.my.isp.com",qop="auth",nonce="BroadWorksXm86t94zxTnh4lreBW",algorithm=MD5
Content-Length: 0


<--- Transmitting SIP request (457 bytes) to UDP:222.222.222.22:5060 --->
ACK sip:815123456@voice.my.isp.com SIP/2.0
Via: SIP/2.0/UDP 111.111.111.11:5060;rport;branch=z9hG4bKPjfeb946a5-de7c-4838-a15f-c27f508d1954
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>;tag=SDtggf899-1814147100-1741837801101
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26666 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 15.3.0
Content-Length:  0


<--- Transmitting SIP request (1250 bytes) to UDP:222.222.222.22:5060 --->
INVITE sip:815123456@voice.my.isp.com SIP/2.0
Via: SIP/2.0/UDP 111.111.111.11:5060;rport;branch=z9hG4bKPj4ab4582e-3deb-4755-b051-ca75059c4ff6
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>
Contact: <sip:my_phone_number@111.111.111.11:5060>
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26667 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 15.3.0
Authorization: Digest username="my_phone_number", realm="voice.my.isp.com", nonce="BroadWorksXm86t94zxTnh4lreBW", uri="sip:815123456@voice.my.isp.com", response="81bea604dbae687c678b50ca3dc22a54", algorithm=MD5, cnonce="8b157543-83a2-44e1-b6f0-b8bbedc2e79e", qop=auth, nc=00000001
Content-Type: application/sdp
Content-Length:   261

v=0
o=- 1572166881 1572166881 IN IP4 111.111.111.11
s=Asterisk
c=IN IP4 111.111.111.11
t=0 0
m=audio 11740 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Received SIP response (346 bytes) from UDP:222.222.222.22:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 111.111.111.11:5060;received=111.111.111.11;branch=z9hG4bKPj4ab4582e-3deb-4755-b051-ca75059c4ff6;rport=5060
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26667 INVITE


<--- Received SIP response (1043 bytes) from UDP:222.222.222.22:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 111.111.111.11:5060;received=111.111.111.11;branch=z9hG4bKPj4ab4582e-3deb-4755-b051-ca75059c4ff6;rport=5060
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>;tag=SDtggf899-1838475812-1741837801748
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26667 INVITE
Supported: timer
Contact: <sip:SDgt55b-vp9pm6n1vn1nrhs6gngof0drovpsfkkt000e420@222.222.222.22:5060;transport=udp>
Session: Media
RSeq: 114281610
P-Asserted-Identity: <sip:815123456@voice.my.isp.com;user=phone>
Privacy: none
Require: 100rel
Allow: ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
Content-Type: application/sdp
Content-Length: 273

v=0
o=BroadWorks 1672228234 1 IN IP4 222.222.222.22
s=-
c=IN IP4 222.222.222.22
t=0 0
m=audio 22364 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=silenceSupp:off - - - -
a=sendrecv
a=bsoft: 1 image udptl t38

<--- Transmitting SIP request (539 bytes) to UDP:222.222.222.22:5060 --->
PRACK sip:SDgt55b-vp9pm6n1vn1nrhs6gngof0drovpsfkkt000e420@222.222.222.22:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 111.111.111.11:5060;rport;branch=z9hG4bKPjd1406e04-98a9-4c15-8c1a-9459aae7ba2e
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>;tag=SDtggf899-1838475812-1741837801748
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26668 PRACK
RAck: 114281610 26667 INVITE
Max-Forwards: 70
User-Agent: Asterisk PBX 15.3.0
Content-Length:  0


    -- PJSIP/Tan-00000005 is making progress passing it to PJSIP/home_KL-00000004
<--- Transmitting SIP response (892 bytes) to UDP:111.111.111.11:5065 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 111.111.111.11:5065;rport=5065;received=111.111.111.11;branch=z9hG4bK-f5-3c02d-34bef130-b44545d8
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
From: "home_KL" <sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456" <sip:815123456@192.168.0.1>;tag=2c5b2732-cd70-4215-8589-53c363ec3745
CSeq: 2 INVITE
Server: Asterisk PBX 15.3.0
Contact: <sip:111.111.111.11:5060>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Content-Type: application/sdp
Content-Length:   258

v=0
o=- 1741838372 1741838374 IN IP4 111.111.111.11
s=Asterisk
c=IN IP4 111.111.111.11
t=0 0
m=audio 16532 RTP/AVP 0 8 96
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Received SIP response (399 bytes) from UDP:222.222.222.22:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 111.111.111.11:5060;received=111.111.111.11;branch=z9hG4bKPjd1406e04-98a9-4c15-8c1a-9459aae7ba2e;rport=5060
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>;tag=SDtggf899-1838475812-1741837801748
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26668 PRACK
Content-Length: 0


<--- Received SIP response (1087 bytes) from UDP:222.222.222.22:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 111.111.111.11:5060;received=111.111.111.11;branch=z9hG4bKPj4ab4582e-3deb-4755-b051-ca75059c4ff6;rport=5060
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>;tag=SDtggf899-1838475812-1741837801748
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26667 INVITE
Require: timer
Session-Expires: 1800;refresher=uac
Supported: timer
Contact: <sip:SDgt55b-vp9pm6n1vn1nrhs6gngof0drovpsfkkt000e420@222.222.222.22:5060;transport=udp>
P-Asserted-Identity: <sip:815123456@voice.my.isp.com;user=phone>
Privacy: none
Allow: ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
Accept: application/media_control+xml,application/sdp
Content-Type: application/sdp
Content-Length: 273

v=0
o=BroadWorks 1672228234 1 IN IP4 222.222.222.22
s=-
c=IN IP4 222.222.222.22
t=0 0
m=audio 22364 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=silenceSupp:off - - - -
a=sendrecv
a=bsoft: 1 image udptl t38

<--- Transmitting SIP request (505 bytes) to UDP:222.222.222.22:5060 --->
ACK sip:SDgt55b-vp9pm6n1vn1nrhs6gngof0drovpsfkkt000e420@222.222.222.22:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 111.111.111.11:5060;rport;branch=z9hG4bKPj595ce3ad-1d58-4674-8585-91c172b246d7
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>;tag=SDtggf899-1838475812-1741837801748
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26667 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 15.3.0
Content-Length:  0


    -- PJSIP/Tan-00000005 answered PJSIP/home_KL-00000004
<--- Transmitting SIP response (926 bytes) to UDP:111.111.111.11:5065 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 111.111.111.11:5065;rport=5065;received=111.111.111.11;branch=z9hG4bK-f5-3c02d-34bef130-b44545d8
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
From: "home_KL" <sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456" <sip:815123456@192.168.0.1>;tag=2c5b2732-cd70-4215-8589-53c363ec3745
CSeq: 2 INVITE
Server: Asterisk PBX 15.3.0
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Contact: <sip:111.111.111.11:5060>
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   258

v=0
o=- 1741838372 1741838374 IN IP4 111.111.111.11
s=Asterisk
c=IN IP4 111.111.111.11
t=0 0
m=audio 16532 RTP/AVP 0 8 96
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

    -- Channel PJSIP/Tan-00000005 joined 'simple_bridge' basic-bridge <30e1af78-cdfb-47d9-8149-d10e6c381d55>
    -- Channel PJSIP/home_KL-00000004 joined 'simple_bridge' basic-bridge <30e1af78-cdfb-47d9-8149-d10e6c381d55>
<--- Received SIP request (902 bytes) from UDP:111.111.111.11:5065 --->
ACK sip:111.111.111.11:5060 SIP/2.0
From: "home_KL"<sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456"<sip:815123456@192.168.0.1>;tag=2c5b2732-cd70-4215-8589-53c363ec3745
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
CSeq: 2 ACK
Via: SIP/2.0/UDP 111.111.111.11:5065;rport;branch=z9hG4bK-f8-3c951-7ecc90c2-b44545d8
Max-Forwards: 70
Allow: INVITE, ACK, BYE, REFER, NOTIFY, CANCEL, UPDATE, OPTIONS, PRACK
User-Agent: MyRouter 123456 Build 555555 5555555 55555 -- 55 23 56 89 56
X-Serialnumber: 55 23 56 89 56
Contact: <sip:home_KL@111.111.111.11:5065>
Authorization: Digest username="home_KL",realm="asterisk",nonce="1741837800/1ef4cfc11888c66daafd0f93a90b0227",uri="sip:815123456@192.168.0.1:5060",response="e38d1c4954c08bbce691e909e2c1a501",algorithm=MD5,cnonce="3c02e",opaque="4c2b630d33916acf",qop=auth,nc=00000001
Content-Length: 0


<--- Received SIP request (879 bytes) from UDP:111.111.111.11:5065 --->
BYE sip:111.111.111.11:5060 SIP/2.0
From: "home_KL"<sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456"<sip:815123456@192.168.0.1>;tag=2c5b2732-cd70-4215-8589-53c363ec3745
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
CSeq: 3 BYE
Via: SIP/2.0/UDP 111.111.111.11:5065;rport;branch=z9hG4bK-fd-3df05-12ae808-b4454798
Max-Forwards: 70
Supported: replaces,100rel
Allow: INVITE, ACK, BYE, REFER, NOTIFY, CANCEL, UPDATE, OPTIONS, PRACK
User-Agent: MyRouter 123456 Build 555555 5555555 55555 -- 55 23 56 89 56
X-Serialnumber: 55 23 56 89 56
Authorization: Digest username="home_KL",realm="asterisk",nonce="1741837800/1ef4cfc11888c66daafd0f93a90b0227",uri="sip:111.111.111.11:5060",response="74fff204b1dbca0cf1cb5716be84ca04",algorithm=MD5,cnonce="3df05",opaque="4c2b630d33916acf",qop=auth,nc=00000002
Content-Length: 0


<--- Transmitting SIP response (437 bytes) to UDP:111.111.111.11:5065 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 111.111.111.11:5065;rport=5065;received=111.111.111.11;branch=z9hG4bK-fd-3df05-12ae808-b4454798
Call-ID: b5285a30-74aa87d-13c9-83545D-196e9d40-3842a657-3c024
From: "home_KL" <sip:home_KL@192.168.0.1>;tag=b44264b8-74aa87d-13c9-83545D-43cd4f17-6e3541ed-3c024
To: "815123456" <sip:815123456@192.168.0.1>;tag=2c5b2732-cd70-4215-8589-53c363ec3745
CSeq: 3 BYE
Server: Asterisk PBX 15.3.0
Content-Length:  0


    -- Channel PJSIP/home_KL-00000004 left 'simple_bridge' basic-bridge <30e1af78-cdfb-47d9-8149-d10e6c381d55>
    -- Channel PJSIP/Tan-00000005 left 'simple_bridge' basic-bridge <30e1af78-cdfb-47d9-8149-d10e6c381d55>
  == Spawn extension (outgoing, 815123456, 2) exited non-zero on 'PJSIP/home_KL-00000004'
<--- Transmitting SIP request (529 bytes) to UDP:222.222.222.22:5060 --->
BYE sip:SDgt55b-vp9pm6n1vn1nrhs6gngof0drovpsfkkt000e420@222.222.222.22:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 111.111.111.11:5060;rport;branch=z9hG4bKPj8a99f45c-e8f6-4d9f-9aac-9bd92d89740f
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>;tag=SDtggf899-1838475812-1741837801748
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26669 BYE
Reason: Q.850;cause=16
Max-Forwards: 70
User-Agent: Asterisk PBX 15.3.0
Content-Length:  0


<--- Received SIP response (397 bytes) from UDP:222.222.222.22:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 111.111.111.11:5060;received=111.111.111.11;branch=z9hG4bKPj8a99f45c-e8f6-4d9f-9aac-9bd92d89740f;rport=5060
From: <sip:my_phone_number@voice.my.isp.com>;tag=0ba99c72-7fb9-4367-ab54-006bdaa28c2f
To: <sip:815123456@voice.my.isp.com>;tag=SDtggf899-1838475812-1741837801748
Call-ID: 14582056-807d-4af8-9aba-c2ce2bd1a112
CSeq: 26669 BYE
Content-Length: 0

When I restarted the device again both outgoing and incoming calls did not work. :frowning:

I then added the following to my pjsip.conf file-

[Tan]
type = registration
server_uri = sip:voice.my.isp.com
client_uri = sip:my_phone_number@voice.my.isp.com
contact_user = my_phone_number

once I restarted I got this error-

[Mar 13 15:40:54] WARNING[18764]: res_pjsip_outbound_authenticator_digest.c:178 digest_create_request_with_auth: Host: '222.222.222.22:5060': Unable to create request with auth. No auth credentials for realm(s) 'voice.my.isp.com' in challenge.
[Mar 13 15:40:54] WARNING[18764]: res_pjsip_outbound_registration.c:930 handle_registration_response: Failed to create authenticated REGISTER request to server 'sip:voice.my.isp.com' from client 'sip:my_phone_number@voice.my.isp.com'
[Mar 13 15:40:54] WARNING[18764]: res_pjsip_outbound_registration.c:1003 handle_registration_response: Fatal response '401' received from 'sip:voice.my.isp.com' on registration attempt to 'sip:my_phone_number@voice.my.isp.com', stopping outbound registration

so I changed the pjsip.conf to -

[Tan]
type = registration
server_uri = sip:voice.my.isp.com
client_uri = sip:my_phone_number@voice.my.isp.com
contact_user = my_phone_number
username =  my_phone_number
password = password1

The error message went away, but calling out still did not work.

I then added the following to the pjsip.conf-

[Tan]
type=identify
match=my_phone_number@voice.my.isp.com
endpoint=Tan

This also did not work. :frowning:

If someone who knows what they are doing can compare the pjsip log file that worked (above) to the pjsip log file that did not work (several posts back), they may be able to find the answer.

They challenged for authentication, but your outbound registration doesn’t reference any authentication so it couldn’t do anything. An “auth” section is referenced for authentication on an outbound registration using the “outbound_auth” option.

These are invalid in an outbound registration.

The only comparison is that in the not working case your ITSP responded with a 403 Forbidden. In the working case they did not. We can only guess why that is the case.

1 Like

Ah!

I restarted the device and got my usual failure. but when I removed-

username =  my_phone_number
password = password1

and replaced it with-

outbound_auth=Tan

The call went through.

I will test an inbound call from an outside line when I get a chance, to see if it is also working. If not I may also have to add-

auth=Tan

This provider may need auths put in the registration section and not the endpoint section.

If you don’t configure inbound authentication, no attempt will be made to authenticate and the call will be accepted whether or not the caller is able to “send” a password.

so auth=Tan is inbound authentication right?
If so I will add this before I test it.

adding

outbound_auth=Tan

fixes the issue with outgoing calling…so far.

adding

outbound_auth=Tan
auth=Tan

Does not fix the inbound calls.
I can not receive inbound calls with all the changes that have been done. :frowning:

Anyone else have any ideas on how to get PJsip working with my provider?

If not I have 2 options,

  1. Keep using chan_sip as it is reliable, easy to setup and works with all providers out of the box.
  2. Call the provider and ask them about setting up pjsip.
    I do not have much hope with #2 calling the provider as it is a large company and the staff are poorly trained (from past experience). They also want the customers to use their equipment.

Is the inbound endpoint capable of authenticating itself? In general ITSPs do not authenticate themselves over SIP.

Having both way authentication is something that normally only happens over tie line trunks, or using PKI certificates, one way, with TLS.

I have no idea, I don’t even know if pjsip is even listening for calls I tried-
pjsip show registrars
and it said there were none.

I also added the following to the registration part-

transport = transport-udp
retry_interval = 20
max_retries = 10
expiration = 20

and the following to the endpoint section-

dtmf_mode = rfc4733
tp_symmetric = yes
force_rport = yes

But nothing works.

All the info is shown in the above posts, I can’t think of anything else to do.
How can I find out if the inbound endpoint capable of authenticating itself?

If it is a provider, assume it can’t. Otherwise, read the documentation on how to configure it. Generally, if it can, and has been configured to do so, it will respond to a 401 response, with authentication information, immediately. Otherwise it will just repeat the request, with no additional headers, probably after a significant delay, and might not retry at all.

If it needs “insecure=invite” on chan_sip, as against just tolerating it, it is not capable of authenticating itself.

This is not a valid parameter. Also, any provider that needs rtp_symmetric shouldn’t be in the business, as providers should not be operating behind NAT.

I was just trying to add different things out of desperation. I have spent lots of time on this, have no solution and am now at a dead end. I am just going to have to stay with chan_sip.

It looks like there won’t be a solution shown here unless someone who knows it reads this post and reply’s with in a month. Why would this site stop people form replying after one month, it is ridiculous. If someone finds these posts in a couple of months and has the answer we will never know.

They will simply flag a post and ask for it be re-opened, then reply. However, unless you actually provide useful diagnostics, that is unlikely to happen.

So what? You can download and compile and install chan_sip even in the very latest version of Asterisk. The only difference now is that it’s no longer included in Asterisk but it was forked and it’s now separately maintained.

This is open source software the entire point of it is to let people modify and tinker with the code. Using a 3rd party chan_sip module is NOT some shooting offence and for those that this offends their sensibilities, just tell them to “up yours”

Thank you for the feedback, looks like I have no choice in the matter now.
The only reason I tried to update to pjsip was because I was told that it was more secure, if this is true or not I do not know as I am only a novice it these things.
The main thing that annoys me is the fact that I spent so much time trying to implement it and all for nothing and I am now disappointed in pjsip that it was not easier to use, for me anyhow. This feels like a step backwards like so many other things today.