Comparison Of PJSIP And SIP In Asterisk Database
Hello,
I’m currently trying to configure a passive Asterisk instance that must backup an active Asterisk instance. Each instance is connected this way:
PSTN <---> Gateway <-- SIP --> Asterisk <-- SIP --> endpoints or IPBXs
Most endpoints connect through registration.
With chan_sip, Asterisk saved registration data in its database with lines such as:
/SIP/Registry/spa3102 : 192.168.64.207:5060:
3600:7013:sip:spa3102@192.168.64.207:5060
Reading such lines in active instance and copying them back in passive instance, I think you had a mean to have a passive instance ready to treat calls coming from PSTN as soon as it would become active (I never experimented with this).
Now, with PJSIP, Asterisk saves registration data with lines such as :
/registrar/contact/foobar: {“via_addr”: … }
Have you tried to copy such registration data from one instance to an aother one ?
What happened then ?
Best regards
One thought on - Comparison Of PJSIP And SIP In Asterisk Database
Well…….
First, you should probably just use a database that is not running on the same instance as Asterisk. You’re assuming that when Asterisk dies on an instance that it’s only Asterisk that is having a problem – in more critical failures, the AstDB (SQLite3) is going to be long gone as well. In less critical (but still severe) failures, Asterisk will probably just be restarted via safe_asterisk or something similar. With an external database such as MySQL/PostreSQL, you can have one instance of Asterisk store the registration information in the database (using Sorcery/realtime), and, if it dies, have a spare start up and use the same database for its backing storage. It will pick up the registration information, endpoint objects, etc.
That being said: yes, if you can find a way to get that JSON blob from one AstDB into another – and yes, there are ways that are sneaky but mostly involve shenanigans and/or custom code – than a second instance of Asterisk will understand and read that JSON just fine. Assuming it was told to get that information from its AstDB via Sorcery as well.