How to route call from VoiceBlue Next device to Asterisk Server - asterisk

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.

Related

Asterisk: How to connect called Party to another Destination

I need to connect the called party to another destination on an Asterisk.
Simple situation:
Inbound call is coming in, answered, welcome prompt, gets connected by the DIAL command to destination 1 (agent 1st level support).
Agent 1st level has to consult agent 2nd level, while inbound call is on hold/parked. In some situations the inbound call then has to be connected to the 2nd level agent.
Any idea how I can control the call to the called party (agent 1st level)? Isn't it just a call transfer situation with a conversation between the forwarding and the second destination?
I am using phpagi so I can send all commands from php scripts - but it doesn't make any difference to dialplan commands.
Thank you for your ideas and help
Kim
You can't do that from AGI, becuase it have no control while in Dial command
You can use transfer from softphone or AMI action Redirect.

How to get call on an extension, which is registered when a call towards it reach Kamailio

I am using Kamailio 4.4 as the proxy with my Asterisk server. I am trying to develop a scenario where an extension gets registered on asterisk via Kamailio when it receives a push notification. This push notification is sent to the sip extension when a call towards this extension reaches to the Kamailio.
For example, suppose there is two SIP extension( extension 1 and extension 2) registered on Asterisk via Kamailio. When a call from extension 1 reaches the asterisk, it forwards the INVITE request towards extension 2 via Kamailio.Kamailio will try to forward it to extension 2. suppose the extension 2 is not able to receive the INVITE request from Kamailio. When extension two receive a push notification, it will register on asterisk.
So I need to get the call on extension 2 through the new registration.
We are trying to simulate registration of extension to the asterisk when receiving the push notification.
First, we registered extension 2 and disconnected the network. Then we tried to register the same extension when a call from extension 1 reaches to Kamailio. This is a simulation of push-based registration since an extension that receives the push will attempt to register when an incoming call is received.
When asterisk sends INVITE request to Kamailio, it immediately responded with 100 trying provisional response. This 100 response by Kamailio towards asterisk prevents asterisk from re-transmitting the INVITE.
Then Kamailio tried to send and retransmit the packet to extension 2, which does not have network access. This extension 2 was on port number 24071. Even after successful registration(in port 59995) of the extension 2, Kamailio continued to transmit the packets to the old port.
After that, we have configured Kamailio in a way that it won't send an immediate provisional reply(100 trying ) for INVITE request.
Here Kamailio is not immediately sending 100 trying message to Asterisk. This forces Asterisk to re-transmit. Asterisk was found to retransmit the same packets. However, even after the successful registration of extension 2, asterisk continued to send the old invite to Kamailio not the new one to the latest port.
This is the problem for me since push relies on the INVITE reaching the phone at the correct port number.
So, is there other good approaches to solve this issue?
One thing I would like to try is modifying the pending INVITE request towards old registered port with the new port details when new registration reaches to Kamailio. Can I get the ongoing requests from Kamailio?
Please suggest a viable solution.
Almost any kamailio config availible do similar thing.
You have save into location and consult it when do call.
However if you need really scalable platform you SHOULD NOT forward register requests to asterisk at all.
If kamailio send invite to wrong port, likly that mean you have TWO records in location.

Call Transfer to Different Host/IP in Asterisk

Is it possible to transfer call to different host in asterisk?
Like I have three asterisk instances in line i.e A, B and C. The scenario is that the call will come from A to B and B will transfer the call to C and after successful transfer, B will not be facilitator and A will directly be communicating with C
Correct setup is have kamailio or opensips proxy infront of asterisk.
For asterisk ff you have on all instances in trunks settings
canreinvite=yes
directmedia=yes
and if you have SIP protocol, you can do Transfer call. If you do that before call setup will be full transfer,if after setup - only last option will work, so signaling will still go via this host, while media go directly.
Both options may not work if provider NOT support that.
pro-sip*CLI> core show application Transfer
-= Info about application 'Transfer' =-
[Synopsis]
Transfer caller to remote extension.
[Description]
Requests the remote caller be transferred to a given destination. If TECH
(SIP, IAX2, LOCAL etc) is used, only an incoming call with the same channel
technology will be transferred. Note that for SIP, if you transfer before
call is setup, a 302 redirect SIP message will be returned to the caller.
The result of the application will be reported in the ${TRANSFERSTATUS}
channel variable:
${TRANSFERSTATUS}:
SUCCESS: Transfer succeeded.
FAILURE: Transfer failed.
UNSUPPORTED: Transfer unsupported by channel driver.
[Syntax]
Transfer([Tech/]destination)
[Arguments]

Asterisk / Freepbx does not set CallerID to calling party when queue contains a cell phone

Does Asterisk / FreePBX support the ability to pass the caller ID of an inbound caller to a remote support agent (on a cell phone)?
Our work has a queue for incoming calls which contains "remote agents" (people on cell phones). To the cell phone agents, all calls appear to be coming from our main number (385-111-1111). We would like the calls to appear to be coming from the caller (201-555-5555).
This is not a problem with our SIP trunk provider. In the past we used different PBX software, with the same SIP trunk provider, and it was able to set the Caller ID properly. Extensions are capable of setting and passing arbitrary Caller ID, only calls from queues retain the main number.
Outgoing PEER Details:
host=sip.provider.com
type=friend
trustrpid=yes
sendrpid=yes
I've manipulated so many settings that I've come to wonder if Asterisk / FreePBX simply does not support this. Has anyone successfully been able to do this?
Asterisk certainly does. Capture the CID in a dialplan variable at the beginning of the call and set the outbound CID to the same value before passing it on.
There's no direct way to do this within the FreePBX GUI but there is a workaround:
Set up a virtual extension
Enable follow-me on the extension, add the mobile number to the follow-me list
Set the follow-me CID mode to default
Ensure the queue's agent restrictions allow the use of follow-me numbers
Have the agent log into the queue using the virtual extension instead of their mobile number
The default behaviour for the follow-me extension is to pass the incoming caller ID out. So, some flexibility is lost (mobile numbers have to be changed in follow-me settings) but it does allow the desired behaviour.
Asterisk supports setting the callerid for all outgoing or redirected calls. I did this with v1.8 and v13.7 as I'm facing the exact same requirements.
This feature depends on the provider and the contract they setup with you. My Provider calls it "Special Arrangement / Clip no screening". In my case they use "P-Asserted-Identity" to find callerid.
I had to set the following options in the outgoing sip trunk in sip.conf:
trustrpid=yes
sendrpid=pai

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