4

I have a completely standard installation of Trixbox with 2 SIP extensions set up on it.

Both extensions are Snom 370 SIP phones.

I can originate a call from one extension to the other using the following CLI command:

originate sip/101 extension 102

This causes the phone on 101 to ring, then when that phone is picked up it dials 102.

What I would like is for the phone on 101 to automatically call 102, without 101 waiting to be picked up.

Is this something that can be done, or do the SIP phones always need to ring before they place a call?

Roland
  • 146
  • 1
  • 1
  • 6

2 Answers2

4

I ended up creating a couple of new contexts in extensions.conf

[clickoutcontext]
exten => _X.,1,NoOp("Click In Context")
exten => _X.,n,SIPAddHeader(Call-Info: <sip:pbx.your-company.de>\;answer-after=0)
exten => _X.,n,Dial(Sip/${EXTEN})

[clickincontext]
exten => _X.,1,NoOp("Click Out Context")
exten => _X.,n,SIPRemoveHeader(Call-Info)
exten => _X.,n,Dial(Sip/${EXTEN})

And then using an AMI action to make the call:

ACTION: Originate
Channel: Local/101@clickoutcontext
Exten: 102
Priority: 1
Timeout: 60000
Context: clickincontext

This sends a header to the Snom phone making the call to tell it to auto answer and then removes it before the call is placed to the second phone.

Roland
  • 146
  • 1
  • 1
  • 6
0

You can use AMI (Asterisk Manager Interface) for originating call. Action "Originate" can be used with header "Async: yes", that allow made a call in both direction in same time.

Yo can also made it using CLI, using Local channel for calling SIP/101 and answering call before executing Dial command to SIP/101 device.

IgorG
  • 82
  • 4
  • 1
    Thanks for your help! OK, I've changed to the AMI interface and I'm making an Async call with the following code: ACTION: Originate Channel: SIP/101 Exten: 102 Priority: 1 Timeout: 60000 Async: yes Context: default However, the phone on 101 still rings and I have to answer the call before it will place the call to 102. Am I doing something wrong? – Roland Feb 21 '12 at 09:01
  • `Async: yes` only makes the AMI return the response in the form of an event rather than a method result. It does not change how the command is executed. – GSerg Apr 18 '16 at 09:53