pbx presentation)

48
Design and Implementing Design and Implementing a 1 a 1 - - to to - - 4 PBX System 4 PBX System Using a Microcontroller Using a Microcontroller Behdad Hosseini University of Isfahan, Iran May 2003

Upload: saqib-hayat

Post on 06-Mar-2015

68 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Pbx Presentation)

Design and Implementing Design and Implementing a 1a 1--toto--4 PBX System 4 PBX System

Using a MicrocontrollerUsing a MicrocontrollerBehdad HosseiniUniversity of Isfahan, IranMay 2003

Page 2: Pbx Presentation)

May 20031-to-4 PBX Project2

PrefacePreface

This is the presentation of a project in partial fulfillment of the requirement for the degree of Bachelor of Engineering in hardware engineering presented to Department of Computer Engineering, Engineering Faculty, University of Isfahan. The title of project is “Design and Implementing a 1-to-4 PBX System Using a Microcontroller”.The project started since September 2002 and lasted until May 2003. I’ve done lots of its work in my home without any laboratory facility. So I hope I’ve done something acceptable.There are some useful technical documents about my project like hardware schematics, a project report (but in Farsi) and its software in assembly language. All of them can be found in the project’s web site. I like to acknowledge everybody (especially my family) that helped my in my project.

Page 3: Pbx Presentation)

May 20031-to-4 PBX Project3

AbstractAbstract

Telephone centers or more precisely, branch exchange systems, are electrical and electronical systems that are responsible for establishing telephony communications. Their behavior can be explained by making conversations between connected phones. Private Branch eXchanges (PBXs) are some kind of such systems that are mainly used in companies, organizations and other private complexes.In this project, I’ve designed and implemented a PBX system that is capable of switching 4 phones (lines) and an external connection(trunk). A microcontroller from MCS-51TM family is used for handling and controlling the whole system. The switching unit is realized via 3 analog conversation circuits (one for each conversation connection). The hardware is implemented on 8 breadboards and the software is in the MCS-51TM assembly language.

Page 4: Pbx Presentation)

IntroductionIntroduction

Page 5: Pbx Presentation)

May 20031-to-4 PBX Project5

ContentsContents

Switching TheorySwitching TheoryTelephone Switching SystemTelephone Switching SystemAbout The PhonesetsAbout The Phonesets

Page 6: Pbx Presentation)

May 20031-to-4 PBX Project6

Switching Theory (1)Switching Theory (1)

Switched NetworkSwitched Network A network consists of some entities (stations) that can communicate with each other and some controlling systems. If we use some switching nodes instead of connecting every pair of stations, we’ve made a switched network.SwitchingSwitching means controlling some connections to making favorite paths. These selections (and its actuators) are under our control. A path can carry any signal from power to speech signals. About our task, assume we have some phones or equally some speech signals.We want to connect these phones to each other so we are concerned about switching these signals.

Page 7: Pbx Presentation)

May 20031-to-4 PBX Project7

Switching Theory (2)Switching Theory (2)

Types of switching:Types of switching:–– CircuitCircuit the traditional form of the switching which makes the paths

physically by switches like relays and codecs. It is like an electrically close circuit that connects our two desired points. So we can have any kind of signaling if the frequency response of the path allows us and the current value is supported by the elements. It means we can have analog or digital data.

–– PacketPacket this kind of switching makes a virtual path not a physically one. The data must be digital and encapsulated in packets. A packets is a collection of data bits plus control bits that constructs its frames. The switching can be performed by a simple PC or some specially designed digital processing systems. So we can only transmit digital data or digitized analog data.

Page 8: Pbx Presentation)

May 20031-to-4 PBX Project8

Telephone Switching System:Telephone Switching System:Definition (1)Definition (1)

DefinitionDefinition An electrical and electronical circuit switching system is called Telephone Switching System if the switched data is in the form of analog speech signals (i.e signals with frequency between 0 and 4kHz) and can understand the request signals like dialing and can also send meaningful informative signals like ringing. The electronictechnology of the system doesn’t matter. The important aspect is the system behavior not the system structure. The switching section usually is implemented in circuit switching model and can be analog or can be digital as is done in new high performance systems.BehaviorBehavior From more practical point of view, Telephone Switching Systems are capable of establishing conversation connections between some connected phones or some external links (e.g from another system).

Page 9: Pbx Presentation)

May 20031-to-4 PBX Project9

Telephone Switching System:Telephone Switching System:Definition (2)Definition (2)

Types (Electronics)Types (Electronics) The Telephone Switching Systems can be categorized by the electronic technology to:

– analog – digital

Types (Domain) Types (Domain) There’s also another kind of categorization that is related to the domain of use (will be discussed in the next slides):

– Global eXchange (GX)– Private Branch eXchange (PBX)

Page 10: Pbx Presentation)

May 20031-to-4 PBX Project10

Telephone Switching System:Telephone Switching System:HistoryHistory

PointPoint--toto--point phones in 1876 (Bell)point phones in 1876 (Bell)Manual Telephone Switching CenterManual Telephone Switching CenterCrossbar (Matrix) Telephone Switching CenterCrossbar (Matrix) Telephone Switching CenterAutomated Central Telephone SwitchingAutomated Central Telephone SwitchingAnalog Telephone Switching SystemAnalog Telephone Switching SystemDigital Telephone Switching SystemDigital Telephone Switching SystemExchange SystemExchange System

Page 11: Pbx Presentation)

May 20031-to-4 PBX Project11

Telephone Switching System:Telephone Switching System:Some Technical Words (1)Some Technical Words (1)

LineLine A voice link is called a line if it is supposed to connect a phone (or some systems alternatively) to the telephone network. Each lines contains just one conversation link.TrunkTrunk A voice link is called a trunk if it connects two switching systems. So a trunk may contain more than one conversation links(multiplexing).Tip & RingTip & Ring These are two wires that carries electrical voice signals (in analog form). The positive one is called Ring and the negative is Tip.Inbound SignalingInbound Signaling If the request and respond signals (like dialing and ringing) is carried over tip and ring, it is inbound signaling. It is more used in lines where one side is a phoneset.

Page 12: Pbx Presentation)

May 20031-to-4 PBX Project12

Telephone Switching System:Telephone Switching System:Some Technical Words (2)Some Technical Words (2)

Outbound Signaling Outbound Signaling If we add some wires to the tip and ring just for transmitting the control signals, it is called outbound signaling. In this form, conversation is isolated from other signals. The trunks usually uses outbound signaling because of its higher quality and ease of use.Conversation CircuitConversation Circuit In analog telephone switching system there are some buses (separated from each other) that may hold conversations and is called conversation circuits (one conversation in one circuit). It means each line / trunk can be connected / disconnected from each bus (like a matrix).

Page 13: Pbx Presentation)

May 20031-to-4 PBX Project13

Telephone Switching System:Telephone Switching System:GXGX

Global eXchange (GX)Global eXchange (GX) is a switching system that is implemented in high scales to support a lot of lines and trunks. The formal telephone network is implemented by GXs. The local telephone wires that iscame to our house is from a GX. These systems are connected hierarchically to build the whole telephone network in a country or in the world. The systems in leaf of that tree is connected to phonesets or alternatively to a PBX.ConnectionsConnections As is obvious from next slide, a GX is connected to phonesets (or PBXs) through lines and another GXs through trunks. A digital processing system can observe and control the policies of the system but can be removed later. Monitor panel is a panel to show some signals like current connections.

Page 14: Pbx Presentation)

May 20031-to-4 PBX Project14

Telephone Switching System:Telephone Switching System:GX ConnectionsGX Connections

… GX Switching System

Data Processing System

Monitor Panel

Power

Trunks &Another GX

Phone 1Line 1

Phone 2Line 2

Phone ILine I

Signals

Page 15: Pbx Presentation)

May 20031-to-4 PBX Project15

Telephone Switching System:Telephone Switching System:PBXPBX

Private Branch eXchange (PBX)Private Branch eXchange (PBX) is a switching system but usually in much lower scales to support the lines and trunks just for an organization, company or another private complex. It designed for private use i.e to switch some phonesets internally and also forexternal connections through a few incoming lines (from the local GX). So a hospital, hotel and … can connect all of its phones to the public telephone network just through some few links.ConnectionsConnections As is obvious from next slide, a PBX is connected to phonesets (or PBXs) through lines and GXs through trunks. A digital processing system can observe and control the policies of the system but can be removed later. Monitor panel is a panel to show some signals like current connections. Operator is a phoneset-like system that has the ability to control connections specially from trunks to lines and some other permissions.

Page 16: Pbx Presentation)

May 20031-to-4 PBX Project16

Telephone Switching System:Telephone Switching System:PBX ConnectionsPBX Connections

…… PBX Switching System

Trunk 1GX 1

Data Processing System

Operator Monitor Panel

Power

Trunk 2GX 2

Trunk JGX J

Phone 1Line 1

Phone 2Line 2

Phone ILine I

Page 17: Pbx Presentation)

May 20031-to-4 PBX Project17

About The Phonesets (1)About The Phonesets (1)

OnOn--hook / Offhook / Off--hookhook These are two traditional words to express the physical mode of the phone. When the handset of a phoneset is in its place and can be ringed, it is in on-hook mode. When the handset is in hand (a conversation or dialing is in progress) the mode is off-hook.VoiceVoice The most important aspect of a phoneset is its ability to send and receive speech signals through two wires: tip and ring. In ahandset there is a speaker and a microphone and the tip and ring pass through these components (serially). The switching system is responsible to put a dc power on these wires so the voice signals can be carried over this voltage. It is obvious that in the conversation mode the phoneset shows a dc resistance and lets dc current pass (a dc-loop).

Page 18: Pbx Presentation)

May 20031-to-4 PBX Project18

About The Phonesets (2)About The Phonesets (2)

DialingDialing When a phone wishes to connect to another, there must be a way of addressing the destination. In nowadays telephone networks, each phone (line) has a unique decimal number (with respect to its local). The process of repeatedly sending the digits of destination no is called dialing. There are two dialing modes:–– PulsePulse the phoneset opens and closes the dc-loop in a predefined timing to

send the the dialed digit to switching system.–– ToneTone the phoneset sends some special wave with predefined timings and

frequencies to show the dialed no. It this mode the dc-loop always exists.

RingingRinging When a phone wishes to connect to another one, the switching system sends an ac power to the destination. If the destination phone is in on-hook mode, it rings. In the on-hook mode there isn’t a dc-loop but an ac-loop establishes.

Page 19: Pbx Presentation)

May 20031-to-4 PBX Project19

About The Phonesets (3)About The Phonesets (3)

Notifying TonesNotifying Tones There are some tones that switching systems send to phones to inform the user of the result of its request.–– Dial toneDial tone a continuous wave after the handset pickup. It means it is ready

to accept the dialing.–– Ring back toneRing back tone a discrete wave synchronous with ring wave to inform

the requester that the requested phone is ringing.–– Busy toneBusy tone a discrete wave which means the requested phone is busy.–– Invalid toneInvalid tone a discrete one which means the dialed number is invalid.

Usually, its frequency is higher than the other tones.

Page 20: Pbx Presentation)

The ProjectThe Project

Page 21: Pbx Presentation)

May 20031-to-4 PBX Project21

ContentsContents

TitleTitleBehaviorBehaviorDesign ConsiderationsDesign ConsiderationsHardwareHardwareSoftwareSoftwareSample ProcessesSample Processes

Page 22: Pbx Presentation)

May 20031-to-4 PBX Project22

TitleTitle

“Design and Implementing a 1-to-4 PBX System Using a Microcontroller”.PBXPBX The project is a telephone switching system and is a Private Branch eXchange.11--toto--44 It supports 4 lines (connection to phones) and 1 trunk (connection to local GX).MicrocontrollerMicrocontroller The controller section is a microcontroller (a digital processor + internal RAM + internal ROM + internal timers …).

Page 23: Pbx Presentation)

May 20031-to-4 PBX Project23

Behavior (1)Behavior (1)

ConnectionsConnections The system is connected to 4 normal phones and 1 external line (from local GX). The monitor panel is the monitoring leds on the project’s boards. The input power is 220V, 50Hz ac voltage. The optional data processing system is not implemented in this version of project (see next slide for details).Dialing modeDialing mode The system supports only pulse dialing. It has no reaction when encountering tone dialing.Number assignmentsNumber assignments The system has 5 valid numbers: “0” for the trunk, “1” for the 1st line, “2” for 2nd, “3” for 3rd and “4” for 4th line. Other numbers are invalid.

Page 24: Pbx Presentation)

May 20031-to-4 PBX Project24

Behavior (2)Behavior (2)

TonesTones The system has 4 tones:–– Dial tone Dial tone system is ready for dialing.–– Ring back toneRing back tone requested phone is ringing.–– Busy tone Busy tone requested phone is busy.–– Invalid toneInvalid tone dialed no is invalid.

ServicesServices No special services (like diverting, auto answering, …) exist in this version of implementation. Note that the design method guaranties adding new services and capabilities.

Page 25: Pbx Presentation)

May 20031-to-4 PBX Project25

Behavior:Behavior:ConnectionsConnections

Project’s PBX Switching System

Trunk 1GX 1

Data Processing System

Monitor Panel

Power

Phone 1Line 1

Phone 2Line 2

Phone 4Line 4

Phone 3Line 3

Page 26: Pbx Presentation)

May 20031-to-4 PBX Project26

Design Considerations (1)Design Considerations (1)

Modular designModular design Everything in this project is designed with modular method. In this method special & predefined tasks are assigned to each subsystem. These subsystems communicate with sending requests and getting answers to each other in order to perform acomplex task. This method guaranties the following characteristics:–– Readability, writablity, debuggingReadability, writablity, debugging A reader can understand the

mechanisms better. The modifications are easy and the bugs can be discovered quickly.

–– Upgrade & developmentUpgrade & development Hardware and software additions (like adding lines or trunks, adding special services, …) are easy tasks. The project development is bright and straight.

Analog switchingAnalog switching The system utilizes the circuit switching with analog technology. So there are some conversation circuits (i.e 3) to switch connections.

Page 27: Pbx Presentation)

May 20031-to-4 PBX Project27

Design Considerations (2)Design Considerations (2)

Nonblocking systemNonblocking system Every phone can be connected to another one at any desired time. It means a connection won’t be blocked because of lack of resources. There are 2 conversation circuits for internal switching (i.e 4 phones) and 1 for connecting the phones to trunk.Digital controllerDigital controller A microcontroller from MCS-51TM family is selected for controlling the whole system. It is observed that even though the switching is analog, the controller is digital making all internal signals (except voice signals) digital.Trunk ring policyTrunk ring policy If a ring is sent to the trunk (by the local GX) the system checks line 1 then 2 … to find first free phone and sends the ring to the found phone in order to connect it to the trunk. Therefore in this project, operator can be neglected.

Page 28: Pbx Presentation)

May 20031-to-4 PBX Project28

Hardware:Hardware:StructureStructure

Control Unit

Line Unit

Trunk UnitPower Supply

Unit

Switch Unit

Project’s PBX

System

Monitoring Signals

Data Signals

Line 1

Line 2

Line 4

Line 3Trunk 1

Page 29: Pbx Presentation)

May 20031-to-4 PBX Project29

Hardware:Hardware:UnitsUnits

Power Supply UnitPower Supply Unit This unit is responsible for supplying the necessary voltages that other units need. This unit must supply the voice carrier voltage applied to the phoneset, so must be designed with care.Line UnitLine Unit This unit interfaces the system with phonesets. It detects the dialing & phone mode and also send ring signal. In this unit, tip and ring of each phone (for use in switch unit) is constructed.Trunk UnitTrunk Unit It interfaces with trunk and has responsibilities similar to line unit. The tip and ring of trunk (for use in switch unit) is constructed.Switch UnitSwitch Unit It has some conversation circuits and switches the phones and trunk (under control of control unit) i.e their tip and ring wires.Control UnitControl Unit This unit controls the whole system. It gets detect signals from line and trunk units and sends control signals to switch unit and (if necessary) to line and trunk units.

Page 30: Pbx Presentation)

May 20031-to-4 PBX Project30

Hardware:Hardware:Some ComponentsSome Components

