Hello Everyone,
First of all, I would like to apologize for commenting such an old thread, but my problem is pretty the same than @clemenlg started. Actually, I am using the same Home Assistant addon and my telco provider is the same (Movistar Spain -former Telefónica-). I am happy to open a new topic if necessary.
I open an issue in project’s Github but had no response yet. From my understanding, such Asterisk based addon works in the same way that Astrisk standalone, but with small differences. The most important one is that .conf files must be edited in a custom folder where you have to put a copy of the main file. Then, both the main and custom files are loaded. Main .conf files shall not be edited. Another thing is that commands have to be issued from an addon stdin service call, that’s the reason you will see below that commands are stated in the following way:
[12:21:25] INFO: Executing command from stdin: asterisk -rx '[COMMAND]'
I know that @clemenlg solved the issue although he did not remember how it was achieved. Then, I am just providing some information according to the point I am not able to move forward from. I need to be able to do an outbound call only, although I setup an inbound trunk as well for testing purposes.
I know SIP is deprecated, but given that I know a SIP account should work, I’d rather to setup SIP first. Once it is confirmed that SIP works, I will try to move to a JSIP config.
I am sorry if there is too much lines in the .conf files, but I have been doing a lot of trial&error, and honestly I am not sure at this point what it is there for a purpose or not.
For reference, I believe there is not any problem in regards of LAN configuration, because I have an ATA SIP device (Grandstream HT802) in my network that works fine. In addition, I can do calls with SessionTalk (a softphone App for iPhone) just providing the following information to the App config:
User = 949xxxxxx ; my FTTH VoIP number (my "landline" number)
Passport = 949xxxxxx ; same number
Domain/Port = telefonica.net:5060
Proxy/Port = 10.31.255.134:5070
My sip.conf (default) file content is the following:
; Note: this file has been modified from the Asterisk defaults to the add-on
[general]
udpbindaddr=0.0.0.0:5260
bindaddr=0.0.0.0:5260
protocol=udp
; TLS
tlsenable=yes
tlsbindaddr=0.0.0.0:5261
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlscipher=ALL
tlsclientmethod=ALL
; HINTS
limitonpeers=yes
notifyringing=yes
notifyhold=yes
notifycid=yes
callcounter=yes
; AUTO GENERATED EXTENSIONS
#include sip_default.conf
; CUSTOM EXTENSIONS
#include sip_custom.conf
My actual sip.conf file content, which is inherited from the previous one is:
; Note: this file has been modified from the Asterisk defaults to the add-on
[general]
context=unauthenticated
allowguest=no
srvlookup=yes
udpbindaddr=0.0.0.0:5260
bindaddr=0.0.0.0:5260
protocol=udp
tcpenable=no
language=es
nat=force_rport,comedia
directmedia=off
localnet=192.168.0.0/255.255.255.0
; TLS
tlsenable=yes
tlsbindaddr=0.0.0.0:5261
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlscipher=ALL
tlsclientmethod=ALL
register => 949xxxxxx@telefonica.net:949xxxxxx@10.31.255.134:5070
; HINTS
limitonpeers=yes
notifyringing=yes
notifyhold=yes
notifycid=yes
callcounter=yes
; AUTO GENERATED EXTENSIONS
#include sip_default.conf
; CUSTOM EXTENSIONS
#include sip_custom.conf
[Movistar](!)
type=peer
secret=949xxxxxx
insecure=port,invite
dtmfmode=auto
disallow=all
allow=ulaw,alaw
outboundproxy=10.31.255.134:5070
[MovistarOut](Movistar)
type=peer
secret=949xxxxxx
insecure=port,invite
dtmfmode=auto
disallow=all
allow=ulaw,alaw
outboundproxy=10.31.255.134:5070
fromuser=949xxxxxx
fromdomain=telefonica.net
host=telefonica.net
nat=force_rport,comedia
insecure=port,invite
dtmfmode=auto
trustrpid=yes
[MovistarIn](Movistar)
context=incoming
defaultuser=949xxxxxx
host=10.31.255.134
port=5060
qualify=no
trustrpid=yes
[MovistarOut]
type=registration
outbound_auth=949xxxxxx
server_uri=sip:telefonica.net
client_uri=sip:949xxxxxx@telefonica.net
retry_interval=10
contact_user=949xxxxxx
expiration=600
outboundproxy=10.31.255.134:5070
fromuser=949xxxxxx
fromdomain=telefonica.net
host=telefonica.net
nat=force_rport,comedia
insecure=port,invite
dtmfmode=auto
trustrpid=yes
[MovistarOut]
type = auth
username = 949xxxxxx
password = 949xxxxxx
My extensions.conf file is:
[globals]
trunk = SIP/MovistarOut
[dispositivos]
include = internos
include = moviles
include = gratuitos
include = nacionales
include = emergencias
[internos]
exten => 100,1,Dial(${ext100})
exten => 101,1,Dial(${ext101})
exten => 102,1,Dial(${ext102})
exten => 103,1,Answer()
exten => 104,2,Playback(tt-monkeys)
exten => 105,3,Hangup()
[moviles]
exten => _[67]XXXXXXXX,1,Dial(${trunk}/${EXTEN})
[gratuitos]
exten => _[89]00XXXXXX,1,Dial(${trunk}/${EXTEN})
[nacionales]
exten => _[89]ZXXXXXXX,1,Dial(${trunk}/${EXTEN})
exten => _[89]01XXXXXX,1,Dial(${trunk}/${EXTEN})
exten => _[89]02XXXXXX,1,Dial(${trunk}/${EXTEN})
[emergencias]
exten => 061,1,Dial(${trunk}/${EXTEN})
exten => 091,1,Dial(${trunk}/${EXTEN})
exten => 092,1,Dial(${trunk}/${EXTEN})
exten => 112,1,Dial(${trunk}/${EXTEN})
[incoming]
exten => s,1,Dial(${ext100}&${ext101},15)
My Asterisk output to sip show registry
command is:
[12:21:25] INFO: Executing command from stdin: asterisk -rx 'sip show registry'
[Jul 26 12:21:25] -- Remote UNIX connection
Host dnsmgr Username Refresh State Reg.Time
10.31.255.134:5070 N 949xxxxxx@te 55 Registered Wed, 26 Jul 2023 12:21:08
1 SIP registrations.
[Jul 26 12:21:25] -- Remote UNIX connection disconnected
Asterisk ending (0).
My Asterisk output to sip show peers
is the following:
[12:21:14] INFO: Executing command from stdin: asterisk -rx 'sip show peers'
[Jul 26 12:21:14] -- Remote UNIX connection
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
100/100 (Unspecified) D Yes Yes 0 Unmonitored
101/101 (Unspecified) D Yes Yes 0 Unmonitored
102/102 (Unspecified) D Yes Yes 0 Unmonitored
MovistarIn/949xxxxxx 10.31.255.134 Yes Yes 5060 Unmonitored
MovistarOut (Unspecified) Yes Yes 0 Unmonitored
5 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 4 offline]
[Jul 26 12:21:14] -- Remote UNIX connection disconnected
Asterisk ending (0).
My Asterisk output to sip show peer MovistarOut
is:
[12:43:06] INFO: Executing command from stdin: asterisk -rx 'sip show peer MovistarOut'
[Jul 26 12:43:06] -- Remote UNIX connection
* Name : MovistarOut
Description :
Secret : <Set>
MD5Secret : <Not set>
Remote Secret: <Not set>
Context : unauthenticated
Record On feature : automon
Record Off feature : automon
Subscr.Cont. : <Not set>
Language : es
Tonezone : <Not set>
AMA flags : Unknown
Transfer mode: open
CallingPres : Presentation Allowed, Not Screened
FromUser : 949xxxxxx
FromDomain : telefonica.net Port 5060
Callgroup :
Pickupgroup :
Named Callgr :
Nam. Pickupgr:
MOH Suggest :
Mailbox :
VM Extension : asterisk
LastMsgsSent : 0/0
Call limit : 2147483647
Max forwards : 0
Dynamic : No
Callerid : "" <>
MaxCallBR : 384 kbps
Expire : -1
Insecure : port,invite
Force rport : Yes
Symmetric RTP: Yes
ACL : No
ContactACL : No
DirectMedACL : No
T.38 support : No
T.38 EC mode : Unknown
T.38 MaxDtgrm: 4294967295
DirectMedia : No
PromiscRedir : No
User=Phone : No
Video Support: No
Text Support : No
Ign SDP ver : No
Trust RPID : Yes
Send RPID : No
Path support : No
Path : N/A
TrustIDOutbnd: Legacy
Subscriptions: Yes
Overlap dial : Yes
Outb. proxy : 10.31.255.134
DTMFmode : auto
Timer T1 : 500
Timer B : 32000
ToHost : telefonica.net
Addr->IP : (null)
Defaddr->IP : (null)
Prim.Transp. : UDP
Allowed.Trsp : UDP
Def. Username:
SIP Options : (none)
Codecs : (ulaw|alaw)
Auto-Framing : No
Status : Unmonitored
Useragent :
Reg. Contact :
Qualify Freq : 60000 ms
Keepalive : 0 ms
Sess-Timers : Accept
Sess-Refresh : uas
Sess-Expires : 1800 secs
Min-Sess : 90 secs
RTP Engine : asterisk
Parkinglot :
Use Reason : No
Encryption : No
RTCP Mux : No
[Jul 26 12:43:06] -- Remote UNIX connection disconnected
Asterisk ending (0).
And finally, my response to issuing the command for dialing to my cellphone is:
[12:45:07] INFO: Executing command from stdin: asterisk -rx 'originate SIP/MovistarOut/686xxxxxx application Playback tt-monkeys'
[Jul 26 12:45:07] -- Remote UNIX connection
[Jul 26 12:45:07] -- Remote UNIX connection disconnected
Asterisk ending (0).
It is strange that the system is not displaying any relevant error or response. Of course, a call is not received.
That’s basically all the information I can share. I have read similar topics with this telco provider in some forums with similar topics. However, I haven’t found any definitive solution anywhere. I’d appreciate very much if someone can give a solution, any suggestion or help to move forward at least. Thanks!
Sésar
EDIT: After enabling SIP debug, I get the following response upon issuing the originate
command as per above:
[13:40:49] INFO: Executing command from stdin: asterisk -rx 'originate SIP/MovistarOut/686xxxxxx application Playback tt-monkeys'
[Jul 26 13:40:49] -- Remote UNIX connection
[Jul 26 13:40:49] -- Remote UNIX connection disconnected
Asterisk ending (0).
[Jul 26 13:40:50] Really destroying SIP dialog '3f0166d931a97b7f791b9ebe7dd9330b@172.30.32.1:5260' Method: INVITE
[Jul 26 13:41:02] NOTICE[464]: chan_sip.c:15891 sip_reregister: -- Re-registration for 949xxxxxx@10.31.255.134
[Jul 26 13:41:02] REGISTER 11 headers, 0 lines
[Jul 26 13:41:02] Reliably Transmitting (NAT) to 10.31.255.134:5070:
[Jul 26 13:41:02] REGISTER sip:telefonica.net SIP/2.0
[Jul 26 13:41:02] Via: SIP/2.0/UDP 192.168.0.100:5260;branch=z9hG4bK63c6aa0e;rport
[Jul 26 13:41:02] Max-Forwards: 70
[Jul 26 13:41:02] From: <sip:949xxxxxx@telefonica.net>;tag=as0658d1ee
[Jul 26 13:41:02] To: <sip:949xxxxxx@telefonica.net>
[Jul 26 13:41:02] Call-ID: 5646b04202c76a9248514535241b67a4@172.30.32.1
[Jul 26 13:41:02] CSeq: 190 REGISTER
[Jul 26 13:41:02] Supported: replaces, timer
[Jul 26 13:41:02] User-Agent: Asterisk PBX 20.2.1
[Jul 26 13:41:02] Expires: 120
[Jul 26 13:41:02] Contact: <sip:s@192.168.0.100:5260>
[Jul 26 13:41:02] Content-Length: 0
[Jul 26 13:41:02]
[Jul 26 13:41:02]
[Jul 26 13:41:02] ---
[Jul 26 13:41:02]
[Jul 26 13:41:02] <--- SIP read from UDP:10.31.255.134:5070 --->
[Jul 26 13:41:02] SIP/2.0 200 OK
[Jul 26 13:41:02] Via: SIP/2.0/UDP 192.168.0.100:5260;received=10.29.1.241;branch=z9hG4bK63c6aa0e;rport=5260
[Jul 26 13:41:02] From: <sip:949xxxxxx@telefonica.net>;tag=as0658d1ee
[Jul 26 13:41:02] To: <sip:949xxxxxx@telefonica.net>;tag=aprqv2ii1gecd3pa6-legtm500000sb
[Jul 26 13:41:02] Call-ID: 5646b04202c76a9248514535241b67a4@172.30.32.1
[Jul 26 13:41:02] CSeq: 190 REGISTER
[Jul 26 13:41:02] P-Associated-URI: <sip:949xxxxxx@telefonica.net>
[Jul 26 13:41:02] P-Associated-URI: <tel:+34949xxxxxx>
[Jul 26 13:41:02] P-Associated-URI: <sip:f2018009635772_1@telefonica.net>
[Jul 26 13:41:02] Contact: <sip:s@192.168.0.100:5260>;expires=70
[Jul 26 13:41:02] Contact: <sip:949xxxxxx@10.29.3.206:5060;transport=udp>;expires=3588
[Jul 26 13:41:02] Service-Route: <sip:s@10.31.255.134:5070;transport=udp;lr>
[Jul 26 13:41:02] Content-Length: 0
[Jul 26 13:41:02]
[Jul 26 13:41:02] <------------->
[Jul 26 13:41:02] --- (13 headers 0 lines) ---
[Jul 26 13:41:02] NOTICE[464]: chan_sip.c:24963 handle_response_register: Outbound Registration: Expiry for 10.31.255.134 is 70 sec (Scheduling reregistration in 55 s)
[Jul 26 13:41:02] Really destroying SIP dialog '5646b04202c76a9248514535241b67a4@172.30.32.1' Method: REGISTER