SIM900 GSM模块|如何检查拨出电话是否已接听 [英] SIM900 GSM Module | How to check if the outgoing-call is answered

查看:116
本文介绍了SIM900 GSM模块|如何检查拨出电话是否已接听的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 AT命令使用SIM900 GSM模块发送去电后,有没有办法知道接听电话的人是否已接听吗?

After sending an outgoing call using SIM900 GSM module using AT commands, is there a way to know if the person receiving the call has answered it?

(通过串行直接与GSM模块通信)

推荐答案

命令 + CLCC 标准方式 在问.这意味着该命令将在支持ETSI规范的任何设备中可用,无论其型号或厂商.

The command +CLCC is the standard way to perform what you are asking. It means that this command will be available in any device supporting ETSI specification whatever is the model or the vendor.

从SIM900 AT命令指南:

执行命令 AT + CLCC 返回当前正在调用的ME列表.

注意:如果Command成功,但是没有可用的呼叫,没有信息响应发送到TE.

Execution command AT+CLCC returns a list of current calls of ME.

Note: if Command succeeds but no calls are available, no information response is sent to TE.

以下响应是由设备发送的

The following response is sent by the device

[+ CLCC:< id1>,< dir>,< stat>,< mode>,< mpty> [,<数字>,<类型>,< alphaID>;]
[< CR> LF&CLCC:< id2>,< dir>,< stat>,< mode>,< mpty> [,<数字>,< type>,< alphaID>]
[...]]]

确定

位置

< idx> -(范围1..7)-呼叫识别号码
该号码可用于 + CHLD 命令操作
< dir>
0-移动发起的(MO)呼叫
1-移动终端(MT)呼叫
< stat> -通话状态:
0-活动
1-举行
2-拨号(MO呼叫)
3-警报(MO呼叫)
4-来电(MT通话)
5-等待(MT通话)
6-断开连接
<模式> -承载/电话服务:
0-语音
1-数据
2-传真
< mpty>
0-呼叫不是多方(会议)呼叫方之一
1-呼叫是多方(会议)呼叫方之一
< number> -字符串类型(字符串应包含在引号中)电话号码,其格式由< type>指定.
< type> -地址类型
< alphaId> -字符串类型(字符串应包含在引号中)< number>的字母数字表示形式.对应于电话簿中找到的条目.

<idx> - (Range 1..7) - Call identification number
This number can be used in +CHLD command operations
<dir>
0 - Mobile originated (MO) call
1 - Mobile terminated (MT) call
<stat> - State of the call:
0 - Active
1 - Held
2 - Dialing (MO call)
3 - Alerting (MO call)
4 - Incoming (MT call)
5 - Waiting (MT call)
6 - Disconnect
<mode> - Bearer/tele service:
0 - Voice
1 - Data
2 - Fax
<mpty>
0 - Call is not one of multiparty (conference) call parties
1 - Call is one of multiparty (conference) call parties
<number> - String type (string should be included in quotation marks) phone number in format specified by <type>.
<type> - Type of address
<alphaId> - String type (string should be included in quotation marks) alphanumeric representation of <number> corresponding to the entry found in phone book.

因此,基本上,您需要做的是提供命令(在轮询中),搜索答案行中的内容,该行包含您要拨打的远程号码,该行包含在< number> 参数,然后等待参数< stat> 的值从 2 (拨号)更改为 0 (有效).

So, basically, what you need to do is to provide the command (in polling), search for the row of the answer containing the remote number you are dialing to, contained in <number> parameter, and wait until the value of parameter <stat> changes from 2 (Dialing) to 0 (Active).

获取信息的另一种方式(不涉及轮询)是启用 URC (未经请求的结果代码).通过设置

An alternative way for obtaining the info, not involving polling, is to enable URCs (unsolicited result codes). By setting

AT+CLCC=1

每当呼叫状态发生变化时,就会自动将

URC异步发送到串行端口(与上述执行命令的格式相同).

an URC will be asynchronously sent to the serial port whenever the call status changes (with the same format of the execution command respose explained above).

它涉及到 AT + MORING 命令.从AT命令指南中:

It involves AT+MORING command. From AT command guide:

AT + MORING =< mode> 显示移动始发呼叫的状态.

AT+MORING=<mode> Show State of Mobile Originated Call.

< mode>
0-不显示移动发起呼叫的呼叫状态
1-显示移动发起呼叫的呼叫状态.拨打电话号码后,如果收到另一个呼叫警报,则将发送MO RING的URC字符串,如果已建立呼叫,则将发送 MO CONNECTED 的URC字符串.

所以,提供

AT+MORING=1

将启用以下形式的URC系列:在移动发起呼叫的情况下

will enable a family of URCs in case of Mobile Originated call, in the form

MO RING -通话被提醒.
已连接MO -通话已建立

MO RING - the call is alerted.
MO CONNECTED - the call is established

这篇关于SIM900 GSM模块|如何检查拨出电话是否已接听的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