Trying to mix the VoIP example project with a MQTT client I had been problems in program runtime.
The VoIP is executed directly in the main and the MQTT functions are implemented but no used, the program never execute any of them.
The issue is that if I comment all of the espressif mqtt library functions, the example runs perfectly but when at least one functions is not commented ("esp_mqtt_client_stop" for example) the module show a "SIP: Error register device"
Trace is as shown:
Code: Select all
I (6161) event: sta ip: 192.168.3.101, mask: 255.255.255.0, gw: 192.168.3.1
I (6161) MAIN: [ 2 ] Start codec chip
I (6161) gpio: GPIO[19]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3
E (6171) gpio: gpio_install_isr_service(394): GPIO isr service already installed
I (6191) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (6191) ES8388_DRIVER: init,out:02, in:00
I (6221) AUDIO_HAL: Codec mode is 3, Ctrl:1
I (6221) MAIN: [ 3 ] Create and start input key service
I (6221) MAIN: [ 4 ] Create SIP Service
I (6221) MAIN: [ 5 ] Create decoder and encoder pipelines
I (6221) MAIN: SIP_EVENT_REQUEST_NETWORK_STATUS
I (6231) SIP: Conecting...
tcp_bind: can only bind in state CLOSED
W (6271) SIP: CHANGE STATE FROM 0, TO 1, :func: sip_connect:1319
W (6271) SIP: [1970-01-01/00:00:03]=======WRITE 0580 bytes>>
I (6271) SIP:
REGISTER sip:1050@192.168.33.151:5060 SIP/2.0
Via: SIP/2.0/TCP 192.168.3.101:5060;branch=z9hG4bK-362257126;rport
From: <sip:1050@192.168.33.151:5060>;tag=-1994083768
To: <sip:1050@192.168.33.151:5060>
Contact: <sip:1050@192.168.3.101:5060>
Max-Forwards: 70
Call-ID: B8904DB40D03D5C2C6E650B19B2E6CAA1761DE07FDD0
CSeq: 1 REGISTER
Expires: 3600
User-Agent: ESP32 SIP/2.0
Content-Length: 0
Allow: INVITE, ACK, CANCEL, BYE, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri
Allow-Events: presence, kpml
W (6331) SIP: [1970-01-01/00:00:03]=======================>>
W (6411) SIP: [1970-01-01/00:00:03]<<=====READ 0503 bytes==
I (6411) SIP:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP 192.168.3.101:5060;rport=61916;received=192.168.135.150;branch=z9hG4bK-362257126
Call-ID: B8904DB40D03D5C2C6E650B19B2E6CAA1761DE07FDD0
From: <sip:1050@192.168.33.151>;tag=-1994083768
To: <sip:1050@192.168.33.151>;tag=z9hG4bK-362257126
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1584529875/b41745cc2174910c4448fbc178ff06f7",opaque="6239ef3269cc2ae7",algorithm=md5,qop="auth"
Server: FPBX-14.0.13.26(13.22.0)
Content-Length: 0
W (6451) SIP: [1970-01-01/00:00:03]<<======================
E (6461) SIP: Error register device
W (6461) SIP: CHANGE STATE FROM 1, TO 0, :func: sip_register:1334