Open kobaz opened 2 months ago
Also from the log: This looks strange:
1724517904.1801 DEBUG:<90> Net::SIP::Dispatcher::__resolve_uri_final[895]: __resolve_uri_final
1724517904.1802 DEBUG:<100> Net::SIP::Dispatcher::__resolve_uri_final[896]: $VAR1 = [
1724517904.1802 DEBUG:<100> {
1724517904.1802 DEBUG:<100> 'proto' => 'udp',
1724517904.1802 DEBUG:<100> 'port' => 5060,
1724517904.1802 DEBUG:<100> 'family' => 2,
1724517904.1802 DEBUG:<100> 'host' => 'sip.clearip.com',
1724517904.1802 DEBUG:<100> 'addr' => '99.83.142.252',
1724517904.1802 DEBUG:<100> 'prio' => 65536
1724517904.1802 DEBUG:<100> },
1724517904.1802 DEBUG:<100> {
1724517904.1802 DEBUG:<100> 'family' => 2,
1724517904.1802 DEBUG:<100> 'proto' => 'udp',
1724517904.1802 DEBUG:<100> 'port' => 5060,
1724517904.1802 DEBUG:<100> 'prio' => 65536,
1724517904.1802 DEBUG:<100> 'addr' => '52.223.0.89',
1724517904.1802 DEBUG:<100> 'host' => 'sip.clearip.com'
1724517904.1802 DEBUG:<100> },
1724517904.1802 DEBUG:<100> {
1724517904.1802 DEBUG:<100> 'host' => 'sip.clearip.com',
1724517904.1802 DEBUG:<100> 'prio' => 65536,
1724517904.1802 DEBUG:<100> 'family' => 2,
1724517904.1802 DEBUG:<100> 'addr' => '99.83.142.252',
1724517904.1802 DEBUG:<100> 'proto' => 'tcp',
1724517904.1802 DEBUG:<100> 'port' => 5060
1724517904.1802 DEBUG:<100> },
1724517904.1802 DEBUG:<100> {
1724517904.1802 DEBUG:<100> 'addr' => '52.223.0.89',
1724517904.1802 DEBUG:<100> 'proto' => 'tcp',
1724517904.1802 DEBUG:<100> 'port' => 5060,
1724517904.1802 DEBUG:<100> 'prio' => 65536,
1724517904.1802 DEBUG:<100> 'host' => 'sip.clearip.com',
1724517904.1802 DEBUG:<100> 'family' => 2
1724517904.1802 DEBUG:<100> }
1724517904.1802 DEBUG:<100> ];
1724517904.1802 DEBUG:<100>
Why is there four entries now for this lookup, half with tcp and half with udp. My local socket opened is tcp only
I have added a lot of new logging to Net::SIP. I will upload my patch for this as well, as soon as possible.
Also. Notice this in the log (related to the other issue where 'prio' is not found, so the sort() throws warnings in resolve_uri_final
1724517905.2701 DEBUG:<90> Net::SIP::Dispatcher::__resolve_uri_final[912]: __resolve_uri_final resp > 1
1724517905.2701 DEBUG:<90> Net::SIP::Dispatcher::__resolve_uri_final[923]: __resolve_uri_final resp > 1 (We do NOT have prio)
1724517905.2701 DEBUG:<90> Net::SIP::Dispatcher::__resolve_uri_final[924]: $VAR1 = [
1724517905.2701 DEBUG:<90> {
1724517905.2701 DEBUG:<90> 'addr' => '52.223.0.89',
1724517905.2701 DEBUG:<90> 'host' => 'sip.clearip.com',
1724517905.2701 DEBUG:<90> 'family' => 2,
1724517905.2701 DEBUG:<90> 'port' => 5060,
1724517905.2701 DEBUG:<90> 'proto' => undef
1724517905.2701 DEBUG:<90> },
1724517905.2701 DEBUG:<90> {
1724517905.2701 DEBUG:<90> 'host' => 'sip.clearip.com',
1724517905.2701 DEBUG:<90> 'addr' => '99.83.142.252',
1724517905.2701 DEBUG:<90> 'proto' => undef,
1724517905.2701 DEBUG:<90> 'port' => 5060,
1724517905.2701 DEBUG:<90> 'family' => 2
1724517905.2701 DEBUG:<90> }
1724517905.2701 DEBUG:<90> ];
1724517905.2701 DEBUG:<90>
Randomly (not every single run) 'prio' hash field is missing from the list
Unfortunately I cannot associate the log messages with the actual released code in Net::SIP. There seems to be at least added debug messages and maybe more changes. To fully understand the log I would need get the exact source code of (patched) Net::SIP and test program which was used to create the log.
Yes of course. I will be submitting a patch with the new logs added.
But, I figured with the code, plus the logs that you are familiar with... possibly that might help uncover the issue.
Situation: Sending INVITE to sip.clearip.com $ host sip.clearip.com sip.clearip.com has address 52.223.0.89 sip.clearip.com has address 99.83.142.252
Problem: Randomly (one in every 1000 calls roughly), Net::SIP will send an INVITE to EACH A record found for sip.clearip.com, instead of picking one and sending only one INVITE as one would expect.
Using this test code:
Notice this in the log: 1724517905.0212 DEBUG:<2> Net::SIP::Leg::deliver[442]: delivery with tcp from 0.0.0.0 to 99.83.142.252:5060: 1724517905.2815 DEBUG:<2> Net::SIP::Leg::deliver[442]: delivery with tcp from 0.0.0.0 to 52.223.0.89:5060:
One INVITE sent to each A record. But this does not happen every single run! You need hundreds or thousands of calls to run into this situation.
Log attached log.txt