[OpenSIPS-Users] Call issue with mid-registrar - Can't figure out issue

Sugar s.lancret at cpabound.net
Tue Jan 11 22:36:25 UTC 2022


Can someone assist me?
-------- Original message --------From: "s.lancret" <S.LanCret at cpabound.net> Date: 1/8/22  12:46 PM  (GMT-06:00) To: users at lists.opensips.org Subject: [OpenSIPS-Users] Call issue with mid-registrar - Can't figure out	issue 
I seem to have an issue getting mid- registrar to work.



I have opensips with internal iP and fqdn say proxy.sip.domain.com



The asterisk/freepbx with pjsip extension at sip.domain.com



The two internal networks and dns resolution works fine.



The extensions can call each other directly through asterisk when linphone domain is sip.domain.com.

pjsip settings rewrite contact yes, direct media yes, from_domain sip.domain.com.



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).



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.



One extension can call the other but not vice versa. The extension that can call the other two way audio is fine.



We have pn enabled = false for now until we can fix call issues period



calls do not seem to work at all without using the call dialog module but with the call module the issues above occur.



Here is what we find:



if we have opensips

socket=udp:10.x.x.x.x:5068 as proxy.sip.domain.com



pjsip info above with from_domain=sip.domain.com



internal extensions go to voicemail hear ringing from the calling extension but called extension does not ring.



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.



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)?



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.



#handle loose routing

if (has_totag()) {

route(handle_loose_routing);

exit;

} 
...




if (is_method("INVITE")) {

if($avp(usedialog))

route(create_dialog);

do_accounting("log");

}





...



if (is_method("INVITE|MESSAGE|NOTIFY")) {

route(trace);

xlog("source ip is ($si)\n");

xlog("source port is ($sp)\n");

xlog("request uri is ($ru)\n");

xlog("request uri is ($rp)\n");

xlog("realm is ($ar)\n");

xlog("User Agent is ($ua)\n");



if(route(is_from_main)){

xlog("looking up $ru!\n");

route(fix_domain);

mid_registrar_lookup("location", "m");

$var(rc) = $retcode;




xlog("request uri is now ($ru) after lookup\n");

xlog("Lookup return code $var(rc)\n");

switch ($var(rc)) {

case 1:

    # we found at least 1 non-PN contact!

    $var(do_relay) = true;

    break;

case 2:

    # success, but all contacts are PN-enabled, so we're

    # sending PNs / awaiting re-registrations from them

    $var(do_relay) = false;

$dlg_val(contact_id) = $(tu{uri.param,ctid});

    break;

default:

    xlog("L_INFO", "DBG: no contacts found ($var(rc))\n");

    t_reply(404, "Not Found");

    exit;

}









if ($var(do_relay) && !t_relay())

    send_reply(500, "Internal Server Error");




        exit;

} else {



#fix linphone missing port issue that causes request time outs if proxy and main registrar port isn't the same



if(($(ua{s.substr,0,8}) == "Linphone") || ($(ua{s.substr,0,6}) == "EZ Sip")) {

xlog("fix linphone missing port issue that causes request time outs if proxy and main registrar port isn't the same");

route(fix_uac);

}

}

}

...






route[handle_loose_routing]{




# handle hop-by-hop ACK (no routing required)

if ( is_method("ACK") && t_check_trans() ) {

route(trace);

t_relay();

exit;

}



xlog("totag before loose_route ru is $ru");

# sequential request within a dialog should

# take the path determined by record-routing

if ( !loose_route() ) {

# we do record-routing for all our traffic, so we should not

# receive any sequential requests without Route hdr.

send_reply(404,"Not here");

exit;

} 



xlog("totag before route relay ruri is $ru and du is $du");



# Uncomment to enable pn_purr full RFC 8599 support

if (!is_method("ACK")){

xlog("PN_PROCESS_PURR will be called\n");

       async (pn_process_purr("location"), resume_route);

#if(check_route_param("pn-wake=true"))

# xlog("L_INFO", "[LOG] Manual Push Request arm\n");

}

​












-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20220111/2b27ff67/attachment-0001.html>


More information about the Users mailing list