Code Monkey home page Code Monkey logo

Comments (7)

davehorton avatar davehorton commented on August 12, 2024

yes, opts.headers should be the correct approach. I think the issue was that originally some of the core sip headers like 'From' I was not letting you modify, over time I relaxed this but it seems like perhaps I did not allow this for the From header. I will look into this. Meanwhile, can you verify the version of drachtio-server you are running (drachtio -v)?

from drachtio-srf.

isaacpz avatar isaacpz commented on August 12, 2024

Would be awesome to allow that functionality for the From header. Pretty important for my use case. The server is using drachtio-server:latest from docker-hub, so should be 4.4.14.

Thanks for your help!

from drachtio-srf.

davehorton avatar davehorton commented on August 12, 2024

ok in my testing, it does look like I have a bug. Also, there is a workaround which I think should work for you. In opts.headers instead of naming the property From name it from (lower-case).

i.e. this worked in my testing:

      const {uas, uac} = await srf.createB2BUA(req, res, config.get('dest'), {
        headers: {
          from: 'myname <sip:foo@localhost>'
        }
      });

The 'localhost' will be replaced with the local IP that drachtio is listening on.

Please let me know if this works for you. Meanwhile I will check in a fix so that 'From' works as well..

from drachtio-srf.

davehorton avatar davehorton commented on August 12, 2024

ok I pushed [email protected] which should have the proper fix for this (either opts.From or opts.from should let you set a customized From header). It would be great if you can confirm this works in your application.

from drachtio-srf.

davehorton avatar davehorton commented on August 12, 2024

BTW, if all you wanted to do was set the user part of the From header on the outbound invite to something, another even simpler way to do that is:

const {uas, uac} = await srf.createB2BUA(req, res, config.get('dest'), {
         callingNumber: '+15083084809'
      });

But if you want to set the display name, etc, the use opts.headers.From. Again, unless you have a specific need to set the host part of that sip url to something, I'd suggest setting it to 'localhost' and letting the server substitute appropriately

from drachtio-srf.

davehorton avatar davehorton commented on August 12, 2024

can you confirm this works for you?

from drachtio-srf.

isaacpz avatar isaacpz commented on August 12, 2024

Yes works great! Thank you!

from drachtio-srf.

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.