GSMCTL(8)
π GSMCTL(8) π
from the System Manager's Manual β okay bestie, this is the manual page for gsmctl(8), and it's a whole vibe. Buckle up. π
β¨ NAME β¨
gsmctl, gsmsiectl β GSM mobile phone control program π¦
πΈ SYNOPSIS πΈ
gsmctl [-b baudrate] [--baudrate baudrate] [-d device] [--device device]
[-h] [--help] [-I init string] [--init init string] [-v] [--version]
[-X] [--xonxoff] -o operation | --operation operation | parameters
gsmsiectl [-b baudrate] [--baudrate baudrate] [-d device] [--device
device] [-h] [--help] [-I init string] [--init init string] [-v]
[--version] [-X] [--xonxoff] -o operation | --operation operation |
parameters
π DESCRIPTION π
So basically, gsmctl can ask an actual GSM mobile phone for info, or make it do stuff. It's giving remote control for your phone, periodt. π
The way it works: gsmctl attaches itself to whatever device you hand it on the command line β usually a GSM modem β using the baudrate you specified. If you don't give it a device, it just goes with /dev/mobilephone. And if you skip the baudrate? It lowkey defaults to 38400. Simple as that. β¨
gsmctl has two modes, and this is the part where you gotta pay attention:
- If you don't pass the
--operationoption, then your parameters are just telling it what status info to pull back from the phone. Head to the STATUS INFORMATION section for the deets. π - If you do pass an
--operationoption, then it goes and actually performs that operation on the mobile, using your parameters. See the OPERATIONS section for all of that. π οΈ
Now, gsmsiectl is literally the same program, except it's got extra features for Siemens mobile phones. Some extra OPERATIONS are available when you use it. Iconic, honestly. π
Error messages get printed to the standard error output. And if the program bails out on an error, it returns the error code 1. No cap. π
π OPTIONS π
-b baudrate,--baudrate baudrateβ the baud rate you wanna use. Defaults to38400. β‘-d device,--device deviceβ the device your GSM modem is plugged into. The default is/dev/mobilephone. π-h,--helpβ prints an option summary. Your lil cheat sheet. π-I init string,--init init stringβ the initialization string to send to the TA (default:"E0"). Note that the sequence"ATZ"is sent first. π«Ά-o operation,--operation operationβ this one is for performing an operation on the mobile phone. Go check the OPERATIONS section for which operations exist and what parameters each one needs. π―-v,--versionβ prints the program version. π·οΈ-X,--xonxoffβ uses software handshaking (XON/XOFF) for accessing the device. π€
π¦ STATUS INFORMATION π¦
If you call it without the --operation option, gsmctl prints out the default mobile phone status info, as specified by the parameters down below. Let's go through them one by one, bestie. π
ALLβ prints all available information. The whole buffet. πBATTβ prints out info about the current battery status. Two lines get printed, shaped like"<BATT0> text"and"<BATT1> charge". The text can be one of these:"0 ME is powered by the battery","1 ME has a battery connected, but is not powered by it","2 ME does not have a battery connected", or"3 Recognized power fault, calls inhibited". Andchargeis a number in the range 0..100, where 0 means the battery is empty or not connected, and 100 means full charge. πBITERRβ prints info about the current bit error rate. The output looks like"<BITERR0> value", wherevaluecan be0..7, or99(and99means not available or not detectable). πCLIPβ prints a line shaped like"<CLIP0> on"if caller line identification is turned on in the network, and"<CLIP0> off"otherwise. πCSETβ displays info about charsets. The output is shaped like"<CSET0> available"and"<CSET1> current", which tells you the charsets available and which one is current. π€CURROPβ prints info about the current operator. The output line looks like"<CURROP0> Long name: Β΄xxxxΒ΄ Short name: Β΄yyyyΒ΄ Numeric Name: zzzz". π‘FLCAPβ prints out the two-letter names of available facility locks. The meaning of the standardized facility lock names goes like this:CSβ Lock control surface (eg. phone keyboard)PSβ Lock phone to SIM card (mobile phone asks password when other than current SIM card inserted)SCβ Lock SIM card (SIM asks password in mobile phone power-up and when this lock command issued)AOβ Barr all outgoing callsOIβ Barr outgoing international callsOXβ Barr outgoing international calls except to home countryAIβ Barr all incoming callsIRβ Barr incoming calls when roaming outside the home countryNTβ Barr incoming calls from numbers not stored to TA memoryNMβ Barr incoming calls from numbers not stored to mobile phone memoryNSβ Barr incoming calls from numbers not stored to SIM memoryNAβ Barr incoming calls from numbers not stored in Any memoryABβ All Barring services (FIXME)AGβ All outGoing barring services (FIXME)ACβ All inComing barring services (FIXME)FDβ SIM fixed dialling memory feature (if PIN2 authentication has not been done during the current session, PIN2 is required as<passwd>)
Heads up: mobile phones may implement facility locks that aren't documented here. So don't come for the list if your phone's got extra ones. π
FLSTATβ prints info about the status of facility locking in the mobile phone. For each facility, a line shaped like"<FLSTATn> Β΄facilitynameΒ΄ classes"gets printed. The classes may be"Voice","Data", and/or"Fax", depending on the class the facility is enabled for. If"unknown"comes out, that means the TA can't report the status. And if the facility isn't enabled for any class, no class identifier gets printed at all. Peep FLCAP for info about the available two-letter names of facility locks. πFORWβ prints info about call forwarding that's enabled in the mobile phone. For each combo of reason (UnconditionalReason,MobileBusyReason,NoReplyReason, andNotReachableReason) and class (Voice,Data, andFax), a line shaped like"<FORWn.m> reason class number: xxx subaddr: yyy time: zzz"gets printed. Thattimeis the number of seconds to wait before forwarding in the case ofNoReplyReason. β³MEβ prints manufacturer, model, revision, and serial number of the mobile phone (ME = mobile equipment). Output lines are numbered from"<ME0>"to"<ME3>". π±OPβ prints info about the currently available mobile network operators. For each operator, an output line shaped like"<OPn> status Long name: Β΄xxxxΒ΄ Short name: Β΄yyyyΒ΄ Numeric name: zzz"gets returned, wherestatusmay be one of:unknownβ the status of the operator is unknown.currentβ this is the currently selected operator.availableβ this operator is available for selection.forbiddenβ this operator is not available for selection, ie. not accessible with this SIM card.
PINβ prints info about the current PIN status. The output is shaped like"<PIN0> status", wherestatuscan be one of the following lines:READYβ ME is not pending for any password.SIM PINβ ME is waiting SIM PIN to be given.SIM PUKβ ME is waiting SIM PUK to be given.PH-SIM PINβ ME is waiting phone/-to/-SIM card password to be given.PH/-FSIM PINβ ME is waiting phone/-to/-very first SIM card password to be given.PH/-FSIM PUKβ ME is waiting phone/-to/-very first SIM card unblocking password to be given.SIM PIN2β ME is waiting SIM PIN2 to be given.SIM PUK2β ME is waiting SIM PUK2 to be given.PH/-NET PINβ ME is waiting network personalisation password to be given.PH/-NET PUKβ ME is waiting network personalisation unblocking password to be given.PH/-NETSUB PINβ ME is waiting network subset personalisation password to be given.
PWβ facilities in the mobile phone may be protected by passwords (ie. PINs or PUKs). This option prints out lines shaped like"<PWn> Β΄facilitynameΒ΄ len"for each facility that has a facility lock password. See FLCAP for info about the available two-letter names of facility locks. πSCAβ reports the default SMS service centre address currently set in the mobile phone. π¬SIGβ prints info about the current network signal strength. The output is shaped like"<SIG0> value". These values are possible:0β -113 dBm or less1β -111 dBm2...30β -109... -53 dBm (in steps of 2 dBm)31β -51 dBm or greater99β not known or not detectable
okay bestie that's part 1, and there is so much more coming β the operations, the examples, the whole thing. stay tuned. π
π₯ OPERATIONS π₯
okay bestie this is the part where stuff actually happens. like, this is the doing-stuff section. main character energy fr fr π
dial numberβ Dials number. Thengsmctljust... sits there waiting for a<CR>keypress to terminate. yes really. it's waiting on you. type the enter key and it lets go π«Άforw mode reason number [facilityclass] [forwardtime]β changes how call forwarding behaves in the network. mode can be any of these:disableβ call forwarding is off. cancelled. blocked. we don't know her πenableβ call forwarding is on. the call forwarding reason, number, and (optionally) forwardtime have to be registered beforehand tho, so don't skip that step bestie.registerβ this is what registers the call forwarding reason, number, and forwardtime in the network. the paperwork. the admin. the β¨bureaucracyβ¨.eraseβ the counterpart toregister. it erases the call forwarding info in the network. poof. gone. no notes.
reason can be any of these:
unconditionalβ this applies to every call. every single one. no exceptions.mobilebusyβ the mobile phone is busy π₯²noreplyβ the call is not answered in forwardtime secondsnotreachableβ mobile phone cannot be reached (ie. switched off). ghosting behaviour honestly πallβ this refers to all forwarding reasonsallconditionalβ this refers to all conditional forward reasons (mobilebusy,noreply,notreachable)
number is the number the incoming call is forwarded to. See the explanation for lock operation for the meaning of facilityclass. The default for forwardtime is 20 seconds if omitted. forwardtime can be in the range 1..30.
offβ Sets functionality level of the phone to 0 (low functionality). The effects of this command depend on the phone (eg. sets low power consumption). nap mode π΄onβ Sets functionality level of the phone to 1 (high functionality). The effects of this command depend on the phone. and she's UP βοΈpin pinβ Sets PIN code. Usegsmctl pinto get the current pin status. yes the argument is also called pin, it's giving "who's on first" energy and we're rolling with it πΈlock facility [facilityclass] [passwd]β Locks the named facility. Usegsmctl flcapto get a list of supported facilities. The facilityclass can be any of:allβ Voice, data, and fax.vvfvdffddβ Any combination of voice, data and fax.
The default is all if facilityclass is omitted. The passwd is password for the facility. If no password is given this parameter can be omitted. π
setop opmode numericnameβ Sets the current operator to numericname. Usegsmctl opto get a list of operators with their numeric codes. opmode can be any of:automaticmanualderegisterβ Deregister from network.manualautomaticβ If manual selection fails, automatic mode is entered. it's got a backup plan, we love a resilient queen π
setpw facility [oldpasswd] [newpasswd]β Sets the password for the facility. If one of the passwords is omitted this means that the facility has no password protection. Passwords are PIN1, PIN2, PUK etc.setsca service centre addressβ Sets the default SMS service centre address. π²unlock facility [facilityclass] [passwd]β This is the reverse operation tolock. See above for a description of the parameters. π
Extra operators for gsmsiectl:
csetβ Charset info.pbookβ Phone book info.signalβ Signal tone info.ringβ Ringing tone info.binaryβ Binary info.
β¨ EXAMPLES β¨
The following invocation of gsmctl prints out all available status information for the mobile phone connected to /dev/mobilephone
gsmctl all
The output could look like (lines edited to fit):
<ME0> Manufacturer: SIEMENS
<ME1> Model: S10
<ME2> Revision: 06
<ME3> Serial Number: 448058511817585
<OP0> Status: available Long name: 'D1/-TELEKOM' Short name: ''
Numeric name: 26201
<OP1> Status: forbidden Long name: 'D2 PRIVAT' Short name: ''
Numeric name: 26202
<CURROP0> Long name: 'D1/-TELEKOM' Short name: '' Numeric name:
26201 Mode: automatic
<FLSTAT0> 'CS'
<FLSTAT1> 'PS'
<FLSTAT2> 'SC' Voice Data Fax
<FLSTAT3> 'AO'
<FLSTAT4> 'OI'
<FLSTAT5> 'OX'
<FLSTAT6> 'AI'
<FLSTAT7> 'IR'
<FLCAP0> 'CS' 'PS' 'SC' 'AO' 'OI' 'OX' 'AI' 'IR' 'AB' 'AG' 'AC'
<PW0> 'PS' 8
<PW1> 'SC' 8
<PW2> 'AO' 4
<PW3> 'OI' 4
<PW4> 'OX' 4
<PW5> 'AI' 4
<PW6> 'IR' 4
<PW7> 'AB' 4
<PW8> 'AG' 4
<PW9> 'AC' 4
<CLIP0> on
<FORW0.0> UnconditionalReason Voice inactive number: subaddr:
time: -1
<FORW0.1> UnconditionalReason Data inactive number: subaddr:
time: -1
<FORW0.2> UnconditionalReason Fax inactive number: subaddr:
time: -1
<FORW1.0> MobileBusyReason Voice active number: +494012345678
subaddr: time: -1
<FORW1.1> MobileBusyReason Data inactive number: subaddr: time:
-1
<FORW1.2> MobileBusyReason Fax inactive number: subaddr: time:
-1
<FORW2.0> NoReplyReason Voice active number: +494012345678
subaddr: time: 20
<FORW2.1> NoReplyReason Data inactive number: subaddr: time: -1
<FORW2.2> NoReplyReason Fax inactive number: subaddr: time: -1
<FORW3.0> NotReachableReason Voice active number: +494012345678
subaddr: time: -1
<FORW3.1> NotReachableReason Data inactive number: subaddr:
time: -1
<FORW3.2> NotReachableReason Fax inactive number: subaddr: time:
-1
<BATT0> 0 ME is powered by the battery
<BATT1> 100
<BITERR0> 0
<SIG0> 19
The following locks the keys on the mobile phone:
gsmctl -o lock cs
This changes the SIM card PIN from 1234 to 2345:
gsmctl -o setpw sc 1234 2345
Switch off all call forwarding (actually erase the numbers):
gsmctl -o forw erase all
Switch on call forwarding to German D1 voice box:
gsmctl -o forw register notreachable 3313
gsmctl -o forw enable notreachable
π FILES π
/dev/mobilephoneβ Default mobile phone device. that's her home address bestie π
π AUTHOR π
Peter Hofmann <software@pxh.de>
π BUGS π
Report bugs to software@pxh.de. Include a complete, self-ncontained example that will allow the bug to be reproduced, and say which version of gsmctl you are using.
okay so real talk: give them an example that stands on its own and tell them your version. no "it doesn't work" and nothing else. they cannot read your mind, bestie, they're not psychic π«Ά
π COPYRIGHT π
Copyright Β© 1999 Peter Hofmann
gsmctl is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
gsmctl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with gsmctl; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
π SEE ALSO π
gsminfo(7), gsmpb(1), gsmsendsms(1), gsmsmsd(8), gsmsmsstore(1).
and that's the whole page, babe π this one is gsmctl v1.10, dated Sun Mar 31 18:20:52 UTC 2024, and it's GSMCTL(8) β go forth and control some phones, you've got this, i'm so proud of you π¦β¨
π¦ where this page comes from
- ubuntu noble: gsm-utils 1.10+20120414.gita5e5ae9a-3build1
- ubuntu questing: gsm-utils 1.10+20120414.gita5e5ae9a-3build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms