[Phone Video SIP] How to send and catch custom params

huy.nguyenthanh

New Member
Hi,

I used createCall options "custom" and "sipHeaders" to make a call to another extension PBX (911).

But in websocket of 911 i can not found that params.

1678788527964.png


1678788546543.png



Any thing wrong?


Please help me how to send custom params.

Thanks.
 

Max

Administrator
Staff member
Hello

You point to incoming notifications, such as ring and notifyIncomingCall

notifyIncomingCall - means you receive a call from another endpoint.
ring - means you receive progress status for the incoming call

Therefore you can't set params custom and sipHeaders for incoming calls.

These two parameters are applied for outgoing calls only.
So if you do createCall and pass parameters, this parameters should be visible in websocket message call
Please share JavaScript code how do you pass the parameters and which websocket frames were displayed.
 

huy.nguyenthanh

New Member
Hi, thanks for reply

This is my code and websocket response from extension createCall

1678845079392.png


1678845022348.png


1678845113246.png

1678845130744.png

1678845154027.png


So in endpoint receive call, I can not get any custom params ?
 
Last edited:

huy.nguyenthanh

New Member
My case:
- Website customers register 1 extension createCall to another by flow PBX. Before createCall, customers must enter information such as name, email,...
- I want send this information to extension received call by custom params or sipHeaders, but websocket can not received.
 

Max

Administrator
Staff member
sipHeaders are passed to PBX only, but not to other call party.
custom is passed in REST hook /call to a backend server. So you should set up your own backend to receive REST hooks and then send a custom data to a client by your own way. Please see the details about REST hooks here.
 

manh.chu

Member
sipHeaders are passed to PBX only, but not to other call party.
custom is passed in REST hook /call to a backend server. So you should set up your own backend to receive REST hooks and then send a custom data to a client by your own way. Please see the details about REST hooks here.
I see hook /call outgoing haven't parameter custom.
1679285937111.png
 

Max

Administrator
Staff member
I see hook /call outgoing haven't parameter custom.
It supports custom option like any other direct invoke hook (publishStream. playStream etc). Please see this example, the custom parameters passing should also work for call:
1. Client side code:
Code:
    var outCall = session.createCall({
        callee: $("#callee").val(),
        visibleName: $("#sipLogin").val(),
        localVideoDisplay: localDisplay,
        remoteVideoDisplay: remoteDisplay,
        constraints: constraints,
        receiveAudio: true,
        receiveVideo: false,
        stripCodecs:"SILK",
        custom: {"token": "call123456"}
        ...
    });
    outCall.call();
2. The hook received by backend server looks like
Code:
12:08:15,275 INFO            RestClient - API-ASYNC-pool-13-thread-1 RECEIVED REST OBJECT <==
URL:http://localhost:8081/apps/EchoApp/call
OBJECT:
{
  "nodeId" : "d2hxbqNPE04vGeZ51NPhDuId6k3hUrBB@192.168.130.39",
  "appKey" : "defaultApp",
  "sessionId" : "/192.168.23.83:59988/192.168.130.39:8443-842cc893-b45c-4981-89a7-7bfb94303e16",
  "callId" : "382feb50-c6dd-11ed-90fd-5d4c1bba2469",
  "incoming" : false,
  "status" : "PENDING",
  "caller" : "10006",
  "callee" : "10008",
  "hasAudio" : true,
  "hasVideo" : false,
  "visibleName" : "10006",
  "mediaProvider" : "WebRTC",
  "holdForTransfer" : false,
  "id" : "382feb50-c6dd-11ed-90fd-5d4c1bba2469_/192.168.23.83:59988/192.168.130.39:8443-842cc893-b45c-4981-89a7-7bfb94303e16",
  "msrp" : false,
  "history" : false,
  "custom" : {
    "token" : "call123456"
  },
  "origin" : "https://test.flashphoner.com:8444",
  "history" : false
}
 
Top