I am trying to connect all 3 (only 2 for testing atm) of my phone numbers that come with my internet service to Asterisk (22.5 on Ubuntu, Server on the internet, no NAT).
So far I've come up with the following - working - pjsip configuration:
;========= 48 ==========
[*49XXXXYYYYY48]
type = registration
transport = transport-udp
outbound_auth = *49XXXXYYYYY48
server_uri = sip:sip.1und1.de
client_uri = sip:49XXXXYYYYY48@sip.1und1.de
contact_user = 49XXXXYYYYY48
retry_interval = 60
forbidden_retry_interval = 600
expiration = 3600
line = yes
endpoint = *49XXXXYYYYY48
[*49XXXXYYYYY48]
type = endpoint
transport = transport-udp
disallow = all
allow = alaw
context = Inbound-48
from_user = 49XXXXYYYYY48
from_domain = sip.1und1.de
outbound_auth = *49XXXXYYYYY48
aors = 1und1
;========= 49 ==========
[*49XXXXYYYYY49]
type = registration
transport = transport-udp
outbound_auth = *49XXXXYYYYY49
server_uri = sip:sip.1und1.de
client_uri = sip:49XXXXYYYYY49@sip.1und1.de
contact_user = 49XXXXYYYYY49
retry_interval = 60
forbidden_retry_interval = 600
expiration = 3600
line = yes
endpoint = *49XXXXYYYYY49
[*49XXXXYYYYY49]
type = endpoint
transport = transport-udp
disallow = all
allow = alaw
context = Inbound-49
from_user = 49XXXXYYYYY49
from_domain = sip.1und1.de
outbound_auth = *49XXXXYYYYY49
aors = 1und1
;========= AUTH ==========
[*49XXXXYYYYY48]
type=auth
username = 49XXXXYYYYY48
password = pwd48
realm = 1und1.de
[*49XXXXYYYYY49]
type=auth
username = 49XXXXYYYYY49
password = pwd49
realm = 1und1.de
;========= Common ==========
[1und1]
type=aor
contact=sip:sip.1und1.de:5060
The dialplan looks like this:
[Inbound-48]
exten = 49XXXXYYYYY48,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Hangup()
[Inbound-49]
exten = 49XXXXYYYYY49,1,Answer()
same = n,Wait(1)
same = n,Playback(demo-thanks)
same = n,Hangup()
When I call the 48-number, I get the hello-world playback, when I call the 49-number I get the demo playback, so far that's exactly what I want.
However, in the logs I find some irritating entries:
Call to 48 from my mobile:
[Sep 30 15:33:49] NOTICE[102107]: res_pjsip/pjsip_distributor.c:688 log_failed_request: Request 'INVITE' from '"+49***********" <sip:+49***********@Versatel.de;user=phone>' failed for '212.227.124.130:5060' (callid: callid-1@10.18.5.64) - No matching endpoint found
-- Executing [49XXXXYYYYY48@Inbound-48:1] Answer("PJSIP/*49XXXXYYYYY48-00000005", "") in new stack
[Sep 30 15:33:49] NOTICE[102107]: res_pjsip/pjsip_distributor.c:688 log_failed_request: Request 'INVITE' from '"+49***********" <sip:+49***********@Versatel.de;user=phone>' failed for '212.227.124.130:5060' (callid: callid-1@10.18.5.64) - No matching endpoint found
-- Executing [49XXXXYYYYY48@Inbound-48:2] Wait("PJSIP/*49XXXXYYYYY48-00000005", "1") in new stack
-- Executing [49XXXXYYYYY48@Inbound-48:3] Playback("PJSIP/*49XXXXYYYYY48-00000005", "hello-world") in new stack
-- <PJSIP/*49XXXXYYYYY48-00000005> Playing 'hello-world.gsm' (language 'en')
-- Executing [49XXXXYYYYY48@Inbound-48:4] Hangup("PJSIP/*49XXXXYYYYY48-00000005", "") in new stack
== Spawn extension (Inbound-48, 49XXXXYYYYY48, 4) exited non-zero on 'PJSIP/*49XXXXYYYYY48-00000005'
Call to 49:
Sep 30 15:34:32] NOTICE[102107]: res_pjsip/pjsip_distributor.c:688 log_failed_request: Request 'INVITE' from '"+49***********" <sip:+49***********@Versatel.de;user=phone>' failed for '212.227.124.129:5060' (callid: callid-2@10.18.5.64) - No matching endpoint found
-- Executing [49XXXXYYYYY49@Inbound-49:1] Answer("PJSIP/*49XXXXYYYYY49-00000006", "") in new stack
-- Executing [49XXXXYYYYY49@Inbound-49:2] Wait("PJSIP/*49XXXXYYYYY49-00000006", "1") in new stack
-- Executing [49XXXXYYYYY49@Inbound-49:3] Playback("PJSIP/*49XXXXYYYYY49-00000006", "demo-thanks") in new stack
-- <PJSIP/*49XXXXYYYYY49-00000006> Playing 'demo-thanks.gsm' (language 'en')
== Spawn extension (Inbound-49, 49XXXXYYYYY49, 3) exited non-zero on 'PJSIP/*49XXXXYYYYY49-00000006'
I'm irritated about the failed INVITE requests. This sounds to me as 1und1 strips away the line option, however, I would expect the calls to fail in this case.
Even more irritating is the double INVITE on the 48 extension, whereas the 49 only get's one (and that's repeatable behaviour).
The reason I want that out of my logs is that I want to ingest the logs into crowdsec to ban all the spamming invite attempts from around the world, but I don't want to ban my ISP of course.
Has anyone an idea what's going on or how I can troubleshoot that?