SIP trunk in realtime DB

Hello experts,

I have the following strange (maybe normal ?) issue since i “converted” my SIP devices to realtime DB:

I send all calls as default to a “notinservice” context. Calls coming in from a SIP trunk get directed to a “from-sip” context.
Now since i use realtime (with cachefriends e.t.c.) my “sip show peers” is empty after an asterisk reload, as expected. What happens is that incoming calls get then directed to the “notinservice” context. As soon as i dial out once on that same trunk, it shows up in “sip show peers” and is cached. Then, while the SIP peer is cached, incoming calls do work without problems.

Is there a workaround, or must trunks stay in classic config files ?


Why don’t you just lower the registration interval (maxexpiry + defaultexpiry) down to 60secs ? The default 3600secs is apparently not working too well for you :wink:

Sorry thor, but i do not understand what this would change ?

My sip trunks are registered on my providers server, else i would not receive any incoming call at all because the provider’s server would not know my actual dynamic IP address. An sip show registry shows the line is well registered. Only sip show peers does not show my sip trunks as long as i did never make an outbound call on them …

But registering my trunk on my provider’s server does not fill the SIP device cache on my local asterisk. That “sip peers” cache is apparently only filled if local devices (aka phones) register to my asterisk server, or if i make an outbound call to my sip provider. Only registering to my SIP provider does not write anything in my local sip peer cache …

And as long as my SIP trunk numbers (means my DID phonenumbers) do not show up in sip peer cache the inbound calls are not directed to the context specified in trunk configuration, but to general SIP trunk meant for anonymous inbound sip requests … (for security)

Sorry, did not quite understand your problem. Pls disregard :unamused: