user directory is ignoring user_context
Hello, I have a weird issue with freeswitch (Version 1.4.8 git 1fe89f5 2014-08-21 18:57:58Z 64bit) sometimes. It also happens to me on Freeswitch 1.2. It ignores the extension's user_context, defined like so: <variable name="user_context" value="testing" /> <include> <user id="3002"> <params> <param name="password" value="******" /> </params> <variables> <variable name="accountcode" value="3002" /> <!-- <variable name="user_context" value="bridging_capture" /> --> <variable name="user_context" value="testing" /> <variable name="effective_caller_id_name" value="Desktop machine" /> <variable name="effective_caller_id_number" value="3002" /> </variables> </user> </include> When I do list_users, i can see it: 3002|testing|XXX.XXX.XXX.XXX|default|error/user_not_registered||Desktop machine|3002 (and when it is registered I can see it registered) And when the user is registered I see it also: 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'record_stereo' = 'true' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'default_gateway' = 'example.com' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'default_areacode' = '918' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'transfer_fallback_extension' = 'operator' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'accountcode' = '3002' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'user_context' = 'testing' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'effective_caller_id_name' = 'Desktop machine' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'effective_caller_id_number' = '3002' However, when I dial the extension, it enter a different context: 2014-09-08 18:05:38.897955 [INFO] mod_dialplan_xml.c:558 Processing 3001 <3002>->3000 in context external_dialer xml_locate dialplan <context name="testing"> <extension name="shout"> <condition field="destination_number" expression="^(300\d)$"> <action application="answer"></action> <action application="playback" data="shout:// 208.53.164.178:80"></action> </condition> </extension> </context> It usually happens after a while, when first it enters the proper context, and later it starts to go somewhere else. even on ./freeswitch -stop and ./freeswitch -ncwait it goes to the wrong context. Am I doing something wrong, or missing something ? Thanks, Ido
Found the reason for the problem, but I do not understand it. By using - <anti-action application="info" /> on the wrong context, I found out that acl_token is set to a different user, that has in it's configuration a cidr of the same IP address of my soft-phone. So even tough Freeswitch know that I'm 3002, it decided that I'm user 2002 (that points to that context), because of the cidr. When I removed the cidr configuration inside the <user> and moved it to the acl.xml.conf , it start to enter the proper context. The thing is, that it's not always happening, only sometimes. Ido On Mon, Sep 8, 2014 at 9:23 PM, ik <idokan@gmail.com> wrote:
Hello,
I have a weird issue with freeswitch (Version 1.4.8 git 1fe89f5 2014-08-21 18:57:58Z 64bit) sometimes. It also happens to me on Freeswitch 1.2. It ignores the extension's user_context, defined like so: <variable name="user_context" value="testing" />
<include> <user id="3002"> <params> <param name="password" value="******" /> </params> <variables> <variable name="accountcode" value="3002" /> <!-- <variable name="user_context" value="bridging_capture" /> --> <variable name="user_context" value="testing" /> <variable name="effective_caller_id_name" value="Desktop machine" /> <variable name="effective_caller_id_number" value="3002" /> </variables> </user> </include>
When I do list_users, i can see it: 3002|testing|XXX.XXX.XXX.XXX|default|error/user_not_registered||Desktop machine|3002
(and when it is registered I can see it registered)
And when the user is registered I see it also: 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'record_stereo' = 'true' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'default_gateway' = 'example.com' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'default_areacode' = '918' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'transfer_fallback_extension' = 'operator' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'accountcode' = '3002' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'user_context' = 'testing' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'effective_caller_id_name' = 'Desktop machine' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'effective_caller_id_number' = '3002'
However, when I dial the extension, it enter a different context: 2014-09-08 18:05:38.897955 [INFO] mod_dialplan_xml.c:558 Processing 3001 <3002>->3000 in context external_dialer
xml_locate dialplan <context name="testing"> <extension name="shout"> <condition field="destination_number" expression="^(300\d)$"> <action application="answer"></action> <action application="playback" data="shout:// 208.53.164.178:80"></action> </condition> </extension> </context>
It usually happens after a while, when first it enters the proper context, and later it starts to go somewhere else. even on ./freeswitch -stop and ./freeswitch -ncwait it goes to the wrong context.
Am I doing something wrong, or missing something ?
Thanks, Ido
Registration is completely separate to making a call. Registration tells FS where to send calls to you, and has no effect on calls from you. They have separate authentication. Registration is not required in order to make a call. In short the fact you're registering ok doesn't tell you anything about how your call will be processed, so ignore the registration and just debug the outgoing call part. I would suggest you avoid authenticating from as one user from an IP that's already matching the cidr of another. The cidr will bypass the password authentication. Ordinarily authentication uses a challenge/response mechanism - you send INVITE, it replies 401 with challenge, you resend INVITE with the response. If you match a cidr you're not going to get the 401, so you'll authenticate as the cidr user not password user. If that behaviour is intermittent, perhaps the challenge response is reusing the authentication challenge from the REGISTER you just did, but since it's time-limited will only do it for a limited amount of time so the behaviour would change after a while. On 9 September 2014 12:11, ik <idokan@gmail.com> wrote:
Found the reason for the problem, but I do not understand it.
By using - <anti-action application="info" /> on the wrong context, I found out that acl_token is set to a different user, that has in it's configuration a cidr of the same IP address of my soft-phone.
So even tough Freeswitch know that I'm 3002, it decided that I'm user 2002 (that points to that context), because of the cidr. When I removed the cidr configuration inside the <user> and moved it to the acl.xml.conf , it start to enter the proper context.
The thing is, that it's not always happening, only sometimes.
Ido
On Mon, Sep 8, 2014 at 9:23 PM, ik <idokan@gmail.com> wrote:
Hello,
I have a weird issue with freeswitch (Version 1.4.8 git 1fe89f5 2014-08-21 18:57:58Z 64bit) sometimes. It also happens to me on Freeswitch 1.2. It ignores the extension's user_context, defined like so: <variable name="user_context" value="testing" />
<include> <user id="3002"> <params> <param name="password" value="******" /> </params> <variables> <variable name="accountcode" value="3002" /> <!-- <variable name="user_context" value="bridging_capture" /> --> <variable name="user_context" value="testing" /> <variable name="effective_caller_id_name" value="Desktop machine" /> <variable name="effective_caller_id_number" value="3002" /> </variables> </user> </include>
When I do list_users, i can see it: 3002|testing|XXX.XXX.XXX.XXX|default|error/user_not_registered||Desktop machine|3002
(and when it is registered I can see it registered)
And when the user is registered I see it also: 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'record_stereo' = 'true' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'default_gateway' = 'example.com' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'default_areacode' = '918' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'transfer_fallback_extension' = 'operator' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'accountcode' = '3002' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'user_context' = 'testing' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'effective_caller_id_name' = 'Desktop machine' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'effective_caller_id_number' = '3002'
However, when I dial the extension, it enter a different context: 2014-09-08 18:05:38.897955 [INFO] mod_dialplan_xml.c:558 Processing 3001 <3002>->3000 in context external_dialer
xml_locate dialplan <context name="testing"> <extension name="shout"> <condition field="destination_number" expression="^(300\d)$"> <action application="answer"></action> <action application="playback" data="shout:// 208.53.164.178:80"></action> </condition> </extension> </context>
It usually happens after a while, when first it enters the proper context, and later it starts to go somewhere else. even on ./freeswitch -stop and ./freeswitch -ncwait it goes to the wrong context.
Am I doing something wrong, or missing something ?
Thanks, Ido
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hi Steven, Thanks, that makes a lot of sense. I tried to limit few users to specific cidr (/32), but it seems like it's the wrong way of doing it, and I should try to use it in the dialplan, and see if the IP address is the one I'm expecting to have for that call. Again, thank you Ido On Tue, Sep 9, 2014 at 9:45 PM, Steven Ayre <steveayre@gmail.com> wrote:
Registration is completely separate to making a call. Registration tells FS where to send calls to you, and has no effect on calls from you. They have separate authentication. Registration is not required in order to make a call.
In short the fact you're registering ok doesn't tell you anything about how your call will be processed, so ignore the registration and just debug the outgoing call part.
I would suggest you avoid authenticating from as one user from an IP that's already matching the cidr of another. The cidr will bypass the password authentication. Ordinarily authentication uses a challenge/response mechanism - you send INVITE, it replies 401 with challenge, you resend INVITE with the response. If you match a cidr you're not going to get the 401, so you'll authenticate as the cidr user not password user.
If that behaviour is intermittent, perhaps the challenge response is reusing the authentication challenge from the REGISTER you just did, but since it's time-limited will only do it for a limited amount of time so the behaviour would change after a while.
On 9 September 2014 12:11, ik <idokan@gmail.com> wrote:
Found the reason for the problem, but I do not understand it.
By using - <anti-action application="info" /> on the wrong context, I found out that acl_token is set to a different user, that has in it's configuration a cidr of the same IP address of my soft-phone.
So even tough Freeswitch know that I'm 3002, it decided that I'm user 2002 (that points to that context), because of the cidr. When I removed the cidr configuration inside the <user> and moved it to the acl.xml.conf , it start to enter the proper context.
The thing is, that it's not always happening, only sometimes.
Ido
On Mon, Sep 8, 2014 at 9:23 PM, ik <idokan@gmail.com> wrote:
Hello,
I have a weird issue with freeswitch (Version 1.4.8 git 1fe89f5 2014-08-21 18:57:58Z 64bit) sometimes. It also happens to me on Freeswitch 1.2. It ignores the extension's user_context, defined like so: <variable name="user_context" value="testing" />
<include> <user id="3002"> <params> <param name="password" value="******" /> </params> <variables> <variable name="accountcode" value="3002" /> <!-- <variable name="user_context" value="bridging_capture" /> --> <variable name="user_context" value="testing" /> <variable name="effective_caller_id_name" value="Desktop machine" /> <variable name="effective_caller_id_number" value="3002" /> </variables> </user> </include>
When I do list_users, i can see it: 3002|testing|XXX.XXX.XXX.XXX|default|error/user_not_registered||Desktop machine|3002
(and when it is registered I can see it registered)
And when the user is registered I see it also: 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'record_stereo' = 'true' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'default_gateway' = 'example.com' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'default_areacode' = '918' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'transfer_fallback_extension' = 'operator' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'accountcode' = '3002' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'user_context' = 'testing' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'effective_caller_id_name' = 'Desktop machine' 2014-09-08 18:05:25.397965 [DEBUG] sofia_reg.c:3013 event_add_header -> 'effective_caller_id_number' = '3002'
However, when I dial the extension, it enter a different context: 2014-09-08 18:05:38.897955 [INFO] mod_dialplan_xml.c:558 Processing 3001 <3002>->3000 in context external_dialer
xml_locate dialplan <context name="testing"> <extension name="shout"> <condition field="destination_number" expression="^(300\d)$"> <action application="answer"></action> <action application="playback" data="shout:// 208.53.164.178:80"></action> </condition> </extension> </context>
It usually happens after a while, when first it enters the proper context, and later it starts to go somewhere else. even on ./freeswitch -stop and ./freeswitch -ncwait it goes to the wrong context.
Am I doing something wrong, or missing something ?
Thanks, Ido
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
ik
-
Steven Ayre