<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">I seem to have an issue getting mid- registrar to work.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">I have opensips with internal iP and fqdn say proxy.sip.domain.com<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">The asterisk/freepbx with pjsip extension at sip.domain.com<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">The two internal networks and dns resolution works fine.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">The extensions can call each other directly through asterisk when linphone domain is sip.domain.com.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">pjsip settings rewrite contact yes, direct media yes, from_domain sip.domain.com.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">When linphone points to sip.domain.com with outbound proxy proxy.sip.domain.com I can call external numbers like cellphones and landlines but cannot reach internal extensions that
 need to go through opensips (ie mobile phones - for push notifications).<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">If from_domain is an ip calls reach (the uac debug shows the Bye received but no ringing occurs) but no ringing occurs so extension eventually goes to voice mail and can leave a
 voice mail.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">One extension can call the other but not vice versa. The extension that can call the other two way audio is fine.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">We have pn enabled = false for now until we can fix call issues period<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">calls do not seem to work at all without using the call dialog module but with the call module the issues above occur.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Here is what we find:<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">if we have opensips<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">socket=udp:10.x.x.x.x:5068 as proxy.sip.domain.com<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">pjsip info above with from_domain=sip.domain.com<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">internal extensions go to voicemail hear ringing from the calling extension but called extension does not ring.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Here is a copy of config with all removed ip and sensitive info - If a function is missing, it is not in the original as opensips does not complain on start.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Can you help me discern the issue. we used dialog only to get from uri for push notifications only when we enable push notifications (which we have disabled for now until we can
 get mid registrar to work)?<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Other info to note: proxy.sip.domain.com, 172.31.11.60 and sip.domain.com is in the domain table. Tried posting config but list complains to big and moderator has yet to approve.
 Here is snippet:  Register works fine.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"></p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
#handle loose routing</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>if (has_totag()) {</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>route(handle_loose_routing);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>exit;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>}<span style="white-space: pre;"> </span></div>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">...<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
if (is_method("INVITE")) {</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>if($avp(usedialog))</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>route(create_dialog);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>do_accounting("log");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>}<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
...<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
if (is_method("INVITE|MESSAGE|NOTIFY")) {</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>route(trace);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("source ip is ($si)\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("source port is ($sp)\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("request uri is ($ru)\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("request uri is ($rp)\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("realm is ($ar)\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("User Agent is ($ua)\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>if(route(is_from_main)){</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("looking up $ru!\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>route(fix_domain);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>mid_registrar_lookup("location", "m");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>$var(rc) = $retcode;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("request uri is now ($ru) after lookup\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("Lookup return code $var(rc)\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>switch ($var(rc)) {</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>case 1:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span># we found at least 1 non-PN contact!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span>$var(do_relay) = true;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span>break;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>case 2:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span># success, but all contacts are PN-enabled, so we're</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span># sending PNs / awaiting re-registrations from them</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span>$var(do_relay) = false;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>$dlg_val(contact_id) = $(tu{uri.param,ctid});</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span>break;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>default:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span>xlog("L_INFO", "DBG: no contacts found ($var(rc))\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span>t_reply(404, "Not Found");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span>exit;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>}</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>if ($var(do_relay) && !t_relay())</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
    <span style="white-space: pre;"></span>send_reply(500, "Internal Server Error");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
        <span style="white-space: pre;"></span>exit;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>} else {</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>#fix linphone missing port issue that causes request time outs if proxy and main registrar port isn't the same</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>if(($(ua{s.substr,0,8}) == "Linphone") || ($(ua{s.substr,0,6}) == "EZ Sip")) {</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("fix linphone missing port issue that causes request time outs if proxy and main registrar port isn't the same");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>route(fix_uac);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>}</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>}</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>}<br>
</div>
...<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
route[handle_loose_routing]{</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span># handle hop-by-hop ACK (no routing required)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>if ( is_method("ACK") && t_check_trans() ) {</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>route(trace);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>t_relay();</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>exit;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>}</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("totag before loose_route ru is $ru");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span># sequential request within a dialog should</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span># take the path determined by record-routing</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>if ( !loose_route() ) {</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span># we do record-routing for all our traffic, so we should not</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span># receive any sequential requests without Route hdr.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>send_reply(404,"Not here");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>exit;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>}<span style="white-space: pre;"> </span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("totag before route relay ruri is $ru and du is $du");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span># Uncomment to enable pn_purr full RFC 8599 support</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>if (!is_method("ACK")){</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>xlog("PN_PROCESS_PURR will be called\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>       async (pn_process_purr("location"), resume_route);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>#if(check_route_param("pn-wake=true"))</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>#<span style="white-space: pre;"> </span>xlog("L_INFO", "[LOG] Manual Push Request arm\n");</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<span style="white-space: pre;"></span>}</div>
<div><br>
​<br>
</div>
<br>
</div>
<div><br>
<br>
</div>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p><br>
</p>
</body>
</html>