PDA

View Full Version : The Official word on what changes the Baseband saves and what it discard


Snowbird
10-06-2007, 09:58 AM
I'm confused. I've found a way to automatically activate SMS acknowledgments (amongst other things that you're all going to like), however when I save the changes and exit the BB and restart the commcenter, the phone forgets about these changes. But why? My reprogramming of my VoiceMail button remains more of less "permanent," so why do SMS config changes get reset?

AT Command that controls SMS message life span and acknowledge. This is the default.

AT+CSMP?
+CSMP: 17,167,0,0

Hereafter the AT Command to increases the live span of an SMS to 24 hours and asks for an acknowledgment

AT+CSMP=33,169,0,0
OK

AT+CSMP? ---> my changes were accepted
+CSMP: 33,169,0,0

Here is the Save Settings command

AT+CSAS
OK

Once again, if you exit minicom and restart the CommCenter, these changes are lost. Is it because once the CommCenter restarts, it sends a series of AT commands that reset SMS and other parameters to predefined settings that are defined somewhere that we can change? Any thoughts?

harshw
10-06-2007, 03:09 PM
Excellent work Snowbird. Perhaps you should change the title of the thread to more accurately reflect that it deals with SMS sending and Delivery Receipts - that way more people will go through it ...

rjshearman
10-06-2007, 03:28 PM
(amongst other things that you're all going to like)

Suspense is killing me.

Possible ability to:

- delete single SMS rather than whole thread?
- start a new thread with a person rather than continuing?

Snowbird, more info please! :)

schalkse
10-06-2007, 03:41 PM
Maybe this could be sim dependent. The commands you issue will go to the sim, not the baseband. Have you tried using a later generation of sim card? Or another provider?

Snowbird
10-06-2007, 03:59 PM
Maybe this could be sim dependent. The commands you issue will go to the sim, not the baseband. Have you tried using a later generation of sim card? Or another provider?

Not quite sure that I follow, however I think I understand what you're saying and this could be a key to coming up with the definitive solution which I'm sure that my friend iunknown can help with (aSMS)?

When you state that the AT commands I type will go to the SIM, but not the baseband, can you please clarify what you're saying?

As an aside, ACK SMS messages are nice, but not the real reason that I'm doing this. My primary objective is to resolve the flash SMS message for vmail notification, which, to my thinking is the more important issue to resolve.

Snowbird
10-06-2007, 04:03 PM
Suspense is killing me.

Possible ability to:

- delete single SMS rather than whole thread?
- start a new thread with a person rather than continuing?

Snowbird, more info please! :)

re: deleting single SMS. Find yourself a copy of sqlite or equiv and just modify the SMS.db. Should take you less than a minute to do once you get the hang of it.

schalkse
10-06-2007, 04:16 PM
Not quite sure that I follow, however I think I understand what you're saying and this could be a key to coming up with the definitive solution which I'm sure that my friend iunknown can help with (aSMS)?

When you state that the AT commands I type will go to the SIM, but not the baseband, can you please clarify what you're saying?

As an aside, ACK SMS messages are nice, but not the real reason that I'm doing this. My primary objective is to resolve the flash SMS message for vmail notification, which, to my thinking is the more important issue to resolve.

Maybe, this will help you ;)
Very good guide. What i am saying is that when you change the sms details, like let's say the sms central number. This is stored on the sim usualy. Sift throught this guide/site. Am sure you will find your answer. There are some commands you can enter to choose between storing on sim or on phone memory.
http://www.smssolutions.net/tutorials/gsm/sendsmsat/

rjshearman
10-06-2007, 04:20 PM
re: deleting single SMS. Find yourself a copy of sqlite or equiv and just modify the SMS.db. Should take you less than a minute to do once you get the hang of it.

Excellent, i'll give it a try later. Out of interest did you download the SMS.db file locally, modify it, delete off iPhone and then re-upload the modified version? Or did you access the SMS.db file via SSH straight onto the phone? Will both ways work? I guess the first is safer.

Snowbird
10-06-2007, 04:23 PM
Excellent, i'll give it a try later. Out of interest did you download the SMS.db file locally, modify it, delete off iPhone and then re-upload the modified version? Or did you access the SMS.db file via SSH straight onto the phone? Will both ways work? I guess the first is safer.

First approach is easier. The second approach is possible, however requires additional software to achieve.

Snowbird
10-06-2007, 04:28 PM
Maybe, this will help you ;)
Very good guide. What i am saying is that when you change the sms details, like let's say the sms central number. This is stored on the sim usualy. Sift throught this guide/site. Am sure you will find your answer. There are some commands you can enter to choose between storing on sim or on phone memory.
http://www.smssolutions.net/tutorials/gsm/sendsmsat/

That's what I thought, thus my comments regarding aSMS. Will investigate and see what I can come up with. Re: the SMS Solutions guide, I'm familiar with this one however it's far from complete. There are others out there that are a little better. The best of all would be the S-Gold2 technical manual, but it doesn't look like we'll be getting our hands on this one anytime soon. Actually, I doubt we ever will.

gusano
10-06-2007, 04:36 PM
Salut Snowbird et al,

Just wanted to share my findings. After some research, I discovered something that you maybe already know: every time a flash message arrives CommCenter creates an edge connection through the interface ip2 to the apn defined in /System/Library/Frameworks/CoreTelephony.framework/Support/PDPContext_1.plist and all the .amr sound files (the voicemail) are downloaded and stored in /var/root/Library/Voicemail/voicemail.db. This is how the visual voicemail works. I was naive into thinking that removing the PDPContext_1.plist would be enough to receive the flash messages, but no... I even tried to shutdown the ip2 with ifconfig, but it also did not work. I found that the voicemail apn was also defined in the file /var/root/Library/Preferences/SydtemConfiguration/preferences.plist, I remove the dict entry for ip2 thinking that that would work... nada! :(.

I really do not see any other solution than hacking CommCenter, and this, I really do not know how to do it... long time since the last time I dissasembled something ;). The flash messages are indeed being catched by this guy, but it just refrains from storing them in SMS.db and let alone alert us of their arrival. The worst part is that it seems that CommCenter deletes them for good so I guess aSMS will never be able to get them.

Féchié,

Rafa.

schalkse
10-06-2007, 04:48 PM
That's what I thought, thus my comments regarding aSMS. Will investigate and see what I can come up with. Re: the SMS Solutions guide, I'm familiar with this one however it's far from complete. There are others out there that are a little better. The best of all would be the S-Gold2 technical manual, but it doesn't look like we'll be getting our hands on this one anytime soon. Actually, I doubt we ever will.

True, however, AT commands are a standard. Issueing commands should work on any modem.
How about this thread?
http://discussion.forum.nokia.com/forum/showthread.php?t=19745

ricochet
10-07-2007, 07:13 AM
The worst part is that it seems that CommCenter deletes them for good so I guess aSMS will never be able to get them.
I've had success using aSMS to view the "last received message" and have my voicemail notifications appear there, when the iPhone SMS app had not alerted me of their arrival. So whatever that app is doing to view these "last received" messages, it's got something right... perhaps the author iUnknown can help out!

aiphone
10-07-2007, 09:11 AM
Is it possible to just disable voicemail along the same lines of setting a new voicemail number? - and if voicemail is disabled alltogether would the messages then be delivered as normal sms?

Snowbird
10-07-2007, 12:26 PM
Is it possible to just disable voicemail along the same lines of setting a new voicemail number? - and if voicemail is disabled alltogether would the messages then be delivered as normal sms?

That's what our friend Gusano above more or less tried to do, but unhappily the end result was the same.

Snowbird
10-07-2007, 12:44 PM
Salut Snowbird et al,

