VERBOSE[90578][C-0027e6ee]: app_dial.c:935 in do_forward: \ [2019-11-25 09:54:06] \ -- Now forwarding SIP/2765-00559bac \ to 'Local/3135@office' (thanks to SIP/2559-00559bad)
NOTICE[90578][C-0027e6ee]: app_dial.c:958 in do_forward: \ Not accepting call completion offers from call-forward \ recipient Local/3135@office-0014b4ca;1
VERBOSE[109197][C-0027f144]: app_dial.c:935 in do_forward: \ [2019-11-25 12:20:26] \ -- Now forwarding SIP/1888-0055b018 \ to 'Local/7xxx3063600@office' (thanks to SIP/2813-0055b019)
NOTICE[109197][C-0027f144]: app_dial.c:958 in do_forward: \ Not accepting call completion offers from call-forward \ recipient Local/7xxx3063600@office-0014b7e3;1
“thanks to SIP/2559-00559bad” – this is a name of the channel who forwarded the call, either manually or by settings configured in the UAC.
and finally some magic in the script, to add the display-name to the INVITE request from the registered user, going through our OpenSIPS SBC:
# call from registered user -> add callerid # and forward to mediaserver for call recording, etc. if(is_registered("location")) { # replace only display and do not touch uri uac_replace_from("$avp(display)",""); rewritehostport("10.145.213.63:5067"); route(relay); }
The information stored in the ‘rpid’ column (in our example, or some custom in your architecture) is fetched to AVP at each REGISTER/save, so you do not need to reload anything to take changes in effect.
The callerid info is seen in console output via ‘opensipsctl fifo ul_dump’ command:
Some notes how to configure Linphone and Cisco SPA-303 to send INVITE with domain in RURI, assuming that your proxy has a different IP address than the resolved address of the domain.
Let’s imagine that we’ve upgraded our VoIP network which was formerly based on geographically distributed Asterisks.
We configured OpenSIPS servers as registrars, connected them together in a full-sharing usrloc cluster and now we need to route calls between endpoints not directly, but through Asterisks – to handle our calls in a familiar way (CDR records, call recording via MixMonitor, some AGI scripts, etc).
We have to create something like that:
This is a code snippet of OpenSIPS with IP address 10.145.213.63:
# initial INVITE
if(is_method("INVITE") && !has_totag())
{
t_on_failure("1");
# call from registered user ->
# forward to mediaserver for call recording, etc.
if(is_registered("location"))
{
$ru="sip:" + $oU + "@" + "10.145.213.63:5067";
route(relay);
}
# call from Asterisk? -> change domain part before doing lookup
if($sp=="5067")
{
$rd="taxsee.com";
}
$var(lookup_flags) = "m";
if(cluster_check_addr("1", "$si")) {
xlog("si: $si . $rm from cluster, doing local lookup only\n");
} else {
xlog("si: $si . $rm from outside, doing global lookup\n");
$var(lookup_flags) = $var(lookup_flags) + "g";
}
if(!lookup("location", "$var(lookup_flags)"))
{
t_reply("404", "Not Found");
exit;
}
if(has_body("application/sdp"))
{
rtpengine_offer("RTP/AVP replace-origin replace-session-connection ICE=remove");
}
} # initial INVITE end
route(relay);
A SIP peer to this OpenSIPS in Asterisk sip.conf looks like this:
context office
{
_XXX =>
{
NoOp(imagine this is CDR, MixMonitor, AGI);
Dial(SIP/opensips/${EXTEN});
Hangup();
};
};
UPD: assuming your SIP acoounts DB has moved from Asterisk to OpenSIPS cluster, its desirable not just processing REGISTER requests and doing authentication, but also adding caller ids to your SIP accounts.