Xml freeswitch application implementation

Source: Internet
Author: User
Tags freeswitch

XML
XML is widely used in FS (FreeSwitch). dialplan is a very important and fast content. The following describes the statements in XML execution:

<Action application = "set" data = "$1"/>

How to associate it with its implementation? Where can I see its implementation? What is its implementation?

Next let's take a look at how FS is done! The preceding XML statement is used as an example.

1. How to associate with its implementation

When the channel of FS is in the EXCUTE state: Execute the code based on the application and data read on XML and call the callback function. The example above is as follows: application is set, data is $1 (1234, the parsed result passed in here)

The call process is as follows:

Switch_core_standard_on_execute->

Switch_core_session_execute_application->

Switch_core_session_execute_application_get_flags->

Switch_core_session_exec: application_interface-> application_function (session, expanded );

Application_function is the callback function.

The specific execution function is the application that will be loaded during system initialization and assigned to the function pointer. Therefore, when the above blue-labeled callback function is executed, the corresponding application on each module of FS will be executed.

2. Specific implementation

For example, set is registered on mod_dptool. (How do we know where to register? When FS is started, the registration information of application is displayed in the information printed in the window, so that you can know the implementation in that module .)

Set implementation:

SWITCH_STANDARD_APP (set_function) // This is macro-defined

{

Base_set (session, data, SWITCH_STACK_BOTTOM );

}

Open the DEBUG log to view the following logs:

01:29:55. 013184 [DEBUG] mod_dptools.c: 1373 sofia/internal/1001@192.168.152.129 SET [1234] = [UNDEF]

3. Implement Functions

According to the above analysis, we can conclude that the implementation of each application is different. For specific implementation, see the specific code. I will not analyze it here.

Note: The Conversion Relationship Between the application name and the function name in xml is application_function. The specific call conditions are not described.


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.