S
S
Sergey Ryzhkin2017-02-19 09:29:10
Asterisk
Sergey Ryzhkin, 2017-02-19 09:29:10

Asterisk and Rostelecom, how to overcome outgoing (sip registration)?

Colleagues, there is a number from Rostelecom (there will be a couple more, but I'm testing with one). Provided username and password. I created a context with the required data:

[authentication]

[r_213162]
type=friend
host=10.10.10.100
port=5060
nat=no
fromdomain=10.10.10.100
insecure=invite,port
disallow=all
allow=alaw
allow=ulaw
dtmfmode=auto
secret=******
defaultuser=213162
fromuser=213162
callbackextension=213162
context=incoming
qualify=300
directmedia=no


The dialplan is also not complicated:
[general]
static=yes
writeprotect=no

[globals]

[default]
;Pick phone
[handup-sip]
exten => _X!,1,HangUp()

;Dial plan "Outcoling"
[outcoling]
exten => 900,1,Answer()
exten => 900,n,ConfBridge(1,confer)
exten => _XXX,1,Dial(SIP/${EXTEN},15,t)
exten => _XXX.,1,Dial(SIP/${EXTEN}@r_213162)
include => handup-sip

;Dial plan "Incoming"
[incoming]
exten => 213162,1,Dial(SIP/105)


But sip does not want to register all the time an error is written:
[Feb 19 09:13:02] WARNING[2355]: chan_sip.c:15937 transmit_register: Probably a DNS error for registration to [email protected], trying REGISTER again (after 20 seconds)
[Feb 19 09:13:22] WARNING[2355]: chan_sip.c:15937 transmit_register: Probably a DNS error for registration to [email protected], trying REGISTER again (after 20 seconds)
[Feb 19 09:13:22] NOTICE[2355]: chan_sip.c:15766 sip_reg_timeout:    -- Registration for '[email protected]' timed out, trying again (Attempt #2)


And if you try to call outgoing, then with asterisk -rvvvv in the logs the following:
Connected to Asterisk 13.14.0 currently running on voip (pid = 1541)
  == Using SIP RTP CoS mark 5
    -- Executing [8*******[email protected]:1] Dial("SIP/105-0000000a", "SIP/8*******[email protected]_213162") in new stack
[Feb 19 09:11:06] WARNING[17606][C-00000005]: app_dial.c:2525 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'SIP/105-0000000a' status is 'CHANUNAVAIL'


In the Internet, everyone says that this error is due to "callbackextension", I don't understand where I have DNS when I entered all the addresses with IPs. There's not even anything to debunk here.

UPD #01 :
Replaced Friend type with Peer in sip.conf, here's the result:
externaddr = 10.*******
;local network
localnet = 192.168.50.0/24
localnet = 10.10.0.0/16
localnet = 10.9.0.0/16
;RU sound
language=ru
context=default
allowoverlap=no
udpbindaddr=0.0.0.0
tcpenable=no
tcpbindaddr=0.0.0.0
transport=udp
srvlookup=yes
allowguest=no
limitonpeers=yes
alwaysauthreject=yes

defaultexpiry=300
minexpiry=300
maxexpiry=3600

[authentication]

[r_213162]
type=peer
host=10.10.10.100
nat=no
insecure=invite,port
disallow=all
allow=alaw
allow=ulaw
dtmfmode=auto
secret=********
defaultuser=213162
trunkname=213162
fromuser=213162
callbackextension=213162
context=incoming
directmedia=nonat


The error with the DNS has disappeared, BUT sometimes I call from the outside, I dial normally, but there is silence in the tubes. And if I try to call externally, then the call goes on, there are beeps, but it does not come to the cellular call, as if the call is going nowhere.

This is in the log when I call from external to internal and silence on the phone:
== Using SIP RTP CoS mark 5
    -- Executing [[email protected]:1] Dial("SIP/r_213162-00000000", "SIP/105") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/105
    -- SIP/105-00000001 is ringing
    -- SIP/105-00000001 answered SIP/r_213162-00000000
    -- Channel SIP/105-00000001 joined 'simple_bridge' basic-bridge <f5c11c0d-fee9-41d1-a023-ccf65b70bd3f>
    -- Channel SIP/r_213162-00000000 joined 'simple_bridge' basic-bridge <f5c11c0d-fee9-41d1-a023-ccf65b70bd3f>
       > Bridge f5c11c0d-fee9-41d1-a023-ccf65b70bd3f: switching from simple_bridge technology to native_rtp
       > Remotely bridged 'SIP/r_213162-00000000' and 'SIP/105-00000001' - media will flow directly between them
       > Remotely bridged 'SIP/r_213162-00000000' and 'SIP/105-00000001' - media will flow directly between them
       > 0x7f54c8005b10 -- Probation passed - setting RTP source address to 192.168.50.13:12134
       > 0x7f5400010dc0 -- Probation passed - setting RTP source address to 10.*******:19140
    -- Channel SIP/105-00000001 left 'native_rtp' basic-bridge <f5c11c0d-fee9-41d1-a023-ccf65b70bd3f>
    -- Channel SIP/r_213162-00000000 left 'native_rtp' basic-bridge <f5c11c0d-fee9-41d1-a023-ccf65b70bd3f>
  == Spawn extension (incoming, 213162, 1) exited non-zero on 'SIP/r_213162-00000000'


And this is when the call goes nowhere when calling a cell phone
== Using SIP RTP CoS mark 5
    -- Executing [8*****[email protected]:1] Dial("SIP/105-00000002", "SIP/8******[email protected]_213162") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/@r_213162
       > 0x7f54d00059e0 -- Probation passed - setting RTP source address to 10.********:15972
    -- SIP/r_213162-00000003 is making progress passing it to SIP/105-00000002
       > 0x7f54d00059e0 -- Probation passed - setting RTP source address to 10.********:15972
       > 0x7f5400010dc0 -- Probation passed - setting RTP source address to 192.168.50.13:12138
    -- SIP/r_213162-00000003 is ringing
  == Spawn extension (outcoling, 8*****8, 1) exited non-zero on 'SIP/105-00000002'

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
D
Dmitry Shitskov, 2017-02-19
@Franciz

Judging by the config, you have an asterisk behind NAT. Then on the external trunks it should be:
Secondly, something incomprehensible is going on in your trunk. For what reason such host is specified there? There must be an ip or hostname of Rostelecom

S
silverjoe, 2017-02-20
@silverjoe

And why do you have a network registered in localnet, which includes the address of the telecom operator ????
You thus confuse your Asterisk, it will think that the telecom operator is in the local network, and not in the external one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question