Nat – Can’t get voice after changing Asterisk UDP port

asterisknat;sip

Test environment consists of a CSipSimple client, Asterisk server and a router with NAT. Formerly the equipment used UDP port 5060 and everything was good. Then I changed port number to 15000 in Asterisk, in router's forwarding rule and in client app. Now, when accessing the net from outside, client can register, but when it calls some extension, Asterisk complains about inability to create DAHDI channel. When client is in the LAN, calls are working.

What went wrong? I changed only control port number.

Update

At first place I need to mention that Asterisk always complains about inability to create DAHDI channel when I am calling extension number 100, no matter whether the voice works or not. So, this error message could be ignored.

Now, the differing tails of verbose call logs:

Mobile client registered over 3G, no sound (call, pickup, timeout):

-- SIP/103-00000001 answered SIP/101-00000000
   > 0x7fda800295a0 -- Probation passed - setting RTP source address to 192.168.1.100:5062

That's all. No further messages.

Mobile client registered over WiFi, sound works (call, pickup, conversation, hangup):

  -- SIP/103-00000003 answered SIP/101-00000002
     > 0x7fda88026620 -- Probation passed - setting RTP source address to 192.168.1.100:5062
     > 0x7fda78013fb0 -- Probation passed - setting RTP source address to 192.168.1.112:4000
     > 0x7fda78013fb0 -- Probation passed - setting RTP source address to 192.168.1.112:4000
  -- Executing [h@macro-dial-one:1] Macro("SIP/101-00000002", "hangupcall,") in new stack
  -- Executing [s@macro-hangupcall:1] GotoIf("SIP/101-00000002", "1?theend") in new stack
  -- Goto (macro-hangupcall,s,3)
  -- Executing [s@macro-hangupcall:3] ExecIf("SIP/101-00000002", "0?Set(CDR(recordingfile)=)") in new stack
  -- Executing [s@macro-hangupcall:4] Hangup("SIP/101-00000002", "") in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/101-00000002' in macro 'hangupcall'
== Spawn extension (macro-dial-one, h, 1) exited non-zero on 'SIP/101-00000002'
== Spawn extension (macro-dial-one, s, 43) exited non-zero on 'SIP/101-00000002' in macro 'dial-one'
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on 'SIP/101-00000002' in macro 'exten-vm'
== Spawn extension (from-internal, 103, 2) exited non-zero on 'SIP/101-00000002'

Best Answer

I suspect your SIP port is now in the RTP range, so Asterisk doesn't realize this is a SIP connection. Either move the SIP port or move the RTP port range so they don't overlap.

Please capture the CLI output of a failed call (off LAN) and a succesfull call (on LAN) and post the results here.


To capture the CLI output, from the bash prompt:

asterisk -r
core set verbose 10

Then make a call from your LAN which works, Then make a call from outside your LAN which fails Post the full output of the above (I assume you have a simple dialplan). I you are using a canned PBX like Elastix or FreePBX the output may be too long to post here...