Call and hang using Asterisk as a SIP client

I am new to Asterisk, so I will start with something simple.

I read some documentation and managed to make a basic configuration.

My version of Asterisk is 1.6.2.9-2 + squeeze10 (installed on Debian using apt-get) and changed ONLY sip.conf and extensions.conf.

My idea is to use it as a SIP client connected to the Streamroute SIP server, but please see what happens when I use the EXTEN console disk ...

sip.conf

[general] register => 74770000: HIDDEN@sip.flowroute.com /s registertimeout=20 context=default allowoverlap=no bindport=5060 bindaddr=0.0.0.0 srvlookup=no subscribecontext=from-sip [flowroute] canreinvite=no username=74770000 fromuser=74770000 secret=HIDDEN context=default type=friend fromdomain=sip.flowroute.com host=85.17.214.222 dtmfmode=rfc2833 disallow=all allow=alaw allow=ulaw nat=yes insecure=very 

extensions.conf

 [default] exten => _XXXXXXXXXXXXXX,1,Dial(SIP/flowroute/${EXTEN}) ;exten => _XXXXXXXXXXXXXX,2,Hangup 

show sip to users

 loreen*CLI> sip show users Username Secret Accountcode Def.Context ACL NAT flowroute HIDDEN default No Always 

sip show peers

 loreen*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status flowroute/74771200 85.17.214.227 N 5060 Unmonitored 1 sip peers [Monitored: 1 online, 0 offline Unmonitored: 0 online, 0 offline] 

console disk EXTEN

 loreen*CLI> console dial 00359891505054 [Jun 14 16:44:27] WARNING[14031]: chan_oss.c:486 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory [Jun 14 16:44:28] NOTICE[14031]: console_video.c:133 console_video_start: voice only, console video support not present [Jun 14 16:44:28] WARNING[14033]: app_dial.c:1714 dial_exec_full: Skipping dialing interface 'SIP/flowroute/00359891505054' again since it has already been dialed 
+4
source share
1 answer

Unfortunately, Asterisk 1.6.2 was completed at the end of April 2012, and it seems that this feature is still not supported, and using a sound card with Asterisk is not the most common use case.

Installing Asterisk from the source is quite simple and also pretty clean ( make uninstall will clean it up enough). I highly recommend it, as it allows you to get ahead of the game (with protection and release of functions). Try with ./configure and then make menuselect (you'll need ncurses libraries) for a really nice build interface.

When trying to test outgoing calls on your SIP trunk (to check if it is connected), I would recommend using the channel originate function in the CLI.

For reference:

asterisk*CLI> core show help channel originate

The specific device and parameter string using your setup:

asterisk*CLI> channel originate SIP/flowroute/00359891505054 application Playback tt-monkeys

Note. This will play the sound of screaming monkeys to the called party!

In addition, if you are a smartphone user, it is quite convenient to connect a softphone as an extension to check your trunk lines, new dialplans, etc. (Although I will always perform my initial tests with channel originate )

Finally, but no less important ... I understand that this is a test scenario, but ... How do you do it; I would avoid directly dialing your ITSP with a dialed extension from the context [default] . This could, if you did not configure the other configuration properly, leave you open to fraud using the fact that when you try to call the default for an asterisk, this context is used by default if the context is unknown.

+5
source

Source: https://habr.com/ru/post/1486266/


All Articles