wdoekes / asterisk-chan-dongle

chan_dongle channel driver for Huawei UMTS cards, works with Asterisk 14+
Other
296 stars 104 forks source link

E303S one way audio if modem in 3G, if forced to 2G working both ways (SOLVED) #135

Open ciberp opened 3 years ago

ciberp commented 3 years ago

Hi!

I am strugling with E303S to get it working. I can make calls in both directions. Problem is only when a call is made from any ip phone to asterisk through dongle, than audio is only one way (not getting audio from iphone, but I get audio from outside to ip phone). If I make a call from outside to dongle than audio is working in both directions. I searched around and found out that someone has added E303S 7bit support to fix that. I don't know if this will fix my problem but I would like to give it a try.

Error message: [Feb 21 20:36:47] ERROR[1100] chan_dongle.c: [dongle0] timedout while waiting 'OK' in response to 'AT'

https://github.com/antirek/asterisk-chan-dongle/issues/117

after modifying and recompiling the at_response.c (at_response_cgmm) ussd works. I have added E303S to 7-bit encoding modem list. now every thing works perfectly fine, voice (bothway), SMS, USSD.

Can you give some directions how to check or add/remove 7bit, since I cannot find modem list.

``` Connected to Asterisk 16.2.1~dfsg-1+deb10u2 currently running on rpi4-2 (pid = 11622) rpi4-2*CLI> dongle show device settings dongle0 ------------- Settings ------------ Device : dongle0 Audio : /dev/ttyUSB1 Data : /dev/ttyUSB2 IMEI : IMSI : Channel Language : en Context : incoming Exten : +38664XXXXXX Group : 0 RX gain : 0 TX gain : 0 U2Diag : -1 Use CallingPres : Yes Default CallingPres : Presentation Allowed, Passed Screen Auto delete SMS : Yes Disable SMS : No Reset Dongle : Yes Call Waiting : auto DTMF : relax Minimal DTMF Gap : 45 Minimal DTMF Duration : 80 Minimal DTMF Interval : 200 Initial device state : start rpi4-2*CLI> dongle show device state dongle0 -------------- Status ------------- Device : dongle0 State : Free Audio : /dev/ttyUSB1 Data : /dev/ttyUSB2 Voice : Yes SMS : Yes Manufacturer : huawei Model : E303S Firmware : 21.157.31.00.850 IMEI : 86173700677XXXX IMSI : 29364000028XXXX GSM Registration Status : Registered, roaming RSSI : 13, -87 dBm Mode : No Service Submode : No service Provider Name : Mobitel d.d Location area code : "000B" Cell ID : "4FC7" Subscriber Number : Unknown SMS Service Center : +38664100010 Use UCS-2 encoding : No Tasks in queue : 0 Commands in queue : 0 Call Waiting : Disabled Current device state : start Desired device state : start When change state : now Calls/Channels : 0 Active : 0 Held : 0 Dialing : 0 Alerting : 0 Incoming : 0 Waiting : 0 Releasing : 0 Initializing : 0 rpi4-2*CLI> dongle show version chan_dongle: Huawei 3G Dongle Channel Driver, Version 1.1, Revision 43gh=47cg Project Home: https://github.com/bg111/asterisk-chan-dongle/ Bug Reporting: https://github.com/bg111/asterisk-chan-dongle/issues rpi4-2*CLI> dongle cmd dongle0 ATI [dongle0] 'ATI' AT command queued [dongle0] Got Response for user's command:'Manufacturer: huawei' [Feb 24 06:50:19] NOTICE[7263]: at_response.c:1816 at_response: [dongle0] Got Response for user's command:'Manufacturer: huawei' [dongle0] Got Response for user's command:'OK' [Feb 24 06:50:19] NOTICE[7263]: at_response.c:1816 at_response: [dongle0] Got Response for user's command:'OK' rpi4-2*CLI> dongle cmd dongle0 AT+CSCS="GSM" [dongle0] 'AT+CSCS=GSM' AT command queued [dongle0] Got Response for user's command:'ERROR' [Feb 24 06:50:47] NOTICE[7263]: at_response.c:1816 at_response: [dongle0] Got Response for user's command:'ERROR' [Feb 24 06:50:47] ERROR[7263]: at_response.c:287 log_cmd_response_error: [dongle0] Received 'ERROR' for unhandled command 'USER'S' rpi4-2*CLI> dongle cmd dongle0 ATD031XXXXXX; [dongle0] 'ATD031XXXXXX;' AT command queued [dongle0] Got Response for user's command:'OK' [Feb 24 06:53:15] NOTICE[7263]: at_response.c:1816 at_response: [dongle0] Got Response for user's command:'OK' [Feb 24 06:53:15] ERROR[7263]: at_response.c:621 at_response_orig: [dongle0] ^ORIG '^ORIG:1,0' for unknown ATD ```

Thank you for your time in advance.

Best regards, Peter

ciberp commented 3 years ago

Hi!

I did some more testing and found out that audio is actually working in both direction but it stops after first call. Command dongle reset dongle0 solves the problem ...

Any hint how to troubleshoot that?

Thank you.

Regards, Peter

ciberp commented 3 years ago

Tried with 7bit set, no difference, problem with one-way-audio on outgoing call exists. I noticed some timeouts if call is not picked up immediately.

rpi4-2*CLI>
  == Using SIP RTP CoS mark 5
       > 0xb410d090 -- Strict RTP learning after remote address set to: 172.22.0.97:29486
    -- Executing [XXXXXXXX@users:1] Dial("SIP/1-00000003", "Dongle/dongle0/XXXXXXXX") in new stack
    -- Called Dongle/dongle0/XXXXXXXX
    -- Dongle/dongle0-0100000003 is making progress passing it to SIP/1-00000003
       > 0xb410d090 -- Strict RTP switching to RTP target address 172.22.0.97:29486 as source
       > 0xb410d090 -- Strict RTP learning complete - Locking on source address 172.22.0.97:29486
[Feb 24 22:18:25] ERROR[18660]: chan_dongle.c:445 do_monitor_phone: [dongle0] timedout while waiting 'OK' in response to 'AT'
    -- [dongle0] Dongle has disconnected
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'SIP/1-00000003' status is 'CHANUNAVAIL'
    -- [dongle0] Trying to connect on /dev/ttyUSB2...
    -- [dongle0] Dongle has connected, initializing...
    -- [dongle0] Dongle initialized and ready
``` rpi4-2*CLI> dongle show device state dongle0 -------------- Status ------------- Device : dongle0 State : Free Audio : /dev/ttyUSB1 Data : /dev/ttyUSB2 Voice : Yes SMS : Yes Manufacturer : huawei Model : E303S Firmware : 21.157.31.00.850 IMEI : 86173700677XXXX IMSI : 29364000028XXXX GSM Registration Status : Registered, roaming RSSI : 15, -83 dBm Mode : No Service Submode : No service Provider Name : Mobitel d.d Location area code : "000B" Cell ID : "4FC7" Subscriber Number : Unknown SMS Service Center : 002B003300380036003 Use UCS-2 encoding : Yes USSD use 7 bit encoding : Yes USSD use UCS-2 decoding : No Tasks in queue : 0 Commands in queue : 0 Call Waiting : Disabled Current device state : start Desired device state : start When change state : now Calls/Channels : 0 Active : 0 Held : 0 Dialing : 0 Alerting : 0 Incoming : 0 Waiting : 0 Releasing : 0 Initializing : 0 ```
ciberp commented 3 years ago

Hi!

I did some more testing and found out the problem. I got one way audio only if inserted SIM is in GSM Registration Status : Registered, roaming. Error message: [Feb 21 20:36:47] ERROR[1100] chan_dongle.c: [dongle0] timedout while waiting 'OK' in response to 'AT' If SIM is in GSM Registration Status : Registered, home network then all voice calls are working both ways with audio and no error msg.

Regards, Peter

ciberp commented 3 years ago

Today I change SIM card with another one and got one way audio again. Than I realised that with working SIM huawei led light was blinking greenand with one-way-audio was blinking blue. I checked huawei e303 manual which says: Green, blinking once every 3s: The USB Stick is registering with a 2G network Blue, blinking once every 3s: The USB Stick is registering with a 3G/3G+ network.

Modem AT commands

Any : AT^SYSCFG=2,0,3FFFFFFF,2,4
2G only : AT^SYSCFG=13,1,3FFFFFFF,2,4
3G only : AT^SYSCFG=14,2,3FFFFFFF,2,4
2G preferred : AT^SYSCFG=2,1,3FFFFFFF,2,4
3G preferred : AT^SYSCFG=2,2,3FFFFFFF,2,4

So I run AT commands through asterisk dongle cmd to force modem to 2G:

rpi4-2*CLI> dongle cmd dongle0 AT^SYSCFG=13,1,3FFFFFFF,2,4 [dongle0] 'AT^SYSCFG=13,1,3FFFFFFF,2,4' Command queued for execute [dongle0] Got Response for user's command:'OK'

And now one-way-audio si fixed and no error msg! So it looks like that e303s has some issues with 3G network or something...