2

How to put the session.id of caller SIP.JS (wss-binding) to CDR log file or in dialplan ("Freeswitch Windows")? Or get the UUID of session freeswitch to browser?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102

3 Answers3

2

I resolved by set extraHeaders on userAgent.invite():extraHeaders:['X-UUID: '+uuid]

and read on server as variable:sip_h_X-UUID

1

In version 0.13.x I ended up using session.dialog.id.callId on the client side (JavaScript) and sip_call_id on the server side (FreeSWITCH).
Note: in version 0.15.x I had to use session.dialogState.callId.

Requests are send using this value as the Call-ID header.

To check your headers on the client side, set traceSip: true in your ua.

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
  • I am trying to identify a call in Freeswitch with a call in SIPjs. The thing is there is no session.dialog.id.callId in InviteServerContext (where do i get that path?). The callId I got in session is from session.dialogState.callId and the two variables are different. eg: session.dialog.id.callId - "6d9bb56f-7fce-1238-5bbd-f04da2cc571c" and sip_call_id: "variable_sip_call_id","value":"101921ODQ5ODk1MTZjYzdhOWJjOTg5ODQzYTkxOWQ1NzJkZTU" The latter is from a socket event call data. I don't know why they are diff. – Emmanuel Mahuni Nov 12 '19 at 09:16
  • @EmmanuelMahuni You are right, I had to change the script after an upgrade of SIP.js – Jasper de Vries Nov 12 '19 at 09:26
  • Oh it is? So do you have any idea of getting the sip call id server side as I asked? – Emmanuel Mahuni Nov 12 '19 at 13:51
  • it seems like Sofia is hashing some parts of the sid and add it to some other hashes to create another call id that it then sends to the SIP INVITE header that we see in SIPjs. I have no idea of getting this id on the server side especially before it is sent to SIPjs. The reason is I want the browser app to know which call this is based on the id. – Emmanuel Mahuni Nov 13 '19 at 06:41
0

I can think of 2 options from Browser to Freeswitch

  1. Once you get session.id of the caller, You can make a http call from your browser to your freeswitch server (running a http service) with caller info and save it to CDR file.
  2. Use SIPjs message function myUA.message('alice@example.com', 'SessionID:'+session.id); to send session id info to server. On server side listen for MESSAGE events and then you can call a method to insert in to cdr.
Sasi Varunan
  • 2,806
  • 1
  • 23
  • 34