Module use_case_single_bridge

Use-Case-Single-Bridge is a part of the BridgeServer use case (see use_case_bridge_server.

Copyright © 2005-2006 Ericsson

Version: 1.0

Behaviour: gen_server.

Authors: Freek Sanders (freekisanders@gmail.com) [web site: http://www.freeksanders.tk].

Description

Use-Case-Single-Bridge is a part of the BridgeServer use case (see use_case_bridge_server. Use-Case-Single-Bridge is started by the BridgeServer and communicates with both the BridgeServer and ExtENS.

Use Case Actions

Use-Case-Single-Bridge can be started in two ways:
(see use_case_single_bridge). Through the BridgeServer, when he calls start_link_incoming, and this is the A party. When this happens, the SingleBridge sends a message to ExtENS to indicate that a call came in. After a certain period, a 'hangup' message might be received from BridgeServer, after which SingleBridge passes this message onto ExtENS and dies.
Through ExtENS, when this SingleBridge is the B party. When this happens, the SingleBridge contacts the BridgeServer so as to create a new leg and route this. As a result, the SingleBridge gets a leg id back from the BridgeServer (see use_case_single_bridge:set_leg_id/2). After the leg has attached, the SingleBridge gets a 'attached' message (see use_case_single_bridge:leg_attached/1). After a certain period, a 'hangup' message might be received from ExtENS, after which SingleBridge passes this message onto the BridgeServer and dies.


Final Note

Use-Case-Single-Bridge has been implemented using the gen-server behaviour. This means that all function calls returning 'ok' (see below) are gen_server casts, which carry out their function asynchronously. An 'ok' does not mean success. If a function has success or not can only be derived from side-effects and messages printed to the command line.

For more information about the flow of events and an explanation of terms see ext_ast_interface.

Function Index

backward_isup/2A backward_isup message came in from ExtENS.
call_created/2A call has been created by the Ext-Ast-Interface.
die/0Destroys the use case.
forward_isup/2A forward_isup message came in from ExtENS.
get_addr/1Get the original and destination address of the bridge.
get_switch/1UseCaseSingleBridge must give the process id of its switch.
incoming_call/4A new caller has been detected by Asterisk.
leg_attached/1The leg has been attached.
leg_released/2The leg of the SingleBridge has been released.
leg_routed/1The leg has been routed.
set_leg/3UseCaseSingleBridge must change its leg and switch.
set_leg_id/2Set the leg id of this bridge.
start_link/4

Function Details

backward_isup/2

backward_isup(Pid::pid(), Message::string()) -> ok

A backward_isup message came in from ExtENS. A message has been received from the B (called) party.

Introduced in: 1.0

call_created/2

call_created(Pid::pid(), CallId::int()) -> ok

A call has been created by the Ext-Ast-Interface. The Ext-Ast-Interface has created a call with the indicated CallId.
This has happened in reaction to a command sent by the SingleBridge indicated by the Pid.

Introduced in: 1.0

die/0

die() -> ok

Destroys the use case.

Introduced in: 1.0

forward_isup/2

forward_isup(Pid::pid(), Message::string()) -> ok

A forward_isup message came in from ExtENS. A message has been received from the A (caller) party.

Introduced in: 1.0

get_addr/1

get_addr(Pid::pid()) -> ok

Get the original and destination address of the bridge. Ext-Ast-Interface wants to retrieve the original and destination address of the SingleBridge indicated by the Pid.

Introduced in: 1.0

get_switch/1

get_switch(Pid::pid()) -> ok

UseCaseSingleBridge must give the process id of its switch.

Introduced in: 1.0

incoming_call/4

incoming_call(CallId::integer(), OrigAddr::string(), DestAddr::string(), GlobalCallId::tuple()) -> F::function()

A new caller has been detected by Asterisk. Ext-Ast-Interface alerts the use case to a incoming call.
A incoming call means that both a call with id CallId and a leg with id 1 have been created.

Introduced in: 1.0

leg_attached/1

leg_attached(Pid::pid()) -> ok

The leg has been attached. Ext-Ast-Interface has attached the leg of the SingleBridge.
This has happened in reaction to a command sent by the SingleBridge indicated by the Pid.

Introduced in: 1.0

leg_released/2

leg_released(Pid::pid(), Cause::string()) -> ok

The leg of the SingleBridge has been released. The leg of the SingleBridge has been released. The reason for this is indicated by the 'Cause' string.
This might have happened in reaction to a command sent by the SingleBridge indicated by the Pid.

Introduced in: 1.0

leg_routed/1

leg_routed(Pid::pid()) -> ok

The leg has been routed. Ext-Ast-Interface has routed the leg of the SingleBridge.
This has happened in reaction to a command sent by the SingleBridge indicated by the Pid.

Introduced in: 1.0

set_leg/3

set_leg(Port::atom(), Pid::pid(), Switch::atom()) -> ok

UseCaseSingleBridge must change its leg and switch. Another process instructs UseCaseSingleBridge to change its leg and switch to the given leg and switch.

Introduced in: 1.0

set_leg_id/2

set_leg_id(Pid::pid(), LegId::int()) -> ok

Set the leg id of this bridge. Ext-Ast-Interface wants to set / change the leg id of the SingleBridge indicated by the Pid.

Introduced in: 1.0

start_link/4

start_link(IncomingProcess, ForwardCounter, MSC, ExtraInfo) -> term()