help. execution in event_route takes too much time

Сергей Приймак via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <CAKsmdEPqnBtFb3Ey2BwW6ujjYruu_9Jt9j5p_2yD_=fA2xW5yA@mail.gmail.com>
   - kamailio version version: kamailio 6.0.1 (x86_64/linux) fce50d
   - operating system where server is running: Linux Ubuntu 24
   - CPU architecture of the system - 1 CPU
   - error log messages from syslog - no errors
   - if there is a coredump file, use gdb to extract the following:
   - information about when it happens:
   -
      - at startup
      - at shutdown
      - at runtime: - permanently

============= ISSUE DESCRIPTION ===============

In case of event below, script execution takes too much time (40 sec):



*event_route[dispatcher:dst-down] {exec_msg("/bin/bash -c
'/usr/local/etc/kamailio/ipassign.sh &'");}*

In case I run this script from shell it takes ~2 sec.

-----------------------------------------------------------------------------------------------
Configs attached.

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
ipassign.sh (text/x-sh, 780 B)
#!/bin/bash

EIP="3.220.4.142"
PVP="172.31.91.20"
REGION="us-east-1"
# === Получаем текущий instance-id ===
INSTANCE_ID="i-0b62ac3ad67244297"
# === Получаем AllocationId по IP ===
ALLOCATION_ID="eipalloc-05366afe62200c011"
# Network interface id
ENI="eni-04cee963f1ca34ac3"

# === Привязываем EIP к instance ===
aws ec2 associate-address \
  --instance-id "$INSTANCE_ID" \
  --allocation-id "$ALLOCATION_ID" \
  --region "$REGION"

# Назначаем приватный IP через ENI
  aws ec2 assign-private-ip-addresses \
    --network-interface-id $ENI \
    --private-ip-addresses $PVP \
    --allow-reassignment \
    --region "$REGION"

#Назначаем локальный IP на интерфейс
ip addr add $PVP/20 dev enX0
kamailio.cfg (application/octet-stream, 30.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.