[OpenSIPS-Users] Authentication problem with softphone X-Lite
mmarzuola at interfree.it
mmarzuola at interfree.it
Thu Dec 11 11:08:19 CET 2008
I want that all INVITE created by a local subscriber should be authenticated by my proxy.
I have installed more softphones in the same machine and the port number is automatically assigned (5060/5061/5062).
Sniffing the traffic I have realized that only some INVITE are authenticated.
By analyzing the headers of the INVITE not authenticated, I have noticed that the softphone X-Lite inserts in the From the number of port in addition to URI (sip:user at domain.com:port).
In the opensips.cfg the lines that allow authentication of these messages are in the main route:
if (!(method=="REGISTER") && from_uri==myself)
{
if (!proxy_authorize("", "subscriber")) {
proxy_challenge("", "0");
exit;
}
if (!check_from()) {
sl_send_reply("403","Forbidden auth ID");
exit;
}
consume_credentials();
# caller authenticated
}
Obviously the control "from_uri==myself" does not work for INVITE that have the from URI with the port number.
I tried to use the uac_replace_from(uri) function of the uac module to change the uri of the From by removing the port:
if(is_method("INVITE") && $(fu{s.select,2,:})!="") {
$avp(s:fromURI)="sip:"+$(fu{s.select,1,:});
uac_replace_from("$avp(s:fromURI)");
}
if (!(method=="REGISTER") && from_uri==myself) {
**
**
**
But in this way only the from uri of the INVITE ranging from proxy to an end-system have changed the uri while those departing from softphone remain unchanged.
Is a limitation of the uac module or I make a configuration error?
I also tried to make the comparison between the avp variable created and myself, but I get the error syslog:
CRITICAL:core:comp_scriptvar: invalid operation 20/11
opensips-lab /usr/local/sbin/opensips[2655]: WARNING:core:do_action: error in expression (l=296)
I tried to replace == with =~ but I get a syntax error.
"myself" allow to make the comparison with a string or is there a way to make this comparison?
Thank you in advance.
Marzuola Matteo.
----------------------------------------------------------------------------
Vuoi essere presente online?
Vuoi dare voce alla tua attivita`?
Acquista un dominio su domini.interfree.it.
A partire da 18,59 euro
----------------------------------------------------------------------------
More information about the Users
mailing list