Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linekey xml_curl auth issue #2670

Open
atidot3 opened this issue Dec 20, 2024 · 0 comments
Open

Linekey xml_curl auth issue #2670

atidot3 opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@atidot3
Copy link

atidot3 commented Dec 20, 2024

When using xml_curl to auth challenge i'm facing a strange behavior.

To auth a user with sip_auth_method REGISTER i'm receiving:
action=sip_auth
user= my_user
domain=my_domain
sip_auth_method=REGISTER

And i can auth my_user without any issue and return:

<document type="freeswitch/xml">
<section name="directory">
<domain name="192.168.10.191">
<params>
<param name="dial-string" value="{^^:sip_invite_domain=${dialed_domain}:presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(*/${dialed_user}@${dialed_domain})}"/>
</params>
<variables>
<variable name="user_context" value="public"/>
</variables>
<groups>
<group name="192.168.10.191">
<users>
<user id="my_user" cacheable="300000">
<params>
<param name="password" value="admin"/>
</params>
</user>
</users>
</group>
</groups>
</domain>
</section>
</document>

Note i have set 300000 to cacheable to avoid spamming from xml_curl.

Now my phone have a line key for the account 888.
I'm receiving:
action=sip_auth
user=my_user
sip_auth_method=SUBSCRIBE
sip_to_user=888

User 888 doesnt exist our system so i'm sending the not found body in order to turn the LED grey:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="result">
<result status="not found" />
</section>
</document>

After few times the linekey 888 will turn now GREEN as freeswitch remember i respond for the auth request (register) on my_user ok and cachaeble 300000.

If i do not set cacheable the led will work as intended and never goes GREEN AS freeswitch will authentificate my_user and 888 everytime it need it and he wont start the mixmatch issue described.

The issue i understand here is that freeswitch do not look at the auth_method used to 'remember' on cacheable that the SUBSCRIBE request is not the same as the REGISTER and considere 888 online as the event values were mostly the same user=my_user.

More details:

REGISTER:
hostname=portable107-LIN section=directory tag_name=domain key_name=name key_value=192.168.10.191 Event-Name=REQUEST_PARAMS Core-UUID=4557a4ef-7578-49e1-b5ce-b5c8b932dd1b FreeSWITCH-Hostname=portable107-LIN FreeSWITCH-Switchname=portable107-LIN FreeSWITCH-IPv4=172.16.23.7 FreeSWITCH-IPv6=::1 Event-Date-Local=2024-12-20 11:18:57 Event-Date-GMT=Fri, 20 Dec 2024 10:18:57 GMT Event-Date-Timestamp=1734689937593340 Event-Calling-File=sofia_reg.c Event-Calling-Function=sofia_reg_parse_auth Event-Calling-Line-Number=3124 Event-Sequence=36152 action=sip_auth sip_profile=api_call sip_user_agent=Yealink SIP-T46G 28.83.0.160 sip_auth_username=my_user sip_auth_realm=192.168.10.191 sip_auth_nonce=cc248046-2546-4743-ab3d-a0009df83e6b sip_auth_uri=sip:192.168.10.191:5060 sip_contact_user=my_user sip_contact_host=192.168.10.190 sip_to_user=my_user sip_to_host=192.168.10.191 sip_to_port=5060 sip_via_protocol=udp sip_from_user=my_user sip_from_host=192.168.10.191 sip_from_port=5060 [email protected] sip_request_host=192.168.10.191 sip_request_port=5060 sip_auth_qop=auth sip_auth_cnonce=656835405 sip_auth_nc=00000005 sip_auth_response=0f61e39890979eab94c3d4e0065c98c9 sip_auth_method=REGISTER client_port=5060 key=id user=my_user domain=192.168.10.191 ip=192.168.10.190

SUBSCRIBE:
hostname=portable107-LIN section=directory tag_name=domain key_name=name key_value=192.168.10.191 Event-Name=REQUEST_PARAMS Core-UUID=4557a4ef-7578-49e1-b5ce-b5c8b932dd1b FreeSWITCH-Hostname=portable107-LIN FreeSWITCH-Switchname=portable107-LIN FreeSWITCH-IPv4=172.16.23.7 FreeSWITCH-IPv6=::1 Event-Date-Local=2024-12-20 11:17:44 Event-Date-GMT=Fri, 20 Dec 2024 10:17:44 GMT Event-Date-Timestamp=1734689864413343 Event-Calling-File=sofia_reg.c Event-Calling-Function=sofia_reg_parse_auth Event-Calling-Line-Number=3124 Event-Sequence=36133 action=sip_auth sip_profile=api_call sip_user_agent=Yealink SIP-T46G 28.83.0.160 sip_auth_username=my_user sip_auth_realm=192.168.10.191 sip_auth_nonce=20f39676-4ecd-4558-9c2f-9f2099e8548c sip_auth_uri=sip:[email protected]:5060 sip_contact_user=my_user sip_contact_host=192.168.10.190 sip_to_user=888 sip_to_host=192.168.10.191 sip_to_port=5060 sip_via_protocol=udp sip_from_user=my_user sip_from_host=192.168.10.191 sip_from_port=5060 [email protected] sip_request_user=888 sip_request_host=192.168.10.191 sip_request_port=5060 sip_auth_qop=auth sip_auth_cnonce=663758358 sip_auth_nc=00000001 sip_auth_response=28e2dc328d88f5cce38ee8bfe42940da sip_auth_method=SUBSCRIBE client_port=5060 key=id user=my_user domain=192.168.10.191 ip=192.168.10.190

@atidot3 atidot3 added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant