summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/phone/nokia/nfunc.c
Unidiff
Diffstat (limited to 'gammu/emb/common/phone/nokia/nfunc.c') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/phone/nokia/nfunc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gammu/emb/common/phone/nokia/nfunc.c b/gammu/emb/common/phone/nokia/nfunc.c
index 3acfb10..d4d8b03 100644
--- a/gammu/emb/common/phone/nokia/nfunc.c
+++ b/gammu/emb/common/phone/nokia/nfunc.c
@@ -1348,125 +1348,139 @@ GSM_Error N71_65_ReplyCallInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
1348 smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii 1348 smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii
1349 tmp = 6; 1349 tmp = 6;
1350 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false); 1350 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false);
1351 smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer)); 1351 smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer));
1352 /* FIXME: read name from frame */ 1352 /* FIXME: read name from frame */
1353 1353
1354 call.Status = GSM_CALL_CallStart; 1354 call.Status = GSM_CALL_CallStart;
1355 break; 1355 break;
1356 case 0x04: 1356 case 0x04:
1357 smprintf(s, "Remote end hang up\n"); 1357 smprintf(s, "Remote end hang up\n");
1358 smprintf(s, "Cause Type : %i\n",msg.Buffer[5]);//such interpretation is in gnokii 1358 smprintf(s, "Cause Type : %i\n",msg.Buffer[5]);//such interpretation is in gnokii
1359 smprintf(s, "CC : %i\n",msg.Buffer[6]); 1359 smprintf(s, "CC : %i\n",msg.Buffer[6]);
1360 smprintf(s, "MM(?) : %i\n",msg.Buffer[7]); 1360 smprintf(s, "MM(?) : %i\n",msg.Buffer[7]);
1361 smprintf(s, "RR(?) : %i\n",msg.Buffer[8]); 1361 smprintf(s, "RR(?) : %i\n",msg.Buffer[8]);
1362 call.Status = GSM_CALL_CallRemoteEnd; 1362 call.Status = GSM_CALL_CallRemoteEnd;
1363 call.StatusCode = msg.Buffer[6]; 1363 call.StatusCode = msg.Buffer[6];
1364 break; 1364 break;
1365 case 0x05: 1365 case 0x05:
1366 smprintf(s, "Incoming call\n"); 1366 smprintf(s, "Incoming call\n");
1367 smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii 1367 smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii
1368 tmp = 6; 1368 tmp = 6;
1369 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false); 1369 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false);
1370 smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer)); 1370 smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer));
1371 /* FIXME: read name from frame */ 1371 /* FIXME: read name from frame */
1372 call.Status = GSM_CALL_IncomingCall; 1372 call.Status = GSM_CALL_IncomingCall;
1373 tmp = 6; 1373 tmp = 6;
1374 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,call.PhoneNumber,false); 1374 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,call.PhoneNumber,false);
1375 break; 1375 break;
1376 case 0x07: 1376 case 0x07:
1377 smprintf(s, "Call answer initiated\n"); 1377 smprintf(s, "Call answer initiated\n");
1378 break; 1378 break;
1379 case 0x09: 1379 case 0x09:
1380 smprintf(s, "Call released\n"); 1380 smprintf(s, "Call released\n");
1381 call.Status = GSM_CALL_CallLocalEnd; 1381 call.Status = GSM_CALL_CallLocalEnd;
1382 break; 1382 break;
1383 case 0x0a: 1383 case 0x0a:
1384 smprintf(s, "Call is being released\n"); 1384 smprintf(s, "Call is being released\n");
1385 break; 1385 break;
1386 case 0x0b: 1386 case 0x0b:
1387 smprintf(s, "Meaning not known\n"); 1387 smprintf(s, "Meaning not known\n");
1388 call.CallIDAvailable = false; 1388 call.CallIDAvailable = false;
1389 break; 1389 break;
1390 case 0x0c: 1390 case 0x0c:
1391 smprintf(s, "Audio status\n"); 1391 smprintf(s, "Audio status\n");
1392 if (msg.Buffer[4] == 0x01) smprintf(s, "Audio enabled\n"); 1392 if (msg.Buffer[4] == 0x01) smprintf(s, "Audio enabled\n");
1393 else smprintf(s, "Audio disabled\n"); 1393 else smprintf(s, "Audio disabled\n");
1394 call.CallIDAvailable = false; 1394 call.CallIDAvailable = false;
1395 break; 1395 break;
1396 case 0x0f:
1397 case 0x10:
1398 smprintf(s, "Meaning not known\n");
1399 call.CallIDAvailable = false;
1400 break;
1396 case 0x23: 1401 case 0x23:
1397 smprintf(s, "Call held\n"); 1402 smprintf(s, "Call held\n");
1398 call.Status = GSM_CALL_CallHeld; 1403 call.Status = GSM_CALL_CallHeld;
1399 break; 1404 break;
1400 case 0x25: 1405 case 0x25:
1401 smprintf(s, "Call resumed\n"); 1406 smprintf(s, "Call resumed\n");
1402 call.Status = GSM_CALL_CallResumed; 1407 call.Status = GSM_CALL_CallResumed;
1403 break; 1408 break;
1404 case 0x27: 1409 case 0x27:
1405 smprintf(s, "Call switched\n"); 1410 smprintf(s, "Call switched\n");
1406 call.Status = GSM_CALL_CallSwitched; 1411 call.Status = GSM_CALL_CallSwitched;
1407 break; 1412 break;
1408 case 0x53: 1413 case 0x53:
1409 smprintf(s, "Outgoing call\n"); 1414 smprintf(s, "Outgoing call\n");
1410 smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii 1415 smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii
1411 tmp = 6; 1416 tmp = 6;
1412 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false); 1417 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false);
1413 smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer)); 1418 smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer));
1414 /* FIXME: read name from frame */ 1419 /* FIXME: read name from frame */
1415 call.Status = GSM_CALL_OutgoingCall; 1420 call.Status = GSM_CALL_OutgoingCall;
1416 tmp = 6; 1421 tmp = 6;
1417 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,call.PhoneNumber,false); 1422 NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,call.PhoneNumber,false);
1418 break; 1423 break;
1424 case 0xA6:
1425 case 0xD2:
1426 case 0xD3:
1427 smprintf(s, "Meaning not known\n");
1428 call.CallIDAvailable = false;
1429 break;
1419 } 1430 }
1420 if (call.CallIDAvailable) smprintf(s, "Call ID : %d\n",msg.Buffer[4]); 1431 if (call.CallIDAvailable) smprintf(s, "Call ID : %d\n",msg.Buffer[4]);
1421 if (s->Phone.Data.EnableIncomingCall && s->User.IncomingCall!=NULL && call.Status != 0) { 1432 if (s->Phone.Data.EnableIncomingCall && s->User.IncomingCall!=NULL && call.Status != 0) {
1422 if (call.CallIDAvailable) call.CallID = msg.Buffer[4]; 1433 if (call.CallIDAvailable) call.CallID = msg.Buffer[4];
1423 s->User.IncomingCall(s->CurrentConfig->Device, call); 1434 s->User.IncomingCall(s->CurrentConfig->Device, call);
1424 } 1435 }
1436 if (s->Phone.Data.RequestID == ID_DialVoice) {
1437 if (msg.Buffer[3] == 0x10) return ERR_NOTSUPPORTED;
1438 }
1425 if (s->Phone.Data.RequestID == ID_CancelCall) { 1439 if (s->Phone.Data.RequestID == ID_CancelCall) {
1426 if (msg.Buffer[3] == 0x09) { 1440 if (msg.Buffer[3] == 0x09) {
1427 if (s->Phone.Data.CallID == msg.Buffer[4]) return ERR_NONE; 1441 if (s->Phone.Data.CallID == msg.Buffer[4]) return ERR_NONE;
1428 /* when we canceled call and see frame about other 1442 /* when we canceled call and see frame about other
1429 * call releasing, we don't give ERR_NONE for "our" 1443 * call releasing, we don't give ERR_NONE for "our"
1430 * call release command 1444 * call release command
1431 */ 1445 */
1432 return ERR_NEEDANOTHERANSWER; 1446 return ERR_NEEDANOTHERANSWER;
1433 } 1447 }
1434 } 1448 }
1435 if (s->Phone.Data.RequestID == ID_AnswerCall) { 1449 if (s->Phone.Data.RequestID == ID_AnswerCall) {
1436 if (msg.Buffer[3] == 0x07) { 1450 if (msg.Buffer[3] == 0x07) {
1437 if (s->Phone.Data.CallID == msg.Buffer[4]) return ERR_NONE; 1451 if (s->Phone.Data.CallID == msg.Buffer[4]) return ERR_NONE;
1438 return ERR_NEEDANOTHERANSWER; 1452 return ERR_NEEDANOTHERANSWER;
1439 } 1453 }
1440 } 1454 }
1441 return ERR_NONE; 1455 return ERR_NONE;
1442} 1456}
1443 1457
1444void N71_65_GetCalendarRecurrance(GSM_StateMachine *s, unsigned char *buffer, GSM_CalendarEntry *entry) 1458void N71_65_GetCalendarRecurrance(GSM_StateMachine *s, unsigned char *buffer, GSM_CalendarEntry *entry)
1445{ 1459{
1446 int Recurrance; 1460 int Recurrance;
1447 1461
1448 Recurrance = buffer[0]*256 + buffer[1]; 1462 Recurrance = buffer[0]*256 + buffer[1];
1449 /* 8760 hours = 1 year */ 1463 /* 8760 hours = 1 year */
1450 if (Recurrance == 0xffff) Recurrance=8760; 1464 if (Recurrance == 0xffff) Recurrance=8760;
1451 if (Recurrance != 0) { 1465 if (Recurrance != 0) {
1452 smprintf(s, "Recurrance : %i hours\n",Recurrance); 1466 smprintf(s, "Recurrance : %i hours\n",Recurrance);
1453 entry->Entries[entry->EntriesNum].EntryType= CAL_RECURRANCE; 1467 entry->Entries[entry->EntriesNum].EntryType= CAL_RECURRANCE;
1454 entry->Entries[entry->EntriesNum].Number= Recurrance; 1468 entry->Entries[entry->EntriesNum].Number= Recurrance;
1455 entry->EntriesNum++; 1469 entry->EntriesNum++;
1456 } 1470 }
1457} 1471}
1458 1472
1459/* method 2 */ 1473/* method 2 */
1460GSM_Error N71_65_ReplyAddCalendar2(GSM_Protocol_Message msg, GSM_StateMachine *s) 1474GSM_Error N71_65_ReplyAddCalendar2(GSM_Protocol_Message msg, GSM_StateMachine *s)
1461{ 1475{
1462 smprintf(s, "Calendar note added\n"); 1476 smprintf(s, "Calendar note added\n");
1463 return ERR_NONE; 1477 return ERR_NONE;
1464} 1478}
1465 1479
1466/* method 2 */ 1480/* method 2 */
1467GSM_Error N71_65_AddCalendar2(GSM_StateMachine *s, GSM_CalendarEntry *Note) 1481GSM_Error N71_65_AddCalendar2(GSM_StateMachine *s, GSM_CalendarEntry *Note)
1468{ 1482{
1469 GSM_CalendarNoteTypeNoteType; 1483 GSM_CalendarNoteTypeNoteType;
1470 time_t t_time1,t_time2; 1484 time_t t_time1,t_time2;
1471 GSM_DateTime Date,date_time; 1485 GSM_DateTime Date,date_time;
1472 GSM_Error error; 1486 GSM_Error error;