Hey Folks,
I am trying to get my asterisk working behind an Openwrt Router that is connected to a Fritzbox.
I dont get it working and would be happy to get some help.
I know Nat is not the best option but i would be able to setup siproxd or so i just need some help here
So first some infos about the setup
Fritzbox7590 IP: 192.168.0.1 (registered a ipphone user:asterisk passwd:LkTy4c7mxHH4?X6_)
Openwrt Router: 192.168.0.2 (from Fritzbox) and 192.168.1.1 (Main running dhcp)
Asterisk Ip: 192.168.1.10 (from Openwrt via dhcp)
Connection
Fritzbox <-> OpenWrt <-> Asterisk
I want to connect the asterisk to the fritzbox to do outbound calls and inbound as well as internal calls
Here are the configs so far
[global]
type=global
endpoint_identifier_order=ip,username
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0
[fritzbox]
type=registration
transport=transport-udp
outbound_auth=fritzbox
contact_user = asterisk
server_uri=sip:asterisk@192.168.0.1:5060
client_uri=sip:asterisk@192.168.0.1:5060
[fritzbox]
type=auth
auth_type=userpass
password=LkTy4c7mxHH4?X6_
username=asterisk
[fritzbox]
type = aor
contact = sip:asterisk@192.168.0.1:5060
[asterisk]
type = endpoint
context = incoming
outbound_auth = fritzbox
aors = fritzbox
disallow=all
allow=ulaw
allow=alaw
allow=gsm
;from_domain = 192.168.0.1
from_user = asterisk
[fritzbox]
type = identify
endpoint = asterisk
match = 192.168.0.2
[6001]
type = endpoint
context = internal
disallow = all
allow = ulaw,alaw
aors = 6001
auth = auth6001
[6001]
type = aor
remove_existing = yes
max_contacts = 1
[auth6001]
type=auth
auth_type=userpass
password=1234
username=6001
[6002]
type = endpoint
context = internal
disallow = all
allow = ulaw,alaw
aors = 6002
auth = auth6002
[6002]
type = aor
remove_existing = yes
max_contacts = 1
[auth6002]
type=auth
auth_type=userpass
password=1234
username=6002
Extensions
[incoming]
exten => _X.,1,Goto(internal,6001,1)
[internal]
exten => 6001,1,NoOp(Rufe 6001)
same => n,Dial(PJSIP/6001)
same => n,Hangup()
exten => 6002,1,NoOp(Rufe 6002)
same => n,Dial(PJSIP/6002)
same => n,Hangup()
exten => _0X.,1,Goto(outgoing,${EXTEN:1},1)
[outgoing]
exten => _X.,1,Dial(PJSIP/asterisk/${EXTEN})
I get the following output
OSMO*CLI> pjsip set logger on
PJSIP Logging enabled
<--- Transmitting SIP request (586 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:asterisk@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPj0c7738f7-6075-43ad-b5cf-3dfc8b08c624
From: <sip:asterisk@192.168.0.1>;tag=b8c6fc48-df5c-4d27-a800-e64aa6151518
To: <sip:asterisk@192.168.0.1>
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1192 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.1~dfsg+~cs6.12.40431414-1
Content-Length: 0
<--- Received SIP response (457 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPj0c7738f7-6075-43ad-b5cf-3dfc8b08c624;received=192.168.0.2
From: <sip:asterisk@192.168.0.1>;tag=b8c6fc48-df5c-4d27-a800-e64aa6151518
To: <sip:asterisk@192.168.0.1>;tag=2F36C5932556433E
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1192 REGISTER
WWW-Authenticate: Digest realm="fritz.box", nonce="47E3E40423E1A280"
User-Agent: FRITZ!OS
Content-Length: 0
<--- Transmitting SIP request (756 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:asterisk@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPj80596e06-9d74-4d7a-b106-5d69f666fc4e
From: <sip:asterisk@192.168.0.1>;tag=b8c6fc48-df5c-4d27-a800-e64aa6151518
To: <sip:asterisk@192.168.0.1>
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1193 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.1~dfsg+~cs6.12.40431414-1
Authorization: Digest username="asterisk", realm="fritz.box", nonce="47E3E40423E1A280", uri="sip:asterisk@192.168.0.1:5060", response="1376400f477dcff34196be07b92c59b7"
Content-Length: 0
<--- Received SIP response (706 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPj80596e06-9d74-4d7a-b106-5d69f666fc4e;received=192.168.0.2
From: <sip:asterisk@192.168.0.1>;tag=b8c6fc48-df5c-4d27-a800-e64aa6151518
To: <sip:asterisk@192.168.0.1>;tag=B457469D8940B2DB
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1193 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>;expires=300
User-Agent: AVM FRITZ!Box 7590 154.07.50 (Nov 18 2022)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer,reg
Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,PRACK,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,PUBLISH
Accept: application/sdp, multipart/mixed
Accept-Encoding: identity
Content-Length: 0
<--- Transmitting SIP request (586 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:asterisk@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPjea4c4ea4-315a-4940-af3b-18370f8a95ce
From: <sip:asterisk@192.168.0.1>;tag=45b34372-668d-4419-99a0-f0f5c858c7e4
To: <sip:asterisk@192.168.0.1>
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1194 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.1~dfsg+~cs6.12.40431414-1
Content-Length: 0
<--- Received SIP response (457 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPjea4c4ea4-315a-4940-af3b-18370f8a95ce;received=192.168.0.2
From: <sip:asterisk@192.168.0.1>;tag=45b34372-668d-4419-99a0-f0f5c858c7e4
To: <sip:asterisk@192.168.0.1>;tag=A830419EFF7CD6E6
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1194 REGISTER
WWW-Authenticate: Digest realm="fritz.box", nonce="741AC68D12EF96DE"
User-Agent: FRITZ!OS
Content-Length: 0
<--- Transmitting SIP request (756 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:asterisk@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPjd6b1e72d-42f6-426f-b460-28599ddf0c51
From: <sip:asterisk@192.168.0.1>;tag=45b34372-668d-4419-99a0-f0f5c858c7e4
To: <sip:asterisk@192.168.0.1>
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1195 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.1~dfsg+~cs6.12.40431414-1
Authorization: Digest username="asterisk", realm="fritz.box", nonce="741AC68D12EF96DE", uri="sip:asterisk@192.168.0.1:5060", response="c4f7a1ce418d0dae0570bf29036d8704"
Content-Length: 0
<--- Received SIP response (706 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPjd6b1e72d-42f6-426f-b460-28599ddf0c51;received=192.168.0.2
From: <sip:asterisk@192.168.0.1>;tag=45b34372-668d-4419-99a0-f0f5c858c7e4
To: <sip:asterisk@192.168.0.1>;tag=D467CA6CF0B97DB7
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1195 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>;expires=300
User-Agent: AVM FRITZ!Box 7590 154.07.50 (Nov 18 2022)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer,reg
Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,PRACK,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,PUBLISH
Accept: application/sdp, multipart/mixed
Accept-Encoding: identity
Content-Length: 0
<--- Transmitting SIP request (586 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:asterisk@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPj506c08e6-c377-4823-8e29-9b6b1530c500
From: <sip:asterisk@192.168.0.1>;tag=49aafc51-dd93-4b74-a6c2-d425d817482a
To: <sip:asterisk@192.168.0.1>
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1196 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.1~dfsg+~cs6.12.40431414-1
Content-Length: 0
<--- Received SIP response (457 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPj506c08e6-c377-4823-8e29-9b6b1530c500;received=192.168.0.2
From: <sip:asterisk@192.168.0.1>;tag=49aafc51-dd93-4b74-a6c2-d425d817482a
To: <sip:asterisk@192.168.0.1>;tag=40F8923BED557EDD
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1196 REGISTER
WWW-Authenticate: Digest realm="fritz.box", nonce="84F9C831842EFB95"
User-Agent: FRITZ!OS
Content-Length: 0
<--- Transmitting SIP request (756 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:asterisk@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPjaf7bffea-bee0-46e6-9409-cb4a9a64329c
From: <sip:asterisk@192.168.0.1>;tag=49aafc51-dd93-4b74-a6c2-d425d817482a
To: <sip:asterisk@192.168.0.1>
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1197 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.1~dfsg+~cs6.12.40431414-1
Authorization: Digest username="asterisk", realm="fritz.box", nonce="84F9C831842EFB95", uri="sip:asterisk@192.168.0.1:5060", response="4764cca6a573db4eed77f6d94ee2e02b"
Content-Length: 0
<--- Received SIP response (706 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPjaf7bffea-bee0-46e6-9409-cb4a9a64329c;received=192.168.0.2
From: <sip:asterisk@192.168.0.1>;tag=49aafc51-dd93-4b74-a6c2-d425d817482a
To: <sip:asterisk@192.168.0.1>;tag=1DC69149B30638D2
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1197 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>;expires=300
User-Agent: AVM FRITZ!Box 7590 154.07.50 (Nov 18 2022)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer,reg
Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,PRACK,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,PUBLISH
Accept: application/sdp, multipart/mixed
Accept-Encoding: identity
Content-Length: 0
<--- Transmitting SIP request (586 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:asterisk@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPj4a765201-2051-49bf-bf39-7d7cd7c8dcf4
From: <sip:asterisk@192.168.0.1>;tag=53b7fd37-5855-4cfe-b72c-656068064dac
To: <sip:asterisk@192.168.0.1>
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1198 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.1~dfsg+~cs6.12.40431414-1
Content-Length: 0
<--- Received SIP response (457 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPj4a765201-2051-49bf-bf39-7d7cd7c8dcf4;received=192.168.0.2
From: <sip:asterisk@192.168.0.1>;tag=53b7fd37-5855-4cfe-b72c-656068064dac
To: <sip:asterisk@192.168.0.1>;tag=B5E1FE6094C96654
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1198 REGISTER
WWW-Authenticate: Digest realm="fritz.box", nonce="CBA4BCC098CFBA25"
User-Agent: FRITZ!OS
Content-Length: 0
<--- Transmitting SIP request (756 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:asterisk@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPj8ebef53b-a93f-4ff4-ab64-909e750137d4
From: <sip:asterisk@192.168.0.1>;tag=53b7fd37-5855-4cfe-b72c-656068064dac
To: <sip:asterisk@192.168.0.1>
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1199 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.1~dfsg+~cs6.12.40431414-1
Authorization: Digest username="asterisk", realm="fritz.box", nonce="CBA4BCC098CFBA25", uri="sip:asterisk@192.168.0.1:5060", response="e7568226943a1e6b990f916f5f70b36e"
Content-Length: 0
<--- Received SIP response (706 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPj8ebef53b-a93f-4ff4-ab64-909e750137d4;received=192.168.0.2
From: <sip:asterisk@192.168.0.1>;tag=53b7fd37-5855-4cfe-b72c-656068064dac
To: <sip:asterisk@192.168.0.1>;tag=21CAE4D0769F2098
Call-ID: 9c960a00-9a20-46c2-aa99-d8bcf4e9daa0
CSeq: 1199 REGISTER
Contact: <sip:asterisk@172.22.22.220:5060>;expires=300
User-Agent: AVM FRITZ!Box 7590 154.07.50 (Nov 18 2022)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer,reg
Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,PRACK,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,PUBLISH
Accept: application/sdp, multipart/mixed
Accept-Encoding: identity
Content-Length: 0
Please Help me with asterisk or i get obelix .
Thanks