SIP trunk username mismatch

Discussion in 'General' started by reliable, Oct 20, 2010.

  1. reliable

    Joined:
    Oct 14, 2010
    Messages:
    13
    Likes Received:
    0
    I have 2.0 running. My goal is to have incoming and outbound voice calls and faxing working concurrently.
    Initially, I had an IAX trunk set up and voice calls successfully completed but faxing did not work. To fix this issue, I modified the iax_general_custom.conf file from calltokenoptional = 64.136.174.24/255.255.255.0 to calltokenoptional = 127.0.0.1/255.255.255.0. This fixed faxing but broke voice calls.
    So, my thinking was this: use a SIP trunk for voice and I'd be able to make the necessary modifications for IAX without breaking my voice call functionality.
    I have the SIP trunk set up and working for outbound calling, however; incoming calls do not complete. The carrier is seeing "401 unauthorized" and I am seeing on my end: "chan_sip.c: username mismatch, have <SIP>, digest has <MY_USERNAME>"
    I have verified that the carrier has the same username that I have listed in my incoming settings for my trunk. Obviously, the carrier is not helping me any further because once they receive the "401", the finger gets pointed to my hardware.
    I have made the following changes to no avail:
    1)allowed anonymous sip callers(temporarily)
    2)modified the host setting for incoming setting on trunk to reflect the carrier's IP rather than the domain name.
    3)in incoming settings, changed "context=from-trunk" to context=default

    I'm happy to send along any further logs that might be needed if anyone might be able give this noob a helping hand!!
     
  2. trymes

    Joined:
    Aug 19, 2009
    Messages:
    228
    Likes Received:
    0
    The easiest way might be this:

    1.) Remove the "calltokenoptional" setting from iax_general_custom.conf
    2.) Open Unembedded FreePBX
    3.) Click on Tools in the Left hand menu
    4.) Click on the "Asterisk IAX Settings" module
    5.) At the bottom, under "Other IAX Settings", type "calltokenoptional" before the equal sign and "64.136.174.24/255.255.255.0" after the equal sign.
    6.) Click Add Field.
    7.) Add another calltokenoptional line, this time for "127.0.0.1/255.255.255.0"
    8.) Click Submit Changes, then apply changes and reload.

    You will end up with two calltokenoptional lines and they will be entered via the GUI, as they really ought to be. Also, if you only want to permit the single host 64.136.174.24 to talk to your machine, you might consider changing the subnet mask to 255.255.255.255.

    Tom
     
  3. reliable

    Joined:
    Oct 14, 2010
    Messages:
    13
    Likes Received:
    0
    Hey Tom, firstly thanks for the reply. Secondly, I'm still having issues after implementing your suggestions. I set up a virtual fax and pointed it towards an IAX2 extension as well(extension 400). When I dial it (400) locally from a SIP extension, I get fax tones as I would expect. When I set up the inbound route to point towards it (or any other extension for that matter) I get a busy tone. I turned IAX2 debugging on and attached the pertinent call info from the FULL log. Would you mind taking a look and letting me know what you think? Thanks

    I highlighted in red the line where I think the problem is occurring.
     
  4. reliable

    Joined:
    Oct 14, 2010
    Messages:
    13
    Likes Received:
    0
  5. reliable

    Joined:
    Oct 14, 2010
    Messages:
    13
    Likes Received:
    0
    Tom, here are my incoming settings for my trunk too, just in case it might help:

    username=<my username>
    user=<my username>
    type=friend
    secret=my secret>
    insecure=very
    host=64.136.174.24
    disallow=all
    context=from-trunk
    allow=ulaw
     
  6. reliable

    Joined:
    Oct 14, 2010
    Messages:
    13
    Likes Received:
    0
    You still there Tom? I could use some help still if you're so inclined:)
     
  7. trymes

    Joined:
    Aug 19, 2009
    Messages:
    228
    Likes Received:
    0
    Sorry for the delay...

    So, basically, everything works besides incoming IAX calls?

    You obviously have an authentication problem, so you're going to need to see which part is giving you issues. To start, what is 400? Is that your fax extension?

    Here's how I would proceed:

    Direct the incoming IAX extension to a known working phone and see if the call goes through.
    - If not, you likely have a problem with your incoming IAX. Check usernames, passwords, and registration strings.
    - If it does work, then you have a problem somewhere in your config where it passes the incoming call to the fax extension.

    The basic idea here is to separate the incoming call portion from the fax reception portion. Make sure you can make an incoming call when you direct it to a phone. Then call the virtual fax extension from a phone and see if it works. Finally, direct the incoming route to the virtual fax extension (don't use fax detection).

    Tom
     
  8. reliable

    Joined:
    Oct 14, 2010
    Messages:
    13
    Likes Received:
    0
    I have done all of what you suggested already with the same line of thinking that you have- separate as much as possible to find where the problem originates.

    Ext 400 is my virtual fax that I created. I can dial it internally and get fax tones as expected. When directing incoming calls to a different extension that is known to work, the result is the same.

    With those results, one would assume that the issue is with the trunk itself. More specifically, with the incoming authentication on the IAX trunk. However; the username and password for incoming and outbound are exactly the same and have been triple checked. The registration string has been triple checked and outbound calls terminate fine.

    :( I am at a loss.
     
  9. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    ensure you have

    calltokenoptional=127.0.0.1

    somewhere in your /etc/asteris/iax.conf tree or you won't be able to connect to your hylafax iaxmodems.
     
  10. trymes

    Joined:
    Aug 19, 2009
    Messages:
    228
    Likes Received:
    0
    To expand on dicko's suggestion, and clarify my earlier post about that same thing, the best way (IMHO) to accomplish this is to open Unembedded FreePBX, click on the Tools tab, and open the "Asterisk IAX Settings" module. Then make entries at the end that look something like this:
    [​IMG]

    HTH,

    Tom
     
  11. reliable

    Joined:
    Oct 14, 2010
    Messages:
    13
    Likes Received:
    0
    Dicko and Tom;

    yes, the argument for calltokenoptional has been added via the Free PBX GUI. I added the argument for the local host and also for the ISP.
     
  12. trymes

    Joined:
    Aug 19, 2009
    Messages:
    228
    Likes Received:
    0
    You mention ISP, not ITSP, so just to double check:

    Did you add an entry for the server with which you are registering, or did you add an entry for your server's external IP Address?

    Tom
     
  13. reliable

    Joined:
    Oct 14, 2010
    Messages:
    13
    Likes Received:
    0
    I added the external public IP of the IAX trunk provider's server.
     
  14. reliable

    Joined:
    Oct 14, 2010
    Messages:
    13
    Likes Received:
    0
    Any further suggestions guys?
     

Share This Page