[OpenSIPS-Users] uac_replace_from i'm doing something wrong..

Michele Pinassi michele.pinassi at unisi.it
Thu Feb 23 04:51:32 EST 2017


Hi all,

i need to remap "from" number prior to send call to a ToIP trunk

In my route[toip] i wrote:

route[toip] {
    xlog("L_INFO","$ci - Route via TOIP from $fU to $tU (RURI: $ru)\n");

    if (is_method("INVITE")) {
    setflag(DB_FLAG);
    setflag(ACC_DO); # do accounting
    }

    if($fU=~"6[0-9]{3}$")  {
    # Change all 6xxx to 05771530xxx 
uac_replace_from("05771530"+$(fU{s.substr,1,0}),"sip:05771530"+$(fU{s.substr,1,0})+"@"+$Ri);
append_hf("P-Asserted-Identity:
<sip:05771530"+$(fU{s.substr,1,0})+"@"+$Ri+">\r\n");
    }   

    if(route_to_carrier("toip")) {
        t_on_failure("next_gw");
        t_relay();
        exit;
    }
}

but i got an error. Maybe i'm doing somewthing wrong with number
manipulation.

Suggestions how i can do the same thing in a more elegant manner are
welcome !

Thanks for any help, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - centralino at unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di Ateneo, http://www.faq.unisi.it 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.opensips.org/pipermail/users/attachments/20170223/40b5a643/attachment.sig>


More information about the Users mailing list