sipcapture / homer7-docker

HOMER 7 Docker Images
93 stars 87 forks source link

HEPLIFYSERVER_ALEGIDS not working #87

Open vandykew opened 4 years ago

vandykew commented 4 years ago

Has anyone gotten the AlegIDs environment variable to work on this docker ?

I have tried it a few ways and it now working

any other ideas ?

adubovikov commented 4 years ago

I have replied to the similar issue on the Homer's issue tracker. You have already a correlation ID in your HEP that asterisk sends to you. To avoid using it you have to create two blocks in the correlation mapping schema

  1. Make an correlation by data_header->>xcid
  2. Make at the end again the fetch from main call table
adubovikov commented 4 years ago

https://github.com/sipcapture/homer/issues/410 please read this comment as well: https://github.com/sipcapture/homer/issues/410#issuecomment-675288139

vandykew commented 4 years ago

i have added this to the top of the mapping and its not working

{
    "source_field": "data_header.X-CID",
    "lookup_id": 100,
    "lookup_profile": "default",
    "lookup_field": "sid",
    "append_sid": true,
    "lookup_range": [
        -300,
        200
    ]
},
vandykew commented 4 years ago

Also iI noticed you said asterix however im using freeswitch

vandykew commented 4 years ago

Also I have

"HEPLIFYSERVER_FORCEALEGID=true"

adubovikov commented 4 years ago
{
"source_field": "data_header.callid",
"lookup_id": 1,
"lookup_profile": "call",
"lookup_field": "data_header->>'X-CID'",
"lookup_range": [
-300,
200
]
},
vandykew commented 4 years ago

This is not working either

adubovikov commented 4 years ago

@vandykew what do you have in your database ? Do you have extracted X-CID in the data_header field ?

vandykew commented 4 years ago

I'm not sure this is a docker i didn't think i could access the database

adubovikov commented 4 years ago

you can always login into docker. Anyway, without to understand what do you have inside it will be almost impossible to help you.

vandykew commented 4 years ago

Ok after looking in the DB im not seeing X-CID in te data header field

{ "cseq": "", "callid": "", "method": "", "to_user": "", "from_tag": "", "from_user": "", "ruri_user": "", "user_agent": "", "ruri_domain": "" }

adubovikov commented 4 years ago

this means you have to enable X-CID extraction first. or as a ALeg: https://github.com/sipcapture/heplify-server/blob/master/example/homer7_config/heplify-server.toml#L58

or as a custom Header:

https://github.com/sipcapture/heplify-server/blob/master/example/homer7_config/heplify-server.toml#L60

vandykew commented 4 years ago

I know in the non-docker homer 7 I able to add this to the toml file "AlegIDs=["X-CID"]" and this worked

in the docker i have tried

"HEPLIFYSERVER_ALEGIDS=["X-CID"]" "HEPLIFYSERVER_ALEGIDS=X-CID"

adubovikov commented 4 years ago

can you please be sure that you have this X-CID in the message ? @lmangani do we have some special flags for docker component ?

vandykew commented 4 years ago

Yes i can confirm that X-CID is in the message

lukeescude commented 4 years ago

It seems none of the HEPLIFYSERVER_X fields in the docker-compose file are honored - I've opened a similar ticket: https://github.com/sipcapture/homer7-docker/issues/86

vandykew commented 4 years ago

@lmangani Do you have any insight on this ?

lmangani commented 4 years ago

@vandykew @lukeescude thanks for this report and the additional details, will try reproduce this. What docker and compose version are you using?

lmangani commented 4 years ago

@vandykew somehow this seems to work for me, on a slightly older docker release from the latest tho - could kindly you try and echo the ENV within your container?

vandykew commented 4 years ago

I am running the latest

[root@test-voip]# docker exec homer-webapp env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=66f29ea22e7b LOKI_HOST=loki PROM_HOST=prometheus DB_HOST=db DB_USER=root DB_PASS=** HOME=/root

[root@test-voip dirad]# docker exec heplify-server env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=dc6c9c63b154 HEPLIFYSERVER_HEPADDR=0.0.0.0:9060 HEPLIFYSERVER_HEPTLSADDR=0.0.0.0:9060 HEPLIFYSERVER_HEPTCPADDR= HEPLIFYSERVER_DBSHEMA=homer7 HEPLIFYSERVER_DBDRIVER=postgres HEPLIFYSERVER_DBADDR=db:5432 HEPLIFYSERVER_DBUSER=root HEPLIFYSERVER_DBPASS=**** HEPLIFYSERVER_DBDATATABLE=homer_data HEPLIFYSERVER_DBCONFTABLE=homer_config HEPLIFYSERVER_DBROTATE=true HEPLIFYSERVER_DBDROPDAYS=5 HEPLIFYSERVER_LOGLVL=info HEPLIFYSERVER_LOGSTD=true HEPLIFYSERVER_PROMADDR=0.0.0.0:9096 HEPLIFYSERVER_DEDUP=false HEPLIFYSERVER_LOKIURL=http://loki:3100/api/prom/push HEPLIFYSERVER_LOKITIMER=2 HEPLIFYSERVER_ALEGIDS=["X-CID"] HEPLIFYSERVER_FORCEALEGID=true HOME=/root [root@test-voip]#

vandykew commented 4 years ago

@lmangani did you happen to find anything ?

lmangani commented 4 years ago

Trying to resolve this but I cannot replicate it. Could you provide the output of docker logs heplify-server

lukeescude commented 4 years ago

@lmangani I apologize I never got this info from you:

docker --version

Docker version 19.03.6, build 369ce74a3c

docker info

Client: Debug Mode: false

Server: Containers: 9 Running: 9 Paused: 0 Stopped: 0 Images: 9 Server Version: 19.03.6 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 init version: fec3683 Security Options: seccomp Profile: default Kernel Version: 3.10.0-1062.12.1.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.638GiB Name: omitted ID: omitted Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

lmangani commented 4 years ago

This seems to work fine with a string in my test, did not test arrays yet

      - "HEPLIFYSERVER_ALEGIDS=X-CID"