Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ sign after Provider Name #39

Closed
532910 opened this issue Aug 11, 2017 · 14 comments
Closed

@ sign after Provider Name #39

532910 opened this issue Aug 11, 2017 · 14 comments

Comments

@532910
Copy link

532910 commented Aug 11, 2017

Sometimes, after some time, I see at sign or unprintable square at the end of provider name:

cellgate*CLI> dongle show device state tele2
-------------- Status -------------
...
Provider Name : Tele2�
...

cellgate*CLI> dongle show device state tele2
-------------- Status -------------
...
Provider Name : Tele2@
...

This is expected output:
cellgate*CLI> dongle show device state tele2
-------------- Status -------------
...
Provider Name : Tele2
...

@532910 532910 changed the title @ after Provider Name @ sign after Provider Name Aug 11, 2017
@532910
Copy link
Author

532910 commented Aug 11, 2017

sometimes dongle cmd tele2 reset helps
sometimes I need to reboot

@wdoekes
Copy link
Owner

wdoekes commented Aug 22, 2017

An @ sign would be an incorrectly decoded NUL.

But the fact that the output changes worries me more.

If you find any more info, please update this ticket.

@532910
Copy link
Author

532910 commented Aug 22, 2017

And now it's "TELE2" in uppercase:

dongle show device state tele2
...
Provider Name : TELE2

@532910
Copy link
Author

532910 commented Aug 22, 2017

I don't know, how I do this. I just toggle modem power on the usb hub.

@532910
Copy link
Author

532910 commented Aug 22, 2017

And some time after it become Tele2� again.

@532910
Copy link
Author

532910 commented Aug 22, 2017

Looks like it's not the asterisk-chan-dongle bug!

Welcome to minicom 2.7.1

AT+COPS?
+COPS: 0,2,"25020",2

OK

AT+COPS=?
+COPS: (2,"TELE2 RU","TELE2 RU","25020",2),(1,"MTS-RUS","MTS","25001",2),(1,"Beeline","Beeline","25099",2),(1,"MegaFon)

OK
AT+COPS=?
+COPS: (2,"TELE2 RU","TELE2 RU","25020",2),(1,"MegaFon RUS","MegaFon","25002",2),(1,"Beeline","Beeline","25099",2),(1,)

OK
AT+COPS=?
+COPS: (2,"Tele2@","Tele2�","25020",2),(1,"MTS-RUS","MTS","25001",2),(1,"Beeline","Beeline","25099",2),(1,"MegaFon RUS)

OK

@532910
Copy link
Author

532910 commented Aug 22, 2017

May it be a simcard bug?

@532910
Copy link
Author

532910 commented Aug 22, 2017

Another dongle shows the same error, but all my dongles are E1550 with the same firmware.

@532910
Copy link
Author

532910 commented Aug 22, 2017

I've replaced the simcard, but nothing changed.
Sometimes it shows
+COPS: (2,"Tele2@","Tele2�","25020",2)...
sometimes it shows
+COPS: (2,"Tele2�","Tele2 ","25020",2)...

@wdoekes
Copy link
Owner

wdoekes commented Nov 19, 2019

diff --git a/at_parse.c b/at_parse.c
index 888ff8a..2598f65 100644
--- a/at_parse.c
+++ b/at_parse.c
@@ -103,6 +103,16 @@ EXPORT_DEF char* at_parse_cops (char* str)
 		if(marks[3][-1] == '"')
 			marks[3]--;
 		marks[3][0] = 0;
+		/* Sometimes there is trailing garbage here;
+		 * e.g. "Tele2<U+FFFD>" instead of "Tele2"
+		 * see github issue #39 */
+		while (marks[3] > marks[2] && (
+				(unsigned char)marks[3][-1] < 32 ||
+				(unsigned char)marks[3][-1] == '@' ||
+				(unsigned char)marks[3][-1] >= 128)) {
+			marks[3]--;
+			marks[3][0] = 0;
+		}
 		return marks[2];
 	}
 

(edit: swapped order of marks[3]-- and =0)

@wdoekes
Copy link
Owner

wdoekes commented Nov 19, 2019

Maybe you want to share the make/model of your dongle as well.

@532910
Copy link
Author

532910 commented Nov 19, 2019

E1550 patched for voice support,
lsusb shows: 12d1:1001 Huawei Technologies Co., Ltd. E161/E169/E620/E800 HSDPA Modem

@532910
Copy link
Author

532910 commented Nov 19, 2019

The patch fixes both #69 and #39 (this one)

@532910
Copy link
Author

532910 commented Nov 20, 2019

Just an acknowledgment that master works fine. Thank you, Walter!

shalzz pushed a commit to shalzz/asterisk-chan-dongle that referenced this issue Apr 23, 2022
# This is the 1st commit message:

Create DONATIONS.txt
# This is the commit message wdoekes#2:

Update README.md
# This is the commit message wdoekes#3:

Update DONATIONS.txt
# This is the commit message wdoekes#4:

Update DONATIONS.txt
# This is the commit message wdoekes#5:

Update DONATIONS.txt
# This is the commit message wdoekes#6:

Update chan_quectel.h
# This is the commit message wdoekes#7:

Update README.md
# This is the commit message wdoekes#8:

Update cpvt.h
# This is the commit message wdoekes#9:

Add files via upload
# This is the commit message wdoekes#10:

Delete DONATIONS.txt
# This is the commit message wdoekes#11:

Update README.md
# This is the commit message wdoekes#12:

Update README.md
# This is the commit message wdoekes#13:

Update README.md
# This is the commit message wdoekes#14:

Add files via upload
# This is the commit message wdoekes#15:

Update README.md
# This is the commit message wdoekes#16:

Update README.md
# This is the commit message wdoekes#17:

Update README.md
# This is the commit message wdoekes#18:

Update README.md
# This is the commit message wdoekes#19:

Update README.md
# This is the commit message wdoekes#20:

Update README.md
# This is the commit message wdoekes#21:

Update README.md
# This is the commit message wdoekes#22:

Update README.md
# This is the commit message wdoekes#23:

Add files via upload

Added Simcom support
# This is the commit message wdoekes#24:

Update README.md
# This is the commit message wdoekes#25:

Update README.md
# This is the commit message wdoekes#26:

Added support for Quectel UAC configuration
# This is the commit message wdoekes#27:

Conf file when using UAC
# This is the commit message wdoekes#28:

Update README.md
# This is the commit message wdoekes#29:

Update README.md
# This is the commit message wdoekes#30:

Quectel CREG correction

chan_dongle code assumes 4 parameters in response to command and 3 for URC. However quectel provides 5 and 4 respectively. This fix helps pass on correct status of registration.
# This is the commit message wdoekes#31:

No force registration status

Due to CREG parse issues, earlier registration status was always kept on, now will show unregistered if not connected to network
# This is the commit message wdoekes#32:

Create readme.md
# This is the commit message wdoekes#33:

For compilation with openwrt sdk
# This is the commit message wdoekes#34:

Support for openwrt sdk compilation
# This is the commit message wdoekes#35:

Fix for lac and cell id

Ref IchthysMaranatha#6
Post fix values may have a trailing double quote for quectel devices
# This is the commit message wdoekes#36:

Updated call ids for simcom

Add call termination for call ids 1 and 2
# This is the commit message wdoekes#37:

comment for simcom audio

Added default audio port for simcom in comment
# This is the commit message wdoekes#38:

Integrated ALSA support for UAC

Integrated driver for ALSA added, no need for bridging additional Asterisk ALSA channel when using UAC mode. Please use non-ALSA integrated branch if there is no need for UAC and you wish to avoid alsa dependency when compiling and running
# This is the commit message wdoekes#39:

Update COPYRIGHT.txt

Attribute copyright for alsa code copied from chan_alsa.c https://github.com/asterisk/asterisk/blob/master/channels/chan_alsa.c
# This is the commit message wdoekes#40:

Update README.md
# This is the commit message wdoekes#41:

Conf file with UAC device support
# This is the commit message wdoekes#42:

UAC mode conf file
# This is the commit message wdoekes#43:

Added alsa-lib for compilation
# This is the commit message wdoekes#44:

Delete Makefile.in
# This is the commit message wdoekes#45:

alsa-lib dependency addition
# This is the commit message wdoekes#46:

Fix for simcom audio issues with immediate answer in dialplan
# This is the commit message wdoekes#47:

Note for Quectel serial audio

Added remark to disable gps messages
# This is the commit message wdoekes#48:

Added note for Pi users
# This is the commit message wdoekes#49:

Quectel creg formatting fix

Removed trailing double quotes in reporting lac/cid
# This is the commit message wdoekes#50:

add gitattributes
# This is the commit message wdoekes#51:

Send DTMF using AT command

Corrected at command for dtmf generation
# This is the commit message wdoekes#52:

Fix for busy on call rejection for simcom

For those who receive 'busy' additionally on call rejection when dialling out. Author only receives 'no carrier' on rejection. Reported and solved by @mpmc here IchthysMaranatha#22
# This is the commit message wdoekes#53:

Removal of redundant closetty
# This is the commit message wdoekes#54:

Update busy fix for call rejection

Updated fix as submitted by @mpmc here IchthysMaranatha#22
Author does not receive busy response on call rejection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants