Sip remote extension

Discussion in 'General' started by kareem, Jun 21, 2010.

  1. kareem

    Joined:
    Dec 9, 2009
    Messages:
    77
    Likes Received:
    0
    Hi every body


    I am trying to connect my remote extension which locate in a different place from my elastix box


    I succeeded in using nat with iax but when trying it with the sip it drive me crazy I can't find my error my be it is so trivial but i can't find it this is what i did


    1- added the following line in my sip_nat.conf
    Nat=Yes
    qualify=yes
    externip=xxx.xxx.xxx.xx my public ip it is static by the way
    Localnet=192.168.1.0/255.255.255.0 my local net

    2- configure my router nat to the elastix box which has an ip 192.168.1.2 like this

    Virtual Server for Single IP Account
    Rule Index 1
    Application sip
    Protocol all
    Start Port Number 5060
    End Port Number 5060
    Local IP Address 192.168.1.2
    Start Port(Local) 5060
    End Port(Local) 5060

    added new nat for the rtp like this

    Virtual Server for Single IP Account
    Rule Index 2
    Application sip2
    Protocol udp
    Start Port Number 10000
    End Port Number 20000
    Local IP Address 192.168.1.2
    Start Port(Local) 10000
    End Port(Local) 20000

    this all i think it shoud work now but i can't register with my remote extension it always give me the same error

    registration error :405 - method not allowed

    any help please :(
     
  2. danardf

    Joined:
    Dec 3, 2007
    Messages:
    8,069
    Likes Received:
    12
    Hi. So, I don't know why you post another thread. :huh:

    first, try to put only :
    Code:
    externip=xxx.xxx.xxx.xx 
    Localnet=192.168.1.0/255.255.255.0
    Into every remote extensions, put nat=yes.
    Because by default, nat=no on each extension. If you put nat=yes, into the general parameters, that should be disabled by nat=no.

    Chack the DNS parameters and the default route.
    The sip protocol is UDP and not TCP, so you can put UDP.

    Your SIP2 information, isn't the good name, you could put RTP only, that should be better. ;)

    Try to add defaultexpirey=1800 or 3600 into sip_general_custom.conf.

    Restart Asterisk (CLI> restat now or reload)

    But, as Rafael said, read Elastix Without Tears before. ;)

    Regards
     
  3. h-idrisi

    Joined:
    Jun 21, 2010
    Messages:
    2
    Likes Received:
    0
    Add this lines
    externip=xxx.xxx.xxx.xx
    Localnet=192.168.1.0/255.255.255.0
    In the beginning of sip.conf file under [general]
     
  4. danardf

    Joined:
    Dec 3, 2007
    Messages:
    8,069
    Likes Received:
    12
    No, h-idrisi, It's wrong. :blink:

    If you read the first lines of the file, you can read this:
    Code:
    ;--------------------------------------------------------------------------------;
    ; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
    ; this file must be done via the web gui. There are alternative files to make    ;
    ; custom modifications, details at: http://freepbx.org/configuration_files       ;
    ;--------------------------------------------------------------------------------;
    ;
    ; This file is part of FreePBX.
    ;
    ;    FreePBX is free software: you can redistribute it and/or modify
    ;    it under the terms of the GNU General Public License as published by
    ;    the Free Software Foundation, either version 2 of the License, or
    ;    (at your option) any later version.
    ;
    ;    FreePBX is distributed in the hope that it will be useful,
    ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
    ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ;    GNU General Public License for more details.
    ;
    ;    You should have received a copy of the GNU General Public License
    ;    along with FreePBX.  If not, see <http://www.gnu.org/licenses/>.
    So, you can't say this.

    It's true only on the Asterisk install without GUI like Freepbx or other.

    Regards
     
  5. h-idrisi

    Joined:
    Jun 21, 2010
    Messages:
    2
    Likes Received:
    0
    danardf,
    it is working also with elastix i did try it you can try by yourself and tell me the result :)
     
  6. danardf

    Joined:
    Dec 3, 2007
    Messages:
    8,069
    Likes Received:
    12
    all right, But I don't know why Freepbx wrote this. Maybe an old comment. :huh:

    Prefer to use sip_general_custom.conf, it's more clean!

    If you read the next of this file you can see this:
    Code:
    #include sip_general_additional.conf
    
    ;sip_general_custom.conf is the proper file location for placing any sip general
    ;options that you might need set. For example: enable and force the sip jitterbuffer.
    ;If these settings are desired they should be set the sip_general_custom.conf file.
    ;
    ; jbenable=yes
    ; jbforce=yes
    ;
    ;It is also the proper place to add the lines needed for sip nat'ing when going
    ;through a firewall.  For nat'ing you'd need to add the following lines:
    ; nat=yes , externip= , localhost= , and optionally fromdomain= .
    ;
    #include sip_general_custom.conf
    sip_general_custom.conf is well into the general part of the sip.conf.

    The day where Freepbx reload this file (from an update, or a next release), you could have a problem!

    If you put your own parameter before #include sip_general_additional.conf, here you have a problem, because there's lots of parameters into this file and this file is reloaded by Freepbx (it's real).
    If you put your own parameters into sip_general_custom.conf, you haven't no risk.

    Else sip_nat.conf is called into the general part of sip. Don't worry for this. ;)
     
  7. kareem

    Joined:
    Dec 9, 2009
    Messages:
    77
    Likes Received:
    0
    thanks for your time
    I have tried all of this but it doesn't work
    i don't knew what wrong with it

    By the way I have read elastix with out tears carefully ;)

    If any body can help
     
  8. danardf

    Joined:
    Dec 3, 2007
    Messages:
    8,069
    Likes Received:
    12
    Hi.

    Else, you could have some problems with your router, firewall, or something else into your LAN. Sometimes, some routers can have some NAT problems.

    If Elastix is configured fine with sip_nat.conf, the DNS, the default router, and every extensions correctly configured (nat=yes, no permit/deny parameters), you should have some problem somewhere out of Elastix.

    In my case, I run on Linksys WRT54G v2 with an alternate Firmware (DD-WRT).
    All works perfectly (NAT, PAT, QoS).
     
  9. kareem

    Joined:
    Dec 9, 2009
    Messages:
    77
    Likes Received:
    0
    Hi again

    It is successfully registered now but not all the times

    it some time register and in another time it is not allowed

    where is the error now :(
     

Share This Page