Search code examples
opensips

what mi_command is used to get server time and date in opensips?


How can I get server date and time in Opensips,through MI_commands and how can I calculate call duration in Opensips??

$message= ":dlg_list_ctx:\n\n"

thanks


Solution

  • At script level, you can print the current time with $Ts (Unix timestamp).

    Additional information about the current server time can be fetched with:

    opensipsctl fifo uptime
    

    From what I see, you are trying to write a script that monitors the duration of all your calls. For this, you could use the timestart:: field of opensipsctl fifo dlg_list_ctx and figure out the duration of that call.