Hi Henning,


The script already does that. As seen at lines 380-382 here:

https://github.com/kamailio/kamailio/blob/master/src/modules/smsops/examples/kamailio.cfg


...

$var(uri) = "sip:"+$avp(to)+"@"+DOMAIN;

if (reg_fetch_contacts("location", "$var(uri)", "caller")) {

...


I even printed the value of $var(uri) to the log to make sure it was correct, and it was! ("sip:bob@ims.mnc001.mcc001.3gppnetwork.org")*


I'm still perplexed.


Any idea which would help resolve the problem would be greatly appreciated.


Regards,

Mohammad


*actually I have changed the mnc and mcc numbers here


On 11/13/2023 12:36 PM, Henning Westerholt wrote:
Hello,

I think you could just give the proper URI with domain part in the variable, according to the documentation:
https://kamailio.org/docs/modules/5.5.x/modules/ims_registrar_scscf.html#idm356

Cheers,

Henning

-----Original Message-----
From: Mohammad Hossein Ahmadi via sr-users <sr-users@lists.kamailio.org>
Sent: Mittwoch, 8. November 2023 14:03
To: sr-users@lists.kamailio.org
Cc: Mohammad Hossein Ahmadi <m.ahmadi@sinacomsys.com>
Subject: [SR-Users] Inconsistent behavior between reg_fetch_contacts
(registrar module) and reginfo_handle_notify (pua_reginfo module)?

Hello everyone,

I have previously set up Kamailio 5.7.2 IMS configuration (including P-CSCF, S-
CSCF and I-CSCF) and successfully made voice calls. Now I'm trying to set up
an IP-SM-GW AS using the example here (with some tweaks):
https://github.com/kamailio/kamailio/blob/master/src/modules/smsops/exa
mples/kamailio.cfg
Currently I'm trying to send the SMS using a SIP software client (MicroSIP).

The problem is, while the SMS is received at the AS and stored in the database,
it does not send it to the callee.

While troubleshooting the problem, I've found that
reg_fetch_contacts("location", "$var(uri)", "caller") in route[SEND_SMS]
cannot find the contact which was added by
reginfo_handle_notify("location") in route[NOTIFY] in the usrloc database. By
tracing the problem more, I've found that reginfo_handle_notify (when
handling reg event NOTIFY) adds the complete AoR in the "username" field in
the location table, e.g. as "bob@ims.mnc001.mcc001.3gppnetwork.org". But
reg_fetch_contacts (when trying to send the SMS) looks up the table using
only the user part in the "username" field, e.g. "bob". So it cannot find the
callee contact and the configuration assumes the callee is still not registered;
so it tries to send out a SUBSCRIBE every time it tries to send an SMS to the
callee, instead of actually sending the SMS.

Does anybody have any idea on what could have caused this inconsistent
behavior between reginfo_handle_notify and reg_fetch_contacts?
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe
send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the
sender!
Edit mailing list options or unsubscribe: