SOLVED Problem connecting FritzBox client

Discussion in 'Clients' started by CyberneticianDave, Mar 9, 2018.

  1. CyberneticianDave

    CyberneticianDave New Member

    Joined:
    Mar 9, 2018
    Messages:
    10
    Likes Received:
    1
    Hi

    New here! I've tinkered with Asterisk in the past but never gone the whole hog, this time I'm trying to go all in.

    I've got IncrediblePBX 13 running on a CentOS 6.9 guest on my FreeNAS box.

    I've managed to create a couple of trunks, routes and extensions. I've got my landline coming in by connecting to my FritzBox 7490 as a trunk, which is great. But I'd like to use the handsets connected to the FritzBox as extensions.

    As far as I can tell, and according to https://www.luxgruppe.de/tech/?p=261 (which I only found thanks to this forum) it should be as straightforward as creating SIP extensions in Incredible PBX and then adding them as "Telephone Numbers" in FritzBox. Except I can't seem to get it to work.

    Here's my settings on the Fritz!Box. I'm just trying using the default extension on Incredible at the moment.

    Telephone provider: Other
    Telephone Number for Registration: 701 (extension in asterisk)
    Internal Telephone Number in the FRITZ!Box: 701 (not sure I understand this field tbh)
    Username: 701
    Password: ****
    Registrar: 192.168.178.55

    It doesn't connect and the Fritz event log says "Registration of Internet telephone number 701 failed. Reason for error: Remote site not responding. Timeout."

    There's nothing obvious in the asterisk logs, it's almost as if the connection is being rejected by the firewall on IncrediblePBX. I can connect to the same extension using a softphone, so it's allowed to access within the network. I can see that other people have gotten this to work, so I must just be missing something. Does anyone have any hints?
     
  2. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,172
    Likes Received:
    2,391
    Have you whitelisted the IP address of your FritzBox on Incredible PBX: /root/add-ip fritz fritz-ip-address
     
  3. CyberneticianDave

    CyberneticianDave New Member

    Joined:
    Mar 9, 2018
    Messages:
    10
    Likes Received:
    1
    I did try that. Is there anything else I might need to do after whitelisting it?
     
  4. CyberneticianDave

    CyberneticianDave New Member

    Joined:
    Mar 9, 2018
    Messages:
    10
    Likes Received:
    1
    Quick thought, I have a feeling the Fritz box may use some reserved IP addresses for the SIP and DECT handsets. So the request may not be coming from the IP I'm expecting. It's there any way to see the failed requests to the server?
     
  5. CyberneticianDave

    CyberneticianDave New Member

    Joined:
    Mar 9, 2018
    Messages:
    10
    Likes Received:
    1
    So I tried iptables -I INPUT 1 -j LOG but I don't ever see the requests hitting the pbx server. So I'm clearly doing something wrong at the fritzbox end. Back to the drawing board.
     
  6. Dr. Kupka

    Dr. Kupka New Member

    Joined:
    Jul 3, 2013
    Messages:
    15
    Likes Received:
    3
    You have to put in the Fritzbox TRUNK (!) settings (section PEER Details AND as well USER Details):

    Code:
    qualifyfreq=600
    EXTENSIONS settings:

    qualifyfreq: 600

    Restart Fritzbox.
     
  7. CyberneticianDave

    CyberneticianDave New Member

    Joined:
    Mar 9, 2018
    Messages:
    10
    Likes Received:
    1
    Happy to try that, but I'm able to connect to the Fritzbox as a trunk, it's using the Fritzbox as an extension on the asterisk box in struggling with. The requests from the Fritzbox don't seem to be reaching the asterisk box at all.
     
  8. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,172
    Likes Received:
    2,391
    Have you tried disabling the firewall temporarily to see if you can connect from extensions??
     
  9. CyberneticianDave

    CyberneticianDave New Member

    Joined:
    Mar 9, 2018
    Messages:
    10
    Likes Received:
    1
    Good plan. Is there an easy way to temporarily do that?
     
  10. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,172
    Likes Received:
    2,391
    Stop IPtables: service iptables stop
    Restart: iptables-restart
     
  11. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,172
    Likes Received:
    2,391
    If it works, look in /var/log/asterisk/full and decipher the IP addresses of the extensions and then WhiteList those additional addresses. Son't forget to restart IPtables!!
     
  12. CyberneticianDave

    CyberneticianDave New Member

    Joined:
    Mar 9, 2018
    Messages:
    10
    Likes Received:
    1
    Great news. I think it's down to the use of port 5060.

    So I had been testing with the default chan_sip extension, but I decided to try with one of the pjsip extensions I had created. I can't remember why I thought it would be different, but it was.

    I got some messages in the log, at last, but unfortunately not good ones. I started off with something like: AOR ‘401’ not found for endpoint ‘asterisk-fritzbox’ which lead me to changing the PJSIP setting endpoint_identifier_order to username,ip,anonymous, which allows the fritzbox to make an attempt at registering. Great!

    The reason I'm relatively confident it's the port number is that changing the PJSIP port to 5060 returns me to the previous state of hearing nothing from the fritzbox.

    Unfortunately I'm now stuck again, I'm now getting: res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '<sip:401@192.168.178.55>' failed for '192.168.178.1:5060' (callid: 1C2EC0D40D6B1F69@192.168.178.1) - Failed to authenticate

    This, as far as I can tell from my googling, seems to be because the fritzbox is requesting from port 5060 and PJSIP is on 5061. I'm a bit stuck now, I can't think of any way around that. Fritzbox won't talk to asterisk on 5060, but it also won't allow the selection of another port, apparently.

    You've all been a great help so far. Got any ideas how I can get around this one?
     
  13. Dr. Kupka

    Dr. Kupka New Member

    Joined:
    Jul 3, 2013
    Messages:
    15
    Likes Received:
    3
    Did you try :

    Registrar: 192.168.178.55:5061
     
  14. CyberneticianDave

    CyberneticianDave New Member

    Joined:
    Mar 9, 2018
    Messages:
    10
    Likes Received:
    1
    Sorry, yes, I omitted that from my update. Registrar in FritzBox is set to 192.168.178.55:5061, but the REGISTER request is still coming from 192.168.178.1:5060.
     
  15. CyberneticianDave

    CyberneticianDave New Member

    Joined:
    Mar 9, 2018
    Messages:
    10
    Likes Received:
    1
    SUCCESS!

    I deleted the internet telephone provider and re-added it as a "SIP trunking with various numbers" (but only added the single number). Hey presto, it connects!

    Now to add all the other extensions.

    Thanks so much for all the help guys, you really are the best asterisk forum I've ever come across!
     
    wardmundy likes this.

Share This Page