Unable to hear ringing signal when calling out on SIP trunk

I am running an AsteriskNow server with 10 IAX2 extensions (located in different countries). I am able to call make calls between my extensions without any problems. My asterisk server is behind a NAT router, and I’m using a non-default bind port for listening to IAX (my IAX2 port is not 4569). I have the appropriate firewall/port forwarding setup so that my clients can connect to my box from the outside.

I decided to take it up a notch by giving my clients the ability to make external calls to regular phone numbers. I registered with a reputable VoIP provider and got a DID. I set up a SIP trunk, and outbound/inbound routes on Asterisk. Subsequently, I was able to make/receive calls from by IAX2 extensions. (Most providers only provide SIP)

However I do have a problem:

When calling out, I do not get a ringing tone. I only hear silence when the remote phone starts to ring. When the remote phone answers the call, the call goes ahead smoothly.

This is an annoyance more than anything else, since the called party may answer their phone after several rings, and all I hear is silence.

Troubleshooting:

  1. I tried connecting to my VoIP provider direclty with a Softphone (Zoiper) - initially, I faced the same issue,then I enabled “Use RPORT for Media” option, and was successful in hearing the ring signal. However, I’m having difficulty finding the equivalent setting in Asterisk.

  2. I have tried all the different NAT modes in Asterisk’s Advanced SIP Settings (Yes/No/Never/route), with no success.

  3. Finally, I created a new SIP extension on asterisk (this is my only SIP extension, all others are IAX2), and then tried calling out. In this scenario, I was able to make a successful call with ring signal, etc.

I know the obvious answer is, switch all my extensions to SIP, but it will be hard for me to get all my clients change (for a variety of reasons). I would like to continue the same arrangement (IAX2 extensions + SIP Trunk) and also get ring signals. Is there some special settings to interface IAX2 and SIP in Asterisk?

Fun logs -

I set RTP debug ON. Here’s a log snippet of a call I made from my IAX extension (IAX2/101) to an external phone number.

        -- Executing [s@macro-dialout-trunk:18] GotoIf("IAX2/101-14509", "0?bypass,1") in new stack
        -- Executing [s@macro-dialout-trunk:19] ExecIf("IAX2/101-14509", "1?Set(CONNECTEDLINE(num,i)=13034997111)") in new stack
        -- Executing [s@macro-dialout-trunk:20] ExecIf("IAX2/101-14509", "1?Set(CONNECTEDLINE(name,i)=CID:1403xxxxxxx)") in new stack
        -- Executing [s@macro-dialout-trunk:21] GotoIf("IAX2/101-14509", "0?customtrunk") in new stack
        -- Executing [s@macro-dialout-trunk:22] Dial("IAX2/101-14509", "SIP/callwithus/13034997111,300,Tt") in new stack
      == Using SIP RTP TOS bits 184
      == Using SIP RTP CoS mark 5
        -- Called SIP/callwithus/13034997111
        -- SIP/callwithus-00000009 is making progress passing it to IAX2/101-14509
        -- SIP/callwithus-00000009 answered IAX2/101-14509
        -- Channel IAX2/101-14509 joined 'simple_bridge' basic-bridge <47977ee6-7f2d-47db-8f59-34cb53215a03>
        -- Channel SIP/callwithus-00000009 joined 'simple_bridge' basic-bridge <47977ee6-7f2d-47db-8f59-34cb53215a03>
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014177, ts 000160, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014178, ts 000320, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014179, ts 000480, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014180, ts 000640, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014181, ts 000800, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014182, ts 000960, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014183, ts 001120, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014184, ts 001280, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014185, ts 001440, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014186, ts 001600, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014187, ts 001760, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014188, ts 001920, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014189, ts 002080, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014190, ts 002240, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014191, ts 002400, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014192, ts 002560, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014193, ts 002720, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014194, ts 002880, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014195, ts 003040, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014196, ts 003200, len 000033)
           > 0xb7635c88 -- Probation passed - setting RTP source address to 198.27.70.147:18512
    Got  RTP packet from    198.27.70.147:18512 (type 03, seq 011686, ts 100000, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014197, ts 003360, len 000033)
    Got  RTP packet from    198.27.70.147:18512 (type 03, seq 011687, ts 100160, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014198, ts 003520, len 000033)
    Sent RTP packet to      198.27.70.147:18512 (type 03, seq 014199, ts 003680, len 000033)
    Got  RTP packet from    198.27.70.147:18512 (type 03, seq 011688, ts 100320, len 000033)[/code]

