[OpenSIPS-Users] Registered trunks

Mike Tesliuk mike at wsu.com.br
Mon Jul 24 22:10:01 EDT 2017


Hello Pat,


I think that you can ask them to set the From Name as the callerid so
you can use transformation to take de information [1]


Example:

                xlog("FROM NAME: $(hdr(From){nameaddr.name})");
                xlog("FROM USER: $fU");

       

Result (on log):


l 24 22:06:51 opensipsHomolog2 /usr/local/sbin/opensips[7960]: FROM
NAME: "1016"
Jul 24 22:06:51 opensipsHomolog2 /usr/local/sbin/opensips[7960]: FROM
USER: 101600000393



After the authentication you can use the uac_replace_from[2] and change
the callerid that you send you carriers.



[1] - https://www.opensips.org/Documentation/Script-Tran-2-2
[2] - http://www.opensips.org/html/docs/modules/devel/uac.html#idp5265536


Em 24/07/17 21:32, Pat Burke escreveu:
> Hello,
>
> As a SIP Provider, we implementing the ability to provide SIP trunks
> to customers with a PBX or Dialer that require Registration.  With
> this in mind,
> the customer wants to be able to set the CallerID on at least on the
> basis of the devices connected tho them, but potentially on a per call
> basis.
>
> For the challenge-response to the non-Register methods, we have
> implemented the script as follows (seems to be a very standard way). 
> My question is
> for the case of the CallerID not being the same as the
> username/authorization name, how do we do this?  Because the "FROM"
> user is different from the
> authorized user, the db_check_from fails.  I don't believe all phone
> systems support P-Asserted-ID, so we can't really go that route.  So
> can we just remove
> the "db_check_from"?   What risk does that expose us to?
>
> if ( !(is_method("REGISTER")) ) {
>   if (is_from_local("$var(reg_domain_attr)")) { # from Registered device
>       $avp(callee_number_type) := "Registered";
>
>       # authenticate if from local subscriber
>       # authenticate all initial non-REGISTER request that pretend to be
>       # generated by local subscriber (domain from FROM URI is local)
>       if (!proxy_authorize("", "subscriber")) {
>          proxy_challenge("", "0");
>          exit;
>       }
>
>       if (!db_check_from()) {
>          sl_send_reply("403","Forbidden auth ID");
>          exit;
>       }
>
>       consume_credentials();
>       # caller authenticated
>    }
> }
> Regards,
> *Pat Burke*
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-- 


​Atenciosamente,
WSU TECNOLOGIA
Mike Tesliuk
Rua Visconde do Rio Branco 1630 . Sala 1302 . Curitiba . PR  
12387 SW 125th ter, Miami, Florida 33186 - USA
tel +55 (41) 3941.0650   +1 (786) 719.6253
*website <http://www.wsu.com.br/>  |  mapa
<https://www.google.com.br/maps/place/WSU+Tecnologia/@-25.4354389,-49.2779048,17z/data=%213m1%214b1%214m2%213m1%211s0x94dce473a24cf705:0x369fdf05247b568b?hl=pt-BR>  |  email
<mailto:contato at wsu.com.br>    *
.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170724/50f0d6c8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: OpenPGP digital signature
URL: <http://lists.opensips.org/pipermail/users/attachments/20170724/50f0d6c8/attachment.sig>


More information about the Users mailing list