Triggering the Connection of two internal sip devices using a call from a third

Hi there!
I’ll try to keep this as simple and short as possible.

I have three devices; a speaker/mic combo, an intercom with a single button and a VOIP phone. All three are VOIP/SIP devices. The speaker/mic monitors a room and sends audio via multicast which can be heard on the intercom (not through asterisk). When someone wants to speak to the room they can pick up the VOIP phone and establish a SIP call with the speaker/mic combo; the speaker auto answers the call. Multicast stops and the phone now has two way communication with the room speaker through the asterisk server.

The intercom has a button that is also capable of making a SIP call to a single extension and here is what I want to do…When the intercom button is pressed the asterisk server answers the call and then hangs up, it then calls the the VOIP phone. When someone answers the voip phone it then calls the speaker and connects the two calls.

I’m using Trixbox but creating a dial plan in the custom config for this. I’ve tried a few things but haven’t had much luck. From my research it seems like the place to start would be to use the Originate() command to originate a call from within the dial plan but anything I did would just connect the intercom to the phone or fail out.

Any help on this would be greatly appreciated.

Supply what you have done. Otherwise, all I can really do is confirm that you should use Originate.

This is along the lines of what I’ve been trying. I’ve tried a few different variations of it. Originally I had it all in one context, then split it into two like below. Ext. 2 the triggering device is directed to [from-internal-O] and dials ext. 12. I’m then trying to have Ext. 1 ring and when picked up connect it to Ext. 3.

; TEST Originate
exten => 12,1,Verbose(2,Testing from-internal-O)
exten => 12,n,Originate(local/1,from-internal-2,3,1)

exten => s,1,Verbose(2,Testing from-internal-2)
exten => s,n,dial(local/3/n)
exten => s,n,Hangup()

Sounds like you’re just trying to Page a couple of phones. Here’s one way that works with several phone models…

same => n(unidirectional),SIPAddHeader(Call-Info:;answer-after=0)
same => n,Page(${int_data},i,30)
same => n,Hangup()

same => n(bidirectional),SIPAddHeader(Call-Info:;answer-after=0)
same => n,Page(SIP/1&SIP/3,id,30)
same => n,Hangup()

I’m not really trying to page multiple phones. What I’d like to do is have two phones ring and connect when a third phone initiates it.

i.e. SIP call on Ext.1 > Asterisk hangs up on Ext.1 > Asterisk calls Ext. 2 > person picks up Ext. 2 > Asterisk calls Ext. 3 > person picks up Ext. 3.

Ext. 2 and Ext. 3 are now connected in a call.

I also tried various variations of this.

; TEST Originate
exten => 12,1,Originate(SIP/2,from-internal-O,13,1)
exten => 12,n,Hangup()
exten => 13,1,dial(local/2/n)
exten => 13,n,dial(local/3/n)

I’ll have a look at that code you posted though and see if I can figured out if I can apply it to my situation.

Let me see if I have this straight…A call comes in and is answered by Ext 1. When Ext 1 hangs up, that same channel needs to call Ext 2 and Ext 3. Both Ext 2 and Ext 3 can answer and have a 3-way call with the original caller. Right?

If I had to build that, I’d probably try using the Dial command to call Ext 1. When Ext 1 hangs up, drop down to exten=>h,1, and use the ChannelRedirect function on the BRIDGEPEER to send it to a conference bridge which would initiate the calls to Ext 2 and Ext 3.

Thanks mkozusnik, that’s pretty close to what I’m trying to do except I don’t need Ext 1 to call any other device.

I want asterisk to ring Ext. 2, then when someone answers Ext. 2 I want asterisk to ring Ext. 3 from Ext. 2. The SIP device at Ext. 3 automatically answers the call and now Ext. 2 and 3 are connected.

Ext. 1 will only be used to cause the above to happen, it wont connect to anything. I don’t need asterisk to do anything with the incoming call from Ext. 1 except initiate that sequence between 2 and 3.

In your first version,you are missing a default context, to allow you to use local/ without a context, and you are missing extension 3 in your from-internal-2 context.

Ok, is this getting closer? I still can’t even get the originate command to do anything so I must be using it wrong.

Exten 1 dials into [from-internal-1] using Exten 7777. After that I would like to somehow have Exten. 2 ring and once answered call Exten 3. I tried a few variations of this…

; TEST Originate
include => from-internal
exten => 7777,1,Verbose(2,Testing from-internal-1)
exten => 7777,n,Originate(local/2,from-internal-2,3,1)

include => from-internal
exten => _.X,1,Verbose(2,Testing from-internal-2)
exten => _.X,n,dial(local/3/n)
exten => _.X,n,Hangup()

I put in from-internal, I also tried to use SIP/2 instead of local but that didnt make a difference.

– Executing [7777@from-internal-1:1] Verbose(“SIP/1-00000009”, “2,Testing from-internal-1”) in new stack
== Testing from-internal-1
== Spawn extension (from-internal-1, 7777, 2) exited non-zero on ‘SIP/1-00000009’
– Executing [h@from-internal-1:1] Macro(“SIP/1-00000009”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/1-00000009”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [s@macro-hangupcall:4] GotoIf(“SIP/1-00000009”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] GotoIf(“SIP/1-00000009”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] Hangup(“SIP/1-00000009”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/1-00000009’ in macro ‘hangupcall’
== Spawn extension (from-internal-1, h, 1) exited non-zero on ‘SIP/1-00000009’

No more ideas on this?

A line seems to be missing from the trace, as I would expect an Executing for priority 2. Also, this is a screen scrape, not the log file, so there is no timing information

I copied and pasted this text right out of putty so there are no lines missing. I would agree with you, I would expect it to execute the originate but it doesn’t. I’m not sure how the timing would shed more light on this but I’ll recreate this and pull the actual log.

Edit: So I checked the logs an saw this “No application for ‘Originate’” It seems that originate wasn’t included in Asterisk until 1.6.2 and I’m using that installs with trixbox (No I cannot upgrade to a newer version, this version is spec’d). Now I’m going to have to figure out how to manually install the originate application. Good call on checking the logs though, I thought this would have shown up in the shell.

[Feb 21 00:31:05] VERBOSE[22423] logger.c: – Executing [7777@from-internal-1:1] Verbose(“SIP/4-000006cd”, “2,Testing from-internal-1”) in new stack
[Feb 21 00:31:05] VERBOSE[22423] logger.c: == Testing from-internal-1
[Feb 21 00:31:05] WARNING[22423] pbx.c: No application ‘Originate’ for extension (from-internal-1, 7777, 2)
[Feb 21 00:31:05] VERBOSE[22423] logger.c: == Spawn extension (from-internal-1, 7777, 2) exited non-zero on ‘SIP/4-000006cd’

After researching a bit more I’m stuck now. The closest I’ve found is this…

I believe I need to find and put it in usr/lib/asterisk/modules. I went to the GUI section of trixbox but I dont see an originate application available for install. Should I start a new thread on how to install the originate application?

As Trixbox is abandonware, I’m not sure you can say that any version of Asterisk is mandated for it.

You are unlikely to find a backport of the binary. You will need to recompile Asterisk, after obtaining and backporting the source file. It is usually safest to compile all of Asterisk, but if you build using the same options and build environment, you can probably build just the one module.

The chances are that your system was supplied too long ago for the GPL requirement to supply the source on demand may have lapsed, so, if Fonality didn’t supply configuration information for the build, you may have difficulty obtaining that.

Have you thought about using a call file…?

When you dial ext1, a call script is created, that calls ext2 and drops that call in a context that calls ext3…

Not that difficult, but might be hard to do in Trixbox though…

But maybe I dont get what you want to happen…