On the contrary, when I'm dialing out from my SIP extension, this is what I see (successful call):

 [code]   -- Executing [s@macro-dialout-trunk:19] ExecIf("SIP/201-0000000a", "1?Set(CONNECTEDLINE(num,i)=13034997111)") in new stack
    -- Executing [s@macro-dialout-trunk:20] ExecIf("SIP/201-0000000a", "1?Set(CONNECTEDLINE(name,i)=CID:1403xxxxxx)") in new stack
    -- Executing [s@macro-dialout-trunk:21] GotoIf("SIP/201-0000000a", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:22] Dial("SIP/201-0000000a", "SIP/callwithus/13034997111,300,Tt") in new stack
    == Using SIP RTP TOS bits 184
    == Using SIP RTP CoS mark 5
    -- Called SIP/callwithus/13034997111
    -- SIP/callwithus-0000000b is making progress passing it to SIP/201-0000000a
    -- SIP/callwithus-0000000b answered SIP/201-0000000a
    -- Channel SIP/201-0000000a joined 'simple_bridge' basic-bridge <729d535c-c536-4ec9-982e-2d5655c24cf5>
    -- Channel SIP/callwithus-0000000b joined 'simple_bridge' basic-bridge <729d535c-c536-4ec9-982e-2d5655c24cf5>
       > 0xb762dda8 -- Probation passed - setting RTP source address to 192.168.1.67:49826
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055600, ts 3315920772, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028360, ts 3315920768, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055601, ts 3315920932, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055602, ts 3315921092, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055603, ts 3315921252, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028361, ts 3315920928, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028362, ts 3315921088, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028363, ts 3315921248, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055604, ts 3315921412, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028364, ts 3315921408, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055605, ts 3315921572, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028365, ts 3315921568, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055606, ts 3315921732, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055607, ts 3315921892, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028366, ts 3315921728, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028367, ts 3315921888, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055608, ts 3315922052, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055609, ts 3315922212, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028368, ts 3315922048, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028369, ts 3315922208, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055610, ts 3315922372, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028370, ts 3315922368, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055611, ts 3315922532, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055612, ts 3315922692, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028371, ts 3315922528, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028372, ts 3315922688, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055613, ts 3315922852, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055614, ts 3315923012, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028373, ts 3315922848, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055615, ts 3315923172, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028374, ts 3315923008, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028375, ts 3315923168, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055616, ts 3315923332, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055617, ts 3315923492, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028376, ts 3315923328, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028377, ts 3315923488, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055618, ts 3315923652, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055619, ts 3315923812, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028378, ts 3315923648, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028379, ts 3315923808, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055620, ts 3315923972, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055621, ts 3315924132, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055622, ts 3315924292, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055623, ts 3315924452, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028380, ts 3315923968, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028381, ts 3315924128, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028382, ts 3315924288, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028383, ts 3315924448, len 000033)
           > 0xb763d570 -- Probation passed - setting RTP source address to 198.27.70.147:22320
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032968, ts 100320, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056916, ts 100320, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032969, ts 100480, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056917, ts 100480, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032970, ts 100640, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056918, ts 100640, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032971, ts 100800, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056919, ts 100800, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055624, ts 3315924612, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055625, ts 3315924772, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028384, ts 3315924608, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028385, ts 3315924768, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032972, ts 100960, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056920, ts 100960, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032973, ts 101120, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056921, ts 101120, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055626, ts 3315924932, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055627, ts 3315925092, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028386, ts 3315924928, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028387, ts 3315925088, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032974, ts 101280, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056922, ts 101280, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032975, ts 101440, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056923, ts 101440, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055628, ts 3315925252, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055629, ts 3315925412, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028388, ts 3315925248, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028389, ts 3315925408, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032976, ts 101600, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056924, ts 101600, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032977, ts 101760, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056925, ts 101760, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055630, ts 3315925572, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055631, ts 3315925732, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028390, ts 3315925568, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028391, ts 3315925728, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032978, ts 101920, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056926, ts 101920, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032979, ts 102080, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056927, ts 102080, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055632, ts 3315925892, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055633, ts 3315926052, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028392, ts 3315925888, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028393, ts 3315926048, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032980, ts 102240, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056928, ts 102240, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032981, ts 102400, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056929, ts 102400, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055634, ts 3315926212, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055635, ts 3315926372, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028394, ts 3315926208, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028395, ts 3315926368, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032982, ts 102560, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056930, ts 102560, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032983, ts 102720, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056931, ts 102720, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055636, ts 3315926532, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055637, ts 3315926692, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028396, ts 3315926528, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028397, ts 3315926688, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032984, ts 102880, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056932, ts 102880, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032985, ts 103040, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056933, ts 103040, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055638, ts 3315926852, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028398, ts 3315926848, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032986, ts 103200, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056934, ts 103200, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032987, ts 103360, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056935, ts 103360, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055639, ts 3315927012, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055640, ts 3315927172, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028399, ts 3315927008, len 000033)
    Sent RTP packet to      198.27.70.147:22320 (type 03, seq 028400, ts 3315927168, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032988, ts 103520, len 000033)
    Got  RTP packet from    198.27.70.147:22320 (type 03, seq 032989, ts 103680, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056936, ts 103520, len 000033)
    Sent RTP packet to      192.168.1.67:49826 (type 03, seq 056937, ts 103680, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055641, ts 3315927332, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055642, ts 3315927492, len 000033)
    Got  RTP packet from    192.168.1.67:49826 (type 03, seq 055643, ts 3315927652, len 000033)
  1. “making progress passing it to SIP/201-0000000a” - you must explicitly call the Progress application for Asterisk to pass through early media.

  2. they are on the nat= options.

  3. There is no “Advanced Options” setting in Asterisk - that must be some other software, e.g. FreePBX - and the options you mention are deprecated.

Hi David55, Thanks for the reply.

Doesn’t that line in the log mean that Progress() has been called?

My bad… I meant FreePBX Advanced settings.

I was still trying to troubleshoot this issue, and I tried giving my SIP trunk the dial option ‘Ttr’ (default was ‘Tt’).

This sort of helps, as the user at least hears a ring instead of silence.

However, I have read that this can be a false positive as as described in the following link:

voip-info.org/wiki/view/Asterisk+cmd+Dial

quoting from the link above: