diff options
author | Michal Čihař <nijel@debian.org> | 2016-10-23 14:49:40 +0200 |
---|---|---|
committer | Michal Čihař <nijel@debian.org> | 2016-10-23 14:49:40 +0200 |
commit | 34ae14a6a6c175b7e5dbcab86dbbde10c45f0122 (patch) | |
tree | 20988a61554879faae62ede58678232dcaaa3a69 /libgammu/phone/dummy/dummy.c | |
parent | d5dd432cc277a2fc89e59ef2d405307af81350c1 (diff) | |
parent | 4293c6165a17103edbdacb9971a8724bba275d32 (diff) |
Merge tag 'upstream/1.37.91'
Upstream version 1.37.91
# gpg: Podpis vytvořen Ne 23. říjen 2016, 14:49:40 CEST
# gpg: použití RSA klíče F4AA229D4D58C245
# gpg: Dobrý podpis od „Michal Čihař <michal@cihar.com>“ [absolutní]
# gpg: alias „Michal Čihař <nijel@debian.org>“ [absolutní]
# gpg: alias „[jpeg image of size 8848]“ [absolutní]
Diffstat (limited to 'libgammu/phone/dummy/dummy.c')
-rw-r--r-- | libgammu/phone/dummy/dummy.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/libgammu/phone/dummy/dummy.c b/libgammu/phone/dummy/dummy.c index 778e682..e34998e 100644 --- a/libgammu/phone/dummy/dummy.c +++ b/libgammu/phone/dummy/dummy.c @@ -1921,6 +1921,40 @@ GSM_Error DUMMY_GetBatteryCharge(GSM_StateMachine *s, GSM_BatteryCharge *bat) return ERR_NONE; } +GSM_Error DUMMY_PreAPICall(GSM_StateMachine *s) +{ + char *path; + struct stat sb; + GSM_Error error = ERR_NONE; + GSM_Call call; + + /* Check for incoming call trigger */ + if (s->Phone.Data.EnableIncomingCall && s->User.IncomingCall != NULL) { + path = DUMMY_GetFilePath(s, "incoming-call"); + if (path == NULL) { + return ERR_MOREMEMORY; + } + if (stat(path, &sb) == 0) { + smprintf(s, "Incoming call!\n"); + + memset(&call, 0, sizeof(call)); + + call.Status = 0; + call.StatusCode = 0; + call.CallIDAvailable = FALSE; + call.Status = GSM_CALL_IncomingCall; + call.CallIDAvailable = TRUE; + EncodeUnicode(call.PhoneNumber, "+800123456", 11); + + s->User.IncomingCall(s, &call, s->User.IncomingCallUserData); + + unlink(path); + } + free(path); + } + return error; +} + /*@}*/ GSM_Reply_Function DUMMYReplyFunctions[] = { @@ -2068,7 +2102,8 @@ GSM_Phone_Functions DUMMYPhone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + DUMMY_PreAPICall }; /*@}*/ |