[Spce-user] Send peer inbound call straight to voicemail
John Murray
john.murray at skyracktelecom.com
Tue Mar 19 19:58:01 EDT 2013
Jon hi,
So I got this fixed.
I modified ROUTE_AUTH as:
route[ROUTE_AUTH]
{
if(allow_trusted("$avp(s:ip)", "$avp(s:proto)"))
{
if(is_avp_set("$avp(s:peer_uuid)/s"))
{
# use tag-column from trusted-table as uuid for this caller
avp_copy("$avp(s:peer_uuid)", "$avp(s:caller_uuid)/d");
NEW ---------> avp_db_query("select username, domain from subscriber where uuid='$avp(S:caller_uuid)'", "$avp(s:caller_username), $avp(s:caller_domain)");
NEW ---------> xlog("L_INFO", "Trusted peer with username '$avp(s:caller_username)' - [% logreq -%]\n");
}
else
{
# if no uuid is set, use "0" as default uuid
$avp(s:caller_uuid) = "0";
}
Then in route[ROUTE_LOAD_CALLER_PREF]:
if($var(forward) == 1 || $var(cf_loop) == 1 || $avp(s:from_faxserver) == 1)
{
$var(pref_domain) = "sip:" + $fU + "@" + $avp(s:acc_caller_domain);
}
else
{
if ($var(from_trusted) != 1)
{
$var(pref_domain) = "sip:" + $fU + "@" + $avp(s:caller_domain);
}
else
{
NEW -------------> $var(pref_domain) = "sip:" + $avp(s:caller_username) + "@" + $avp(s:caller_domain);
#$var(pref_domain) = $fu;
}
Many thanks
John
-----Original Message-----
From: Jon Bonilla (Manwe) [mailto:jbonilla at sipwise.com]
Sent: 19 March 2013 22:33
To: spce-user at lists.sipwise.com
Cc: John Murray
Subject: Re: [Spce-user] Send peer inbound call straight to voicemail
El Mon, 18 Mar 2013 09:33:35 -0000
"John Murray" <john.murray at skyracktelecom.com> escribió:
> Jon,
>
> The problem initially to be authentication.
>
> The PBX is actually a gateway and does not register with SPCE. I need
> to give each gateway subscriber an SPCE subscriber so I use the trusted source model.
> IP address of gateway + userpart of From: field matches the subscriber
> for them to make calls. For calls to the subscriber I have a static
> contact/location pointing at the gateway.
>
> However when a call is put out to the subscriber on the gateway and
> they are not available a call comes in from the gateway to SPCE with
> 'From:' the original caller 'To:' the voicemail number and 'Divert:'
> the subscriber details.
>
> This call is rejected with '407 Proxy Authentication Required' as
> there is no PSTN peer and no trusted source matching the 'From:'
> because the From: is the originating caller in the PSTN.
>
> I cannot add a peer with the gateway's address as in the logic this is
> checked before trusted sources and non of my subscribers are then matched.
>
> Would it not be better to check trusted sources first?
>
>
You could modify the proxy configuration and modify ROUTE_AUTH. There you have the "allow_trusted" function call.
More information about the Spce-user
mailing list