im using asterisk in my application and this is how my extensions.conf looks
[default]
exten => _[*#0-9a-zA-Z+].,1,Answer
exten => _[*#0-9a-zA-Z+].,n,Wait(2)
exten => _[*#0-9a-zA-Z+].,n,Monitor(wav,test123,i)
exten => _[*#0-9a-zA-Z+].,n,Dial(SIP/0000FFFF0001,35,L(2000)|A(hello-world))
i configured 0000FFFF0001 sip phone and that is also playing an announcement.So there are 2 playbacks from both ends.But when i listen to the test123.wav file it contains only the sound that played from 0000FFFF0001 after the hello-world finished.So basically i don't have the sound part from 0000FFFF0001 announcement when when asterisk playback is there.
You have to check flags in Monitor application - url to doc
i - Skip recording of input stream (disables m option).
So in your case you use i flag which disables recording of second side of call. You just have to remove it, then you will receive 2 files, each for one side of call. If you want asterisk to mix them use m flag.
Related
We are using atom electron to run an app in a "kiosk" type setting, we have 4 webcam devices connected to the physical computer, we want specifically 1 of those to be used for webrtc inside of the electron browser, then other 3 we use some C code to capture still frames. We know the USB path or the /dev/video{#} for the device we want.
Is there a way to either disable access by the view layer to the 3 webcams in node before we launch the electron window? Or another option is to set the default camera before we launch the view layer so that it will default to the webcam we want.
In the view layer we can get a list of devices and see if they are audio or video, but we can't get their /dev/video# or their USB path to figure out which one is the target webrtc cam, so this has not been very helpful yet.
Any help is great, I feel weird for having to post a question since for the last 12 years I have been able to find what I needed by searching, but its been about 3 hours so its time to ask for help.
I don't think Chromium provides a way to retrieve the USB path for a media source. You'll probably need to display a configuration screen to allow the user to select the correct camera (similar to this demo) the first time around and then use the source/device id as a mandatory constraint from that point on.
Another option is to find the correct camera based on the device label, though obviously this will only work if each camera has a distinct label. You can get all the device labels and ids by running this snippet in the DevTools console:
navigator.mediaDevices.enumerateDevices()
.then(devices => devices.forEach(
device => console.log(`kind: ${device.kind}: ${device.label} id=${device.deviceId}`)
))
.catch(err => console.log(err));
Either way, once you have the source/device id you can specify it as a mandatory constraint to ensure that only that one particular camera is used:
navigator.webkitGetUserMedia(
{
audio: false,
video: {
mandatory: {
chromeMediaSourceId: 'the camera source id obtained earlier',
}
}
},
stream => console.dir(stream),
error => console.log(error)
);
I am trying to create dialplan for incoming/outgoing for given numbers:
+xx xxx [xxxxxxxxx|xxxxxxxx]
I have already configure my service provider information in sip.conf
[sipprovider]
type=friend
secret=xxxxx
defaultusername=xxxxx
host=xxx.xx.xx.xxx
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
allow=gsm
insecure=port,invite
;fromdomain=xxx.xx.xx.xxx
context=default
nat=yes
Now, I want to create incoming/outgoing trunk, my extensions allow to dial international calls and incoming call received on given number.
+xx xxx [xxxxxxxxx|xxxxxxxx]
[default]
switch => Realtime
exten => 55,1,Verbose(1,Echo test application)
exten => 55,n,Dial(SIP/sipprovider/0091XXXXX99999#sipprovider); Here is the outbound call, the exact dialstring depends on outgoing provider and channeltype
exten => 55,n,Hangup()
Display: Calling....
and then, VM Play: Person you are calling is unavailable
Asterisk Console:
== Using SIP RTP CoS mark 5
-- Executing [55#default:1] Verbose("SIP/3001-00000029", "1,Echo test application") in new stack
Echo test application
-- Executing [55#default:2] Dial("SIP/3001-00000029", "SIP/sipprovider/0091XXXXX99999#sipprovider") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/sipprovider/0091XXXXX99999#sipprovider
[Aug 17 18:29:02] WARNING[32467]: chan_sip.c:4024 retrans_pkt: Retransmission timeout reached on transmission 78a9b28011fd522601047c9317adca91#xx.xx.xx.xx:5060 for seqno 102 (Critical Request) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 32000ms with no response
[Aug 17 18:29:02] WARNING[32467]: chan_sip.c:4053 retrans_pkt: Hanging up call 78a9b28011fd522601047c9317adca91#xx.xx.xx.xx:5060 - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [55#default:3] Hangup("SIP/3001-00000029", "") in new stack
== Spawn extension (default, 55, 3) exited non-zero on 'SIP/3001-00000029'
-- Executing [h#default:1] Verbose("SIP/3001-00000029", "Hangup...") in new stack
Hangup...
Basically a dialstring can be in 'SIP/devicename/extension' or 'SIP/username#host' format. SIP/sipprovider/0091XXXXX99999#sipprovider is wrong.
"Retransmission timeout reached" means that asterisk tries to send an INVITE to sipprovider, but sipprovider's SIP port (5060 UDP) isn't accessible. You can see this in SIP debug.
I managed (with very much joy :D) to configure chan_mobile with asterisk 1.8 and my iPhone 4 and outgoing calls work nicely.
I have issues with automatic answering incoming calls.
This is what my chan_mobile.conf looks like:
[adapter]
address = 11:11:11:11:11:11
id = box-1
[iphone]
address = 22:22:22:22:22:22
port = 8
context = from-test-phone
adapter = box-1
and in /etc/asterisk/extensions.conf I added
[from-test-phone]
exten => s,1,Answer()
exten => s,n,Wait(1)
exten => s,n,Hangup()
But when I call my mobile phone there is no answer.
The bluetooth device is paired and active
# rasterisk
> mobile show devices
ID Address Group Adapter Connected State SMS
iphone 22:22:22:22:22:22 0 box-1 Yes Free No
Am I missing something?
Apparently it was enough to type
rasterisk
> core set verbose 4
> core set debug 4
thanks user1938742!
I am developing a sample IVR system in the Asterisk that plays a voice file when it receives and answers an incoming call. I wonder if it is possible to write a dial plan code or shell script which records message while it is playing a voice file (play and record simultaneously).
I appreciate your help in advance.
Yes, it is. I do it all the time, in fact. Your code would look something like:
exten => 100,1,Answer
same => n,Wait(1)
same => n,Monitor(wav,myfilename)
same => n,Playback(this-call-may-be-monitored-or-recorded)
same => n,Playback(pls-wait-connect-call)
For further reading, see:
http://www.voip-info.org/wiki/view/Asterisk+cmd+Monitor
http://www.voip-info.org/wiki/view/Asterisk+cmd+Playback
I want to know how to run an ivr on a outbound call.
I did the the settings in extensions.conf of asterisk like this.
[outgoing] ;context
exten => 1567XXXX,1,Dial(SIP/101010#ip) ;the call is successfully route on this number
exten => 1567xxxx,1,Answer()
exten => 1567xxxx,n,Wait(1)
exten => 1567xxxx,n,Playback(hello-world) ;but i want this ivr to be play when end user pick up the call
Try to use macro at Dial command:
[outgoing] ;context
exten => 1567XXXX,1,Dial(SIP/101010#ip,,M(call))
[macro-call]
exten => s,1,Wait(1)
exten => s,n,Playback(hello-world)
exten => s,n,MacroExit
You need create outbound call and put other side of call to your context. Please check this article: http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
Note: if you are gooing create dialler, that is realy bad idea. Better got opensource one or hire professional. It will be alot of issues in this path.
You have got two possible options. One is use the "Orignate" command. See http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+Originate for an example.
The other one, which is what I favor in my solutions, since it does not require AMI, is using spooled call files. See https://wiki.asterisk.org/wiki/display/AST/Asterisk+Call+Files for how to do them. The trick, and I cannot stress it enough, is to create the spool file in /tmp and then "move" the file into the ../spool/asterisk/outgoing directory.
If you assign a unique channel variable key/value to the spooled call, you can then pick it up with your dial plan and route the call appropriately.
If you are building a batch dialer system, at its most fundamental is a database application that creates call spool files once a minute, equal to the number of lines your system has that are on-hook. Complexity of your spooling system increases fairly rapidly if you want to worry about predictive/ optimized dialing, or passing calls to agents.
Creating outbound calls in a spool-like way is not as easy as suggested by MichelV69 - I mean, it is that easy, but things start to get downhill fast as soon as you start having new requirements. I totally agree with the article here http://www.wombatdialer.com/manuals/WD_UserManual-chunked/ar01s01.html#_why_was_wombatdialer_created because that's what you'll be facing