[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openser-users
Subject:    [SR-Users] Re: Knowing about the uac module with primary and secondary proxy setting
From:       MUSLIH K <muslihk00 () gmail ! com>
Date:       2023-05-31 6:22:42
Message-ID: CAEPUy3GC5b+33X_AqdF+OFWViZG+3YMPuaoAiF=M8d2KsZa6UA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


*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:
>

[Attachment #5 (text/html)]

<div dir="ltr"><p dir="auto" \
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(31,35,40);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe \
UI&quot;,&quot;Noto Sans&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color \
Emoji&quot;,&quot;Segoe UI Emoji&quot;;font-size:14px"><b>uac_block</b></p><div \
class="gmail-snippet-clipboard-content gmail-notranslate gmail-position-relative \
gmail-overflow-auto" \
style="box-sizing:border-box;color:rgb(31,35,40);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe \
UI&quot;,&quot;Noto Sans&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color \
Emoji&quot;,&quot;Segoe UI Emoji&quot;;font-size:14px;overflow:auto"><pre \
class="gmail-notranslate" \
style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;padding:16px;overflow:auto;line-height:1.45;border-radius:6px"><code \
class="gmail-notranslate" \
style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;padding:0px;margin:0px;background:transparent;bo \
rder-radius:6px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit">#!KAMAILIO
 loadmodule &quot;uac.so&quot;
loadmodule &quot;db_sqlite.so&quot;

modparam(&quot;uac&quot;, &quot;reg_contact_addr&quot;, UAC_CONTACT_ADD)

modparam(&quot;uac&quot;, &quot;reg_db_url&quot;, \
&quot;sqlite:///etc/kamailio/dbs/uac_reg.db&quot;) modparam(&quot;uac&quot;, \
&quot;reg_retry_interval&quot;, 10)

</code></pre></div><p dir="auto" \
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(31,35,40);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe \
UI&quot;,&quot;Noto Sans&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color \
Emoji&quot;,&quot;Segoe UI \
Emoji&quot;;font-size:14px"><b>dispatcher_block</b></p><div \
class="gmail-snippet-clipboard-content gmail-notranslate gmail-position-relative \
gmail-overflow-auto" \
style="box-sizing:border-box;color:rgb(31,35,40);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe \
UI&quot;,&quot;Noto Sans&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color \
Emoji&quot;,&quot;Segoe UI Emoji&quot;;font-size:14px;overflow:auto"><pre \
class="gmail-notranslate" \
style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;padding:16px;overflow:auto;line-height:1.45;border-radius:6px"><code \
class="gmail-notranslate" \
style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;padding:0px;margin:0px;background:transparent;bo \
rder-radius:6px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit">#!KAMAILIO
 loadmodule &quot;dispatcher.so&quot;

modparam(&quot;dispatcher&quot;, &quot;force_dst&quot;, 1)
modparam(&quot;dispatcher&quot;, &quot;flags&quot;, 2)
modparam(&quot;dispatcher&quot;, &quot;xavp_dst&quot;, &quot;dsdst&quot;)
modparam(&quot;dispatcher&quot;, &quot;xavp_dst_mode&quot;, 0)

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

modparam(&quot;dispatcher&quot;, &quot;list_file&quot;, \
&quot;/etc/kamailio/dispatcher.list&quot;) </code></pre></div><p dir="auto" \
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(31,35,40);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe \
UI&quot;,&quot;Noto Sans&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color \
Emoji&quot;,&quot;Segoe UI Emoji&quot;;font-size:14px"><b>route_block</b></p><div \
class="gmail-snippet-clipboard-content gmail-notranslate gmail-position-relative \
gmail-overflow-auto" \
style="box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe \
UI&quot;,&quot;Noto Sans&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color \
Emoji&quot;,&quot;Segoe UI Emoji&quot;;font-size:14px;overflow:auto"><pre \
class="gmail-notranslate" \
style="color:rgb(31,35,40);box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;padding:16px;overflow:auto;line-height:1.45;border-radius:6px"><code \
class="gmail-notranslate" \
style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;padding:0px;margin:0px;background:transparent;bo \
rder-radius:6px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit">
 event_route[dispatcher:dst-down] {
	xlog(&quot;L_ERR&quot;, &quot;Destination down: $rm $ru ($du)\n&quot;);

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

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



</code></pre><pre class="gmail-notranslate" \
style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;padding:16px;overflow:auto;line-height:1.45;border-radius:6px"><code \
class="gmail-notranslate" \
style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;padding:0px;margin:0px;background-image:initial; \
background-position:initial;background-size:initial;background-repeat:initial;backgrou \
nd-origin:initial;background-clip:initial;border-radius:6px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit"><b \
style=""><span style="background-color:rgb(255,255,255)"><font color="#ff0000">i am \
getting following error</font></span><font color="#1f2328"> </font></b><font \
color="#1f2328">


</font><pre class="gmail-notranslate" \
style="color:rgb(31,35,40);background-color:transparent;box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;padding:16px;overflow:auto;line-height:1.45;border-radius:6px"><code \
class="gmail-notranslate" \
style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,&quot;SF \
Mono&quot;,Menlo,Consolas,&quot;Liberation \
Mono&quot;,monospace;font-size:11.9px;padding:0px;margin:0px;background:transparent;bo \
rder-radius:6px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit">17(26) \
ERROR: &lt;script&gt;: Destination down: OPTIONS sip:10.*.32.1:5060 (&lt;null&gt;) \
17(26) NOTICE: &lt;script&gt;: 91XXX_state : 1 17(26) CRITICAL: &lt;core&gt; \
[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: \
&lt;script&gt;: Found remote user [91XXX] on [<a \
href="http://sip.siptrunk.in">sip.siptrunk.in</a>] 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</code></pre><font color="#1f2328">


</font></code></pre></div></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Fri, May 26, 2023 at 5:03 PM Ihor Olkhovskyi &lt;<a \
href="mailto:igorolhovskiy@gmail.com">igorolhovskiy@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div \
dir="ltr"><div>Hello!<br><br></div><div>Yes, you can &#39;loop&#39; outbound \
registration via self and than - use dispatcher module to send REGISTER accordingly. \
<br></div><div>For the detection part, you can play with dispatcher event routes - <a \
href="https://kamailio.org/docs/modules/devel/modules/dispatcher.html#idm1090" \
target="_blank">https://kamailio.org/docs/modules/devel/modules/dispatcher.html#idm1090</a></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">Le  ven. 26 mai 2023 Ã   12:16, \
MUSLIH K &lt;<a href="mailto:muslihk00@gmail.com" \
target="_blank">muslihk00@gmail.com</a>&gt; a écrit  :<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div \
dir="ltr">Hi,<div><br></div><div><b>sip_provider_proxy1[</b> uac module-register] \
---&gt; <b>kamailio</b> [dispatcher Module]   ----&gt; <b>Asterisk1</b></div><div>    \
----&gt; <b>Asterisk 2</b></div><div><br></div><div>in my configuration kamailio \
register to the sip provider using <b>uac module</b>, sip information are stored in \
database (uacreg).</div><div><br></div><div>when a incoming call(INVITE) come to \
kamailio it will dispatch call to Asterisk using<b> &quot;dispatcher \
module&quot;.</b></div><div><b><br></b></div><div>Here i have couple of questions  \
</div><div><br></div><div>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?<br></div><div>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)?</div><div><div style="border-width:0px 0px \
1px;border-style:solid;border-color:rgba(0,0,0,0.1);box-sizing:border-box;width:1098px;font-family:Söhne,ui-sans-serif,system-ui,-apple-system,&quot;Segoe \
UI&quot;,Roboto,Ubuntu,Cantarell,&quot;Noto Sans&quot;,sans-serif,&quot;Helvetica \
Neue&quot;,Arial,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe \
UI Symbol&quot;,&quot;Noto Color Emoji&quot;;font-size:14px"><div style="border:0px \
solid rgb(217,217,227);box-sizing:border-box;margin:auto;display:flex;padding:1.5rem \
0px;font-size:1rem;line-height:1.5rem;max-width:48rem"><div style="border:0px solid \
rgb(217,217,227);box-sizing:border-box;display:flex"><div style="border:0px solid \
rgb(217,217,227);box-sizing:border-box"><div style="border:0px solid \
rgb(217,217,227);box-sizing:border-box;margin-top:0px;display:flex;padding-left:0.5rem"><button \
style="border-width:0px;border-style:solid;border-color:rgb(217,217,227);font-family:inherit;font-size:16px;font-weight:inherit;line-height:inherit;margin:0px \
0px 0px auto;padding:0.25rem;background-image:none;display:flex;border-radius:0.375rem"></button><div \
style="border:0px solid rgb(217,217,227);box-sizing:border-box;display:flex"><button \
style="border-width:0px;border-style:solid;border-color:rgb(217,217,227);font-family:i \
nherit;font-size:16px;font-weight:inherit;line-height:inherit;margin:0px;padding:0.25rem;background-image:none;border-radius:0.375rem"></button><button \
style="border-width:0px;border-style:solid;border-color:rgb(217,217,227);font-family:i \
nherit;font-size:16px;font-weight:inherit;line-height:inherit;margin:0px;padding:0.25r \
em;background-image:none;border-radius:0.375rem"></button></div></div></div></div></div></div><br></div><div></div></div>
 __________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
To unsubscribe send an email to <a href="mailto:sr-users-leave@lists.kamailio.org" \
                target="_blank">sr-users-leave@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the \
sender!<br> Edit mailing list options or unsubscribe:<br>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- \
</span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Best \
regards,<div>Ihor (Igor)<br></div></div></div> \
__________________________________________________________<br> Kamailio - Users \
Mailing List - Non Commercial Discussions<br> To unsubscribe send an email to <a \
href="mailto:sr-users-leave@lists.kamailio.org" \
                target="_blank">sr-users-leave@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the \
sender!<br> Edit mailing list options or unsubscribe:<br>
</blockquote></div>



__________________________________________________________
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:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic