SIP trunking and call routing in Kamailio - sip-server

I was using freepbx, but because of some limits I installed kamailio on another machine.
I want to have a route for outgoing calls to NGN(was peer friend siptrunk in freepbx), which handles call setups started from extensions registered on kamailio.
and another route which send incoming calls to a freepbx ivr.
how can I do that?

Kamailio controlled via config file. You can add if operator based on any info you want(source ip, destination number etc etc ) and choose for each own route.
You also can use already writed module like carrierroute https://kamailio.org/docs/modules/3.0.x/modules/carrierroute.html, which use prefix table for selection.

Related

Custom service/route creation using feathersjs

I have been reading the documentation for last 2 days. I'm new to feathersjs.
First issue: any link related to feathersjs is not accessible. Such as this.
Giving the following error:
This page isn’t working
legacy.docs.feathersjs.com redirected you too many times.
Hence I'm unable to traceback to similar types or any types of previously asked threads.
Second issue: It's a great framework to start with Real-time applications. But not all real time application just require alone DB access, their might be access required to something like Amazon S3, Microsoft Azure etc. In my case it's the same and it's more like problem with setting up routes.
I have executed the following commands:
feathers generate app
feathers generate service (service name: upload, REST, DB: Mongoose)
feathers generate authentication (username and password)
I have the setup with me, ready but how do I add another custom service?
The granularity of the service starts in the following way (Use case only for upload):
Conventional way of doing it >> router.post('/upload', (req, res, next) =>{});
Assume, I'm sending a file using data form, and some extra param like { storage: "s3"} in the req.
Postman --> POST (Only) to /upload ---> Process request (isStorageExistsInRequest?) --> Then perform the actual upload respectively to the specific Storage in Req and log the details in local db as well --> Send Response (Success or Failure)
Another thread on stack overflow where you have answered with this:
app.use('/Category/ExclusiveContents/:categoryId', {
create(data, params) {
// do complex stuff here
params.categoryId // the id of the category
data // -> additional data from the POST request
}
});
The solution can viewed in this way as well, since featherjs supports micro service approach, It would be great to have sub-routes like:
/upload_s3 -- uploads to s3
/upload_azure -- uploads to azure and so on.
/upload -- main route which is exposed to users. User requests, process request, call the respective sub-route. (Authentication and Auth to be included as well)
How to solve these types of problems using existing setup of feathersjs?
1) This is a deployment issue, Netlify is looking into it. The current documentation is not on the legacy domain though, what you are looking for can be found at docs.feathersjs.com/api/databases/querying.html.
2) A custom service can be added by running feathers generate service and choosing the custom service option. The functionality can then be implemented in src/services/<service-name>/<service-name>.class.js according to the service interface. For file uploads, an example on how to customize the parameters for feathers-blob (which is used in the file uploading guide) can be found in this issue.

Scout Eclipse ScoutServerTestRunner on client tests

now I run on new problems with scout testing.
I have Client fragment project for testing and I would like to test some templates I created.
My problem is that this templates contains some SmartFields and I would like to test them. For this I probably need ScoutServerTestRunner, so the server is up and running.
But If I try to add it I get error :
#RunWith(ScoutServerTestRunner.class)
#ServerTest()
I get error :
ServerTest cannot be resolved to a type
, all of my assert imports are deleted and I get error on my package line suggesting me Configure build path.
My guess is that this can't be done because it is client fragment and it can't connect to server.
But how then test smartFields ?
From your question I guess that there is some misunderstanding...
ScoutServerTestRunner and #ServerTest is something similar to ClientServerTestRunner and #ClientTest but for the server. You will need it for tests testing the server.
The classes are located in the org.eclipse.scout.rt.testing.server bundle.
If in a client test you need a server you have two possibilities:
A/ Start a server
You can start a server
This will probably not be the normal server (the one like in production) because you want to control the database or some external services. Authentication might also be slightly different (in order to control it and to have something compatible with your tests)
For the integration in your maven build, the maven-cargo plugin can be used to start your server before executing the client test suite.
B/ Mock the server services
Each of the services call that creates a ProxyService calling the server, can be replaced by mock (client only).
This is the preferred way for unit test, because you do not rely on a deployed server. You can also define for each test what the server answer will be.
This solutions requires probably initially more work, but in my opinion it worth it.
To register an alternative service, you can use:
TestingUtility.registerServices(
<activator instance>,
<priority>,
<service instances>
);
The service with the higher priority will win.
In each test, do not forget to un-register the alternative services you have registered.
SmartFields are using CodeTypes or LookupCalls. In case of a LookupCall, the LookupCall is probably calling the server through a LookupService. In case of a CodeType, the SmartField is internally using the CodeLookupCall class relying on a ICodeService.
In both cases, if you want to run your test without a server, you need to ensure that the client uses alternative implementations of the required services that do requires a server.

