Call Packet Tracking (fs_cli)

By Ignat Kononov on 2021-05-25

 

Contents

Prerequisites. 1

Call Packet Tracking (fs_cli). 2

Case one: A calls B, B answers, B hangs up. 2

Case two: A calls B, B decline. 7

Case three: A calls B, B doesn't answer. 7

Case four: A calls non-existent number. 8

Case five: A calls wrong- form number. 8

Case six: A calls, B answers, hang up from ASTPP GUI (Switch => Live calls). 9

References. 9

End of document 9

 

Prerequisites

CentOs  7 server with ASTPP.

In order to install ASTPP, this document must be followed from the beginning till the end: https://docs.switzernet.com/3/public/210311-astpp-instalation/

Call Packet Tracking (fs_cli)

Case one: A calls B, B answers, B hangs up.

In this example, two accounts are assigned: A (sofia/default/8620826254@) and B (sofia/default/7843973936@)

Freeswitch allocates a channel for the upcoming session for 8620826254 (A number):

Freeswitch gets an invite twice. About double INVITE case: https://docs.switzernet.com/3/public/210526-call-packet-tracking-sip/#_Toc73032903

Freeswitch sends SDP message (further in the document will not focus on SDP messages):

What is SDP: https://www.3cx.com/pbx/sdp/, https://en.wikipedia.org/wiki/Session_Description_Protocol

Freeswitch performs audio codecs for A (27-43 strings in the log)):

Requests ASTPP for data from the mysql database (58- 88 strings in the log):

More about mysql database usage by ASTPP: https://docs.switzernet.com/3/public/210527-mysql-database-usage-by-astpp/

Call detected as local:

Сreates XML document and with the call process necessary information (90-128 strings in the log):

Freeswitch performs the routing process for A (51-55 strings in the log) and puts the call for A in the RINGING state:

Diaplan now executes instructions from an XML document (129-158 strings in the log):

What is diaplan: https://freeswitch.org/confluence/display/FREESWITCH/Dialplan

Mod_dptools now also executes instructions from an XML document (165-202 strings in the log):

What is mod_dptools: https://freeswitch.org/confluence/display/FREESWITCH/Dialplan

Freeswitch sets proxy route for sofia/default/7843973936@192.168.1.102: 40143 (B account) and sending invite:

Freeswitch performs the routing process for sofia/default/7843973936@192.168.1.102:40143 (B account number) (231- 244 strings in the logs) and  enters the [calling] [processing] [ringing] state one by one for B side, since everything is fine with the data and it is ready to continue working:

A waits for B to pick up the phone:

B pick up the phone:

Freeswitch performs audio codecs (51-55 strings in the log) and change callstate to ACTIVE for B:

Freeswitch informs A that B has picked up the phone and change callstate to ACTIVE for A:

A and B exchange audio (294-308 strings in the log) and B hangs up:

Freeswitch performs HANGUP hangup procedure and change callstate to HANGUP for B (304-324 strings in the log).

Freeswitch informs A that the connection has been interrupted, start HANGUP procedure and change callstate to HANGUP for A (323-338 strings in the log):

Freeswitch changes state to DESTROY and begins closing session (342-364 strings in the log):

Session ends:

Full text log of the session: 2.txt

Case two: A calls B, B decline

Full text log of the session: 3.txt

The procedures are the same as in case one, after callstate becomes RINGING for A and B, B terminated session:

Session ends by CALL_REJECTED procedure.

Case three: A calls B, B doesn't answer

Full text log of the session: 4.txt

The procedures are the same as in case one, but after 1m In the RINGING state Freeswitch ends session with USER_BUSY error. The session ends after playing A voice auto answer.

Case four: A calls non-existent number

Full text log of the session: 5.txt

A calls 688444 (number non-existent in DB)

The procedures are the same as in case one, but an incorrect request to the database occurs, in the generated XML document, the ORIGNATION_RATE_NOT_FOUND line is entered into the two last fields:

When instructions from XML are executed by Dialplan, an "origination rates not found" error occurs.

Then the session goes through a quick termination procedure due to this error.

CS_EXECUTE used for this case and call information is entered into the database, unlike case five.

Case five: A calls wrong- form number

Full text log of the session:  6.txt

A calls !@#$%^&*()qwerty (invalid number with special characters)

The procedures are the same as in case one, but an incorrect request to the database occurs, in the generated XML document, the ORIGNATION_RATE_NOT_FOUND line is entered into the two last fields:

When instructions from XML are executed by Dialplan, an "origination rates not found" error occurs.

Then the session goes through a quick termination procedure due to this error.

CS_EXECUTE is not used for this case and call information is not entered into the database, unlike case four.

Case six: A calls, B answers, hang up from ASTPP GUI (Switch => Live calls)

The procedures are the same as in case one.

Based on the logs, when the HANGUP button is pressed in the ASTPP GUI, a simulation of the termination of the call by user B occurs.

Otherwise, everything is the same as in case one.

Full text log of the session: 7.txt

References

If a method is not described in sufficient detail in this document, you can find all the additional information about API and more in the official Freeswitch documentation: https://freeswitch.com/

End of document


***

© 4z.com