Just wanted to share my findings. After some research, I discovered something that you maybe already know: every time a flash message arrives CommCenter creates an edge connection through the interface ip2 to the apn defined in /System/Library/Frameworks/CoreTelephony.framework/Support/PDPContext_1.plist and all the .amr sound files (the voicemail) are downloaded and stored in /var/root/Library/Voicemail/voicemail.db. This is how the visual voicemail works. I was naive into thinking that removing the PDPContext_1.plist would be enough to receive the flash messages, but no... I even tried to shutdown the ip2 with ifconfig, but it also did not work. I found that the voicemail apn was also defined in the file /var/root/Library/Preferences/SydtemConfiguration/preferences.plist, I remove the dict entry for ip2 thinking that that would work... nada! :(.

I really do not see any other solution than hacking CommCenter, and this, I really do not know how to do it... long time since the last time I dissasembled something ;). The flash messages are indeed being catched by this guy, but it just refrains from storing them in SMS.db and let alone alert us of their arrival. The worst part is that it seems that CommCenter deletes them for good so I guess aSMS will never be able to get them.

Féchié,

Rafa.

Salut gusano. Looked at the mulicast interfaces as well, actually both of them. I'm still looking at them. Ready for an interesing piece of news? aSMS sees the Flash messages. If you call you're iphone and then tap twice on the power on/off button to send the call to voicemail and then wait a few minutes before clicking on the SMS(SIM) button, you'll see it in LastReceived. I've all but given up on the tty.baseband now and am focusing my attention on tty.debug.

I'm convinced now that the solution is really staring us in the face and we're just not seeing. The iPhone receives these messages and knows what to do with them, but unhappily, the phone is not alerting as it should be doing.

gusano
10-07-2007, 01:59 PM
aSMS sees the Flash messages

Cool, I stand corrected!. I actually verified this with minicom:

at+cmgf=1 (set message mode to text)
ok

at+cmgr=0 (read message in position 0)
+CMGR: "REC UNREAD","88",,"07/10/06,19:35:32+08"
"888" messagerie Orange : 2 messages.

So the idea would be to have some daemon running in background executing this command every n seconds. The thing that I do not like is to have a "unload commcenter" executing all the time. Is there a way to read /dev/tty.baseband concurrently?.

Just another question, where is this message stored? SIM? baseband memory? for info, the preferred message storage in my phone:

at+cpms?
+CPMS: "MT",0,30,"MT",0,30,"MT",0,30

I quote http://www.developershome.com/sms/cpmsCommand.asp


SM. It refers to the message storage area on the SIM card.

ME. It refers to the message storage area on the GSM/GPRS modem or mobile phone. Usually its storage space is larger than that of the message storage area on the SIM card.

MT. It refers to all message storage areas associated with the GSM/GPRS modem or mobile phone. For example, suppose a mobile phone can access two message storage areas: "SM" and "ME". The "MT" message storage area refers to the "SM" message storage area and the "ME" message storage area combined together.

So the message may be in the sim or in the modem memory :confused:.

I continue my research ;).

Gusano.

pappi
10-07-2007, 02:08 PM
:D Good Work Guys...:D

Snowbird
10-07-2007, 05:27 PM
Gusano,

You need the full set of values to fully understand what the phone does with the Flash Message and other types of SMS --

AT+CPMS=?
+CPMS: ("MT","ME","SM","BM"),("MT","ME","SM"),("MT","ME","SM","BM")

AT+CPMS=?
Responses decrypted
+CPMS: (list of supported <mem1>s),( list of supported <mem2>s) ,(list of supported <mem3>s)

<mem1> Memory from which messages are read and deleted

SM SIM message storage
ME Mobile Equipment message storage
MT combination of "ME" and "SM" storages
BM refers to the broadcast message storage area. It is used to store cell broadcast messages.

<mem2> Messages will be written and sent to this memory storage:

SM SIM message storage
ME Mobile Equipment message storage
MT combination of "ME" and "MT" storages

<mem3> Memory in which received messages are preferred to be stored, if routing to is not set (see AT+CNMI command)

SM SIM message storage
ME Mobile Equipment message storage
MT combination of "ME" and "SM" storages
BM refers to the broadcast message storage area.

The iPhone's CNMI Values Very weird!

AT+CNMI?
+CNMI: 1,0,0,0,0

CNMI Decrypted:

+CNMI: <mode>,<mt>,<bm>,<ds>,<bfr>

<mode>:
0: buffer in TA;
1: discard indication and reject new SMs when TE-TA link is reserved; otherwise forward directly;

<mt>: 0: no SMS-DELIVER are routed to TE;

1: +CMTI: <mem>,<index> routed to TE;

2: for all SMS_DELIVERs except class 2: +CMT: .... routed to TE; class 2 is indicated as in <mt>=1;

3: Class 3: as in <mt>=2; other classes: As in <mt>=1;

---> Interesting: Only when <mt> is different from 0, you will get a message that a new SMS has been received. Is this not the problem? Nokia sets their phones to 2.


<bm>: same as <mt>, but for CBMs;
<ds>: 0: No SMS-STATUS-REPORT are routed to TE;

1: SMS-STATUS-REPORTs are routed to TE, using +CDS: ...

<bfr>: 0: TA buffer is flushed to TE (if <mode>=1..3);

1: TA buffer is cleared (if <mode>=1..3);

Ok here's the deal as far as SMS are concerned. Using the aSMS app as my guide, a normal SMS is treated very differently then a Flash SMS message. The storage area of a normal SMS is the SMS.db (via the BB) and the storage area of the Flash Message is on the SIM (via the BB). All traces of the flash message disappears the moment that either a new Flash or Normal SMS is received.

So whats the workaround?

Assuming that the settings in AT+CNMI is the cause of all our headaches -- not 100% sure of this -- try and find a way to apply Nokia's default values of AT+CNMI=1,2,0,0,1 (or 1,2,0,0,0 so as not to change the config too much) in the BB. Only problem is that we can't seem to save the commands that you enter in the BB permanently with SMS.

Would be nice to see that default AT+CNMI setting of another phone running the S-GOLD2.

Need to focus on the tty.debug...

ricochet
10-07-2007, 11:23 PM
awesome work guys, I hope you have some success getting the baseband changes saved so we can put this one to bed.

fr0zen
10-07-2007, 11:26 PM
woa! i am excited! would love to finally have voicemail notifications!

thanks for looking into this snowbird

Snowbird
10-08-2007, 01:04 AM
How annoying! The AT+CSAS command is used to save service settings to a non-volatile memory. All settings specified in commands Service Centre Address +CSCA and Set Message Parameters +CSMP are saved and conserved. The rest can be forced into a profile which will be saved. Issuing a AT+CSAS=? shows that there is already 1 profile defined "0." You can add a second one (0,1 for example), but guess what happens when you reload the CommCenter? You got it, it gets wiped out. If you exit minicom without reloading the CommCenter and check, your changes are still there.

It's hard to say with any certainly what resets the settings, but the CommCenter plist clearly illustrates that upon unloading that there is a "ResetAtClose" and probably -- somewhere -- a PrepareAtLaunch (but where?) Would be nice to see what replacing the <true> with a <false> would do? Will try that tomorrow night.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.CommCenter</string>
<key>MachServices</key>
<dict>
<key>com.apple.commcenter</key>
<dict>
<key>ResetAtClose</key>
<true/>
</dict>

Snowbird
10-08-2007, 01:25 AM
BTW, the very best document that I've found to date on AT commands is a Nokia guide. You can find it at:

www.itruss.com/files/atnokia.pdf

I haven't run across a single AT command to date that doesn't workwith the iPhone's S-GOLD2 (haven't tested them all though). Clearly a Siemens S75 or equiv guide would be better, but the Nokia manual is perfect.

ricochet
10-08-2007, 01:44 AM
Is it possible to save the changes to AT+CNMI on the default profile 0 which doesn't get wiped, or do changes saved to this profile also get reset?

The ResetAtClose may just be a restart of the commcenter to apply the changes - if you disable this then my guess is that your changes may persist until you performed a restart but then be lost. Worth a try though :)

gusano
10-08-2007, 12:11 PM
Hi there,

