Browser-Phone
Browser-Phone copied to clipboard
callerID and CalleeID
I've added a function to save the recording video in server. To name the video file, I need the CallerID and the CalleeID. How to retrieve it?
At what point do you need this?
During a call, you can refer to the session object, say when the users hangs up. Just be aware that writing to the CallRecordings database is done async, so when the call is finished writing, the session may be over and deleted. For that, you have to trace back to the CDRs (or Message Stream in this project).
The call recordings have two useful bits of data, the SIP Session ID (actual Call-ID:
used in SIP headers), and the call Recording ID (not unique). There is not enough information stored in the Call Recordings Database, to build CDR's, and it's the "backwards" reference based on call Recordings ID. This means that even though the call recordings save function finishes lasts, you should still build your extensional call recordings collection code from the perspective of the CDR's.
From CDR's (storage <BuddyID>-stream
) you get an array in there called: DataCollection[n].Recordings = [{uID: String, startTime: String, stopTime: String}]
Take the Recordings item, and reference the uID, and find the Call Recording in the Index DB, based on that uID. And then you will have both the CDR and the recording(s): Note, there can be more than one recording.
Then in the CDR's, you have both Src
and Dst
nodes.
Otherwise:
If your server is capturing CDR data, then you could also match the Call-ID
saved with the Call Recording (referred to as sessionid in the CallRecordings database), to just match it up server side. This would assume that the CDR's can log the Call-ID
of the call leg, and is not overwritten later. Your Own CDR's should contain Source and Destination caller ID