Code Monkey home page Code Monkey logo

Comments (7)

 avatar commented on June 10, 2024 1

Hey @hpsony94

Sorry for the late response. About adapter documentation: there is not much documented yet. Your best bet is to check the source code from example implmentations like:
https://github.com/vialer/vjs-adapter-user-vg (user/login)
https://github.com/vialer/vjs-provider-contacts-vg (contacts)
https://github.com/vialer/vjs-mod-queues-vg (custom module for queues)

About the fix; yes that should be a 486. There is a ticket for it, but I can't say when it's going to be fixed.

from vialer-js.

 avatar commented on June 10, 2024

Hi hpsony94,

You're right. This needs to be a 486. We'll look into it and come up with a fix.

from vialer-js.

 avatar commented on June 10, 2024

By the way, do you have a good reference on how to give this a go with Freeswitch? It would be nice to test with a different PBX. We'll add some documentation for PBX setup to the project later.

from vialer-js.

hpsony94 avatar hpsony94 commented on June 10, 2024

Hi @jvanveen ,

I did follow this official doc from Freeswitch, please take it: https://freeswitch.org/confluence/display/FREESWITCH/WebRTC

Let me know if you need help. :)

BR,
Sony

from vialer-js.

hpsony94 avatar hpsony94 commented on June 10, 2024

Hi @jvanveen ,

Do you have any documents about using a custom adapter, a provider or an addon?

For example: I'd like to use my own system to provide contact, login, auth API? So that's the reason I need to custom those function to adapt with my own system.
It's good to me to know kind of API, docs about those feature.

Thanks in Advance,
Sony

from vialer-js.

hpsony94 avatar hpsony94 commented on June 10, 2024

Update for this ticket

I think it's not a fault of Vialer application layer. Let's look at a bit source code from vialer.
src/js/bg/plugins/calls/call/sip.js

/**
* Terminate a Call depending on it's current status.
*/
terminate() {
...
        // Calls with other statuses need some more work to end.
        try {
            if (this.state.status === 'invite') {
                this.setState({status: 'request_terminated'})
                **this.session.reject() // Decline an incoming call.**

reject() function has been triggered by SIP.js stack layer. I think vialer just should do what needed from SIP.js document.

Let's have a look at SIP.js stack API document.
https://sipjs.com/api/0.11.0/context/server/

reject([options])
Send a failure (300-699) response. By default, reject will send a 480 Temporarily Unavailable response with no body.

According to API document, I don't know the reason why by default reject will send a 480 TU response to SIP server. For this case, I think reject should identify which is the right case for "Busy Here" case.

I had to fix this issue by changing source code from sip.js

Here is my small fix, i don't know what will impact other func.
node_modules/sip.js/dist/sip.js

ServerContext.prototype.reject = function (options) {
options = Object.create(options || Object.prototype);
options.statusCode || (options.statusCode = 486);
options.minCode = 300;
options.maxCode = 699;
options.events = ['rejected', 'failed'];
return this.reply(options);
};

from vialer-js.

 avatar commented on June 10, 2024

Fixed in the develop branch

from vialer-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.