Sip.conf connect an external voip number

Hi everyone I enabled sip.conf and I put the suggested parameters in the wikis and everything went ok I created the extensions that can communicate with them and by calling the node number you get to talk via radio everything ok Now I would like to connect a number external voip that can connect to the node and can also call extensions is it possible to do this? Where can I find information about it thanks

That sounds like you might be looking for a reverse auto patch. But even if you are not this might give you some inside to the workings of the Asterisk PBX. I googled around this among others:

http://enhanced.github.io/2016/04/AllStar_AutoPatch

I recommend the Asterisk book from O’Reilly: Asterisk-Definitive-Guide-Future-Telephony

It’s complicated and interesting stuff. Please share your questions and efforts.

Oh, poop! Looks like some already posted same link I mentioned. Did you see that? Perhaps the O’Reilly book will help you… or someone smarter than me. Calling all dialplan experts. Who can help?

1 Like

Would I understand you correctly that you want to ‘connect a number’ to a sip extension for inbound dialing on the box/server ?

Hello everyone then I did it this way following the wiki on Allstar and another guide to configure one
an external line. Then from the external line you call
the phone which is registered as 2000
While registered telephones 210 and 211 can call each other
and by doing 515932 and using * 99 and # they enter the node and communicate with the node
My question is how can I make sure that from the outside line via a menu I can choose to go either
towards 2000 2010 201 211 and 515932 and use +99 and # Do you have suggestions
sorry my english

my sip.conf
;
[general]
context=chiamate-in-entrata ; Default context for incoming calls
bindport=6050 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
language=us ; it ; Default language setting for all users/peers
; This may also be set for individual users/peers
canreinvite=no ; Workaround per problemi di autenticazione con Messagenet
nat=yes ; Global NAT settings (Affects all peers and users)
; yes = Always ignore info and assume NAT
; no = Use NAT mode only according to RFC3581
; never = Never attempt NAT mode or RFC3581 support
; route = Assume NAT, don’t send rport
; In
register => 5406…:mypassword@sip.messagenet.t:5061/06…

; Out
;register => 5406…:mypasswordT@sip.povy.om/USERNAME_POIVY

;[out]
;type=peer
;context=chiamate-in-uscita
;username=USERNAME_
;fromuser=USERNAME_
;secret=PASSWORD
;host=sip.poivy.com ;
;fromdomain=sip.poivy.com ;
;qualify=yes
;insecure=very
;nat=yes

; Principale - Aladino
[2000]
type=friend
context=telefoni-locali
secret=password
host=dynamic
dtmfmode=rfc2833

; Nokia N80
[2010]
type=friend
context=telefoni-locali
secret=PASSWORD
host=dynamic
dtmfmode=rfc2833

[210]
type=friend
host=dynamic
username=210
secret=passw0rd ; make it yours
nat=yes
dtmfmode=rfc2833
mailbox=210 ; Mailbox for message waiting indicator
context=sip-phones ; Points to the stanza in extensions.conf
callerid=“xxxx” <210> ; Note: Asterisk only uses the first host
; in SRV records
; Disabling DNS SRV lookups disables the
; ability to place SIP calls based on domain
; names to some other SIP users on the Internet

[211]
type=friend
host=dynamic
username=211
secret=passw0rd ; make it yours
nat=yes
dtmfmode=rfc2833
mailbox=211 ; Mailbox for message waiting indicator
context=sip-phones ; Points to the stanza in extensions.conf
callerid=“xxxx” <211> ; Note: Asterisk only uses the first host
; in SRV records
; Disabling DNS SRV lookups disables the
; ability to place SIP calls based on domain
; names to some other SIP users on the Internet

my extensions.conf

[telefoni-locali]
;20xx = Telefoni fisici
;21xx = Softphone
;12xxx = Diretti segreteria

; Principale
exten => 2000,1,Dial(SIP/2000,60,rT)
;exten => 2000,1,Dial(SIP/2000||tT,20)
exten => 2000,2,VoiceMail(2000,us)
exten => 12000,1,VoiceMail(2000,us)

; Secondo
exten => 2010,1,Dial(SIP/2010,60,rT)
;exten => 2010,1,Dial(SIP/2010||tT,20)
exten => 2010,2,VoiceMail(2010,u)
exten => 12010,1,VoiceMail(2001,u)