Can I use "new ServerSocket(0)" with openshift

I have developed an application that allows multiple players to play together on line at various games such shifumi, poker, chess and so on. It works very well on my localhost. I would like to publish it. So I decided to use openshift to do this.
But there is a problem.
It seems it come from this statement : new ServerSocket(0). I do this inside the doPost method of an HttpServlet.
Could you tell me I don't have the permission to do this (new ServerSocket(0)) inside an openshift server?
I think you have a couple of issues going on here.
The first is that when you call new ServerSocket(0), it is going to try to find a socket that it can bind to, probably on either 0.0.0.0 (all ip addresses/interfaces) or 127.0.0.1, neither of which is allowed on OpenShift.
According to the documentation (located here: http://download.java.net/jdk7/archive/b123/docs/api/java/net/ServerSocket.html) you can use one of the overloaded methods to provide an ip address to bind to, which should be your OPENSHIFT__IP (where could be jbosseap, jbossas, wildfly, jbossews, etc).
ServerSocket(int port, int backlog, InetAddress bindAddr)
Your second issue is a bit more complicated, basically what ports you can bind to. OpenShift allows user code to bind to ports 15000-20000, depending on what ports are not being used by other applications or services. However, none of those ports are open to the public internet, they are all internal ports for internal communications, so if you are trying to let a client connect to them, it won't work. The only ports that are publicly available are 80/443/8000/8443, and your application must bind to port 8080 on your OPENSHIFT__IP to be able to be reached using your app-domain.rhcloud.com public url. You can check out this article to read more about how all of the binding and routing works: https://developers.openshift.com/en/managing-port-binding-routing.html
Hopefully that answers the question about why that piece of code is not working.

Create a xades.sign with an external sign

I need to install a xades library in a web-application, this webapp will produce xades documents using remote-sign certificates.
The private key of this certificates are placed on a remote HSM device, so if i have to sign (i mean produce a RSA of a digest) i need to pass the hash to the remote device, this will produce the rsa and will give it to the webapp that with xades4j will create the xades structure
Can you tell me if xades4j already can do this, and if not how can i implement a sort of signatureProvider for xades4j that delegate the production of the RSA to a remote device?
Thanks
Old-but-gold question: I'm stucking at the same point too, but... I found a different (maybe cleaner) way to get the result, so that's my suggestion:
Implement a Provider (https://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec.html#Provider)` with it's own "SHA256WithRSA" algorithm implementation, that delegates the signature production to something out of the application
Pass this Provider to the sign() method
I don't know if this can work, but it seems like a nicer try...

Stream .LRF files via webbserver

i've noticed that on LoLReplays webpage you can now stream live games via their program LoLRecorder. I found this code on their page
href="lrf://spectator spectator.eu.lol.riotgames.com 2nHvYdkaSjjqC7f+mtHQeIhFcUSQLFu5 488978485 EUN1 3.01.0.1"
And i've tried a little to stream from my own (already recorded) game. But all i get is unable to find match. My question is: Does anyone here know how this works?
Thanks!
TL;DR; You can't stream anything, but you can open LoLReplay in spectator mode for a specific match.
Try reinstalling LoLReplay, seemed to fix the issues that I was having.
The title of your post is somewhat misleading as no streaming actually happens - all that the link does is open LoLReplay on your local machine and pass in the details of the match you want to spectate.
This will only work for matches that are happening now, as it connects in a similar way as the LoL client does when you spectate a match.
Calling LoLReplay from the browser
The links seem to be formatted as follows:
lrf://spectator [Observer IP Address][:Observer Port] [Observer Encryption Key] [Game Id] [Platform Id] [Client Version?]
lrf://spectator tells LoLReplay to open up in spectator mode.
Observer IP Address is required and can either be a hostname or an IP address. The hostname is usually in the format spectator.[eu/na/br/etc.].lol.riotgames.com.
Observer Port is optional, I believe it defaults to 8088 which appears to be the default spectator mode port.
Observer Encryption Key... is a required per-match encryption key.
Game Id is a required, per-match integer id.
Platform Id is a more specific version of the region, I guess relating to how Riot have grouped their servers. For example EUW1.
Client Version, the last field appears to be a version number - I can only assume this is either the version of the client that LoLReplay is using OR the version of the client the players in the match are using.
How to find IP address, encryption key etc.
Edit: you can now grab all the info you need using the official Riot API, you just need the SummonerId of the user you're querying for. See current-game API docs for usage.