Interconnecting 2 servers Elastix - Asterisk

Discussion in 'General' started by javapaul, Jul 14, 2009.

  1. javapaul

    Joined:
    Jul 1, 2009
    Messages:
    99
    Likes Received:
    0
    Hi, im trying to interconnect 2 servers, server 1 is running elastix, and server 2 is running asterisk(clean),

    so far i can do the following

    ELASTIX ----EXT---> ASTERISK

    Which mean i can call an extension on my asterisk server from elastix, but i cant dial an extension on my elastix server from my asterisk

    I'm getting this error when i try to dial out from asterisk to elastix

    I DONT HAVE THIS PROBLEM ANY MORE SO I POSTED MY CONFIG, HOPE IT HELPS
    SOLUTION

    ASTERISK SERVER
    EXTENSIONS.CONF

    Code:
    [asterisktwo]
    exten => _60XX,1,dial(SIP/A-out/${EXTEN})
    exten => _60XX,2,hangup()
    i include "asterisktwo" on my internal context

    SIP.CONF
    added the following sip account
    Code:
    [A-out]
    type=friend
    host=172.26.1.223 ;or the ip address from the other server
    fromuser=tuyo ; this is very important cause it should be the same in your elastix server
    username=tuyo
    secret=tuyo
    disallow=all
    allow=ulaw ;ulaw works for me, try different ones till it works
    canreinvite=no
    Code:
    [prueba]
    type=friend
    username=prueba
    secret=5555
    dtmfmode=info
    disallow=all
    allow=ulaw ; again use the best one that suits you
    qualify=yes
    nat=no
    host=172.26.1.152 ;IP of the  asterisk server
    context=internal
    canreinvite=yes
    ELASTIX SERVER
    create a sip trunk
    Code:
    TRUNK NAME Asterisk
    PEER DETAILS
    type=peer
    host=172.26.1.152 ;IP from your asterisk server
    fromuser=prueba
    username=prueba
    secret=5555
    disallow=all
    allow=ulaw
    canreinvite=no
    
    USER CONTEXT tuyo ;this is why the fromuser line is important for
    USER DETAILS
    type=user
    username=tuyo ; from the sip account u created in asterisk server
    secret=tuyo
    host=172.26.1.223 ;IP FROM YOUR ELASTIX
    disallow=all
    allow=ulaw
    canreinvite=no
    context=from-internal
    
    
    now on outbound rules u can set them to whatever suits u best.
     
  2. Megabyte

    Joined:
    Mar 28, 2009
    Messages:
    327
    Likes Received:
    0
    Do you have a register string? because sometimes you need to create one and use a way like this:


    asterisk:password@myserverip/elastixuser


    Try that of course you have to fixed to your reality
     
  3. javapaul

    Joined:
    Jul 1, 2009
    Messages:
    99
    Likes Received:
    0
    yeah about that, at the end /elastixuser , what should i put in there?
    something like this
    A:A@172.26.1.152/B

    where B is my username for the context?

    USER CONTEXT B
    USER DETAILS
    type=friend
    secret=B
    host=172.26.1.223
    disallow=all
    allow=ulaw
    canreinvite=no
     
  4. Megabyte

    Joined:
    Mar 28, 2009
    Messages:
    327
    Likes Received:
    0
    ok i will try to make you a detailed config

    in your elastix server try something like this

    in the name of the trunk try serverA
    in peer details try

    host=dynamic
    secret=alfio
    trunk=yes
    type=friend

    in the register field

    serverB:alfio@ipserverB

    In your asterisk server try something like


    in the register use:


    register => serverA:alfio@ipserverA/serverB

    [serverB]
    type=friend
    secret=alfio
    context=whereyouwanttohandleincomingcalls
    host=dynamic

    Try it and tell waht happend
     
  5. haamed

    Joined:
    Jul 23, 2007
    Messages:
    251
    Likes Received:
    0
  6. rejil.rajan

    Joined:
    Apr 8, 2007
    Messages:
    154
    Likes Received:
    0
    The best method to connect between two asterisk servers is using IAX

    You could also try by making the type as friend in Server A
     
  7. javapaul

    Joined:
    Jul 1, 2009
    Messages:
    99
    Likes Received:
    0
    sorry been so busy with work that i haven't had the time to work with elastix, i got it to a point were i can call between extensions but when i try to use the sip trunk from my asterisk, it would think that elastix is trying to dial an extensions, but ill try the other stuff tomorrow, thanks again elastix community :)
     
  8. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    I believe the context of the remote box(asterisk) trunk on the box with outbound connectivity (elastix) should be

    context=from-internal

    or the trunks on that box(Elastix) won't be available to calls from the remote box (asterisk), just the internal extensions (unless specifically included in your chosen context) . (do you understand the logic, the remote box is in effect another set of extensions using a "tie-line" to the master box, so calls from it should be treated as local extension calls, they will be thusly routed to extension or outbound trunk as appropriate)
     
  9. javapaul

    Joined:
    Jul 1, 2009
    Messages:
    99
    Likes Received:
    0
    :woohoo: thanks for all the help guys i was able to interconnect the two boxes and make calls trough one of them, there is a whole lot of logic involved like dicko said, thanks again elastix's community :woohoo:
     
  10. Megabyte

    Joined:
    Mar 28, 2009
    Messages:
    327
    Likes Received:
    0
    Hi im happy you did it, can you post yours configs here for other people, in that way the forum gets better.
     
  11. younes371

    Joined:
    Jul 15, 2009
    Messages:
    4
    Likes Received:
    0
    Hi,

    i would like do the same config, can you tel me how can i do it ?

    Thank's
     
  12. javapaul

    Joined:
    Jul 1, 2009
    Messages:
    99
    Likes Received:
    0
    I posted the solution/config files at the beginning of the threat.
     
  13. younes371

    Joined:
    Jul 15, 2009
    Messages:
    4
    Likes Received:
    0
    Thank you very match for help

    I will test it and i return to you if i will have problème

    Thank's
     

Share This Page