Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to make outbound calls #24

Open
max-peroch opened this issue Dec 12, 2024 · 6 comments
Open

Not able to make outbound calls #24

max-peroch opened this issue Dec 12, 2024 · 6 comments

Comments

@max-peroch
Copy link

Hello,

I'm trying to use your fork to make an outbound call through Twilio as I'm interested in the DTMF support.
Using the CLI or GUI, when starting the call I get this NPE:

java.lang.NullPointerException: Cannot invoke "org.mjsip.ua.MediaAgent.getCallMedia()" because "this._mediaAgent" is null
	at org.mjsip.ua.UserAgent.getSessionDescriptor(UserAgent.java:120)
	at org.mjsip.ua.UserAgent.call(UserAgent.java:169)
	at org.mjsip.ua.UserAgent.call(UserAgent.java:156)
	at org.mjsip.examples.UserAgentCli.call(UserAgentCli.java:154)
	at org.mjsip.examples.UserAgentCli.run(UserAgentCli.java:219)
	at org.mjsip.examples.UserAgentCli.main(UserAgentCli.java:471)

I don't seem to run into this issue with https://github.com/mjsip/mjSIP, although haven't figured out how to make the sound work yet...

Thanks!

@haumacher
Copy link
Owner

haumacher commented Dec 13, 2024

This problem was introduced during a refactoring. 2564f73 should fix it, however I did not yet test.

Could you re-test your setup?

@max-peroch
Copy link
Author

Thanks! That NPE doesn't show up anymore but it seems like the configs have diverged from the main repo

@haumacher
Copy link
Owner

haumacher commented Dec 14, 2024

Yes there was a complete rework of the configuration part. Option parsing is now done by args4j, see e.g. org.mjsip.sip.provider.SipConfig.

But the option names mostly are the same with underscore replaced with -. Each program can output a list of available options with --help. All options can either be given at the command line or in a configuration file (leave out the -- for the option in the configuration file).

Help output e.g.:

 -f (--config-file) <file>        : File with configuration options, 'none' to prevent reading from the default
                                    location.
 -h (--help)                      : Print this help message. (default: true)
 --min-session-interval N         : Minimum session interval (Min-SE header field) for supporting "Session Timers" (RFC
                                    4028). (default: 90)
 --default-session-interval N     : Default session interval (Session-Expires header field) for supporting "Session
                                    Timers" (RFC  4028). (default: 0)
 --via-addr VAL                   : Host IPv4 address added to the via header.
 --via-addr-v6 VAL                : Host IPv6 address used in communication with an IPv6 counterpart in the via header.
 --prefer-ipv4 yes/no             : Whether to use IPv4 addresses by default. (default: false)
 --host-port N                    : Local SIP port. (default: 0)
 --transport-protocols VAL        : Use the given transport protocol for SIP. (default: [udp,tcp])
 --outbound-proxy <addr>[:<port>] : Use the given outbound proxy.
 --log-all-packets yes/no         : Whether to log all SIP messages. (default: false)
 --display-name <name>            : The display name of the user.
 --user <name>                    : The user ID to register at the registrar. (default: bhu)
 --proxy VAL                      : Proxy server to use.
 --registrar <addr>[:<port>]      : Registrar server.
 --route <addr>[:<port>]          : Additional URI for routing the registration messages.
 --auth-user VAL                  : User name used for authentication.
 --auth-realm VAL                 : Realm used for authentication.
 --auth-passwd VAL                : Password used for authentication.
 --expires N                      : Registers the contact address with the registrar server for a gven duration in
                                    seconds. (default: 3600)
 --keep-alive N                   : Send keep-alive packets each given milliseconds. (default: 0)
 --no-offer yes/no                : Send no offer in response to invite (offer/answer in 2xx/ack). (default: false)
 --no-prompt yes/no               : Do not prompt. (default: false)
 --receive-only yes/no            : Receive only mode, no media is sent. (default: false)
 --send-only yes/no               : Send only mode, no media is received. (default: false)
 --loopback                       : Loopback mode, received media are sent back to the remote sender. (default: false)
 --send-tone                      : Send only mode, an audio test tone is generated. (default: false)
 --send-file VAL                  : Audio is played from the specified file.
 --recv-file VAL                  : Received audio is recorded to the specified file.
 --send-video-file VAL            : Video is streamed from the specified file.
 --recv-video-file VAL            : Received video is recorded to the specified file.
 --media-port N                   : The first port used for RTP media streams. (default: 50000)
 --port-count N                   : The number of ports used for RTP media streaming. (default: 100)
 --hangup-time N                  : Hang up after the given number of seconds (0 means manual hangup). (default: -1)

@max-peroch
Copy link
Author

Sorry I didn't mean the parsing per se, but for example I seem to need to define a registrar when with the original repo I can start a call with just those options:

  • user
  • auth_user
  • auth_realm
  • auth_passwd
  • audio
  • call_to

@haumacher
Copy link
Owner

Sounds like a bug - I'll check that out. In the original code, it was unclear where an option was actually used. I tried to make only those options available to parts of the code that really need it. But this might have also introduced some bugs.

@max-peroch
Copy link
Author

Apologies, forgot to follow up on this! Using do_register=false gets me past the initial issue but I'm still unable to make my outbound call... From the logs it seems to keep on sending an INVITE request and then times-out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants