My objective: I want to use softphone(3CX phone) register with asterisk server, and make call to the server and asterisk act
as a server to automatically response something, like play a song.
How i did: I installed asteriskNow using virtualbox, and registered the softphone by setting exntension for my SIP device
(extension 333). And i write a dialplan in etc/asterisk/extensions.conf. The dialplan is :
[incoming]
exten =>s,1,Answer()
exten =>s,n,Playback(dir-intro-oper)
exten =>s,n,Hangup()
I want any incoming call to server, the server will automatically answer, and play a pre-defined voice (dir-intro-oper.gsm )
then handup.
But I met the problem is:
I use softphone, and i dont know which number i should dial to the asterisk server. Should i set up a extension number for
asterisk server itself? If so, how to do that? By setting up SIP truck? Write the dialplan in sip.conf? or anything else?
Another questions:
I read the asterisk related book"asterisk, the future telephony" which tells us to write dialplan in the extensions.conf
directly, but i found the extensions.conf in the server which alerts us do not modified the file directly, must use web-gui
to modify.So which way i should follow?
In this case, i do not use any other hardware phone.
I am a novice on asterisk, please give me some hints and detail procedure.
The "s" extension that you are using is a "special" that when Asterisk doesn't know what to do, it tries to use that.
If you really want any call to the box, either from a VoIP phone or an ITSP to get handled the same way, try this:
[incoming]
exten =>_X.,1,Answer()
same => n,Playback(dir-intro-oper)
same => n,Hangup()
... and make sure that in your SIP phone and SIP trunk definitions that you set:
context=incoming
That literally forces all calls into your context and then no matter what you dial, you always match the extension number.
More reading at https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching
[incoming1]
exten => 333,1,Answer()
same => n,Playback(File_name)
same => n,Hangup()
Go to /etc/asterisk/extension_custom.conf and write your context like this:
and name the context as incoming1 or anything else cause incoming context already exists. I have named it as incoming1:
Now goto /etc/asterisk/sip_additional.conf and edit the context of extension you are going to register on the softphone.
Now register the softphone and you can dial the number 333 and everything will work properly.
![][3]
Related
For a project I need to build an mvp of a service where users call a toll free number, on the other side, the pbx detects the call, saves the caller # and hangs up (so caller never gets charged for the call). Then the pbx calls the user back, allows him to dial a #, then pbx plays an audio file and when it finishes, makes the connection to the # introduced by the user.
I'm new to voip and asterisk, but which documentation should I read to achieve this (which features do I need to understand and look for?)
At begining you have to understand how to build dialplan and use it's applications(Dial, Playback and Read). If you want to use some programming language you can use AGI, there are library to write agi in almost all languages :)
For redialing user you can use call files or Asterisk Manager function originate. Call file can be used to call in future if you change creation time of file to future.
Simple flow can look like this:
User dial simple dialplan, run there some AGI, which read callerid and saves call file in near future. You do this without answering the call.
Call file dials user.
After answer you go to another dialplan which reads dtmf from user and dial that number.
I have a SIp trunk and I want to make an outgoing call to a external analog number and play a message when the other side answers it.
The problem is that the message be played as soon as it finish dialing the number, without waiting to answer.
Between SIP extensions works fine but not for outgoing external calls.
Any help?
Details:
The call is initiated from the CLI (for simplicity)
CLI> Originate Sip/MySipTrunk/destinationNumber extension 6789#from-sip
in the dial plan:
[from-sip]
ext => 6789.1, answer ()
ext => 6789,n, Playback (demo-congrats)
ext => 6789.n, hangup ()
Thanks....
You need setup answer detection on hardware used for dialout.
You also can write tone detection application, but that require guru level of knowledge and c/c++ programming experience.
There are no tone detect app in default asterisk install.
If detection is ok, issue can be with incorrect order in your "dialler". You can try switch order of call(first callout, not call ext) to be ok.
ps create dialling application require more then advanced level in asterisk. there are alot of other issues in this field.
I think there is an issue with your SIP trunk provider. I'm pretty sure there is 200 OK quite immediately after INVITE and then fake ringing in RTP audio.
not sure whether this was answered. but I see . btn your extension and answer application on the first line.
ext => 6789,1, answer ()
ext => 6789,n, Playback (demo-congrats)
ext => 6789,n, hangup
I am running asterisk on a elastix 2.2 distro. I have a Queue with EXT 9000 where 3 softphone (c#) extensions belong to this round robin queue.
I know that I could trigger a AGI or AMI event from the dialplan and let in some way a webservice know about the length of the queue and then forward this information to the softphones.
Is there any way that the softphones could get this information directly from asterisk. Either something AsteriskBuiltIn or ElastixBuiltIn.
a last resort (baaaaaad) idea was to open a line, call an encoded number like (555*1) and receive back a dtmf. it is a Bad Way but it would work.
Open for any suggestions
Queue drop events into ami.
Also queue log all actions into /var/log/asterisk/queue_log, which is posible put to mysql(see this)
There are no way say how your softphone can catch that event. But for sure you can get that info from mysql and rewrite your softphones to show that info.
Also elastix call center edition have web panel for call center. As option you can check fop2 project for panel.
I´m pretty now to all this Asterisk-thingy and I wonder, is there a way how to call a user back from asterisk after he ended (hangup) call and give him a IVR survey, then save results somewhere (in form of audio records or DTMF inputs) ?
Sure there are alot of way to do that. But all require understanding of how asterisk works.
Hangup events can be detected by "h" extensions something like this
exten => h,1,System(/etc/asterisk/create_callback.sh)
After that you have create script for callback, see
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
You need create IVR in your dialplan
http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Introduction
If you have programming experience you can use AMI(Asterisk Manager Interface) to generate your calls from Asterisk to your customers, based on whatever logic. Once the customer answer the call all you have to do is redirect it to your IVR context.
For the IVR(survey) portion, you may want use AGI(Asterisk Gateway Interface). You can access both APIs with virtually any programming language. Take a look of the following:
Adhearsion (Ruby)
Asterisk-Java or Astive Toolkit (Java)
PHPAGI (PHP)
Good luck.
I understand this should be really easy but I can't find my way around the asterisk configuration files to do this.
What I need in an entry point for a external SIP call to execute an asterisk script. To keep things simple let's say I want to execute something like this:
[my888app]
exten => 888,1,Answer()
exten => 888,2,SayDigits(1234)
exten => 888,3,Hangup
The user will dial this particular 888 SIP extension in the form:
sip:888#mydomain.com
This is not an internal call, the call comes from another server, to test I'm using this Phono sample and the call is getting onto the asterisk server ok, the problem is that I have no idea how to route it to my888app. Already tried /etc/asterisk/sip_general_custom.conf without luck, guess the problem is the context [my888app] is not right. I already have the asterisk CLI in front of me
So, to recap:
No DID funny business, just SIP
In which .conf file do I put the [my888appp]
I dont understand if 888 is an entension or a channel
Multiple calls will be made at the same time to [my888app], is that a
problem?
Right now when I dial from the Phono app I get please enter the
channel number follow by the # sign, I dont know if that is helpful
or not
Thanks!!!
Well, after a lot of searching turns out the routing is as follows (default FreePBX installation):
The SIP calls goes into a context called from-sip-external
from there, it goes to the context from-trunk
from there it goes to from-pstn
from there it goes to ext-did-catchall
And there, in ext-did-catchall, is where I can put my888app and it will execute ok
I'm 100% positive this is not the correct place to put the app, but as I'm not an Asterisk expert I will settle for it.
Hope this help someone else.
Thanks.-
You need check the context attributes in your sip.conf. You can have a context in general section and you can have another in your peer definition, if you dont define any specific context in you peer then the general context attribute is assumed.
For simplicity I advice you change context in general section of sip.conf and put your my888app in extensions.conf.
Example of sip.conf general section:
[general]
context=my888app
...
About 888: it is a extension, an extension is a end point to your call. A channel is a object created dynamically when setting up a call to retain the session information and to exchange data (voice) between two points.
Answer is very simple, Any external call first land on the context which is defined under general section in sip.conf file. There you can define your own dial plan. if you want to redirect to your own context from there then you can use GoSub.