I'd like to forward a call. I can define an extension, answer the call and use Dial command. But t is not what I want. I don't want to answer the call immediately. I'd rather wait the second call to be answered.
How to do it? When I just use Dial(Sip/...) without answering, there is a complete silence on both sides.
I've read (see http://fonality.com/trixbox/forums/trixbox-forums/open-discussion/call-forward-without-answer-dialplan ) that it can be solved by disabling fax. I've unloaded fax modules, but it didn't solve the problem. On the same page, I've read that I can try somethig like http://www.voip-info.org/wiki/view/Asterisk%20auto-dial%20out , but that looks too advanced.
I've another idea. Use Dial(Sip/..., 60, M(a-macro)). But I don't know how to join these two calls in the macro.
Any idea?
EDIT: To make it clear. When I use just Dial (e.g. Dial(SIP/uri) or Dial(SIP/uri, 60, r)), it does the following:
- caller: It rings
- SIP phone (or software) rings
- The call is answered from the SIP phone
- SIP phone: There is no sound.
- caller: It stops ringing, there is no sound
When I add command Playback(invalid) before Dial(...) command, it is completely different:
- caller: It rings
- caller: The call is answered and the message "invalid" is read.
- caller: It rings (but the call is answered and callers pays this ringing time)
- SIP phone (or software) rings
- The call is answered from the SIP phone
- The call is successfully connected
Is seems that the problem occurs if and only if when the call is not explicitly answered (e.g. via Playback(...) or Answer()) before Dial(...) command. So, something like following may help (JQuery-like pseudocode):
call_1.Dial(...).onAnswer(function(call_2){
call_1.Answer();
});
Asterisk tries something similar, but the Asterisk's way is buggy.
Of course, adding Answer() before Dial(...) works, but I don't want to answer the call until the redirected call is answered
I've almost solved it by using Dial(SIP/..., timeout, A(invalid)). Now, I've to use another (zero-length or almost zero-length) sound.