Git Product home page Git Product logo

ari-proxy's People

Contributors

ahrdie avatar bfncs avatar boettner avatar dependabot[bot] avatar hekmekk avatar illtemperedmax avatar ironmaya avatar m0 avatar mia-krause avatar michelpelletier07 avatar simonlansing avatar sipgate-mkrause avatar sipseb avatar svenkube avatar vinzens avatar zwendris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ari-proxy's Issues

How to import ari-proxy into Eclipse?

We wrote an Eclipse plugin and are now collecting a database of large Akka Java Maven projects. I tried to import ari-proxy into Eclipse, but I couldn't compile it and run the tests. I Just imported the ari-proxy as an existing maven project in eclipse but it shows 50 errors like the below samples:

image

I tried changing the java version or maven version, adding that plugin to maven dependencies, and following all of the StackOverflow suggestions, such as removing the.m2 folder, but none of them worked.

Is ari-proxy Eclipse compatible? Is it possible to run their test classes inside Eclipse? If so, what procedure should I follow?

java.lang.RuntimeException: Failed to extract resourceId from command

Bug Report

corresponding commit-id: latest of master branch
asterisk version: 17.9.4
kafka version: 2.7
java version: openjdk8

setup description

Docker Compose configuration with following nodes:

  • Zookeeper
  • 3 Kafka nodes
  • Redis node
  • Asterisk node
  • ari-proxy node

failure description

For testing, I wanted to play an audio file on an incoming call. Therefore I answer the incoming call on STASIS_START, using a randomly generated command_id, with the following:

from kafka import KafkaConsumer, KafkaProducer


producer = KafkaProducer(bootstrap_servers=['localhost:9093'], value_serializer=lambda v: json.dumps(v).encode('utf-8'))

producer.send('ari-commands-topic', {
	"callContext":call_context,
	"commandId": command_id,
	"ariCommand": {
		"method": "POST",
		"url": f"/channels/{ channel_id }/answer"
	}
})

Which works fine. Next I react to the RESPONSE of the command above with the following, also using another randomly generated command_id:

producer.send('ari-commands-topic', {
	"callContext": call_context,
	"commandId": command_id,
	"ariCommand": {
		"method": "POST",
		"url": f"/channels/{ channel_id }/play",
		"body": {
			"channelId": channel_id, # not sure if required
			"media": "sound:https://example.com/audio.sln16"
		}
	}
})

This command lets ari-proxy fail with the following stacktrace:

2021-08-09/16:56:50,120/CEST [INFO] [ari-app-akka.actor.default-dispatcher-6] Materializer - [>>>   ARI RESPONSE] Element: {"type":"RESPONSE","commandsTopic":"ari-commands-topic","payload":{"status_code":204},"callContext":"c72c970c-9c5b-4722-817b-43e15a22045d","resources":[{"type":"CHANNEL","id":"1628521009.17"}],"commandId":"test-1234-26","commandRequest":{"method":"POST","url":"/channels/1628521009.17/answer"}}
2021-08-09/16:56:52,181/CEST [INFO] [ari-app-akka.actor.default-dispatcher-7] Materializer - [>>>   ARI COMMAND] Element: {"callContext": "c72c970c-9c5b-4722-817b-43e15a22045d", "commandId": "test-1234-46", "ariCommand": {"method": "POST", "url": "/channels/1628521009.17/play", "body": {"channelId": "1628521009.17", "media": "https://example.com/audio.sln16"}}}
2021-08-09/16:56:52,185/CEST [ERROR] [ari-app-akka.actor.default-dispatcher-7] ActorSystemImpl - Error in some stage; restarting stream ...
java.lang.IllegalStateException: java.lang.RuntimeException: Failed to extract resourceId from command 'AriCommand[body={"channelId":"1628521009.17","media":"https://example.com/audio.sln16"},method=POST,url=/channels/1628521009.17/play]'
	at io.retel.ariproxy.boundary.commandsandresponses.AriCommandResponseKafkaProcessor.lambda$null$7(AriCommandResponseKafkaProcessor.java:125)
	at io.vavr.control.Try.onFailure(Try.java:659)
	at io.retel.ariproxy.boundary.commandsandresponses.AriCommandResponseKafkaProcessor.lambda$run$8b4133d7$1(AriCommandResponseKafkaProcessor.java:123)
	at akka.stream.javadsl.Source.$anonfun$map$1(Source.scala:1969)
	at akka.stream.impl.fusing.Map$$anon$1.onPush(Ops.scala:52)
	at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:542)
	at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:423)
	at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:650)
	at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:521)
	at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:625)
	at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:800)
	at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$shortCircuitBatch(ActorGraphInterpreter.scala:787)
	at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:819)
	at akka.actor.Actor.aroundReceive(Actor.scala:537)
	at akka.actor.Actor.aroundReceive$(Actor.scala:535)
	at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:716)
	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:580)
	at akka.actor.ActorCell.invoke(ActorCell.scala:548)
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270)
	at akka.dispatch.Mailbox.run(Mailbox.scala:231)
	at akka.dispatch.Mailbox.exec(Mailbox.scala:243)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