RelaysRelays The main switch components that is used in this project are relays. A relay is an electrical-mechanical component capable of attract a contact with an electrical command in order to connect / disconnect some connections. It is like a key with electrical control. Despite of its mechanical problems, it’s an idle component for passing a wide range of signals with different powers.Open collector not gatesOpen collector not gates Just like normal logical not gates, open collector not gates, negates the input signals but with one major difference. The output layer transistors are open collectors, which means are not connected to power voltage.OptoOpto--couplerscouplers A semiconductor device which consists of a normal led and a BJT transistor with optically sensitive base. If a current is passes through the led, it stimulated base just like a normal current. It’s main usage in this project, is detecting dc-loop in order to find phoneset mode.

Page 31: Pbx Presentation)

May 20031-to-4 PBX Project31

Hardware:Hardware:Boards (1)Boards (1)

Power Supply boardPower Supply board It produces the following voltages: – +5Vdc: for the digital (gates and microcontroller) components.– +18Vdc: for carrying the voice signal and also for driving the relays.– 110Vac: This board also generates an ac voltage (around 50Hz) as the

ring voltage for applying to phonesets.

Line boardsLine boards Each line board contains 2 line interface circuits that interfaces a phoneset to the system and do the following tasks:

– Detecting the phone mode (Off-hook or On-hook), also useful for detecting pulse dialing signals.

– Applying the ring to phone, if necessary.– Carry tip and ring wires to switch unit for switching.– Showing the phone mode and phone ring signal by two leds.

Page 32: Pbx Presentation)

May 20031-to-4 PBX Project32

Hardware:Hardware:Boards (2)Boards (2)

Trunk boardTrunk board The trunk board contains 1 trunk interface circuits that interfaces a trunk to the system and do the following tasks:

– Detecting the trunk ring signal.– Carry tip and ring wires to switch unit for switching.– Showing the ring signal and connect mode by two leds.

Conversation Circuit boardsConversation Circuit boards Each conversation circuit board contains 1 conversation circuit that is able to create one conversation between some lines or trunk. Control unit controls which relays are active and therefore switching of each circuit.Control boardControl board This board has one microcontroller from MCS-51TM

(AT89C52) that controls the system by scanning the detect signals and retrieving the request information then sending controlling or monitoring signals and if necessary, switching the lines / trunk (via switch unit).

Page 33: Pbx Presentation)

Hardware: Boards DiagramHardware: Boards Diagram

Switc

h U

nit

Con

vers

atio

n C

ircui

t 0 b

oard

pbx.

dsn

(“C

onve

rsat

ion

Ckt

0”

shee

t)

Con

vers

atio

n C

ircui

t 1 b

oard

pbx.

dsn

(“C

onve

rsat

ion

Ckt

1”

shee

t)

Con

vers

atio

n C

ircui

t 2 b

oard

pbx.

dsn

(“C

onve

rsat

ion

Ckt

2”

shee

t)

Tru

nk U

nit

Trun

k 0

boar

d pbx.

dsn

(“Tr

unk

0”sh

eet)

Con

trol

Uni

t

Con

trol b

oard

pbx.dsn(“Control” sheet)

C0_S0

C0_S1

C0_S2

C0_S3

C0_TONE

C1_S0

C1_S1

C1_S2

C1_S3

C1_TONE

C2_S0

C2_S1

C2_S2

C2_S3

C2_TONE

L3_RNG

L3_INTR

L3_DTCT

L2_RNG

L2_INTR

L2_DTCT

Lin

e U

nit

Line

2&

3 bo

ard

pbx.

dsn

(“Li

ne 2

”sh

eet)

pbx.

dsn

(“Li

ne 3

”sh

eet)

Line

0&

1 bo

ard

pbx.

dsn

(“Li

ne 0

”sh

eet)

pbx.

dsn

(“Li

ne 1

”sh

eet)

L1_RNG

L1_INTR

L1_DTCT

L0_RNG

L0_INTR

L0_DTCT

L0_TIP

L0_RING

L1_TIP

L1_RING

L2_TIP

L2_RING

L3_TIP

L3_RING

T0_TIP

T0_RING

VCC

+18V

Ring1

Ring2

Pow

er

Supp

ly

Uni

t

Pow

er

Supp

ly

boar

d pbx.dsn (“Power Supply” sheet)

T0_CNCT

T0_RDTCT

Page 34: Pbx Presentation)

Hardware: PhotoHardware: Photo

Page 35: Pbx Presentation)

May 20031-to-4 PBX Project35

Software:Software:StructureStructure

Trunk Hardware Interface Unit

Trunk Control Unit

Trunk Ports

Central Control UnitProject’s Software

Architecture

Switch Control Unit

Line Hardware Interface Unit

Line Control Unit

Line Ports

Ring & Tone Generator Unit Switch Hardware Interface Unit

Switch Ports

Page 36: Pbx Presentation)

May 20031-to-4 PBX Project36

Software:Software:Units (1)Units (1)

Line Hardware Interface UnitLine Hardware Interface Unit This unit is responsible for interfacing the line ports (hardware signals) to the software. Every access to line ports are through this unit. This unit also translate detect signals to some meaningful messages.Trunk Hardware Interface UnitTrunk Hardware Interface Unit This unit is similar to Line one but interfaces the trunk ports.Switch Hardware Interface UnitSwitch Hardware Interface Unit This unit interfaces the switch ports to software or in the other words, any access to switch ports must be through this unit. Line Control UnitLine Control Unit This unit controls each line by getting messages from line interfaces and central control. In this unit the applied signals to the phone is constructed and it watches over any change concerning with the line (phone).

Page 37: Pbx Presentation)

May 20031-to-4 PBX Project37

Software:Software:Units (2)Units (2)

Trunk Control UnitTrunk Control Unit Like the line one, this unit controls the trunk. It receives messages from trunk interface and central control in order to build trunk control signals.Switch Control UnitSwitch Control Unit This unit has a collection of useful routines for handling and monitoring the switching. Central Control UnitCentral Control Unit This unit is responsible for making inter-routine communication and higher policies are held in this unit. This unit applies number assignments and connects the three above control units to each other. Ring & Tone Generator UnitRing & Tone Generator Unit This unit generates all of the tones and waves that is needed in the software including: ring wave, dial tone, busy tone, ring back tone and invalid tone.

Page 38: Pbx Presentation)

May 20031-to-4 PBX Project38

Software:Software:Considerations (1)Considerations (1)

ConcurrencyConcurrency Because of executing some routines (like control units) in real time mode, we are encountering with a concurrency problem. This can be solved by use of hardware interrupts but this solution is not applicable in all situations where we have some software routines. The used method is time sharing and use of timer interrupt. For simplifying the context switching, all of the concurrent routines are state-based. Whenever a change has been detected in the system, an event is created and will be propagated in the related control units. So the switching between concurrent routines is done by themselves not by forcing and cutting their execution.

Page 39: Pbx Presentation)

May 20031-to-4 PBX Project39

Software:Software:Considerations (2)Considerations (2)

StateState--based routinesbased routines State-based routines are routines that have some finite states and are in one of those states in every specific time.When a messages or events is received by these routines, the state will be updated and if necessary some action will be done.EventEvent--driven routinesdriven routines Whenever a change has been occurred in the system, an event is created usually by interface routines and will be reported to the other parts of the software. This mechanism guaranties that if and only if something is changed, processor will process it not always. Therefore the processor will have enough time to complete concurrent tasks.

Page 40: Pbx Presentation)

May 20031-to-4 PBX Project40

Software:Software:Phone StatesPhone States

StIdleStIdle Normal state of the phone i.e on-hook.StDialToneStDialTone The handset is picked up and the dial tone must be applied (ready to dial).StDialingStDialing The user is dialing. No tone must be applied.StInvalidToneStInvalidTone The requested no is invalid. Invalid tone must be applied.StBusyToneStBusyTone The requested no is busy. Busy tone must be applied.StTrunkStTrunk The requested no is the trunk and the connection is established.StRingbackToneStRingbackTone The requested phone is ringing. Ring back tone must be applied.StTalkStTalk A talk (conversation) is established and is in progress.StRingStRing The phone is ringing (requested by another phone).

Page 41: Pbx Presentation)

StR

ingb

ack

Tone

EvConvReq

EvToneReq(TnDial)

StTa

lk

StR

ing

StD

ialT

one

StD

ialin

g

StIn

valid

Tone

StB

usy

Tone

StTr

unk

EvPickup

EvPutdown

EvSOD

EvPutdown

EvPutdown

EvPutdown

EvEOD+EvNoInvalid

EvEOD+EvNoLineBusy

EvEOD+EvNoTrunkBusy

EvEOD+EvNoTrunkOK

EvEOD+EvNoLineRB

EvPutdown

EvPutdown

EvEOR

EvSOR

EvPickupEvTalkAccept

EvTalkAccept

EvAllRel

EvTalkCancel

EvAllRel

EvAllRel

EvTrunkRel

EvAllRel

EvToneReq(TnNo)

EvPutdown

EvDigitDialed

EvToneReq(TnInvalid)

EvToneReq(TnBusy)

EvToneReq(TnRingback)

EvAllRel

EvToneReq(TnNo)

Software: Phone State DiagramSoftware: Phone State Diagram

StId

le

Page 42: Pbx Presentation)

May 20031-to-4 PBX Project42

Software:Software:Routines (1)Routines (1)

Initialize routinesInitialize routines These routines are executed once (usually after a reset) and will initialize variables and set up the timer settings.Timer ISR routineTimer ISR routine When an interrupt is received by the processor, it will execute this routine that is responsible for invoking the timing routines repeatedly.Timing routinesTiming routines These routines make the necessary timings like 1ms, 20ms, 1s … and will call the time sensitive routines (like interface routines) with special periods.Memory Access routinesMemory Access routines Access to memory is through these routines. Each routine that needs to restore / retrieve some value (like its state) will call the related memory access routine.

Page 43: Pbx Presentation)

May 20031-to-4 PBX Project43

Software:Software:Routines (2)Routines (2)

Hardware Access routinesHardware Access routines These routines interface the software and ports. Any routine that needs to change or read a port will do that via these routines.Interface routinesInterface routines These routines translate the hardware signals to events (if required) and will propagate it through the software.Control routinesControl routines These routines control the parts of the hardware (lines, trunk and switches) by attending to events and messages from interface and other control routines.Debugging routinesDebugging routines There are some routines just for debugging and development of the software. These routines can be removed in the final implementation of the software.

Page 44: Pbx Presentation)

May 20031-to-4 PBX Project44

Sample Processes (1)Sample Processes (1)

Internal connectionInternal connection In this process a line connects to another line. First, a user pickups the handset (off-hook). The hardware signal is detected by the interface routines and the appropriate event is generated. The state of its line control will be updated and the dial tone will be applied. Now, requester starts to dial, the software finds out the dialed no by watching over the hardware, then sends the no to central control and gets the meaning of the dialed no. Assume it is no of a free line. The destination starts to ring. When the handset is picked up, the connection is established (switched) and voice signals can be transmitted. When two sides put down the handsets (on-hook) the connection is ended and the resources are returned to the system.

Page 45: Pbx Presentation)

May 20031-to-4 PBX Project45

Sample Processes (2)Sample Processes (2)

External connectionExternal connection In this process the trunk is ringed by the local GX. First the ring is detected by hardware and the interface software makes an event to inform the central control of what has been happened. In this case, according to the trunk ring policy of the system, the first free phone with higher priority will be ringed. When the handset is picked up the connection starts and a dedicated conversation circuit will hold the conversation. When the destination put downs the handset (off-hook), the resources return to the system and the communication ends.

Page 46: Pbx Presentation)

SummarySummary

Page 47: Pbx Presentation)

May 20031-to-4 PBX Project47

Summary (1)Summary (1)

Development Suggestions:Development Suggestions:– The switch unit can be implemented using digital technology. It needs

major changes in hardware and software.– Tone dialing can be supported by adding some hardware component to

line boards. Of course some software modification is needed.– Operator is another possible addition that can be implemented using a new

hardware unit and its software drivers.– Lots of services like diverting, auto answering, conferencing … and

monitoring and also logging can be supported by system just by adding required software routines.

Page 48: Pbx Presentation)

May 20031-to-4 PBX Project48

Summary (2)Summary (2)

Conclusion:Conclusion:– This project is an electrical and electronical circuit switching system, a PBX

i.e a Private Branch eXchange that is implemented in analog technology.– Mixture of electronics, communication, software and hardware theories and

technologies are used to construct the project.

More Information:More Information:– All of project documents are in electronic form and are stored as PC files,

please refer to them for more technical information.– For information of the used microcontroller, please refer to the Intel®

official site: www.intel.com.