Thanks. I’ve managed to route all incoming GSM call to SIP.
But as I found, the SIP calls don’t work properly even when initiated from the CLI: I receive the call in SIP Linphone client installed on my phone, answer it, but Asterisk doesn’t see it answered
Here is my current sip.conf setup:
[general]
context=incoming
register => user1:user1password@sip.linphone.org/user1 ; what is here after slash?
default_caller_id="Asterisk" <sip:asterisk@example.com>
alwaysauthreject=yes
hidecallerid=no
[user1]
type=peer
host=sip.linphone.org
defaultuser=user1
secret=user1password@
fromuser=user1
fromdomain=sip.linphone.org
insecure=invite,port
context=outbound ; should it be used somewhere else?
transport=udp
qualify=yes
authuser=user1
callerid="user1" <sip:user1@sip.linphone.org>
canreinvite=no
directmedia=no
insecure=invite,port
dtmfmode=rfc2833
callcounter=yes
[user2]
type=peer
host=sip.linphone.org
defaultuser=user2
secret=user2password ; why do I need it?
context=test-sip-out ; should it be used somewhere else?
transport=udp
when I initiate a call
CLI> channel originate SIP/user1/user2 application answer,playback(hello-world)
I get the following:
proxmox-alpine-vm*CLI> channel originate SIP/user1/user2 application answer,playback(hello-world)
[2025-06-14 16:48:40] ERROR[828]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo("proxmox-alpine-vm", "(null)", ...): Name or service not known
[2025-06-14 16:48:40] WARNING[828]: acl.c:835 resolve_first: Unable to lookup 'proxmox-alpine-vm'
== Using SIP RTP CoS mark 5
Audio is at 15470
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 5.135.215.43:5060:
INVITE sip:user2@sip.linphone.org SIP/2.0
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK2a946b8a
Max-Forwards: 70
From: "Anonymous" <sip:user1@sip.linphone.org>;tag=as07b77880
To: <sip:user2@sip.linphone.org>
Contact: <sip:user1@192.168.1.128:5060>
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
CSeq: 102 INVITE
User-Agent: Asterisk PBX certified/13.21-cert6
Date: Sat, 14 Jun 2025 16:48:40 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 330
v=0
o=root 1421228007 1421228007 IN IP4 192.168.1.128
s=Asterisk PBX certified/13.21-cert6
c=IN IP4 192.168.1.128
t=0 0
m=audio 15470 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=maxptime:150
a=sendrecv
---
-- Called user1/user2
<--- SIP read from UDP:5.135.215.43:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK2a946b8a;rport=5060
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
From: "Anonymous"<sip:user1@sip.linphone.org>;tag=as07b77880
To: <sip:user2@sip.linphone.org>;tag=D7t7HQctKeNDp
CSeq: 102 INVITE
Server: Flexisip/2.4.1-12-g2e25adc8 (sofia-sip-nta/2.0)
Proxy-Authenticate: Digest realm="sip.linphone.org",nonce="aCb46wAAAAAc/5iUAABZM6lzkUYAAAAA",opaque="+GNywA==",algorithm=MD5,qop="auth"
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
Transmitting (no NAT) to 5.135.215.43:5060:
ACK sip:user2@sip.linphone.org SIP/2.0
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK2a946b8a
Max-Forwards: 70
From: "Anonymous" <sip:user1@sip.linphone.org>;tag=as07b77880
To: <sip:user2@sip.linphone.org>;tag=D7t7HQctKeNDp
Contact: <sip:user1@192.168.1.128:5060>
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
CSeq: 102 ACK
User-Agent: Asterisk PBX certified/13.21-cert6
Content-Length: 0
---
Audio is at 15470
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 5.135.215.43:5060:
INVITE sip:user2@sip.linphone.org SIP/2.0
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK1f59dece
Max-Forwards: 70
From: "Anonymous" <sip:user1@sip.linphone.org>;tag=as07b77880
To: <sip:user2@sip.linphone.org>
Contact: <sip:user1@192.168.1.128:5060>
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
CSeq: 103 INVITE
User-Agent: Asterisk PBX certified/13.21-cert6
Proxy-Authorization: Digest username="user1", realm="sip.linphone.org", algorithm=MD5, uri="sip:user2@sip.linphone.org", nonce="aCb46wAAAAAc/5iUAABZM6lzkUYAAAAA", response="b03524a1d7d651673e9870e209a0c90d", opaque="+GNywA==", qop=auth, cnonce="38214ebb", nc=00000001
Date: Sat, 14 Jun 2025 16:48:40 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 330
v=0
o=root 1421228007 1421228008 IN IP4 192.168.1.128
s=Asterisk PBX certified/13.21-cert6
c=IN IP4 192.168.1.128
t=0 0
m=audio 15470 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=maxptime:150
a=sendrecv
---
<--- SIP read from UDP:5.135.215.43:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK1f59dece;rport=5060
Record-Route: <sip:sip12.linphone.org:5060;lr>
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
From: "Anonymous"<sip:user1@sip.linphone.org>;tag=as07b77880
To: <sip:user2@sip.linphone.org>
CSeq: 103 INVITE
Server: Flexisip/2.4.1-12-g2e25adc8 (sofia-sip-nta/2.0)
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
<--- SIP read from UDP:5.135.215.43:5060 --->
SIP/2.0 110 Push sent
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK1f59dece;rport=5060
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
From: "Anonymous"<sip:user1@sip.linphone.org>;tag=as07b77880
To: <sip:user2@sip.linphone.org>
CSeq: 103 INVITE
Content-Length: 0
<------------->
--- (7 headers 0 lines) ---
-- SIP/linphone-00000002 is making progress
> 0x7f7f0400df50 -- Strict RTP learning after remote address set to: 5.135.215.43:11052
> 0x7f7f0400df50 -- Strict RTP switching to RTP target address 5.135.215.43:11052 as source
> 0x7f7f0400df50 -- Strict RTP learning complete - Locking on source address 5.135.215.43:11052
Scheduling destruction of SIP dialog '6ee7184045172713700184d728352385@sip.linphone.org' in 6400 ms (Method: INVITE)
Reliably Transmitting (no NAT) to 5.135.215.43:5060:
CANCEL sip:user2@sip.linphone.org SIP/2.0
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK1f59dece
Max-Forwards: 70
From: "Anonymous" <sip:user1@sip.linphone.org>;tag=as07b77880
To: <sip:user2@sip.linphone.org>
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
CSeq: 103 CANCEL
User-Agent: Asterisk PBX certified/13.21-cert6
Content-Length: 0
---
Scheduling destruction of SIP dialog '6ee7184045172713700184d728352385@sip.linphone.org' in 6400 ms (Method: INVITE)
<--- SIP read from UDP:5.135.215.43:5060 --->
SIP/2.0 481 Call/Transaction Does Not Exist
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK1f59dece;rport=5060
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
From: "Anonymous"<sip:user1@sip.linphone.org>;tag=as07b77880
To: <sip:user2@sip.linphone.org>;tag=61Nm30Qjm8XpH
CSeq: 103 CANCEL
Server: Flexisip/2.4.1-12-g2e25adc8 (sofia-sip-nta/2.0)
Content-Length: 0
<------------->
--- (8 headers 0 lines) ---
[2025-06-14 16:49:10] WARNING[52]: chan_sip.c:25061 handle_response: Remote host can't match request CANCEL to call '6ee7184045172713700184d728352385@sip.linphone.org'. Giving up.
Really destroying SIP dialog '6ee7184045172713700184d728352385@sip.linphone.org' Method: INVITE
Reliably Transmitting (no NAT) to 5.135.215.43:5060:
OPTIONS sip:sip.linphone.org SIP/2.0
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK324e5730
Max-Forwards: 70
From: "asterisk" <sip:user1@192.168.1.128>;tag=as424befc1
To: <sip:sip.linphone.org>
Contact: <sip:user1@192.168.1.128:5060>
Call-ID: 7e2bd7d91ababd82102e82393c938d47@192.168.1.128:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX certified/13.21-cert6
Date: Sat, 14 Jun 2025 16:49:23 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
---
<--- SIP read from UDP:5.135.215.43:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK324e5730;rport=5060
Call-ID: 7e2bd7d91ababd82102e82393c938d47@192.168.1.128:5060
From: "asterisk"<sip:user1@192.168.1.128:5060>;tag=as424befc1
To: <sip:sip.linphone.org>;tag=S6Q3gFvtN936g
CSeq: 102 OPTIONS
Content-Length: 0
<------------->
--- (7 headers 0 lines) ---
Really destroying SIP dialog '7e2bd7d91ababd82102e82393c938d47@192.168.1.128:5060' Method: OPTIONS
<--- SIP read from UDP:5.135.215.43:5060 --->
BYE sip:user1@192.168.1.128:5060 SIP/2.0
Via: SIP/2.0/UDP sip12.linphone.org;branch=z9hG4bK.Hy2me158t25j6ZaZD67gQ5U50a;rport,SIP/2.0/TLS [2606:4700:0110:8C75:5F65:A174:8FF3:B639]:34722;branch=z9hG4bK.Tc8BJEIFY;received=2A09:BAC1:61A0:0000:0000:0000:0057:022F;rport=40102
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
From: <sip:user2@sip.linphone.org>;tag=SeFmSAl
To: "Anonymous"<sip:user1@sip.linphone.org>;tag=as07b77880
CSeq: 111 BYE
Max-Forwards: 69
Reason: SIP;cause=408;text="no ACK received"
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
Sending to 5.135.215.43:5060 (no NAT)
<--- Transmitting (no NAT) to 5.135.215.43:5060 --->
SIP/2.0 481 Call leg/transaction does not exist
Via: SIP/2.0/UDP sip12.linphone.org;branch=z9hG4bK.Hy2me158t25j6ZaZD67gQ5U50a;received=5.135.215.43;rport=5060,SIP/2.0/TLS [2606:4700:0110:8C75:5F65:A174:8FF3:B639]:34722;branch=z9hG4bK.Tc8BJEIFY;received=2A09:BAC1:61A0:0000:0000:0000:0057:022F;rport=40102
From: <sip:user2@sip.linphone.org>;tag=SeFmSAl
To: "Anonymous"<sip:user1@sip.linphone.org>;tag=as07b77880
Call-ID: 6ee7184045172713700184d728352385@sip.linphone.org
CSeq: 111 BYE
Server: Asterisk PBX certified/13.21-cert6
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
<------------>
[2025-06-14 16:50:14] NOTICE[52]: chan_sip.c:15760 sip_reregister: -- Re-registration for user1@sip.linphone.org
REGISTER 12 headers, 0 lines
Reliably Transmitting (no NAT) to 5.135.215.43:5060:
REGISTER sip:sip.linphone.org SIP/2.0
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK16f09a4e
Max-Forwards: 70
From: <sip:user1@sip.linphone.org>;tag=as17188f83
To: <sip:user1@sip.linphone.org>
Call-ID: 2abacceb41b70f34388a71bb0ec1c97b@192.168.1.128
CSeq: 115 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX certified/13.21-cert6
Authorization: Digest username="user1", realm="sip.linphone.org", algorithm=MD5, uri="sip:sip.linphone.org", nonce="1CH46wAAAACQ2pxjAABBGeblyXsAAAAA", response="c9563d2a99ad28461159ac277eee851c", opaque="+GNywA==", qop=auth, cnonce="66457f1c", nc=0000000d
Expires: 120
Contact: <sip:linphone@192.168.1.128:5060>
Content-Length: 0
---
<--- SIP read from UDP:5.135.215.43:5060 --->
SIP/2.0 200 Registration successful
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK16f09a4e;rport=5060
Call-ID: 2abacceb41b70f34388a71bb0ec1c97b@192.168.1.128
From: <sip:user1@sip.linphone.org>;tag=as17188f83
To: <sip:user1@sip.linphone.org>;tag=DyFtav34rXKtK
CSeq: 115 REGISTER
Contact: <sip:linphone@192.168.1.128:5060>
Expires: 120
Server: Flexisip/2.4.1-12-g2e25adc8 (sofia-sip-nta/2.0)
Supported: path,outbound
Content-Length: 0
<------------->
--- (11 headers 0 lines) ---
[2025-06-14 16:50:14] NOTICE[52]: chan_sip.c:24602 handle_response_register: Outbound Registration: Expiry for sip.linphone.org is 120 sec (Scheduling reregistration in 105 s)
Really destroying SIP dialog '2abacceb41b70f34388a71bb0ec1c97b@192.168.1.128' Method: REGISTER
Reliably Transmitting (no NAT) to 5.135.215.43:5060:
OPTIONS sip:sip.linphone.org SIP/2.0
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK00c7c543
Max-Forwards: 70
From: "asterisk" <sip:user1@192.168.1.128>;tag=as3d8e75f8
To: <sip:sip.linphone.org>
Contact: <sip:user1@192.168.1.128:5060>
Call-ID: 54760bea4bda53263a6d3c3c5e4d20aa@192.168.1.128:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX certified/13.21-cert6
Date: Sat, 14 Jun 2025 16:50:23 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
---
<--- SIP read from UDP:5.135.215.43:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.128:5060;branch=z9hG4bK00c7c543;rport=5060
Call-ID: 54760bea4bda53263a6d3c3c5e4d20aa@192.168.1.128:5060
From: "asterisk"<sip:user1@192.168.1.128:5060>;tag=as3d8e75f8
To: <sip:sip.linphone.org>;tag=HKeBQ6jH9F4ZF
CSeq: 102 OPTIONS
Content-Length: 0
<------------->
--- (7 headers 0 lines) ---
Really destroying SIP dialog '54760bea4bda53263a6d3c3c5e4d20aa@192.168.1.128:5060' Method: OPTIONS