No ring back tone on outbound calls. [FreePBX] - asterisk

I have a FreePBX 13 server set up with a SIP Trunk connection, however for some reason we are not getting the ring back tone for calls going out of the trunk connection.
I was able to implement a work around for this by placing the "Tr" options under "Asterisk Trunk Dial Options" to force Asterisk to produce the ring back tone for outbound calls.
However this only works while manually dialing from a soft-phone / VoIP Phone, when I try to launch a call via the Asterisk AMI "Originate" command we are not getting the ring back tone, even when the "r" option is set on the trunk. This is how the command I'm sending looks:
Action: Originate,
Channel: SIP/{extension},
Context: from-internal,
Exten: {phoneNumber},
Priority: 1,
Callerid: {callerId},
Timeout: 30000,
Async: yes
Any idea about what can I do to force the ring back tone?

This could be due to inband progress.
Try to add the following to your sip.conf
under [general] section,
prematuremedia=no
progressinband=yes
if you are using freepbx, then navigate to your trunk settings in the user interface and add the above 2 configs under the peer settings.
restart asterisk and try after that.

Launch Originate via Local/ channel call, if still not work, launch via custom context which answer first.

This is not an uncommon problem. Your ITSP is being lazy and either not providing or not forwarding RFC-complaince SIP 180/183 responses.
My usual solution is to put the local caller into an MOH state where the MOH is a ring tone, and then when the other end picks up, bridge the two calls.
This is kind of jarring, however, if the remote end is busy or is congested, since you go from "fake ring" to "real error tone". The other option is to reverse your dialing process ... call the remote end and then hook the local end, so that the local end doesn't need to hear ringing.
Of course, you can also reach out to your ITSP and tell them you need them to be RFC SIP 180/183 complaint.

Related

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.

Unable to locate Registered client Asterisk - Kamailio

Problem: My main issue is that when I “REGISTER” a client via Kamailio, and I attempt to “Dial” a different endpoint within an Asterisk Dial Plan, Asterisk throws an error stating that the endpoint (the number I am dialing via “Dial”) is not registered or reachable. However, commands like “Playback” do work correctly for the client I “REGISTERED” via Kamailio.
E.g. I register client 10001 in Kamailio, I then register another client 10002 in Kamalio; both 10001 and 10002 can exercise an Asterisk Dial Plan which will play videos/audio (No Problem). But, now I want 10001 to Call (Dial) 10002; it is at this point that Asterisk throws the error “10002 is not registered or reachable”.
I have tried many of the suggestion on many different help boards (several times) but I am still unable to forward a registration from Kamailio to Asterisk.
With my current Kamailio configuration (I do use dispatching), I see , via tcpdump, Asterisk receiving a “REGISTER” request, and Asterisk sends back the “unauthorized” as expected, however, Kamailio does not re-send the “REGISTER” as is customary. I am not sure of the next step to take, but I feel I have a couple of options.
- I can continue to try and figure out why Kamailio is not sending the second “REGISTER” (I have not yet been able to figure this out).
- Tell Asterisk to not require authentication. (I am using pjsip and do not know how to not require authentication in Asterisk when the request is from Kamailio).
I have put a lot of time into this one, and I am at a sticking point. Any help or suggestions would be very much appreciated.
Thank you,
Kamailio is proxy. It SHOULD NOT do send second register unless you EXPLICTLY ask it do that in dialplan.
Dispatcher module is fast processing module. It should not do for you all staff, it just give you suggestion for dispatch.
You should not do check on asterisk for registration, you have send request to kamailio, and kamailio SHOULD do that work(it do much faster and HAVE info).
Main issue is:
asterisk main goal - give easy to understand platform for begginers. So anyone can get working pbx for free. It work on top level, with calls.
kamailio main goal is PERFOMANCE. It is not for begginer, you need have solid understanding of sip protocol, not just know that you want call. You have define what to do on packets level.

channel originate, how to do call from a local channel? (call intercom and send dtmf)

