Shoretel SIP Trunking

Discussion in 'General' started by tknman0700, Oct 30, 2009.

  1. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    I am trying to trunk an Elastix box to a Shoretel box... I have this working with other Asterisk distros but cannot seem to figure this one out.

    Here are the peer details for the trunk on Elastix side:
    host=10.1.4.3
    secret=testtest
    type=peer
    username=test

    The context for user is: from-trunk

    Here are the user details for the trunk:
    secret=testtest
    type=user
    username=test

    I have an inbound route set to just ring an extension.

    I can place a call from teh Asterisk box to the Shoretel box but cannot go the other direction. A sip debug shows this..

    <--- SIP read from 10.1.4.3:5060 --->
    INVITE sip:8002@10.1.2.144:5060 SIP/2.0
    Via: SIP/2.0/UDP 10.1.4.3:5060;branch=z9hG4bK3131416112-113812830
    Max-Forwards: 70
    Allow: INVITE,BYE,CANCEL,ACK,INFO,PRACK,COMET,OPTIONS,SUBSCRIBE,NOTIFY,MESSAGE,REFER,REGISTER,UPDATE
    Supported: timer,replaces
    From: Unknown <sip:Unavailable@10.1.4.3:5060>;tag=hssUA_3131416112-113812831
    To: 8002 <sip:8002@10.1.2.144:5060>
    Call-ID: 3131416112-113812829
    CSeq: 1 INVITE
    Session-Expires: 1800;Refresher=uac
    User-Agent: ShoreTel_FSS_SIP_UATK ShoreTel 7
    Contact: Unknown <sip:Unavailable@10.1.4.3:5060>
    Content-Type: application/sdp
    Content-Length: 175

    v=0
    o=ShoreTel 0 12 IN IP4 10.1.4.50
    s=-
    c=IN IP4 10.1.4.50
    t=0 0
    m=audio 3000 RTP/AVP 0 102
    a=rtpmap:0 PCMU/8000/1
    a=rtpmap:102 telephone-event/8000
    a=fmtp:102 0-15

    <------------->
    --- (14 headers 9 lines) ---
    Sending to 10.1.4.3 : 5060 (no NAT)
    Using INVITE request as basis request - 3131416112-113812829
    Found peer 'Test_Sip'

    <--- Reliably Transmitting (no NAT) to 10.1.4.3:5060 --->
    SIP/2.0 407 Proxy Authentication Required
    Via: SIP/2.0/UDP 10.1.4.3:5060;branch=z9hG4bK3131416112-113812830;received=10.1.4.3
    From: Unknown <sip:Unavailable@10.1.4.3:5060>;tag=hssUA_3131416112-113812831
    To: 8002 <sip:8002@10.1.2.144:5060>;tag=as3e0807f1
    Call-ID: 3131416112-113812829
    CSeq: 1 INVITE
    User-Agent: Asterisk PBX
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
    Supported: replaces
    Proxy-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="5f5d3c48"
    Content-Length: 0


    <------------>
    Scheduling destruction of SIP dialog '3131416112-113812829' in 32000 ms (Method: INVITE)
    localhost*CLI>
    <--- SIP read from 10.1.4.3:5060 --->
    ACK sip:8002@10.1.2.144:5060 SIP/2.0
    Via: SIP/2.0/UDP 10.1.4.3:5060;branch=z9hG4bK3131416112-113812830
    Max-Forwards: 70
    From: Unknown <sip:Unavailable@10.1.4.3:5060>;tag=hssUA_3131416112-113812831
    To: 8002 <sip:8002@10.1.2.144:5060>;tag=as3e0807f1
    Call-ID: 3131416112-113812829
    CSeq: 1 ACK
    User-Agent: ShoreTel_FSS_SIP_UATK ShoreTel 7
    Contact: Unknown <sip:Unavailable@10.1.4.3:5060>
    Content-Length: 0


    <------------->
    --- (10 headers 0 lines) ---
    localhost*CLI>
    <--- SIP read from 10.1.4.3:5060 --->
    INVITE sip:8002@10.1.2.144:5060 SIP/2.0
    Via: SIP/2.0/UDP 10.1.4.3:5060;branch=z9hG4bK3131436112-111522848
    Max-Forwards: 70
    Allow: INVITE,BYE,CANCEL,ACK,INFO,PRACK,COMET,OPTIONS,SUBSCRIBE,NOTIFY,MESSAGE,REFER,REGISTER,UPDATE
    Supported: timer,replaces
    From: Unknown <sip:Unavailable@10.1.4.3:5060>;tag=hssUA_3131416112-113812831
    To: 8002 <sip:8002@10.1.2.144:5060>
    Call-ID: 3131416112-113812829
    CSeq: 2 INVITE
    Session-Expires: 1800;Refresher=uac
    User-Agent: ShoreTel_FSS_SIP_UATK ShoreTel 7
    Contact: Unknown <sip:Unavailable@10.1.4.3:5060>
    Content-Type: application/sdp
    Proxy-Authorization: Digest username="test",realm="asterisk",nonce="5f5d3c48",uri="sip:8002@10.1.2.144:5060",response="6fcb5eb60059dc4c4b5887718319cab4",algorithm=MD5
    Content-Length: 175

    v=0
    o=ShoreTel 0 12 IN IP4 10.1.4.50
    s=-
    c=IN IP4 10.1.4.50
    t=0 0
    m=audio 3000 RTP/AVP 0 102
    a=rtpmap:0 PCMU/8000/1
    a=rtpmap:102 telephone-event/8000
    a=fmtp:102 0-15

    <------------->
    --- (15 headers 9 lines) ---
    Sending to 10.1.4.3 : 5060 (no NAT)
    Using INVITE request as basis request - 3131416112-113812829
    Found peer 'Test_Sip'

    <--- Reliably Transmitting (no NAT) to 10.1.4.3:5060 --->
    SIP/2.0 403 Forbidden
    Via: SIP/2.0/UDP 10.1.4.3:5060;branch=z9hG4bK3131436112-111522848;received=10.1.4.3
    From: Unknown <sip:Unavailable@10.1.4.3:5060>;tag=hssUA_3131416112-113812831
    To: 8002 <sip:8002@10.1.2.144:5060>;tag=as3e0807f1
    Call-ID: 3131416112-113812829
    CSeq: 2 INVITE
    User-Agent: Asterisk PBX
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
    Supported: replaces
    Content-Length: 0


    <------------>
    Scheduling destruction of SIP dialog '3131416112-113812829' in 32000 ms (Method: INVITE)
    localhost*CLI>
    <--- SIP read from 10.1.4.3:5060 --->
    ACK sip:8002@10.1.2.144:5060 SIP/2.0
    Via: SIP/2.0/UDP 10.1.4.3:5060;branch=z9hG4bK3131436112-111522848
    Max-Forwards: 70
    Proxy-Authorization: Digest username="test",realm="asterisk",nonce="5f5d3c48",uri="sip:8002@10.1.2.144:5060",response="6fcb5eb60059dc4c4b5887718319cab4",algorithm=MD5
    From: Unknown <sip:Unavailable@10.1.4.3:5060>;tag=hssUA_3131416112-113812831
    To: 8002 <sip:8002@10.1.2.144:5060>;tag=as3e0807f1
    Call-ID: 3131416112-113812829
    CSeq: 2 ACK
    User-Agent: ShoreTel_FSS_SIP_UATK ShoreTel 7
    Contact: Unknown <sip:Unavailable@10.1.4.3:5060>
    Content-Length: 0


    Your help is GREATLY appreciated.
     
  2. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    Register string is test:testtest@10.1.4.3/test
     
  3. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    It will be helpful to know that 8002 is the extension being called from the shoretel to the Asterisk box
     
  4. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    to call 8002 directly from the "from-trunk" context you will need an inbound route to match, if it is an "internal" trunk then it is usually easier to make the context of that trunk "from-internal"
     
  5. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    by changing the context to be test (the username of the trunk) it worked??
     
  6. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    I should say - I took the user details out and made the trunk name be test...
     
  7. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    The trunk has a context (actually two, one for inbound and one for outbound calls (channels)), not the user, in asterisk the context of the caller must be available from the context of the callee. from-trunk cannot see from-internal directly, the extensions are in the from-internal context and can see the trunk, (it is sometimes easier to define the trunk twice, once for inbound calls and once for outbound calls to clarify ones thinking, in your case the calls are in effect security symmetrical, so from-internal on both ends means the shoretel can see things like extensions and conferences more easily.
     
  8. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    I feel really stupid but you lost me.. I am sorry.
     
  9. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    what do you mean by define the trunk twice?

    I added the trunk and left the user details section and context blank.
    I named the trunk test and it started working for incomming calls.

    if I name the trunk anything other than test (also the username) then it does not work. This has me confused.
     
  10. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
  11. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    Got it.. I have used Asterisk before but am new to FreePBX.

    I dont understand how the setup is different between what I am used to and what I have here. For example.. where are the Sip Trunks defined in conf files? I am trying to see what is written..

    From the link you sent:
    =======================
    How Are Contexts Used?
    When Asterisk receives a call connection, whether an incoming call from outside, or from an internal extension, that call belongs to a context. Which context the call belongs to depends on what channel the call came in on. When you configured the channels that you have on your Asterisk PBX, one of the things you had to do was to define what context an incoming connection on that channel would be put into, using a definiton like:

    context=incoming

    So the first way contexts are used is to make Asterisk do different things depending on where a call is coming from. You pretty certainly will have at least one context defined for how Asterisk handles an incoming call on your telephone line: it might ring some of your extensions or play an announcement and record a voicemail message. You want Asterisk to handle connections from your internal extensions differently
     
  12. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    I am looking to understand in what conf file this context is defined. This will be most helpful as I try to learn FreePBX.
     
  13. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    My peer details look only like this..

    host=10.1.4.3
    secret=password
    type=peer
    username=test
    allow=ulaw,gsm,g726,g722

    There is no context defined in the peer details...
     
  14. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    same concept as my last answer to you:

    in

    sip.conf

    is a line

    #include => sip_additional.conf

    this file is generated by FreePBX from the mysql tables that are generated by your interaction with the GUI.
     
  15. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    Ok great.. they are in sip_additional.conf

    So teh question is this.. what context is used here when someone calls this trunk.
    I have no user details defined so it looks like the trunk name is used as a context in this event because when I make the username and the trunk name match then it seems to work.
     
  16. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    As you noted, and I accepted I am a RTFM type, I really suggest that now is the time to crack the cover of one of them FM's.
     
  17. tknman0700

    Joined:
    Oct 30, 2009
    Messages:
    49
    Likes Received:
    0
    I am confused by one version of Asterisk to another here. I dont understand why the Digium port would have phone extensions as in provisioned devices in users.conf and this one is in the sip.conf (via: sip_additional.conf).
     
  18. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Indeed you seem a little confused, All "versions" of Asterisk, are in fact Digium ports.

    If you read the top bit of users.conf it says . . .


    ;
    ; User configuration
    ;
    ; Creating entries in users.conf is a "shorthand" for creating individual
    ; entries in each configuration file. Using users.conf is not intended to
    ; provide you with as much flexibility as using the separate configuration
    ; files (e.g. sip.conf, iax.conf, etc) but is intended to accelerate the
    ; simple task of adding users. Note that creating individual items (e.g.
    ; custom SIP peers, IAX friends, etc.) will allow you to override specific
    ; parameters within this file. Parameter names here are the same as they
    ; appear in the other configuration files. There is no way to change the
    ; value of a parameter here for just one subsystem.
    ;
    .
    .
    .

    As you can see it's intended for Quick and dirty vanilla installs, that is not the way of FreePBX or Elastix.
     
  19. DrVoIP

    Joined:
    Jan 20, 2012
    Messages:
    21
    Likes Received:
    0
    I have worked on this issue and find the follow results to work best (see blog.drvoip.com for additional detail):
    TrunkOut>SG90

    host=10.1.4.21
    type=peer
    dtmfmode=info
    disallow=all
    allow=ulaw
    canreinvite=no
    directmedia=no
    nat=no
    qualify=yes
    context=from-internal
    secret=mysecret
    setvar=KEEPCID=TRUE
    insecure=port,invite
    defaultuser=mcco-in-from-mccokSG90


    TrunkIn<SG90

    host=10.1.4.21
    type=peer
    dtmfmode=info
    disallow=all
    allow=ulaw
    canreinvite=no
    directmedia=no
    nat=no
    qualify=yes
    context=from-internal
    secret=mysecret
    setvar=KEEPCID=TRUE
    insecure=port,invite
     
  20. wizkid

    Joined:
    Feb 11, 2011
    Messages:
    2
    Likes Received:
    0
    This didn't work for me. Can you post the full directions to register a sip trunk to shoretel? I would really appreciate that.
     

Share This Page