homer7-docker icon indicating copy to clipboard operation
homer7-docker copied to clipboard

HEPLIFYSERVER_ALEGIDS not working

Open vandykew opened this issue 4 years ago • 24 comments

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

I have tried it a few ways and it now working

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

any other ideas ?

vandykew avatar Aug 18 '20 01:08 vandykew

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 avatar Aug 18 '20 06:08 adubovikov

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

adubovikov avatar Aug 18 '20 06:08 adubovikov

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 avatar Aug 18 '20 12:08 vandykew

Also iI noticed you said asterix however im using freeswitch

vandykew avatar Aug 18 '20 12:08 vandykew

Also I have

"HEPLIFYSERVER_FORCEALEGID=true"

vandykew avatar Aug 18 '20 12:08 vandykew

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

adubovikov avatar Aug 18 '20 12:08 adubovikov

This is not working either

vandykew avatar Aug 18 '20 13:08 vandykew

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

adubovikov avatar Aug 18 '20 13:08 adubovikov

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

vandykew avatar Aug 18 '20 13:08 vandykew

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

adubovikov avatar Aug 18 '20 13:08 adubovikov

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": "" }

vandykew avatar Aug 18 '20 14:08 vandykew

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

adubovikov avatar Aug 18 '20 14:08 adubovikov

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"

vandykew avatar Aug 18 '20 14:08 vandykew

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

adubovikov avatar Aug 18 '20 14:08 adubovikov

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

vandykew avatar Aug 18 '20 14:08 vandykew

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

lukeescude avatar Aug 18 '20 19:08 lukeescude

@lmangani Do you have any insight on this ?

vandykew avatar Sep 03 '20 13:09 vandykew

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

lmangani avatar Sep 03 '20 14:09 lmangani

@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?

lmangani avatar Sep 10 '20 11:09 lmangani

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 avatar Sep 10 '20 13:09 vandykew

@lmangani did you happen to find anything ?

vandykew avatar Sep 23 '20 14:09 vandykew

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

lmangani avatar Sep 29 '20 09:09 lmangani

@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

lukeescude avatar Oct 29 '20 20:10 lukeescude

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

      - "HEPLIFYSERVER_ALEGIDS=X-CID"

lmangani avatar Oct 29 '20 22:10 lmangani