Hello. I have construction Asterisk --> Kamailio --> Providers
My provisers registered with UAC modure and stored at UACREG table.
Problem scenario is:
I ring from asterisk to provider
Asterisk --> Kamailio --> Providers
Call from asterisk come to kamailio with
furi(Asterisk_clinet_local_number@asterisk)
turi(external_number@kamailio)
Then, to forward INVITE to provider that Needed I use some manipulations to
choose provider (it does not matter, it is only sql_queryes to some
tables), and then modify invite with this code:
#$var(prov) - my.provider.ip
#$var(trunk) - name_of_trunk
uac_replace_from("sip:$var(trunk)@$var(prov)");
$rd=$var(prov);
$rp="5060";
$td=$var(prov);
remove_hf("Contact");
append_hf("Contact:<$var(trunk)@my.kamailio.domain:5068>\n","Contact");
#Then I get from database varibles to set it at failure route whet it needs
to auth
#modparam("uac","auth_realm_avp","$avp(s:realm)")
#modparam("uac","auth_username_avp","avp(s:uname)")
#modparam("uac","auth_password_avp","$avp(s:passwd))")
sql_pvquery("ca","select auth_username, auth_password, realm from uacreg
where auth_username='$var(trunk)'","$avp(uname), $avp(passwd),
$avp(realm)");
So -after this manipulation I have write packet, that goes to my provider.
Then Provier sends me 407 answer and packet goes to failure_route
if (t_check_status("401|407")){
xlog("L_INFO", "Reply from provider on failure: $rs");
pv_printf("$avp(s:uname)","$var(uname)");
pv_printf("$avp(s:passwd)","$var(passwd)");
pv_printf("$avp(s:realm)","$var(realm)");
avp_print();
uac_auth();
xlog("L_INFO", "UAC_AUTH(): $rs");
t_relay();
}
After that Call fails. When I look at at syslog I see that avp parametrs
succesfull sets: INFO: avpops [avpops_impl.c:1484]: ops_print_avp():
p=0x7f63acec0650, flags=0x0113 INFO: avpops [avpops_impl.c:1488]:
ops_print_avp(): #011#011#011name=<realm> INFO: avpops
[avpops_impl.c:1496]: ops_print_avp(): #011#011#011val_str=<0 / 1> INFO:
avpops [avpops_impl.c:1484]: ops_print_avp(): p=0x7f63acebe1a8,
flags=0x0113 INFO: avpops [avpops_impl.c:1488]: ops_print_avp():
#011#011#011name=<passwd> INFO: avpops [avpops_impl.c:1496]:
ops_print_avp(): #011#011#011val_str=<0 / 1> INFO: avpops
[avpops_impl.c:1484]: ops_print_avp(): p=0x7f63ace697a8, flags=0x0113 INFO:
avpops [avpops_impl.c:1488]: ops_print_avp(): #011#011#011name=<uname>
INFO: avpops [avpops_impl.c:1496]: ops_print_avp(): #011#011#011val_str=<0
/ 1> INFO: avpops [avpops_impl.c:1484]: ops_print_avp(): p=0x7f63acec0240,
flags=0x0113 INFO: avpops [avpops_impl.c:1488]: ops_print_avp():
#011#011#011name=<realm> INFO: avpops [avpops_impl.c:1496]:
ops_print_avp(): #011#011#011val_str=<my.provider.com / 15> INFO: avpops
[avpops_impl.c:1484]: ops_print_avp(): p=0x7f63acec0308, flags=0x0113 INFO:
avpops [avpops_impl.c:1488]: ops_print_avp(): #011#011#011name=<passwd>
INFO: avpops [avpops_impl.c:1496]: ops_print_avp():
#011#011#011val_str=<mYPa$$wd / 8> INFO: avpops [avpops_impl.c:1484]:
ops_print_avp(): p=0x7f63acea3d40, flags=0x0113 INFO: avpops
[avpops_impl.c:1488]: ops_print_avp(): #011#011#011name=<uname> INFO:
avpops [avpops_impl.c:1496]: ops_print_avp(): #011#011#011val_str=<myTrunk/
16>
But Next I see:
ERROR <script> : AUTH_UAC(): <null>
As I see AUTH_UAC() don`t want to set Auth parameters.
My question is Why?
Thanks!