Register a sip client to asterisk

Register a sip client to asterisk

Register a sip client to asterisk

In sip.conf under [general] add a register definition:

register => user[:secret[:authuser]]@host[:port][/extension]

register => fromuser@fromdomain:secret@host

register => fromuser@fromdomain:secret:authuser@host:port/extension

If you have problems with your network connection going up and down (e.g. an unreliable cable connection) and you keep losing your sip registry, you may want to add registerattempts and registertimeout settings to the general section above the register definitions. Setting registerattempts=0 will force Asterisk to attempt to reregister until it can (the default is 10 tries). registertimeout sets the length of time in seconds between registration attempts (the default is 20 seconds).


  ; Register with authname 2345 at at sip provider as 1234 here:
  register =>
  ; Register with authname 1235 and realm at as s here.
  ; (as needed by
  register =>


  • user is the user id for this SIP server (ex 2345)
  • authuser is the optional authorization user for the SIP server
  • secret is the user’s password
  • host is the domain or host name for the SIP server. This SIP server needs a definition in a section of its own in SIP.conf (
  • port send the register request to this port at host. Defaults to 5060
  • /1234 is the Asterisk contact extension. 1234 is put into the contact header in the SIP Register message. The contact extension is used by remote SIP server when it needs to send a call to Asterisk. See the example below. The default context extension is “s”.

Check the success of your own server’s registrations at the CLI with SIP SHOW REGISTRY, whereas you can obtain a list of clients that registered with your server with the help of SIP SHOW PEERS. You may examine all details of a peer’s registration with SIP SHOW PEER <NAME>


The server definition for outgoing calls looks like this:

context=from-mysipprovider ; this section will be defined in extensions.conf

In extensions.conf you’d then use a statement like this:

exten => _9.,1,Dial(SIP/${EXTEN:1}@mysipprovider-out,30,r)
For any query or issue, feel free to discuss on