drachtio / drachtio-siprec-recording-server

SIPREC recording server based on drachtio and rtpengine
MIT License
83 stars 34 forks source link

error connecting to rtpengine #27

Open sashasaturn opened 4 years ago

sashasaturn commented 4 years ago

Hi Dave,

I have a feature request. I've noticed that sometimes when RTPEngine is busy and unable to respond to the connection request - the application crashes with an error "error connecting to rtpengine"

Is it possible to add a code that will try to connect to a different RTPEngine server from config or will try to connect to the same RTPEngine server a few more times?

Thanks,

Alex

davehorton commented 4 years ago

I dont have time immediately, but this would be pretty easy. There is a utility function getAvailableRtpengine which already takes the array of configured rtpengines and returns the next one (round robin). In the case of the failure above, it would simply be a matter of calling this function again, checking to see if it is a different IP (as long as there are more than one rtpengine it will be) and then trying again