Host = Dynamic In A Register Free Setup

Home » Asterisk Users » Host = Dynamic In A Register Free Setup
Asterisk Users 10 Comments

Hello Everyone.

Our environment is a register free setup, and our phones are set as host=dynamic. The problem we are experiencing is for inbound calls:

Name/username Host Dyn Forcerport ACL Port Status Realtime
222/222 (Unspecified) D N A 0
Unmonitored Cached RT

So when we DIAL 222 we get:

WARNING[23103]: app_dial.c:2198 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 – Unknown)

My question is how can we get Asterisk to fill in the gaps (ie, ipaddr, port) for a dynamic peer in a register free environment.

Kind Regards,


10 thoughts on - Host = Dynamic In A Register Free Setup

  • There are two ways for Asterisk to get the IP address for a peer:
    1. Provide the address statically with host=

    2. Allow the peer to register.

    I don’t believe there is any other way for Asterisk to get the IP

    What this means is, you can have a register-free environment or you can have host=dynamic, but you can’t have both.

  • I can’t imagine it working any other way.

    Either your phones are on static IP addresses or they must register to inform Asterisk the IP associated with the peer entry in sip.conf. Unless you have Asterisk won’t know the IP of the phones unless you tell it.

    —–Original Message—

  • Is Asterisk not able to gather IP and port info on INVITES in a REGISTER free, host=dynamic setup? As you all know REGISTERS are resourceful and the phone can be anywhere……

    Kind Regards,


  • No. Asterisk will accept calls from unregistered devices, but you have to enable guests I sip.conf and hope your dialplan is secure. No sane person does this.

    Asterisk cannot send calls to a device unless it knows the address from a register or from a host= entry for the peer.

    You may not like it, but this is the way Asteirsk has worked for the past 15 years.

    —–Original Message—

  • Hello Eric,

    Thank you for your response. Our security layer is abstracted out of the Asterisk boxes completely. The setup is secure we just need Asterisk to fill in the gaps
    (ie, ipaddrss and port) after initial INVITE vs. REGISTER.

    Kind Regards,


  • autocreatepeer still requires registration, from sip.conf.sample:

    ;autocreatepeer=no ; Allow any UAC not explicitly defined to register
    ; WITHOUT AUTHENTICATION. Enabling this options poses a high
    ; potential security risk and should be avoided unless the
    ; server is behind a trusted firewall.
    ; If set to “yes”, then peers created in this fashion
    ; are purged during SIP reloads.
    ; When set to “persist”, the peers created in this fashion
    ; are not purged during SIP reloads.

    —–Original Message—

  • I just want to clarify. We are not creating peers automatically. And we allowguest=no. We do have peer entries in sip_buddies db as you would expect. As mentioned, we just don’t allow phones to REGISTER
    every 3600 (for example). Once a valid peer/phone tries to place a call, we would like asterisk to store the ipaddr and port of the phone to be able to create the SIP channel for incoming calls. As mentioned security is managed elsewhere.