two trunks and I feel soooo n00b

Discussion in 'General' started by lol24h, Jan 13, 2011.

  1. lol24h

    Joined:
    Jul 16, 2010
    Messages:
    12
    Likes Received:
    0
    I configured the second trunk, another SIP account from my provider.
    The new inbound route I configured to match some call coming. But still all calls are coming to the first inbound route, which matches "any"

    It is weird btw that I cannot set different inbound route for each trunk instead of preparing some matches it just sucks that way.
    I thought it is obvious if I have another auxiliary number I want to make specific behaviour, like giving right away different announcement and putting to different queue basing on the trunk from which the connection came.
     
  2. hinzinho

    Joined:
    Sep 18, 2009
    Messages:
    461
    Likes Received:
    0
    Depending on how you put in the match. Some SIP providers might require the "+" symbol in front of the CID.
     
  3. lol24h

    Joined:
    Jul 16, 2010
    Messages:
    12
    Likes Received:
    0
    The first inbound route got a match DID and Called ID blank, so I pressume "any" then.
    The second got much on DID and the proper exact number I want, in logs I see that incoming calls are presented as without country code.
     
  4. hinzinho

    Joined:
    Sep 18, 2009
    Messages:
    461
    Likes Received:
    0
    For "Any", both DID and CID are blank. Since you have two trunk with two different #s, it's quite easy to setup. For example

    Trunk A with # 111-111-1111
    Trunk B with # 222-222-2222


    Create an inbound route for A with DID 1111 (depending on some cases, it might be with a +11111111111, but for my PRI lines, 1111 works) and direct it to queue A.

    Create another inbound route for B with DID 2222 and direct it to queue B.
     
  5. lol24h

    Joined:
    Jul 16, 2010
    Messages:
    12
    Likes Received:
    0
    Thanks for a quick response! I've just recently came back to the topic.
    When I try both patterns in Inbound Route ("DID Number:"). like my country code +48 123456789 or only 123456789, none of these are working.
    Calling from my cellphone I got:
    "The number you dialed is not in service, please check your number and try again."

    When I left the DID Number field blank everything is working fine again.

    This is possibly the most verbosive output (if not tell me, please).
    Code:
    # /usr/sbin/asterisk -vvvvvv -g  -dddddd -r
    Asterisk 1.6.2.13, Copyright (C) 1999 - 2010 Digium, Inc. and others.
    Created by Mark Spencer <markster@digium.com>
    Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
    This is free software, with components licensed under the GNU General Public
    License version 2 and other licenses; you are welcome to redistribute it under
    certain conditions. Type 'core show license' for details.
    =========================================================================
      == Parsing '/etc/asterisk/asterisk.conf': Parsing /etc/asterisk/asterisk.conf
      == Found
    Seeding global EID '00:06:5b:38:90:4f' from 'eth0' using 'siocgifhwaddr'
      == Parsing '/etc/asterisk/extconfig.conf': Parsing /etc/asterisk/extconfig.conf
      == Found
    Connected to Asterisk 1.6.2.13 currently running on kalmar (pid = 9264)
    Verbosity is at least 6
    Core debug is at least 6
      == Using SIP RTP TOS bits 184
      == Using SIP RTP CoS mark 5
        -- Executing [s@from-trunk-sip-inotel:1] Set("SIP/inotel-00001682", "GROUP()=OUT_1") in new stack
        -- Executing [s@from-trunk-sip-inotel:2] Goto("SIP/inotel-00001682", "from-trunk,s,1") in new stack
        -- Goto (from-trunk,s,1)
        -- Executing [s@from-trunk:1] NoOp("SIP/inotel-00001682", "No DID or CID Match") in new stack
        -- Executing [s@from-trunk:2] Answer("SIP/inotel-00001682", "") in new stack
        -- Executing [s@from-trunk:3] Wait("SIP/inotel-00001682", "2") in new stack
        -- Executing [s@from-trunk:4] Playback("SIP/inotel-00001682", "ss-noservice") in new stack
        -- <SIP/inotel-00001682> Playing 'ss-noservice.gsm' (language 'en')
        -- Executing [s@from-trunk:5] SayAlpha("SIP/inotel-00001682", "") in new stack
        -- Executing [s@from-trunk:6] Hangup("SIP/inotel-00001682", "") in new stack
      == Spawn extension (from-trunk, s, 6) exited non-zero on 'SIP/inotel-00001682'
        -- Executing [h@from-trunk:1] Hangup("SIP/inotel-00001682", "") in new stack
      == Spawn extension (from-trunk, h, 1) exited non-zero on 'SIP/inotel-00001682'
    kalmar*CLI> quit
    
     
  6. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    It is possible that your provider is sending the did in the SIP header, try using:

    context=from-pstn-toheader

    in the inbound trunk settings.
     
  7. lol24h

    Joined:
    Jul 16, 2010
    Messages:
    12
    Likes Received:
    0
    no difference
     
  8. ivancp

    Joined:
    Sep 17, 2009
    Messages:
    6
    Likes Received:
    0
    Sorry for stealing your thread, but I also have a question about 2 trunks, but I have a problem with outgoing calls. I need to send some extensions via second trunk. At the moment, I placed them in a from-internal-2ndtrunk context and edited the extensions_custom.conf and placed a Dial(SIP/2ndtrunk/${EXTEN}) which basically works but it probably breaks other things (I needed to rewrite caller ID). Is there another way of doing this, more friendly and "the Elastix way".

    About your problem: my both trunks are from the same provider so they send both numbers the same way. Maybe, as someone suggested, there is a different SIP header in one of them. I had to do some rewriting
    Code:
    exten => _.,2,Set(DN=${SIP_HEADER(TO):5})
    exten => _.,3,Set(DID=${CUT(DN,@,1)})
    in order to get the DID from To: field. Try to enable sip debugging for two distinct calls and paste it here. Maybe someone will work things out.
     
  9. lol24h

    Joined:
    Jul 16, 2010
    Messages:
    12
    Likes Received:
    0
    @ivancp: sry I don't have answer for your question

    but to continue my topic.
    I contacted with my SIP operator and they said I got bad request in SIP header?
    sip:s@my_sip_device:5060
    in Contact field.
    I should have
    sip:mysipaccount_login@my_sip_device:5060

    In attached file is screenshot from Wireshark of REGISTER packet.
    [​IMG]

    Uploaded with ImageShack.us
     

Share This Page