DoubangoTelecom / sipml5

The world's first HTML5 SIP client (WebRTC)
BSD 3-Clause "New" or "Revised" License
935 stars 455 forks source link

How can I update displayName in sip session just before the call? #353

Open jayanthbondi opened 3 years ago

jayanthbondi commented 3 years ago

currentnly I'm registering display_name in oConfigCall just before initiating the call. But still it's not working, can someone help me?

call = phoneNo => { if (!this.isRegistered()) return; this.oConfigCall.display_name = '54321'; if (this.oSipStack && !this.oSipSessionCall) { this.oSipSessionCall = this.oSipStack.newSession('call-audio', this.oConfigCall); if (this.oSipSessionCall.call(phoneNo) !== 0) { this.oSipSessionCall = null; } } else if (this.oSipSessionCall) { this.oSipSessionCall.accept(this.oConfigCall); } };

shreyshahh commented 3 years ago

Same question, Found any solutions for this?

jayanthbondi commented 3 years ago

Hi @shreyshahh , Yes I found the solution.

call = (phoneNo, callerId) => { if (!this.isRegistered()) return; if (this.oSipStack && !this.oSipSessionCall) { _.set(this.oSipStack, ['o_stack', 'identity', 'o_uri_impu', 's_display_name'], callerId); this.oSipSessionCall = this.oSipStack.newSession('call-audio', this.oConfigCall); } }

jayanthbondi commented 3 years ago

You can console your this.oSipStack object and you can find 's_display_name' attribute

shreyshahh commented 3 years ago

@jayanthbondi Hi, I've updated s_display_name in sip stack object but it does not reflect that display name on call, it still shows the display name we have added while creating new SIPML stack object. It does not update even if we update s_display_name.

For eg. While creating new sip stack I am giving 'test' as display name

this.oSipStack = new SIPml.Stak({
display_name: 'test'
})

Just before call I am updating it,

this.oSipStack.o_stack.identity.s_display_name = 'xyz';

So I need 'xyz' to be displayed, but instead it displays 'test' only