Control of SIP phone volume on attended transfer in Asterisk - asterisk

I've been trying to resolve a volume issue. I have an analogue SIP phone that has low gain on its microphone. This can be remedied by putting the following in its extension.ael config:
Set(VOLUME(TX)=4);
The problem is that the caller to this extension will be making attended transfers and the change in channel volume distorts the voice prompt "transfer" and the subsequent dial tone.
Is there a way that I can redefine "atxfer" in features.conf, or use a featuremap to make the transfer, such that the volume of the channel is set back to 1 before the transfer is made? I would like to do the opposite after that, ie. return the volume of the extension to 4 when the transfer is finalised with "atxferthreeway".
If anyone can help with this or has other suggestions, please let me know.

You can do manual version of transfer via feature codes(features.conf)
No, there are no option like change volume while transfer.

I found a solution, the problem is that the gain increase should be set on the receiver's channel and not on that of the caller. This way the voice prompts on the caller's channel don't get distorted. The solution uses a pre-dial handler. Here are the relevant parts from extensions.ael:
context outgoing {
greenphone_pre_dial_handler => {
Set(VOLUME(RX)=5);
Return();
}
601 => { // green phone
Set(VOLUME(TX)=1);
Dial(SIP/sip-spa1,20,Tb(outgoing^greenphone_pre_dial_handler^1));
Hangup();
}
}

Related

RxAndroidBle rxBleConnection.writeCharacteristic

I am running the entire sample application provided in RxAndroidBle from scanning to discover services to writeCharacteristic. I am trying to debug into the flow and put a break point in onWriteClick() of the CharacteristicOperationExampleActivity.java file. Clicking the WRITE button does nothing. Break point wasn't caught.
Reading the instruction from the blog RxAndroidBle
Stating that discovering characteristic is optional for write. But the way this sample app's activities are setup, one has to go thru discovering the characteristics before the Characteristic Operation page will be shown. On the characteristic page, I selected the read/write characteristic entry to get to the Operation page. Isn't that the correct way to operate the app?
Also, is there a way to handle writeCharacteristic without having to discover its characteristics? I don't want to show the characteristic view and the user has to pick the correct characteristic to be able to read and write to the BLE device.
In any case, the sample app discovered my BLE device and connected to it but failed to write to it however. Does anyone have experience with RxAndroidBle, please help.
There seems to be a bug in the example - I couldn't make it to work (despite connecting the buttons were disabled) - will need to look into it.
As for the quick-fix you can replace the onConnectToggleClick() method with:
#OnClick(R.id.connect)
public void onConnectToggleClick() {
if (isConnected()) {
triggerDisconnect();
} else {
connectionObservable
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe(() -> connectButton.setText("Connecting"))
.subscribe(
rxBleConnection -> {
Log.d(getClass().getSimpleName(), "Hey, connection has been established!");
updateUI();
},
this::onConnectionFailure
);
}
}
The sample application is not meant to be run with any particular BLE device so to show possible BluetoothCharacteristics of an unknown device it needs to perform an explicit discovery to present them to the user. When using the library with a known device you can safely use UUIDs of BluetoothCharacteristics you're interested in without performing the discovery (it will be done underneath either way but you don't need to call it explicitly).

Astarisk Call File_Can wait or get response to start playback?

Channel: $number
Application: Playback
Data: $outputfilename
When callee answers the phone, s/he misses the first one or two words. So I would like to wait untill s/he gives any response like "hello?' or "alo" and then start playback. Is there anyway to make it done in the call file?
If there is not at least I would like to wait 1 or 2 seconds. Does wait(2) works here?
Use
Channel: $number
Application: Playback
Data: beep&silence/2&$outputfilename
That way it will play beep, which probably will be not heared by human, but for sure will start rtp process. After that 2 second wait(silence file) which may be required for echocancel training or connection process. That way you message will go clear.
You can create new dialplan context. In it You add Wait application and then Palyback. In call file you can connect number to this new context by specifying it directly or dialing to it via Dial(Local/XXX#new-context)
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
The issue you're having is the RTP stream not being fully "up". Until the call is established, RTP (sound) isn't shipped. So, if you "start talking" right away, you loose words. This is a dialplan side problem, because it depends on both ends of the call being in the "shipping sound" phase.
Using Answer() ; Wait() will not always fix this issue on VoIP connections, because it doesn't actually get the audio stream moving. Wait() is more for cranky T1 lines with slow set-up speeds where you are literally waiting for the rest of the hardware to catch up.
You can get around this by just playing 1 or 2 seconds (1 works 80% of the time) of silence. Eg:
[answering_context]
exten => s,1,Verbose(2,Example of good audio discipline)
same => n, Playback(silence/1)
same => n, Playback(the_real_message_you_want_to_send)
"Silence" is technically "still sound", but the human can't tell if you are shedding packets or clipping words during "silence". By the time the the_real_message_you_want_to_send gets played, the audio stream will be fully stable.
Cheers!

Detect silence while playing sound

I am developing an java-asterisk application that is calling subscribers to deliver messages. At some moments during the call, I need to monitor whether the subscriber is talking or is silent. I need to monitor that for a fairly long time (1-3 seconds) but don't want to interrupt the flow of the outgoing message.
The way I am doing it now is as below
streamFile(*file A*);
exec("WaitForSilence","300,1,1");
waitStatus=getVariable("WAITSTATUS");
streamFile(*file B*);
This works fine but it is only a 300ms detect and a 1s timeout, so from the subscriber point of view the silence between file A and file B is almost unnoticeable. But if I want to listen for longer (say 3 seconds for example) then the subscriber's experience will be ruined.
What I would need is a function similar to "WaitForSilence" but that:
runs in parallel to the script;
delivers its outcome in a variable channel with a name that I define (as there might be several calls to the function, and I need to get all the results)
I've been looking for more than aweek now and couldn't find a way to do that. Any ideas?
Code you provided will do wait, after that will do playback.
There are no way do that simple in one application.
Posible ways:
1) create c/c++ application(asterisk guru skill required) for that.
2) create enother channel, mix it with ChanSpy and in that channel do silence detect. Complexity - expert in asterisk.
Both are not so short(more then 2-3 screens of code), so can't be described in this site.
You can also try use Background application, but i am afraid it will not work too.

Asterisk No Audio in Extension

I have an inbound number that I want to connect to my cell. The problem I'm having is that unless I use the music on hold flag, I don't get any audio.
For example:
exten => 1**********,1,Dial(SIP/1**********#flowroute,30,m)
The above works great, ot rings on my cell and the call is connected and we can talk.
Now when I remove the music flag or try an ring flag because I need the ringing sound, it connects to my cell, but when I answer, all I get is silence:
exten => 1**********,1,Dial(SIP/1**********#flowroute,30)
exten => 1**********,1,Dial(SIP/1**********#flowroute,30,r)
Neither of the above works.
Anyone encountered this or have a fix?
[SOLVED]
I added progressinband=yes to sip.conf under the general area. Now when I call with no flags, it rings and there is audio after I pick up.
Do a SIP trace and see which of "180 Ringing" and/or "183 Session Progress" responses that 1** peer sends you when you dial it without "m" or "r", in what order, and which has SDP. If it differs from cases where you do get ringback, then the problem is the calling peer, and you need to try different progressinband settings for that peer (yes / no / never) to work around it.
It's very strange that you get silence after answering when you don't use "m" in Dial(). NAT problem?

Communication between two nodes

I have an assignment to implementation of communication between 2 PC terminals using Ethernet.
There is no big deal in establishing network between 2 nodes. but the the big deal is "8 bit data sent on one node is to be decoded on the other node & the same is to be displayed & if possible though a front end window."
the specs for the front end window on the receiving node is as follows , say for example 10110101 is sent from node 1 , the same is to be decoded & interpreted as below using a frontend GUI window , A-On
B-off
C-On
D-On
E-Off
F-On
G-Off
H-On
So please someone suggest me is any other application available to see the decoding process on terminal or what are the steps i need to intiate.
All your suggestions are appreciated,
Thanks in advance,
I guess your specific solution depends on if you are allowed to use existing libraries. Either way I would checkout networkComms.net, an open source network library written in C#.
You could achieve your basic goal if you modify the basic send example (11 lines of code) here. Instead of sending a random string, send your 8 bits, and on the receiving end, rather than just writing the string to the console do something cleverer:
if (recievedString == "10110101")
{
//Do this
}
else
{
//Do this instead
}
If you are not allowed to use existing libraries and have to write something from scatch perhaps networkComms.net could act as a good guide?

Resources