espressif / esp-adf-libs

56 stars 41 forks source link

(VOIP) sip can not login #17

Closed Alpha-zh closed 3 years ago

Alpha-zh commented 3 years ago

After ESP32 successfully networked through the external 4G module, SIP could not log in. The prompt message is as follows. What is the problem? Is that some option setting problem?

log W (21850) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (33050) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (44250) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (55450) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (66650) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (77850) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (89050) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (100250) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (111450) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (122650) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (133850) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312

Alpha-zh commented 3 years ago

通过wifi连接网络就没问题,用的移动sim卡,是移动网络的问题还是那个配置项的问题呢?VOIP用的UDP协议。

Alpha-zh commented 3 years ago

The VoIP demo and PPPOS_CLIENT demo are directly integrated together. The problems are the same: 1, PPP dial successful , MQTT connected successful 。 2, VoIP connection unsuccessful 。

???

I (11235) pppos_example: Module: ML302 I (11235) pppos_example: Operator: "46000" I (11235) pppos_example: IMEI: 22272M002350C60 I (11235) pppos_example: IMSI: 460048683216732 I (11435) pppos_example: rssi: 31, ber: 99 I (11935) pppos_example: Modem PPP Started I (12035) pppos_example: Modem Connect to PPP Server I (12035) pppos_example: ~~~~~~ I (12035) pppos_example: IP : 0.0.0.0 I (12035) pppos_example: Netmask : 255.255.255.255 I (12045) pppos_example: Gateway : 0.0.0.0 I (12045) pppos_example: Name Server1: 0.0.0.0 I (12055) pppos_example: Name Server2: 0.0.0.0 I (12055) pppos_example: ~~~~~~ I (12065) pppos_example: **** I (12065) pppos_example: MQTT Start... I (12075) pppos_example: **** I (12085) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (12095) pppos_example: MQTT other event id: 7 E (12095) MQTT_CLIENT: Error transport connect I (12105) pppos_example: MQTT_EVENT_ERROR I (12105) pppos_example: MQTT_EVENT_DISCONNECTED I (12165) pppos_example: Modem Connect to PPP Server I (12165) pppos_example: ~~~~~~ I (12165) pppos_example: IP : 10.54.186.247 I (12165) pppos_example: Netmask : 255.255.255.255 I (12175) pppos_example: Gateway : 192.168.0.1 I (12175) pppos_example: Name Server1: 211.136.17.107 I (12185) pppos_example: Name Server2: 0.0.0.0 I (12185) pppos_example: ~~~~~~ I (22115) pppos_example: MQTT other event id: 7 I (22245) pppos_example: MQTT_EVENT_CONNECTED I (22245) pppos_example: sent subscribe successful, msg_id=53189 I (22295) pppos_example: MQTT_EVENT_SUBSCRIBED, msg_id=53189 I (22295) pppos_example: sent publish successful, msg_id=0 I (22345) pppos_example: MQTT_EVENT_DATA TOPIC=/topic/esp-pppos DATA=esp32-pppos I (22345) VOIP_EXAMPLE: [ 4 ] Create SIP Service I (22345) SIP: esp_sip ver : '1.0.1' Compile date: Oct 27 2020-15:53:05 I (22355) VOIP_EXAMPLE: Func:sip_start, Line:382, MEM Total:4407824 Bytes, Inter:322440 Bytes, Dram:255992 Bytes

W (32355) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (43555) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (54755) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (65955) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (77155) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (88355) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (99555) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (110755) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (121955) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (133155) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (144355) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312

Alpha-zh commented 3 years ago

Integrated UDP client demo together,the UDP client work ok, But the sip can not connect ,what the function sip_reconneect doing?

I (12065) pppos_example: **** I (12065) pppos_example: MQTT Start... I (12075) pppos_example: **** I (12085) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (12095) pppos_example: MQTT other event id: 7 E (12095) MQTT_CLIENT: Error transport connect I (12105) pppos_example: MQTT_EVENT_ERROR I (12105) pppos_example: MQTT_EVENT_DISCONNECTED I (12165) pppos_example: Modem Connect to PPP Server I (12165) pppos_example: ~~~~~~ I (12165) pppos_example: IP : 10.87.140.67 I (12165) pppos_example: Netmask : 255.255.255.255 I (12175) pppos_example: Gateway : 192.168.0.1 I (12175) pppos_example: Name Server1: 211.136.17.107 I (12185) pppos_example: Name Server2: 0.0.0.0 I (12185) pppos_example: ~~~~~~ I (22115) pppos_example: MQTT other event id: 7 I (22245) pppos_example: MQTT_EVENT_CONNECTED I (22245) pppos_example: sent subscribe successful, msg_id=41578 I (22305) pppos_example: MQTT_EVENT_SUBSCRIBED, msg_id=41578 I (22305) pppos_example: sent publish successful, msg_id=0 I (22345) pppos_example: MQTT_EVENT_DATA TOPIC=/topic/esp-pppos DATA=esp32-pppos I (22345) example: Socket created, sending to 47.110.154.**:3333 I (22345) example: Message sent I (22355) VOIP_EXAMPLE: [ 4 ] Create SIP Service I (22355) SIP: esp_sip ver : '1.0.1' Compile date: Oct 27 2020-15:53:05 I (22365) VOIP_EXAMPLE: Func:sip_start, Line:382, MEM Total:4402888 Bytes, Inter:317504 Bytes, Dram:251056 Bytes

W (32365) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 I (33975) example: Received 6 bytes from 47.110.154.*: I (33975) example: 11212

I (35975) example: Message sent I (39725) example: Received 6 bytes from 47.110.154.*: I (39725) example: alpha

I (41725) example: Message sent W (43565) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 I (46135) example: Received 11 bytes from 47.110.154.*: I (46135) example: 12pppppqpw

I (48135) example: Message sent I (50715) example: Received 7 bytes from 47.110.154.*: I (50715) example: sdfasd

I (52715) example: Message sent W (54765) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 I (56425) example: Received 10 bytes from 47.110.154.*: I (56425) example: ASDasdasd

I (58425) example: Message sent I (60445) example: Received 15 bytes from 47.110.154.*: I (60445) example: ladflasdflafas

I (62445) example: Message sent I (64135) example: Received 14 bytes from 47.110.154.*: I (64135) example: sldfladflasdf ........ I (85365) example: Message sent W (88365) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (99565) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (110765) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (121965) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (133165) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (144365) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (155565) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (166765) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (177965) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (189165) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (200365) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (211565) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (222765) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (233965) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (245165) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (256365) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (267565) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312 W (278765) SIP: CHANGE STATE FROM 0, TO 0, :func: sip_reconnect:312

Alpha-zh commented 3 years ago

@jason-mao Could you please help to reply?

Alpha-zh commented 3 years ago

@ahhfzhang Could you please help to reply?

ahhfzhang commented 3 years ago

Hi @Alpha-zh,

虽然我没有使用4G模块来测试,但我想很可能的原因是在SIP_EVENT_REQUEST_NETWORK_STATUS的时候,这里默认的example使用的是WIFI STA来获取IP地址和状态,这里你可以替换成4G模块的接口。

BR.

Alpha-zh commented 3 years ago

@ahhfzhang 非常感谢您的回复。 正如您所说,问题确实出在这个地方,我修改了获取IP地址的方式,可以注册成功了。 但是SIP的Message里面的IP地址还是有错误“SIP/2.0/UDP 0.0.0.0:15551” ,这就导致虽注册成功但仍不可及(服务器有注册信息,但其它客户端无法呼叫)。 看到在SIP_EVENT_REQUEST_NETWORK_IP的时候,有将ip地址送进去,但跟踪后发现,该事件并没有被触发。是不是还有地方要修改IP地址?或者如何触发该事件呢?

非常感谢!

REGISTER sip:1004@xwx003.domain.cn:15060 SIP/2.0 Via: SIP/2.0/UDP 0.0.0.0:15551;branch=z9hG4bK--1016416057;rport From: sip:1004@xwx003.domain.cn:15060;tag=1977969521 To: sip:1004@xwx003.domain.cn:15060 Contact: sip:1004@0.0.0.0:15551 Max-Forwards: 70 Call-ID: E21FA2253B520AA96EFB0DF2911158C5CFD807E79A02 CSeq: 1 REGISTER Expires: 3600 User-Agent: ESP32 SIP/2.0 Content-Length: 0 Allow: INVITE, ACK, CANCEL, BYE, UPDATE, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri Allow-Events: presence, kpml

ahhfzhang commented 3 years ago

Hi @Alpha-zh,

哦 这部分我看了下,的确在库中注册一开始是使用的 tcpip_adapter_get_ip_info 没有通过回调来获取 为了测试 您可以先修改下tcpip_adapter_get_ip_info接口 这里直接获取到4G的地址而不是0.0.0.0

BR.

Alpha-zh commented 3 years ago

@ahhfzhang 通过修改tcpip_adapter_get_ip_info接口已经可以了,非常感谢!