* [PATCH] voicecall.c: use swap_without_accept method, if present @ 2009-10-08 16:59 Pekka Pessi 2009-10-08 16:59 ` [PATCH] voicecall: allow sending DTMF tones while call is in alerting state Pekka Pessi 2009-10-08 18:01 ` [PATCH] voicecall.c: use swap_without_accept method, if present Denis Kenzior 0 siblings, 2 replies; 10+ messages in thread From: Pekka Pessi @ 2009-10-08 16:59 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1137 bytes --] From: Pekka Pessi <Pekka.Pessi@nokia.com> --- src/voicecall.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index eff6321..1be907a 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -835,11 +835,31 @@ static DBusMessage *manager_transfer(DBusConnection *conn, return NULL; } +static DBusMessage *manager_swap_without_accept(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct ofono_voicecall *vc = data; + + if (vc->flags & VOICECALLS_FLAG_PENDING) + return __ofono_error_busy(msg); + + vc->flags |= VOICECALLS_FLAG_PENDING; + vc->pending = dbus_message_ref(msg); + + vc->driver->swap_without_accept(vc, generic_callback, vc); + + return NULL; +} + + static DBusMessage *manager_swap_calls(DBusConnection *conn, DBusMessage *msg, void *data) { struct ofono_voicecall *vc = data; + if (vc->driver->swap_without_accept) + return manager_swap_without_accept(conn, msg, data); + if (vc->flags & VOICECALLS_FLAG_PENDING) return __ofono_error_busy(msg); -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] voicecall: allow sending DTMF tones while call is in alerting state 2009-10-08 16:59 [PATCH] voicecall.c: use swap_without_accept method, if present Pekka Pessi @ 2009-10-08 16:59 ` Pekka Pessi 2009-10-08 16:59 ` [PATCH] voicecall: allow P or , within the dial string Pekka Pessi 2009-10-08 18:02 ` [PATCH] voicecall: allow sending DTMF tones while call is in alerting state Denis Kenzior 2009-10-08 18:01 ` [PATCH] voicecall.c: use swap_without_accept method, if present Denis Kenzior 1 sibling, 2 replies; 10+ messages in thread From: Pekka Pessi @ 2009-10-08 16:59 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 914 bytes --] From: Pekka Pessi <Pekka.Pessi@nokia.com> 2nd stage dialing may be done before call gets connected. --- src/voicecall.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index 1be907a..bd5358c 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -138,7 +138,7 @@ static const char *call_status_to_string(int status) case CALL_STATUS_DIALING: return "dialing"; case CALL_STATUS_ALERTING: - return "alerting"; + return "alerting"; case CALL_STATUS_INCOMING: return "incoming"; case CALL_STATUS_WAITING: @@ -561,6 +561,10 @@ static gboolean voicecalls_have_connected(struct ofono_voicecall *vc) if (v->call->status == CALL_STATUS_ACTIVE) return TRUE; + + /* Connected for 2nd stage dialing */ + if (v->call->status == CALL_STATUS_ALERTING) + return TRUE; } return FALSE; -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] voicecall: allow P or , within the dial string 2009-10-08 16:59 ` [PATCH] voicecall: allow sending DTMF tones while call is in alerting state Pekka Pessi @ 2009-10-08 16:59 ` Pekka Pessi 2009-10-08 17:29 ` Denis Kenzior 2009-10-08 18:02 ` [PATCH] voicecall: allow sending DTMF tones while call is in alerting state Denis Kenzior 1 sibling, 1 reply; 10+ messages in thread From: Pekka Pessi @ 2009-10-08 16:59 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1185 bytes --] From: Pekka Pessi <Pekka.Pessi@nokia.com> "DTMF control digit separator" is used as pause according to GSM 02.07. According to GSM 11.11 it is stored as BCD code 1100 in the SIM card. Nokia modems use 'p' to represent pause. AT commands use ',' to represent pause. Note that the interpretation of 'p' and ',' differs when used as a part of a dial strings. When a dial string is separated from the phone number by ',', sending the dial string starts after call is alerting. When a dial string is separated by 'p' (DTMF control digit separator), dial string is sent only after call is connected. --- src/voicecall.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index bd5358c..c69c822 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -1121,6 +1121,12 @@ static DBusMessage *manager_tone(DBusConnection *conn, (tones[i] >= 'A' && tones[i] <= 'D')) continue; + /* Pause can be described with P or , */ + if (tones[i] == 'P' || tones[i] == ',') { + tones[i] = 'p'; + continue; + } + g_free(tones); return __ofono_error_invalid_format(msg); } -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] voicecall: allow P or , within the dial string 2009-10-08 16:59 ` [PATCH] voicecall: allow P or , within the dial string Pekka Pessi @ 2009-10-08 17:29 ` Denis Kenzior 2009-10-08 19:30 ` Pekka Pessi 0 siblings, 1 reply; 10+ messages in thread From: Denis Kenzior @ 2009-10-08 17:29 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 687 bytes --] Hi Pekka, > "DTMF control digit separator" is used as pause according to GSM 02.07. > According to GSM 11.11 it is stored as BCD code 1100 in the SIM card. Nokia > modems use 'p' to represent pause. AT commands use ',' to represent pause. Strictly speaking AT modems use 'C' to represent the pause. Can you point me to any spec that actually says ',' and 'p' are used the way you describe? > + /* Pause can be described with P or , */ > + if (tones[i] == 'P' || tones[i] == ',') { > + tones[i] = 'p'; This should really be 'C'. We also need to modify the code above not to accept 'D' as a valid character since that is a wild card value. Regards, -Denis ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] voicecall: allow P or , within the dial string 2009-10-08 17:29 ` Denis Kenzior @ 2009-10-08 19:30 ` Pekka Pessi 2009-10-08 20:37 ` Denis Kenzior 0 siblings, 1 reply; 10+ messages in thread From: Pekka Pessi @ 2009-10-08 19:30 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 2143 bytes --] 2009/10/8 Denis Kenzior <denkenz@gmail.com>: >> "DTMF control digit separator" is used as pause according to GSM 02.07. >> According to GSM 11.11 it is stored as BCD code 1100 in the SIM card. Nokia >> modems use 'p' to represent pause. AT commands use ',' to represent pause. > > Strictly speaking AT modems use 'C' to represent the pause. Can you point me > to any spec that actually says ',' and 'p' are used the way you describe? C? RFC 4967 uses 'X' to wait for call completion, and 'P' for pause. Nokia modems use 'p' to represent DMTF control digit separator. GSM 02.07 specifies how the DTMF control digit separator is used when making calls. The dtmf digits in the dial string are sent after the call gets connected. The extra separator characters represent extra delays. V.250 uses '@' to wait for call completion, and ',' for pause (controlled by S8). >> + /* Pause can be described with P or , */ >> + if (tones[i] == 'P' || tones[i] == ',') { >> + tones[i] = 'p'; > > This should really be 'C'. > > We also need to modify the code above not to accept 'D' as a valid character > since that is a wild card value. The dial string stored in the SIM card along with a phone number cannot contain DTMF digits A-D. However, the other dialstrings do not share the same limitation and they can can contain full set of DTMF digits, 0-9, *, #, A, B, C, and D. The special bcd coded digits (dtmf control digit separator and wildcard) from the SIM card must be mapped outside this set. Nokia modems use 'p' and '?' for that purpose (extended bcd code 0b1100 => 'p', extended bcd code 0b1101 => '?'). I think G1 uses ',' instead of 'p'. Either one is fine. An why to include pause in the tones string in the first place? The current API does not provide any feedback of the sent dtmf digits to the application or between ofono driver and core, so the only way to implement pauses between digits is to include them in the dial string and hope the driver can do something about them. -- Pekka.Pessi mail at nokia.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] voicecall: allow P or , within the dial string 2009-10-08 19:30 ` Pekka Pessi @ 2009-10-08 20:37 ` Denis Kenzior 2009-10-09 2:30 ` Pekka Pessi 0 siblings, 1 reply; 10+ messages in thread From: Denis Kenzior @ 2009-10-08 20:37 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 4322 bytes --] Hi Pekka, > 2009/10/8 Denis Kenzior <denkenz@gmail.com>: > >> "DTMF control digit separator" is used as pause according to GSM 02.07. > >> According to GSM 11.11 it is stored as BCD code 1100 in the SIM card. > >> Nokia modems use 'p' to represent pause. AT commands use ',' to > >> represent pause. > > > > Strictly speaking AT modems use 'C' to represent the pause. Can you > > point me to any spec that actually says ',' and 'p' are used the way you > > describe? > > C? Unless I'm missing something, the DTMF 'C' digit refers exactly to what you're trying to achieve with 'p' and ',' Check TS 11.11 Table 12. 'C' is mentioned as the DTMF Control digit separator from TS 02.07. Also, quoting 27.007 for valid input to VTS: "A single ASCII character in the set 0 9, #,*,A D. This is interpreted as a single ACSII character whose duration is set by the +VTD command." It sounds like 'p' is entirely an MMI convention, not anything defined by a standard... > > RFC 4967 uses 'X' to wait for call completion, and 'P' for pause. > oFono does not (yet) care about SIP. > Nokia modems use 'p' to represent DMTF control digit separator. GSM > 02.07 specifies how the DTMF control digit separator is used when > making calls. The dtmf digits in the dial string are sent after the > call gets connected. The extra separator characters represent extra > delays. Yes, however 02.07 never mentions 'p' or ','. Quoting: "The way in which the separator is entered and display in the ME, is left to the individual manufacturer's MMI." Since 'C' is defined by the standard, that is what oFono core should use. If Nokia modems prefer 'p' over C, simply convert these in the specific driver. > The dial string stored in the SIM card along with a phone number > cannot contain DTMF digits A-D. However, the other dialstrings do not > share the same limitation and they can can contain full set of DTMF > digits, 0-9, *, #, A, B, C, and D. The special bcd coded digits (dtmf > control digit separator and wildcard) from the SIM card must be mapped > outside this set. SIM storage is a nightmare. The problem is that on the SIM the following characters are valid: 0-9, 'A', 'B', 'C', 'D'. 'F' is used as an endmark (e.g. empty) character. 'E' has been deprecated and not used for anything. Much of the confusion stems from the fact that 'A' maps to '*' and 'B' maps to '#'. Whenever you store anything on the SIM, you have to convert '*' and '#' back to 'A' and 'B'. oFono does this for you when writing to / from the SIM. The EFadn, EFsdn, etc can definitely contain the full set above for the SSC / Dialing Number fields. However, the 'C' and 'D' characters cannot actually be sent to the network. In fact 'D' is particularly evil since it requires special handling in the UI. Hence 'D' should be stripped from the valid DTMF set that oFono supports. 'C' is used as a separator in its first occurrence, but also as a pause character for all subsequent occurrences. > > Nokia modems use 'p' and '?' for that purpose (extended bcd code > 0b1100 => 'p', extended bcd code 0b1101 => '?'). I think G1 uses ',' > instead of 'p'. Either one is fine. Yes, you're talking about the 'C' (1100) and 'D' (1101') DTMF characters, as above. I have no problem handling 'P', 'p', ',' and 'X' or whatever at the D- Bus API level. However, what gets sent down to the modem must be according to some standard. Doing otherwise leads to chaos. > An why to include pause in the tones string in the first place? The > current API does not provide any feedback of the sent dtmf digits to > the application or between ofono driver and core, so the only way to > implement pauses between digits is to include them in the dial string > and hope the driver can do something about them. I still wonder about this myself. Strictly speaking all modems should support the 'C' digit. In the worst case the modem driver can simulate a 3 second delay itself. Whether this should be encouraged or not is questionable. 'D' should be never sent to oFono in the first place, it is entirely an MMI issue. However, I agree that the current situation is less than ideal. Ideas / suggestions welcome. Regards, -Denis ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] voicecall: allow P or , within the dial string 2009-10-08 20:37 ` Denis Kenzior @ 2009-10-09 2:30 ` Pekka Pessi 2009-10-09 6:22 ` Denis Kenzior 0 siblings, 1 reply; 10+ messages in thread From: Pekka Pessi @ 2009-10-09 2:30 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 4584 bytes --] Hi Denis, >> >> "DTMF control digit separator" is used as pause according to GSM 02.07. >> >> According to GSM 11.11 it is stored as BCD code 1100 in the SIM card. >> >> Nokia modems use 'p' to represent pause. AT commands use ',' to >> >> represent pause. >> > >> > Strictly speaking AT modems use 'C' to represent the pause. Can you >> > point me to any spec that actually says ',' and 'p' are used the way you >> > describe? >> >> C? > > Unless I'm missing something, the DTMF 'C' digit refers exactly to what you're > trying to achieve with 'p' and ',' > > Check TS 11.11 Table 12. 'C' is mentioned as the DTMF Control digit separator > from TS 02.07. You mean binary code 0b1100 aka hex code 0xC? It would be otherwise known as DTMF digit 'A'. Welcome to wonderful world of phones. Have a peek in src/smsutil.c to_semi_octet(). > Also, quoting 27.007 for valid input to VTS: "A single ASCII character in the > set 0 9, #,*,A D. This is interpreted as a single ACSII character whose > duration is set by the +VTD command." Yep. Those are actual tones sent within media, however. There are 16 different DTMF tones, 0-9, *, # A, B, C and D have each different tone. If you say at+vts="A" while call is going on, other end hears a tone. If you say at+vts="C", different tone is heard. GSM 11.11 cheated and used the DTMF digits from A to D for other purpose: 'A' (0b1100, 0xC) for the separating dial string from the phone number, 'B' for FDN wildcard, 'C' for quoting, and 'D' for padding. > It sounds like 'p' is entirely an MMI convention, not anything defined by a > standard... Exactly. >> RFC 4967 uses 'X' to wait for call completion, and 'P' for pause. > > oFono does not (yet) care about SIP. But we care about dial strings, right? >> Nokia modems use 'p' and '?' for that purpose (extended bcd code >> 0b1100 => 'p', extended bcd code 0b1101 => '?'). I think G1 uses ',' >> instead of 'p'. Either one is fine. > Yes, you're talking about the 'C' (1100) and 'D' (1101') DTMF characters, as > above. I have no problem handling 'P', 'p', ',' and 'X' or whatever at the D- > Bus API level. Cool. >However, what gets sent down to the modem must be according to > some standard. Doing otherwise leads to chaos. There is no standard. We should specify one. >> An why to include pause in the tones string in the first place? The >> current API does not provide any feedback of the sent dtmf digits to >> the application or between ofono driver and core, so the only way to >> implement pauses between digits is to include them in the dial string >> and hope the driver can do something about them. > > I still wonder about this myself. Strictly speaking all modems should support > the 'C' digit. In the worst case the modem driver can simulate a 3 second > delay itself. Whether this should be encouraged or not is questionable. I'm afraid the modem driver has to implement pause either by itself or with some modem-specific command. Each DTMF digit is sent using 24.008/Q.931 "Start DTMF" message, followed by "Stop DTMF". Start DTMF contains DTMF digit encoded as a single IRA character (from the set of 0-9, *, # and A-D). If there is pause (like one defined in 02.07), modem just don't send next "Start DTMF" for 3 seconds. AT+VTS tries to hide that, you just give digit and its duration. Any layer above modem driver has no control on duration of dtmf digits, nor any idea when the pause gets started and when next digit should be sent. ... > However, I agree that the current situation is less than ideal. Ideas / > suggestions welcome. I'd propose that we allow dial strings in phone numbers, like, "8188080p1234#pp6789#" (Nokia) "8188080(a)1234#,,6789#" (V.250) Both strings mean same, after call gets connected, there is 3 second pause, then digits 1234# are sent, again 6 second pause, and digits 6789# are sent. Both will be stored on SIM phonebook in same format. When phone number is read from SIM card, Ofono modem driver should return it in V.250 format. Ofono should also accept dial strings like "8188080,1234#,6789#ABCD#" where the , means that voicecall should start sending DTMF digits 3 seconds after first RINGING. If a string starting with 'p' or '@' is given to SendTones() before call is connected, driver waits until call is connected before sending it to network. If call is already connected, ',', 'p' or '@' are interpreted as pause of 3 seconds. -- Pekka.Pessi mail at nokia.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] voicecall: allow P or , within the dial string 2009-10-09 2:30 ` Pekka Pessi @ 2009-10-09 6:22 ` Denis Kenzior 0 siblings, 0 replies; 10+ messages in thread From: Denis Kenzior @ 2009-10-09 6:22 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 3665 bytes --] Hi Pekka, > > Unless I'm missing something, the DTMF 'C' digit refers exactly to what > > you're trying to achieve with 'p' and ',' > > > > Check TS 11.11 Table 12. 'C' is mentioned as the DTMF Control digit > > separator from TS 02.07. > > You mean binary code 0b1100 aka hex code 0xC? It would be otherwise > known as DTMF digit 'A'. Welcome to wonderful world of phones. > > Have a peek in src/smsutil.c to_semi_octet(). > Funny part is that I wrote that function :) But actually you're absolutely correct. I forgot how context sensitive this specification is. Just so we're on the same page: 24.008 Table 10.5.118 maps BCD thus: 0-9, 10 -> '*', 11 -> '#', 12-> 'a', 13-> 'b', 14->'c', 15 -> endmark TS 11.11, 51.011 and 31.102 define the BCD SIM storage thus: 0-9, 10-> '*', 11->'#', 12->'C' DTMF Control Digit separator, 13 -> 'D' Wild value. 14 -> RFU, 15->Endmark. DTMF digits have yet another coding. The current implementation is actually correct, so you can safely ignore most of what I said in the last message. > I'm afraid the modem driver has to implement pause either by itself or > with some modem-specific command. > > Each DTMF digit is sent using 24.008/Q.931 "Start DTMF" message, > followed by "Stop DTMF". Start DTMF contains DTMF digit encoded as a > single IRA character (from the set of 0-9, *, # and A-D). If there is > pause (like one defined in 02.07), modem just don't send next "Start > DTMF" for 3 seconds. > > AT+VTS tries to hide that, you just give digit and its duration. Problem is, AT+VTS only handles true DTMF characters according to 27.007. Any pauses have to be simulated or sent directly using ATD. If we are going to support such dialstrings, we have to do this in the core daemon, not the driver. > I'd propose that we allow dial strings in phone numbers, like, > > "8188080p1234#pp6789#" (Nokia) > "8188080(a)1234#,,6789#" (V.250) Yuck. Lets come up with one format to support, if possible. How does CDMA handle this nonsense? > > Ofono should also accept dial strings like > > "8188080,1234#,6789#ABCD#" > > where the , means that voicecall should start sending DTMF digits 3 > seconds after first RINGING. A significant number of modems do not return from ATD until the call is connected, not just ringing. So unless we use a different multiplexer channel for DTMF such behavior cannot be guaranteed. Even with a multiplexer this probably won't work with a significant number of modems. > > If a string starting with 'p' or '@' is given to SendTones() before > call is connected, driver waits until call is connected before sending > it to network. If call is already connected, ',', 'p' or '@' are > interpreted as pause of 3 seconds. Yuck. I suggest we leave SendTones as is. If we support this behavior it should be specified by the dialing number. The biggest issue is that there is no progress synchronization as you've already mentioned. Most of the modern platforms need to generate audible events whenever a DTMF is signaled since this is (potentially) no longer handled by the modem. The current API was actually intended to be used only as a 'slave' by a controlling entity that interacts with UI, audio framework and oFono. While I'm sure we can accommodate a state machine to handle all of this nonsense inside oFono, I'm no longer convinced we should. First step should be to come up with a nice, clean API for all of this that will report DTMF progress, and has a realistic chance of actually being implemented across modems and technologies. Regards, -Denis ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] voicecall: allow sending DTMF tones while call is in alerting state 2009-10-08 16:59 ` [PATCH] voicecall: allow sending DTMF tones while call is in alerting state Pekka Pessi 2009-10-08 16:59 ` [PATCH] voicecall: allow P or , within the dial string Pekka Pessi @ 2009-10-08 18:02 ` Denis Kenzior 1 sibling, 0 replies; 10+ messages in thread From: Denis Kenzior @ 2009-10-08 18:02 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 67 bytes --] Hi Pekka, Patch has been applied. Thanks. Regards, -Denis ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] voicecall.c: use swap_without_accept method, if present 2009-10-08 16:59 [PATCH] voicecall.c: use swap_without_accept method, if present Pekka Pessi 2009-10-08 16:59 ` [PATCH] voicecall: allow sending DTMF tones while call is in alerting state Pekka Pessi @ 2009-10-08 18:01 ` Denis Kenzior 1 sibling, 0 replies; 10+ messages in thread From: Denis Kenzior @ 2009-10-08 18:01 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 105 bytes --] Hi Pekka, I modified the commit message slightly and applied the patch. Thanks! Regards, -Denis ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-10-09 6:22 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-10-08 16:59 [PATCH] voicecall.c: use swap_without_accept method, if present Pekka Pessi 2009-10-08 16:59 ` [PATCH] voicecall: allow sending DTMF tones while call is in alerting state Pekka Pessi 2009-10-08 16:59 ` [PATCH] voicecall: allow P or , within the dial string Pekka Pessi 2009-10-08 17:29 ` Denis Kenzior 2009-10-08 19:30 ` Pekka Pessi 2009-10-08 20:37 ` Denis Kenzior 2009-10-09 2:30 ` Pekka Pessi 2009-10-09 6:22 ` Denis Kenzior 2009-10-08 18:02 ` [PATCH] voicecall: allow sending DTMF tones while call is in alerting state Denis Kenzior 2009-10-08 18:01 ` [PATCH] voicecall.c: use swap_without_accept method, if present Denis Kenzior
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.