; Segreteria telefonica
exten => 3000,1,VoiceMailMain(${CALLERID(num)},s)
exten => 4444,1,Goto(3000,1)
exten => 3001,1,VoiceMailMain()

; Chiamate in uscita
exten => _0X.,1,Dial(SIP/0039${EXTEN}@out)
exten => _3X.,1,Dial(SIP/0039${EXTEN}@out)
exten => _00X.,1,Dial(SIP/${EXTEN}@out)

; Numero inesisntente
exten => _X.,1,Playback(invalid)
exten => _X.,n,Hangup()

; Chiamate in attesa
include => parkedcalls
exten => _70X,1,GoTo(parkedcalls,${EXTEN},1)

[chiamate-in-entrata]
; Chiamate in entrata
exten => _06…,1,NoOp(‘Chiamata entrante allo 06…, redirezionata su Aladino, interno 21000’)
;exten => _06…,n,Dial(SIP/2000||Tt,20)
exten => _06…,n,Dial(SIP/2010||Rt,20)
exten => _06…,n,NoOp(‘Aladino occupato/non disponibile, chiamata passata in segreteria’)
exten => _06…,n,VoiceMail(2000,us)

[sip-phones]
exten => 515932,1,Answer
exten => 515932,n,Wait(2)
;exten => 515932,n,Playback(rpt/node)
;exten => 515932,n,Playback(/var/lib/asterisk/sounds/rpt/nodenames/515932)
;exten => 515932,n,Playback(/etc/asterisk/msg/idmsg)
;exten => 515932,n,Playback(digits/2&digits/9&digits/2&digits/8&digits/3)
exten => 515932,n,Wait(1)
exten => 515932,n,SayPhonetic(iu0ndt14468750 mhz)
;exten => 515932,n,SayAlpha(iu0ndt144.68750)
;exten => 515932,n,Playback(repeater)
exten => 515932,n,Rpt,515932|P ;< most important to connect node in ‘phone mode’

; Extension 210 - Tim’s line 1
; Extension 211 - Tim’s line 2

exten => 210,1,Dial(SIP/210,60,rT)
exten => 211,1,Dial(SIP/211,60,rT)
exten => 1000,1,Voicemailmain(210)
exten => 1000,1,Voicemailmain(211)
exten => 1000,2,Hangup

If I understand you correctly, and you are wanting to steer inbound call to a specific extension,
that routing would be preformed in extensions.conf

Where you designate the inbound trafic for the line…
something like this as a menu…

[inbound-did-3]
exten => 1234ccccccc/1330ccccccc,3,Goto(p-menu,s,1) ; VZN-1 <<<<< START route by cid#

[p-menu]
exten => s,1,Answer(250)
exten => s,2,Wait(.75)
exten => s,n,Background(agent-newlocation)
exten => s,n,WaitExten(600,m)
exten => s,n,Goto(p-menu,s,2)

exten => 00,1,Gosub(my-pbxip,s,1)
exten => 00,n,Goto(p-menu,s,2)
exten => 10,1,Playback(recorded)
exten => 10,n,Goto(my-rec,s,1)
exten => 15,1,Gosub(my-specialops,s,1)

exten => 50,1,Gosub(inv-num-chk,s,1)
exten => 50,n,Goto(my-rec,s,1)

exten => 83,1,Rpt,29283|P
exten => 84,1,Rpt,29284|P
exten => 85,1,Rpt,29285|P

follow only what is in bold.
This is not a copy paste thing you can do and have it work. But if you study what I have done, you should be able to adapt it to your own.
My code here is looking for specific caller id to route to p-menu where it listens for input/extension to new direction. The input of 83,84,85 direct it to connect to nodes.
Asterisk dial plan is all over the web, and google is your friend (sometimes)
But the art for this is done in extensions.conf
Hopefully, i have not erased to much private stuff to make it not understandable.

Yes, thank you for your answers and in any case I found the solution to my problem, I wanted to make that the asl node could be connected by an internal sip number and also by an external number, however I reconfigured everything it was enough have create two contexts and join the two inner and outer lines like this
internal lines
exten => _5xxxxx, n, Rpt, 5xxxx | P; <most important to connect node in ‘phone mode’
external lines
exten => _06xxxxxx, n, Rpt, 5xxxxx | P; most important to connect node in 'phone mode
now these are my files

Sip.conf

[general]
context=chiamate-in-entrata ; Default context for incoming calls
bindport=6050 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
language=us;it ; Default language setting for all users/peers
; This may also be set for individual users/peers
canreinvite=no ; Workaround per problemi di autenticazione con Messagenet
nat=yes ; Global NAT settings (Affects all peers and users)

; In
register => 5xxxxxxxxx:password@sip.messa.it:5061/06xxxxxxx

; Out
;register => 5xxxxxxxx:passwordT@sip.poi.com/USERNAME_PO

; PROVIDER Out
;[out]
;type=peer
;context=chiamate-in-uscita
;username=USERNAME_POIVY
;fromuser=USERNAME_POIVY
;secret=PASSWORD
;host=sip.poivy.com ; Modificare con il proprio server SIP in uscita
;fromdomain=sip.poivy.com ; Idem
;qualify=yes
;insecure=very
;nat=yes

[2000] ;interno con di esclusione xxxxxx
type=friend
secret=password
host=dynamic
dtmfmode=rfc2833
context=sip-phones
;context=telefoni-locali

[210] ; interno
type=friend
host=dynamic
username=210
secret=passw0rd ; make it yours
nat=yes
dtmfmode=rfc2833
mailbox=210 ; Mailbox for message waiting indicator
context=sip-phones ; Points to the stanza in extensions.conf
callerid=“1 interno” <210> ; Note: Asterisk only uses the first host
; in SRV records
; Disabling DNS SRV lookups disables the
; ability to place SIP calls based on domain
; names to some other SIP users on the Internet

[211] ;interno
type=friend
host=dynamic
username=211
secret=passw0rd ; make it yours
nat=yes
dtmfmode=rfc2833
mailbox=211 ; Mailbox for message waiting indicator
context=sip-phones ; Points to the stanza in extensions.conf
callerid=“2 interno” <211> ; Note: Asterisk only uses the first host
; in SRV records
; Disabling DNS SRV lookups disables the
; ability to place SIP calls based on domain
; names to some other SIP users on the Internet

extensions.conf

[telefoni-locali]
;20xx = Telefoni fisici
;21xx = Softphone
;12xxx = Diretti segreteria

; Principale - xxxxx
exten => 2000,1,Dial(SIP/2000||tT,20)
exten => 2000,2,VoiceMail(2000,us)
exten => 12000,1,VoiceMail(2000,us)
;context=telefoni-locali

; Segreteria telefonica
exten => 3000,1,VoiceMailMain(${CALLERID(num)},s)
exten => 4444,1,Goto(3000,1)
exten => 3001,1,VoiceMailMain()

; Chiamate in uscita
exten => _0X.,1,Dial(SIP/0039${EXTEN}@out)
exten => _3X.,1,Dial(SIP/0039${EXTEN}@out)
exten => _00X.,1,Dial(SIP/${EXTEN}@out)

; Numero inesisntente
exten => _X.,1,Playback(invalid)
exten => _X.,n,Hangup()

; Chiamate in attesa
include => parkedcalls
exten => _70X,1,GoTo(parkedcalls,${EXTEN},1)

;…

[chiamate-in-entrata]

exten => _06xxxxxxxx,1,NoOp(‘Chiamata entrante allo 06xxxxxxxx, redirezionata su Nodo Allstar,515932’)
exten => _06xxxxxxxx,1,Answer
exten => _06xxxxxxxx,n,Wait(1)
exten => _06xxxxxxxxx,n,Playback(connected)
exten => _06xxxxxxxxx,n,Playback(repeater)
exten => _06xxxxxxxxx,n,Rpt,515932|P ;most important to connect node in ‘phone mode’

[sip-phones]

exten => _515932,1,NoOp(‘Chiamata entrante da interni sip , redirezionata su Nodo Allstar,515932’)
exten => _515932,1,Answer
exten => _515932,1,Wait(1)
exten => _515932,n,Playback(rpt/node)
exten => _515932,2,Wait(1)
exten => _515932,n,Playback(repeater)
exten => _515932,n,Rpt,515932|P ;< most important to connect node in ‘phone mode’

;Configurazione interni sip

exten => 210,1,Dial(SIP/210,60,rT)
exten => 211,1,Dial(SIP/211,60,rT)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.