Caused by: java.lang.RuntimeException: Failed to extract resourceId from command 'AriCommand[body={"channelId":"1628521009.17","media":"https://example.com/audio.sln16"},method=POST,url=/channels/1628521009.17/play]'
	at io.retel.ariproxy.boundary.commandsandresponses.AriCommandResponseProcessing.registerCallContext(AriCommandResponseProcessing.java:32)
	at io.retel.ariproxy.boundary.commandsandresponses.AriCommandResponseKafkaProcessor.lambda$run$8b4133d7$1(AriCommandResponseKafkaProcessor.java:119)
	... 22 more

I did some digging in the code, but could not find anything helpful about resourceId.
Am I missing something or how can I investigate this further?

expected behaviour description

Should play the provided audio file.

Thanks a lot for your great code base and your help!

default-http-port in service.config

Feature Request

there is a default-http-port in application.conf which is bundled. There is no way to have the port configured by external config (service.conf)

proposal

use a field in service.conf in order to configure the port

current behaviour

no change possible without changing the application.conf

desired behaviour

port parameter in service.conf

use case / why is this important?

to have a more customization of configuration if the ports needs to be changed.

Sample config is invalid

Bug Report

corresponding commit-id:latest
asterisk version:latest
kafka version:2.0
java version:8

setup description

failure description

When running the application via

java -Dconfig.file=service.conf  -jar target/ari-proxy-0.9.0-fat.jar 

, it exits saying no config websocket-uri is found , on closer inspection the ServiceConfig class doesnt have a asterisk-uri field only a websocket-uri field.
It would seem to be that the sample config file is inaccurate

expected behaviour description

to run

Client example

Hello. Thank you for providing ari-proxy to the community. I need help to get started. Could you direct me to a java sample client program, preferably using akka, that connects to kafka and retrieves the Stasis start event and sends a few simple commands to Asterisk? For example Answer, then play a media file, and then Hangup. Many thanks.

config valitation

So far there is no validation of the config.
The Ari-proxy does read the config and starts even though the config is invalid and the ari-proxy is not able to connect since there is an invalid connection for asterisk and kafka and/or the connection is not working.
If the ari-proxy is not able to function properly it must not start and stay started. A problem in startup must be logged at least to stdout (if logger config is broken) and the service has to terminate.

zookeeper support

Feature Request

I would like to suggest service discovery via zookeeper

proposal

current behaviour

currently the only support for a kafka cluster seems to be via a comma separated list which requires hard-coding the hostname:ports

desired behaviour

The desired behavior would for ari-proxy to pull from zookeeper the list of brokers

use case / why is this important?

one specific case would be when running a kafka cluster on docker, ports are assigned dynamically which makes it difficult to configure ari-proxy properly

asterisk 16 new Stasis Message

Bug Report

corresponding commit-id: latest

asterisk version: 16

kafka version:
not involved

setup description

Basic Call from Application

failure description

there is a non implemented Stasis Message which is comming from asterisk and which is not implmented. In this case "STASISSTATUS"

expected behaviour description

Should be able to extract recourceID out of all messages

2018-10-09/19:05:59,241/CEST [ERROR] [ari-proxy-for-some-stasis-app-akka.actor.default-dispatcher-41] ActorSystemImpl - java.lang.RuntimeException: Failed to extract resourceId from body={"variable":"STASISSTATUS","value":"SUCCESS","type":"ChannelVarset","timestamp":"2018-10-09T19:05:59.214+0200","channel":{"id":"83374320-dac0-4010-9ad6-c51e30fd93c0","name":"PJSIP/101-00000054","state":"Up","caller":{"name":"Temple Morgan","number":"101"},"connected":{"name":"","number":""},"accountcode":"","dialplan":{"context":"foo","exten":"s","priority":1},"creationtime":"2018-10-09T19:05:52.489+0200","language":"en","channelvars":{"X-AUTHDOMAIN":""}},"asterisk_id":"e4:b3:18:51:7d:4a","application":"application-name"}

Retry of http command if socket breaks

In the AriCommandResponseKafkaProcessor.class there is a step in order to place a raw http request to the asterisk Web socket. We have seen broken Web sockets and the commands could not be sent to the asterisk. In order to provide more stability we have to react on a broken web socket in this case and do a reconnect / retry of the command.
We haven't figured a way to reproduce this issue on purpose but it occur occasionally.

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.