voicecall.c: use swap_without_accept method, if present
PATCH 1/1 voicecall.c: use swap_without_accept method, if present
From: Pekka Pessi <[email protected]>
--- src/voicecall.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-)
src/voicecall.c +20 -0
@@ -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);
Signature · 1 line
1.6.0.4
PATCH 1/1 voicecall: allow sending DTMF tones while call is in alerting state
From: Pekka Pessi <[email protected]>
2nd stage dialing may be done before call gets connected.
--- src/voicecall.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
src/voicecall.c +5 -1
@@ -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;
Signature · 1 line
1.6.0.4
PATCH 1/1 voicecall: allow P or , within the dial string
From: Pekka Pessi <[email protected]>
"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(-)
src/voicecall.c +6 -0
@@ -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); }
Signature · 1 line
1.6.0.4
Re: [PATCH] voicecall: allow P or , within the dial string
Hi Pekka,
Quoted 3 lines
"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?
src/voicecall.c static DBusMessage *manager_tone(DBusConnection *conn, · line 1126
Quoted 3 lines
src/voicecall.c +3
-0+/* 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
Re: [PATCH] voicecall: allow P or , within the dial string
2009/10/8 Denis Kenzior <[email protected]>:
Quoted 6 lines
Quoted 3 lines
"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).
Quoted 8 lines
Quoted 3 lines
+ /* 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.
Signature · 1 line
Pekka.Pessi mail at nokia.com
Re: [PATCH] voicecall: allow P or , within the dial string
Hi Pekka,
Quoted 11 lines
2009/10/8 Denis Kenzior <[email protected]>:
Quoted 8 lines
Quoted 4 lines
"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...
Quoted 3 lines
RFC 4967 uses 'X' to wait for call completion, and 'P' for pause.
oFono does not (yet) care about SIP.
Quoted 5 lines
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.
Quoted 6 lines
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.
Quoted 4 lines
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.
Quoted 5 lines
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
Re: [PATCH] voicecall: allow P or , within the dial string
Hi Denis,
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
"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?
Quoted 7 lines
Quoted 1 line
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().
Quoted 3 lines
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.
Quoted 2 lines
It sounds like 'p' is entirely an MMI convention, not anything defined by a standard...
Exactly.
Quoted 3 lines
Quoted 1 line
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?
Quoted 7 lines
Quoted 3 lines
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.
Quoted 2 lines
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.
Quoted 9 lines
Quoted 5 lines
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.
...
Quoted 2 lines
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.
Signature · 1 line
Pekka.Pessi mail at nokia.com
Re: [PATCH] voicecall: allow P or , within the dial string
Hi Pekka,
Quoted 11 lines
Quoted 5 lines
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.cto_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.
Quoted 10 lines
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.
Quoted 4 lines
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?
Quoted 7 lines
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.
Quoted 5 lines
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
Re: [PATCH] voicecall: allow sending DTMF tones while call is in alerting state
In reply to Pekka PessiHi Pekka,
Patch has been applied. Thanks.
Regards,
-Denis
Hi Pekka,
I modified the commit message slightly and applied the patch. Thanks!
Regards,
-Denis