Well, no news on my side. I spent most of sunday attacking the problem from any angle I could. At least I could draw some conclusions that I'm pretty sure about:

- CommCenter opens the device /dev/h5.baseband so no clear AT commands in the code (I dissasembled it using IDA and a patched macho.ldw found in the dev team wiki). I would love to know what is this h5 protocol, the reset command surely would be found!.

- CommCenter is in charge of connecting to the Visual Voicemail server (if you are in AT&T and VVM a.k.a EnhancedVoicemail is configured) and adding any new voicemail (with the .amr sound files) to /var/root/Library/Voicemail/voicemail.db. It also opens the file sms.db for some querying but I could not find any CREATE call in the code. I've even found some DELETEs.... why is CommCenter deleting entrys in sms.db???... for a moment I thought the voicemail notification was indeed being stored in sms.db and CommCenter just deleted it... wrong... I left myself a voicemail (with the other 20 yesterday ;) ) and the modification time of sms.db did not change.

- in the plist file for CommCenter you can add the -p argument and define the stderr and stdout files. Sending a kill -USR2 to CommCenter produces a lot of nice information in the stdout file, but totally useless for our flash sms enterprise :mad:. The dump produced by dialing *5005*78283# and entering a name is way more "informational".... BTW, I do not know what I did, but I get a dump .bin file together with the .log file. The bin file is 1.5 MB. Any ideas? a dump of the baseband? :confused:

I have some open questions:

- who is creating the new entries in sms.db? CommCenter? MobileSMS? AppSupport? other? that I will look tonight.. my disassembling faculties are way too rusty ;).

-who is in charge of giving the notification "Text from %s"? SpringBoard?.. maybe the bug with the flash sms is in there... will check tonight.

A plus tard,

Rafa (gusano).

Snowbird
10-08-2007, 02:15 PM
Pressed for time, but the BIN file is no doubt debug information that can be analysed using Xcode. Since it's not possible to debug locally, that is, unless Apple has created a test Mac that runs iPhone OS (non!), I would assume that's what this file is for. Makes sense I would say.

Just thought of something, speaking of short codes, I'm wondering if there's not a *5005*...*short code that allows you to change the AT command that I'm trying to make semi-permenant? Need to check this out.

Re: your questions. I'll take a shot at answering them.

Let's call the CoreServices the Firmware/CPU to keep things simple. So, who creates the entry in the SMS.db? I don't think that there's only one culprit. The BB (CommCenter) informs the CPU/Firmware that it has received a message and the Firmware informs the SMS.App who then populates the received SMS in SMS.db and fires back a message to the Firmware that it's done. The Firmware fires back a message to the BB to remove the waiting SMS from BB memory. At the sametime, the Firmware informs "notification" services that a new message is received which results in the SMS app icon being updated by 1 and then using hashed configuration details the phone either beeps or vibrates and spreys a alert message across your screen that it gets from the USSD/Springboard string files.

Re: question 2. I thought of this before. My initial assumption was that the phones knows precisely how to deal with Flash SMS and that the phone WANTs to splash the notification across the screen, but that it hasn't been taught how to do so for the simple and precise reason that "there's no string defined for this option in the SpringBoard.string file." The phone knows exactly what to do with the Flash SMS -- it's on the SIM -- and the Phone CLEARLY know how to get it there, what's missing is just the reporting feature.

If we could convince the phone via the BB that this message is not special or a "BC" (which is what I'm trying to do), the VM Notication would find it's way into SMS.db, but with either 0 sender details. Whether this will crash the SMS.db, I can't say because I haven't managed to apply the changes. I'm sure that this will crash the SMS.db each time, but at least this is progress and a step in the right direction....

Snowbird
10-08-2007, 02:33 PM
From the Dev Site: Re: **5005*78283# asks you "Please add description for this capture", you can hit reply and enter a string. This enables baseband exchanges logging to /Library/Logs/Baseband. These logs will be transferred to the host computer when synced with iTunes again. On a Mac, the files get to /Library/Logs/CrasReporter/MobileDevice/<myiphone's name>/