[asterisk-users] Cannot originate to extension unless /etc/hosts is edited constantly?

Stefan Viljoen viljoens at verishare.co.za
Tue Jan 15 10:29:50 CST 2019


Hi Guys

I've run into a weird problem on Asterisk 13. Again something that worked fine on 1.8 but is now broken on Asterisk 13.

I have an extension 3015. I'm trying to originate a recording playback call on it via AMI by sending

Action: Originate
ActionID: test
Channel: SIP/3015
Exten: 7777
Context: local
Priority: 1
CallerID: 3015
Account: recordinglisten
ChannelID: abc
OtherChannelID: def
Variable: CallLimit=3600,recfile=/var/spool/asterisk/monitor/1807/25/2507180836591192526,altfile=/var/spool/asterisk/monitor/archive/1807/25/2507180836591192526
Async: true

My dialplan code:

exten=>7777,1,Answer()
exten=>7777,n,NoOp(Requesting File ${recfile})
exten=>7777,n,Set(${__recfile}=${recfile})
exten=>7777,n,Set(${__altfile}=${altfile})
exten=>7777,n,NoOp(Rec file set to ${recfile})
exten=>7777,n,NoOp(Alt file set to ${altfile})
exten=>7777,n,NoOp(Requesting Alt File ${altfile})
exten=>7777,n,Set(__numbertarget=7777)
exten=>7777,n(play),ControlPlayback(${recfile},20000,6,4,8,5,9)
exten=>7777,n(play2),ControlPlayback(${altfile},20000,6,4,8,5,9)
exten=>7777,n,hangup()

However, on sending the above to the AMI I get in the console of Asterisk 13:

[Jan 15 18:19:23] ERROR[10519]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo("local", "(null)", ...): Name or service not known
[Jan 15 18:19:23] WARNING[10519]: chan_sip.c:6316 create_addr: No such host: local

and no recording playback takes place.

I've found that by editing /etc/hosts and adding

172.56.4.11  local

where 172.56.4.11 is the phone SIP/3015's IP address, it works perfectly and the recording starts playing once 3015 is answered.

On Asterisk 1.8 the above worked without having to constantly edit /etc/hosts and having to constantly map and remap the one phone that is then capable of playing back a recording.

This appears to be some kind of DNS / name resolution issue exclusive to Asterisk 13 (for me) - how can I fix this, e. g. NOT get

[Jan 15 18:19:23] ERROR[10519]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo("local", "(null)", ...): Name or service not known
[Jan 15 18:19:23] WARNING[10519]: chan_sip.c:6316 create_addr: No such host: local

and constantly having to edit /etc/hosts to get one of my phones (the one tied to "local") to be able to play back a recording on Asterisk 13?

(This obviously is fatal anyway as I got lots of phones on which I want to playback recordings and editing /etc/hosts for each phone is impossible if two phones want to listen to different recordings at the same time- /etc/hosts can only contain one "local").

How can I fix this?

Thanks

Stefan




More information about the asterisk-users mailing list