My goal is to :
run a background task activated by dynamic feature while in active call, that will execute dial to another EXT and send DTMF.
It means, when a user is active call with someone, when the user press 5555, the door will be opened.
In order to open the door today, I have to manually call EXT 6(the door) and send DTMF digits: 00*
All of this has to happen automatically when the user press 5555 without interfering the active call.
I tried before to do all of this with dial, but dial blocks the call or bridges with another extension and then I lose the original call.
I figured out that I need to do this with ASYNC, means I can not use dialplan, I need to use CLI, and then originate some how.
Asterisk will need to create a local session / local channel and establish/connect to the door extension, then send DTMF and hangup
All of this – in background.
this is somthing i managed to do so far:
features_applicationmap_custom.conf
openthedoor=> 5555,caller,macro,OpenIntercomCall
then in ->
extensions_custom.conf
[macro-OpenIntercomCall]
exten => s,1,System(asterisk -rx "channel originate SIP/6 extension#yoyo")
i do not understand how do i call to SIP/6 from asterisk(using a local or random channel), and then send DTMF on answer.
the door ext is SIP/6, and 00* is the dtmf to open it.
What i am trying to do is that when a user 5555 in a call, the door will be opened.
means i want asterisk to call the intercom and send dtmf
There are no any sence do exec asterisk from inside asterisk. You can do Originate command.
Originate(tech_data,type,arg1[,arg2[,arg3[,timeout]]])
For example you can do something like this
exten => s,1,Originate(SIP/6,app,SendDTMF,ww00*)
Should be enought for your need.

Asterisk: Call dropped after 15mn

I'm getting a weird behavior on my Asterisk.
Calls are dropped after 15mn.
I'm getting the following error on the log file:
NOTICE[6301] chan_sip.c: Failed to authenticate on INVITE to '<sip:41907736445#188.32.64.1>;tag=ef7143klc9'
I'm using Asterisk Realtime. Calls a received from an operator and forwarded to external numbers throught an outbound trunk provided by anther operator.
Thanks in advance
In your sip.conf, try setting qualify=yes or keepalive=yes globally or for the trunk. Make sure to reload or just restart the service.
What version of Asterisk are you running?
Some carriers may send "confirmation" invite every X minutes.
You can see more by enable sip debug
Also if exactly at 15 min calls get dropped, then i would check the firewall to see whether there is timer set there that closes the connection after 15 min. I am speaking from experience.

Where can I see executed "Originate" command from Asterisk AMI

I'm adjusting simple application that among other things should be able to call another party using Asterisk AMI Originate command.
I'm stuck and I believe that my originate command is wrong.
Where/how can I see log of Originate commands that Asterisk creates when I use regular phone so I can compare it to my hand crafted one?
Use a network sniffer, such as tcpdump or wireshark, and capture the packets that come and go to/from asterisk. By default, it uses 5038/tcp. Check your manager.conf file, and look for the bindaddr and port options to be sure you capture the right traffic.
If you are using ssl (sslenable=yes), then you will have to configure wireshark with your ssl keys, so it can decrypt the traffic or just use normal tcp (without ssl) for debugging and then switch to ssl.
You should see the Action: Originate coming in to asterisk, and the asterisk response and the associated events. Look for the ActionID parameter of the action so you can trace which responses and events correspond to each issued action.
Take into account that an async originate (async: true) will return a response as soon as the action is received by asterisk, but it will then send asynchronous events to inform the call status (once finished). On the other hand, when using async: false, the call will be placed and the response will have the status.
A few more resources on the originate action:
http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Originate
https://wiki.asterisk.org/wiki/display/AST/ManagerAction_Originate
Another question related to the async parameter:
Asterisk originate response says successfully queued but nothing more
Hope it helps!
EDIT: Asterisk does not create the originate command, but will dial a target (a channel) based on an incoming originate action, or call file, so your application (the ami client) will issue an originate action and then asterisk will react to it by doing the call. If your call is originating from a phone, it's more probable that the call is being originated by a dial() command in your dialplan.

Resources