Asterisk No Audio in Extension - asterisk

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?

Related

Control of SIP phone volume on attended transfer in 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();
}
}

Asterisk, keys don't work on background command,just after background

[out]
exten=>_X.,1,Answer()
exten=>_X.,n,Background(hello)
exten=>_X.,n,WaitExten(5)
exten=>1,1,Goto(check,s,1)
Audio menu are playing, but when I press 1, sound stop and after few second check command run. How to quickly respond to a user request?
You are doing begginer error which described in almost any asterisk book for beginer.
I recommend you read "Asterisk The Future of Telephony" by O'Relly.
This exact error is simple:
in your dialplan you have extension _X., which mean "any number starting with digit.
you ask asterisk waitfor extension selected in this context.
you are pressing digit, but acordinly to context you may want enter 1111(also fit you context). So asterisk wait upto TIMEOUT(digits) until you enter next digit.
your timeout is 5 second, so it go ext 1 in 5 second.
[Syntax]
BackGround(filename1[&filename2[&...]][,options[,langoverride[,context]]])
You can use other context for matching.

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!

How to get the dialled number in parallel calling in asterisk

I want to set up a parallel calling dialplan in asterisk.I have searched a bit and found that we can call parallel in asterisk with the below command.
exten => _X.,1,Dial(DAHDI/g0/${NUMBER1}&DAHDI/g0/${NUMBER2})
So what i understood that asterisk server calls both number paralelly which one picks first the call is connected to that person and other hangup.
My problem in that how do i get the number which picks the call.Is there any variable to get the dialled number?
Thanks.
You can use on-answer-macro - M option of dial command to put any info into cdr.
Also you probably re-inventing queue with queue_log.

Multiple DTMFs defined to leave_conference

I need to be able to define multiple DTMF digits to exit a CONFBRIDGE conference. Once out of the conference, I need to know what DTMF digit was pressed.
I want to implement the following:
Press 4 for the previous conference
Press 6 for the next conference
Press the star key to exit the conference
Therefore, I need to define 3 keys for exiting the conference, but I need to know which key was pressed when I'm out of the conference.
I tried using dialplan_exec, but once you are out of the conference executing your dialplan snippet of code, you can't kick yourself out of the conference. I tried using AMI commands and CLI commands and the command appears to work, but confbridge list confirms that you are still in the conference. Therefore, if I have the code put me into another conference room, then confbridge list shows me as being in two conference rooms at the same time.
Any ideas??? Thanks in advance!
Use something like this:
exten => _X.,1,ConfBridge(500)
exten => _X.,2,Dumpchan
you will see variable it set on exit.

Resources