uac_block

#!KAMAILIO
loadmodule "uac.so"
loadmodule "db_sqlite.so"

modparam("uac", "reg_contact_addr", UAC_CONTACT_ADD)

modparam("uac", "reg_db_url", "sqlite:///etc/kamailio/dbs/uac_reg.db")
modparam("uac", "reg_retry_interval", 10)

dispatcher_block

#!KAMAILIO
loadmodule "dispatcher.so"

modparam("dispatcher", "force_dst", 1)
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "xavp_dst", "dsdst")
modparam("dispatcher", "xavp_dst_mode", 0)

modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_ping_interval", 15)
#modparam("dispatcher", "ds_ping_reply_codes", "class=2;class=3;class=4")

modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")

route_block


event_route[dispatcher:dst-down] {
	xlog("L_ERR", "Destination down: $rm $ru ($du)\n");

	$var(status) = uac_reg_status("+91XXX6");
	xlog("L_NOTICE", "+91XXX_state : $var(status)\n\r");
	if(uac_reg_request_to("+91XXX", 0))
		{
			xlog("L_NOTICE", "Found remote user [$rU] on [$rd] via [$du]");
			t_on_failure("REMOTE_AUTH");
			$du="sip:10.*.32.1:5060";
			t_relay();
		}

}
failure_route[REMOTE_AUTH] {
		if ($T_reply_code == 401 or $T_reply_code == 407) {
			xlog("L_NOTICE", "Remote asked for authentication");
			uac_auth();
		}
	}



i am getting following error



17(26) ERROR: <script>: Destination down: OPTIONS sip:10.*.32.1:5060 (<null>)
17(26) NOTICE: <script>: 91XXX_state : 1
17(26) CRITICAL: <core> [core/mem/q_malloc.c:501]: qm_free(): BUG: bad pointer 0x7fa7ec666479 (out of memory block!) called from core: core/action.c: do_action(757) - ignoring
17(26) NOTICE: <script>: Found remote user [91XXX] on [sip.siptrunk.in] via [sip:10.*.33.1:5060]
17(26) INFO: tm [t_lookup.c:1333]: t_newtran(): attempt to create transaction for a faked request - try to avoid it
17(26) NOTICE: tm [t_reply.c:2159]: relay_reply(): dst no longer set - skipped sending the reply out

On Fri, May 26, 2023 at 5:03 PM Ihor Olkhovskyi <igorolhovskiy@gmail.com> wrote:
Hello!

Yes, you can 'loop' outbound registration via self and than - use dispatcher module to send REGISTER accordingly.
For the detection part, you can play with dispatcher event routes - https://kamailio.org/docs/modules/devel/modules/dispatcher.html#idm1090

Le ven. 26 mai 2023 à 12:16, MUSLIH K <muslihk00@gmail.com> a écrit :
Hi,

sip_provider_proxy1[ uac module-register] ---> kamailio [dispatcher Module]  ----> Asterisk1
                                                                                                                               ----> Asterisk 2

in my configuration kamailio register to the sip provider using uac module, sip information are stored in database (uacreg).

when a incoming call(INVITE) come to kamailio it will dispatch call to Asterisk using "dispatcher module".

Here i have couple of questions 

1.  If my SIP provider has a secondary proxy as a failover server (sip_provider_proxy2), can I configure Kamailio with the uac module to use the secondary proxy if the primary proxy fails?
2. Since my application is inbound-only, registration failure is only identified when the registration expires (3600 seconds = 1 hour). Can I use the dispatcher module to select the SIP proxy and switch the registration to the secondary proxy if the primary proxy is not reachable (using OPTIONS)?

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:


--
Best regards,
Ihor (Igor)
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe: