| 1 |
Hook all transactions? |
| 2 |
register callbacks for TMCB_REQUEST_IN_N & TMCB_RESPONSE_IN_N |
| 3 |
if Call-Info header not found, pass |
| 4 |
might be able to dispense with sca_handle_subscribe(). |
| 5 |
performance penalty: cost of check for Call-Info on each transaction. |
| 6 |
|
| 7 |
OR |
| 8 |
|
| 9 |
check for Call-Info header in script, call "sca_call_info_update" |
| 10 |
must be done in onreply route, too |
| 11 |
more prone to bugs because of missed cases |
| 12 |
easy to misconfigure, potentially leading to low adoption |
| 13 |
|
| 14 |
|
| 15 |
To consider: |
| 16 |
* What to do when a subscriber reSUBSCRIBES and the dialog is different |
| 17 |
from the current saved subscription? Avoiding shm_realloc seems like a |
| 18 |
good idea, so perhaps just delete the current one and save the new. |
| 19 |
|
| 20 |
Update: separate shm_alloc for dialog.id in sca_subscription_create, |
| 21 |
then shm_free & shm_alloc if differing dialog found. |
| 22 |
|
| 23 |
|
| 24 |
How to remove Call-Info header before relaying? |
| 25 |
Use del_lump from ../../data_lump.h |
| 26 |
Cf. textops module's remove_hf_f() |
| 27 |
|
| 28 |
How to detect hold/pickup in SDP? |
| 29 |
Use parse_sdp/free_sdp from ../../parser/sdp/sdp.h. |
| 30 |
|
| 31 |
sdp_stream_cell_t *sdp_stream; |
| 32 |
|
| 33 |
/* puts sdp_info_t pointer in msg->body */ |
| 34 |
rc = parse_sdp( msg ); |
| 35 |
if ( rc < 0 ) { |
| 36 |
error; |
| 37 |
} |
| 38 |
/* msg->body must now be free_sdp'd */ |
| 39 |
|
| 40 |
/* for now we'll just assume a single stream per call */ |
| 41 |
sdp_stream = get_sdp_stream( msg, 0, 0 ); |
| 42 |
|
| 43 |
if ( sdp->is_on_hold ) { |
| 44 |
.... |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
Call-Info meaning in context |
| 50 |
If present, refers to appearance associated with the Contact URI. |
| 51 |
|
| 52 |
e.g., a Call-Info header present in an INVITE indicates the caller |
| 53 |
has appearance-index N and is using the line to place a call. |
| 54 |
|
| 55 |
e.g., a Call-Info header present in a response indicates the callee |
| 56 |
has appearance-index N |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
A reINVITE from another line in the SCA group has the following characteristics: |
| 61 |
* RURI is the SCA line's AoR, not the callee. |
| 62 |
* From and To URIs are also SCA line's AoR. |
| 63 |
* SCA provides very limited way to pass callee info: only |
| 64 |
in NOTIFY's appearance-uri, which is for display purposes. |
| 65 |
* From-tag and Call-ID are new. There is no to-tag. |
| 66 |
* A Call-Info header is present with the appearance-index the line is |
| 67 |
attempting to retrieve from hold. |
| 68 |
|
| 69 |
|
| 70 |
Revisiting possibility of using TMCB_ tm module hooks. |
| 71 |
TMCB_E2EACK_IN is called when an ACK matching a 200OK-answered INVITE |
| 72 |
is received. Could use this to send out call-info NOTIFYs when an SCA |
| 73 |
line answers a call. Bug right now is that the NOTIFYs are sent out |
| 74 |
before the proxy has CANCELed the INVITEs to the other members of the |
| 75 |
group. Seems the handsets are dumping the line state when they get the |
| 76 |
CANCELs, so the appearance goes away. On next reSUBSCRIBE/NOTIFY, the |
| 77 |
handsets get the correct state again. |
| 78 |
|
| 79 |
Using TCMB_REQ_IN is a viable option. It would allow for eliminating |
| 80 |
the use of exported functions to the script. Second rev? Probably |
| 81 |
more efficient than using exported functions. |
| 82 |
|
| 83 |
Hooking TMCB_E2EACK_IN does solve the above problem. Current problem |
| 84 |
is getting current URIs on both call legs, since callee in hold/pickup |
| 85 |
scenario (SCA line A1 holds call to B, SCA line A2 picks up) thinks |
| 86 |
To & From URI are both the SCA line's AoR. Tried sending UPDATEs from |
| 87 |
the TMCB_E2EACK_IN callback, but because we're sending them before the |
| 88 |
proxy relays the ACK to the callee, the callee appears to revert to |
| 89 |
using the URIs in the ACK for all future packets. The callER handles |
| 90 |
the UPDATE correctly, and uses the correct URIs. |
| 91 |
|
| 92 |
Possible workarounds for the above, in order of increasing quality: |
| 93 |
* Append UPDATE info to shared linked list, register short timer, |
| 94 |
send all pending UPDATEs when timer alarms, clear queue. |
| 95 |
|
| 96 |
Pros: easy to write, discrete from other code |
| 97 |
Cons: This is effectively a sleep(1) workaround. Clumsy, prone |
| 98 |
to error: still might cause UPDATE packet to be sent prior |
| 99 |
to ACK delivery to callee, if UPDATE is appended to queue |
| 100 |
just as timer fires. |
| 101 |
|
| 102 |
* Register a TMCB_DESTROY callback in the TMCB_E2EACK_IN callback |
| 103 |
to send the UPDATEs when the ACK transaction is destroyed. |
| 104 |
|
| 105 |
Pros: fits current model fairly well, can glean all required |
| 106 |
information from struct cell in callback, no need to |
| 107 |
involve script. |
| 108 |
Cons: also similar to a sleep(1) workaround, though less prone |
| 109 |
to races. still attached to a timer (tm destroy tick), |
| 110 |
meaning users may still trigger problem with rapid hold/ |
| 111 |
pickups. |
| 112 |
|
| 113 |
* Register a pv in the module, set it to a known value in the |
| 114 |
TMCB_E2EACK_IN callback, have the script check the value of the |
| 115 |
pv, and invoke an exported sca_update function if the pv is set |
| 116 |
to the known value. |
| 117 |
|
| 118 |
Pros: fits sip-router script-based logic model well, does not |
| 119 |
rely on a timer (eliminates races). |
| 120 |
Cons: pv has a lot of overhead for what amounts to a flag, means |
| 121 |
adding an exported function to the script. |
| 122 |
|
| 123 |
* Register a flag, set it in TMCB_E2EACK_IN callback if UPDATEs |
| 124 |
need to go to call legs, invoke sca_update from script as above. |
| 125 |
|
| 126 |
Pros: it's just a flag. |
| 127 |
Cons: setup may be complicated, given sip-router's script flag |
| 128 |
handling, means adding exported function for script. |
| 129 |
(see fix_flags in flags.c, e.g. registrar's |
| 130 |
fix_nated_contact()) |
| 131 |
|
| 132 |
|
| 133 |
Dependency on To-URI is problematic for hold/pickup |
| 134 |
An SCA pickup of a held call on another handset means RURI, From-URI |
| 135 |
and To-URI are identical. The module currently expects those to |
| 136 |
be unique. It will be possible to reconcile these, but it suggests |
| 137 |
that using the sip_uri_t struct and the parse_uri functions may be |
| 138 |
helpful. |
| 139 |
|
| 140 |
No handler for t_reply (locally sent transaction-stateful replies). |
| 141 |
Probably need to register callback for TMCB_LOCAL_RESPONSE_IN. |
| 142 |
|
| 143 |
Deletion of call-info subscription when line-seize NOTIFY fails seems |
| 144 |
wrongheaded. |