Simple implementation of pjsip DTMF, callback function: on_dtmf_digit

Source: Internet
Author: User

Pjsip source code is relatively powerful. Let's talk about what DTMF is?

Dual-Tone Multi-frequency DTMF (Dual Tone Multi frequency), dual-Tone Multi-frequency, composed of high frequency groups and low frequency groups, each of which contains four frequencies. A high-frequency signal and a low-frequency signal are combined to form a combined signal, representing a number. The DTMF signal has 16 encodings. You can call the corresponding walkie talkie by using DTMF signaling.
Dual-Tone Multi-frequency signal (DTMF) is a user signaling between the telephone and the switch in the telephone system. It is usually used to send called numbers. Before using a dual-Tone Multi-frequency signal, the telephone system uses a series of intermittent pulses to transmit the called number, which is called pulse dialing. Pulse dialing requires the operator in the Telecommunications Board to manually complete the long-distance connection (early method, very old and antique ). Dual-Tone Multi-frequency signals were invented by Bell Labs to automatically complete long-distance calls.
The dual-Tone Multi-frequency dial-up keyboard is a 4 × 4 matrix. Each row represents a low frequency, and each column represents a high frequency. Each time you press a key, a combination of high-frequency and low-frequency sine signals is sent. For example, '1' is equivalent to 697 and 1209Hz ). The switch can decode these frequency combinations and determine the corresponding buttons.

You can call the callback function to achieve the target.
Static void on_dtmf_digit (pjsua_call_id call_id, int digit)

In the pjsip example:
Pjsip-apps \ SRC \ pjsua \ pjsua_app.c (5418): app_config.cfg.cb.on_dtmf_digit = & call_on_dtmf_callback;

Implementation:

/** DTMF callback. */static void call_on_dtmf_callback (pjsua_call_id call_id, int DTMF) {pj_log (3, (this_file, "Incoming DTMF on call % d: % C", call_id, DTMF ));}

Go to: http://www.zhimax.com/article/vc/on_dtmf_digit.html

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.