Testing Asterisk SIP and DAHDI local calls - asterisk

I am a real beginner in asterisk, so please tolerate my question :)
I tried to configure asterisk for realtime and it is working fine for local sip calls. Now, I am trying to make the following test with dahdi calls:
I connected an analog phone to an FXS channel of my Digium card and tried to call this phone (exten 124) from a sip softphone (X-lite).
I get the following error:
-- Executing [124#from-sip:1] Dial("SIP/2000-00000004", "SIP/124")
[May 31 10:24:22] WARNING[5457]: chan_sip.c:5667 create_addr: Purely numeric hostname (124), and not a peer--rejecting
my extensions.conf:
[from-sip]
switch =>Realtime
[from-pstn]
exten => 124,1,Dial(DAHDI/3)
It seems that the dial is done using from-sip context not from-pstn context as required.
Anyone to advise or correct my understanding?
Thanks million
Zak

In Asterisk realtime and not realtime you can configure where to send calls from particular extension, this should be configured in "context"(for realtime check context column), so I believe in your case it is "from-sip". This means all calls from that extension will hit this context, you can't send one call from same extension to one context and other to another, all calls will hit "from-sip" context.

Related

IVR call simulation on Asterisk 15 server

I am using Asterisk 15 server and wanted to configure IVR call simulation. My configuration scenario is
1. A subscriber will register to Asterisk server and start a call.
2. The IVR audio will come from the Asterisk sever to sbscriber.
3. Once the subscriber pressed the botton, the call will connect to a number based on DTMF digit pressed by subscriber. Then call will continue for 30 seconds.
I observered for normal call pjsip.conf file is used for configuration of a subscribers.
Could you please help me on below queries ?
1. Which file we need to configure for the IVR call simulation ?
2. Please suggest a good documentation for IVR simulation.
Files are extensions.conf and pjsip.conf/sip.conf
You have read book for beginner, for example "Asterisk the future of telephony".
After that write dialling core or reuse vicidial.org or other core and write dialplan in extensions.conf for you ivr.
What you tried to do usually called "press-1 outbound dialling campaign"

Replacing dialplan with ARI for "dynamic" inbound extensions

I'm experimenting with the ARI interface in Asterisk (v15.5). I've managed to placing and manage outbound calls relatively well, and I'm now trying to tackle inbound calls.
I don't have any dialplan to speak of on my test server; it hasn't been needed: I just connect via ARI, Originate channels, and bridge them together. However, trying to send an inbound call to the server gives me an error
chan_sip.c:26513 handle_request_invite: Call from 'upstreamserver' (192.168.x.x:5060) to extension '12345' rejected because extension not found in context 'default'.
Fair enough - Asterisk doesn't know about extension 12345 or what to do with it. I could, of course, add this into extensions.conf, put the extension into stasis and let my application deal with this: however, this has two downsides:
We have potentially hundreds of inbound numbers, and we'd need to keep the dialplan up to date
We'd like to have multiple ARI applications connecting to the server: it seems we need to specify a specific application name for each extension
Ideally, I'd like to use ARI to programatically tell Asterisk: hey Asterisk, I'm an ARI application, let me know if there's any calls for extension 12345, and I'll take care of those for you. Is there currently a way to do this, or is it back to editing the dialplan and pointing it to my app by hand?
If you want control all via ARI you should do something like this
[default]
exten => _.,1,Noop(need ban this <${CHANNEL(recvip)}>);use fail2ban
exten => h,1,Hangup
[from-trunk]
exten => _.,1,Stasis()
exten => h,1,Hangup
You should not use default context in your peers/extensions
You also can use dynamic realtime and fastagi for control dialplan.

Asterisk ringback tone recording

I made an outbound-call service application using Asterisk AMI interface.
Following is how my application works.
I generate an Originate request to internal channel using TCP/IP socket.
my dialplan accepts the request and run dial command. extension.conf file is
[from-internal]
exten => _X.,1,NoOP()
same => n,MixMonitor(${DialMonitorFile}.wav)
same => n,Dial(PJSIP/${EXTEN}#TRUNK_100-1234-5678,30)
What I want to do is record whole call process (from ringback tone sound until user hangup).
But, when dial started, only 44 byte size file is generated (maybe wav file header?) before user accepts the call. And, file increased after user accepts call.
Can someone help me how can I record ringback tone sound as well ?
Regards,
Brian
You should do Answer before MixMonitor if you want that
Please note, CDRs will be affected

how to make outbound call using dongle

I have been tried couple of hours to outbound call from Asterisk using dongle. But it shows following error
WARNING[22180]: channel.c:166 channel_request: [dongle0] Request to call on device which can not make call at this moment
[Apr ] WARNING[22180]: app_dial.c:2277 dial_exec_full: Unable to create channel of type 'dongle' (cause 44 - Requested channel not available)
Dialplan command is :
exten => _X.,n,Dial(dongle/dongle0/+73432823232)
Could you please give me solution?
UPDATE : On asterisk*CLI> i can make outboud call using this dongle cmd dongle0 ATD+434343434232;
Error mean you not configured it correctly or device turned off/unplugged
For more info enable debug or do
dongle show devices
https://github.com/bg111/asterisk-chan-dongle

How to route call from VoiceBlue Next device to Asterisk Server

I want to setup and IVR Menu i mean if a user calls to a particular GSM Number then the number should be redirected to Asterisk Server and the user needs to Get IVR Menu
I am using VoiceBlue Next firmware version 1.31.1.34.1 inserted working SIM Card
If i make a call to that particular number i am able to accept call,reject call and other options from VoiceBlueNext Web Interface.
I have made a SIP account in pjsip.conf file and created and extension as 100 in extensions.conf but unable to transfer the call to Asterisk Server
In asterisk server are there any other files to be changed or any settings in VoiceBlue Next
There are not many details to understand your scenario, I have not used VoiceBlue but on Asterisk if you want to receive calls, from your VoiceBlue or any other provider. You have to do two things, one you have to register this peer to allow receive calls, or you can also set allowguest=yes(but very dangerous anyone can send you calls) or add peers at end of pjsip.conf file as little secure way.
Next, you need to add dialplan, suppose if you get any number _X will be any number, now you can put Dial your extension to receive any number from the provider.
As for sip client to call out you have to register peer and both must be in the same context.
Sending outgoing calls, now if you call any number beginning 6 and 7 they will be forwarded to VoiceBlue
exten=>_6XXXXXXXX,1,Dial(SIP/${EXTEN:0}#10.0.0.20,,r)
exten=>_7XXXXXXXX,1,Dial(SIP/${EXTEN:0}#10.0.0.20,,r)
for incoming please add following in your pjsip.conf
[VoiceBlueNext]
type=peer
host=10.0.0.20
username=voiceblue
secret=password
fromdomain=10.0.0.20
and in same file on top put following general section
[general]
port = 5060
bindaddr = 0.0.0.0
allowgues=no
context = sip
disallow=all
allow=ulaw
Notice I allowguest = no , so you must provide peer VoiceBlue peer information to receive calls, but if you want to test, make it yes and you will get calls without any security.

Resources