call_uuid in web sdk

167 views
Skip to first unread message

gsk

unread,
Apr 3, 2013, 12:18:18 AM4/3/13
to plivo...@googlegroups.com
I am trying to get the call_uuid from the phone.html web sdk example.  I noticed that when I click mute I get the following in the console: 

muting..0.id=akaYdb90pOm49qHJWUaiTVb2x5E4OVPgUEfMa0..enabled status=true 

Is that long random string the call_uuid?  While I wait for a new API release with something like Plivo.conn.getcurrentcall() or Plivo.conn.transfer(number)

Here is the relevant code from Plivo.min.js:   


p.prototype.mute = function () {
            if (x) {
                var
                D = x.mediaSession.localMedia.audioTracks || x.mediaSession.
                localMedia.getAudioTracks();
                for (var
                C = 0; C < D.length; C++) {
                    console.log("muting.." + C + ".id=" + D[C].id + "..
enabled
status=" + D[C].enabled);
                    D[C].enabled = false
                }
            } else {
                Plivo.logDebug("
mute failed : no active call
session")
            }
        };

Amit Dholu

unread,
Dec 19, 2015, 12:10:57 AM12/19/15
to Plivo Users
Hello,

You can set extra-headers in plivo answer url like
$dial_params['sipHeaders'] = 'mycallID='.$_REQUEST['CallUUID'];  

and then you can get this extra-header key=value pair in
function onIncomingCall(account_name, extraHeaders) {
                console.log("onIncomingCall:"+account_name);
                console.log("extraHeaders=");
                var CallUUID = extraHeaders['X-PH-mycallID'];// this is set on Answer URL.
                for (var key in extraHeaders) {
                    console.log("key="+key+".val="+extraHeaders[key]);
                }
                IncomingCallUI(account_name,CallUUID);
            }

Thanks.
Reply all
Reply to author
Forward
0 new messages