0

How to dial a network service number like #100*3# by AT Command? And what is the correct syntax in C# because when I try to dial it, the application considers it as a phone number and I hear a message that means that I can't dial this number.

Note: the code is successfully running and I can successfully dial any phone number but the problem is in the network service numbers.

I tried the following code:

sp.WriteLine("AT+CUSD=1,#"+100+"*3#,15"+Environment.NewLine );
Lupindo
  • 19
  • 6

1 Answers1

2

The correct syntax for the AT+CUSD command is specified in 27.007:

AT+CUSD=[<n>[,<str>[,<dcs>]]]

and the <str> parameter is a string which must be enclosed in double quotes. From V.250:

String constants shall be bounded at the beginning and end by the double-quote character

So your code should be

sp.WriteLine("AT+CUSD=1,\"#100*3#\",15\r");

Update: You should never use Environment.NewLine to terminate the command line, it should just be \r always.

hlovdal
  • 26,565
  • 10
  • 94
  • 165
  • 1
    Firstly thanks because the code is approximately working, but the problem is that the code is only responding to the first part of the code.I mean that #100# is the same result like #100*3# what means that it doesn't look at 3 . finally i want ,for example, to write #100*3*1*5*01287687678# because by writing it like the upper code the result will be like writing just #100# – Lupindo Apr 14 '13 at 05:37
  • by the way I tried the following codes but they don't work:: sp.WriteLine"ATCUSD=1,"#100*0000\",15"Environment.NewLine); sp.WriteLine("AT+CUSD=1,\"1\",15" + Environment.NewLine); and also AT+CUSD=1,"#100*0000\" AT+CUSD=1,"1" – Lupindo Apr 14 '13 at 06:35