[mod_xml_curl] Only accept if Return Password is blank
Hi, I'm trying to setup freeswitch to authenticate SIP client login (SIP register) to my backend database via php, example: username=65972932222, pwd=1234 As I couldn't really find sample return that suit my need, so I tried with below xml return. Problem is if the password is blank, then it will accepted, but if I change to simple password 1234 as xml return below, I will get SIP/2.0 403 Forbidden. xml return : <?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="freeswitch/xml"> <section name="directory" description="User Directory"> <domain name="10.1.1.47"> <user id="6597293279"> <params> </params> </user> </domain> </section> I tried add in groups, but it doesn't have any impact. The bindings' auth-scheme value is "basic", mod_xml_curl will call another server (LAN) and it will validate and return the xml above. Anybody can advise what I might be missing here? Thanks in advance -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-xml-curl-Only-accept-if-Re... Sent from the freeswitch-users mailing list archive at Nabble.com.
When I check my database and I have no matching entry I return this to FS from curl "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n" + "<document type=\"freeswitch/xml\">\r\n" + " <section name=\"directory\">\r\n" + " <result status=\"not found\"/>\r\n" + " </section>\r\n" + "</document>\r\n" if it is found I return all information that would be in the static directory xml for that user. You should also be returning the password, FreeSwitch checks it against what is sent from your client to authenticate. This is probably why it works when use a blank password. this scenario works like a charm for me. Jack On 9/14/2011 2:02 AM, rendyfrx wrote:
Hi, I'm trying to setup freeswitch to authenticate SIP client login (SIP register) to my backend database via php, example: username=65972932222, pwd=1234 As I couldn't really find sample return that suit my need, so I tried with below xml return. Problem is if the password is blank, then it will accepted, but if I change to simple password 1234 as xml return below, I will get SIP/2.0 403 Forbidden.
xml return :
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="freeswitch/xml"> <section name="directory" description="User Directory"> <domain name="10.1.1.47"> <user id="6597293279"> <params> *<param name=\"password\" value="1234"/>* </params> </user> </domain> </section>
I tried add in groups, but it doesn't have any impact. The bindings' auth-scheme value is "basic", mod_xml_curl will call another server (LAN) and it will validate and return the xml above.
Anybody can advise what I might be missing here? Thanks in advance
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-xml-curl-Only-accept-if-Re... Sent from the freeswitch-users mailing list archive at Nabble.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
Sorry, the param should not include the backslashes. When it reaches Freeswitch it shoud look like this: *<param name="password" value="1234"/>* On 9/14/2011 8:50 AM, Jack wrote:
When I check my database and I have no matching entry I return this to FS from curl
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n" + "<document type=\"freeswitch/xml\">\r\n" + " <section name=\"directory\">\r\n" + " <result status=\"not found\"/>\r\n" + " </section>\r\n" + "</document>\r\n" if it is found I return all information that would be in the static directory xml for that user. You should also be returning the password, FreeSwitch checks it against what is sent from your client to authenticate. This is probably why it works when use a blank password.
this scenario works like a charm for me. Jack
On 9/14/2011 2:02 AM, rendyfrx wrote:
Hi, I'm trying to setup freeswitch to authenticate SIP client login (SIP register) to my backend database via php, example: username=65972932222, pwd=1234 As I couldn't really find sample return that suit my need, so I tried with below xml return. Problem is if the password is blank, then it will accepted, but if I change to simple password 1234 as xml return below, I will get SIP/2.0 403 Forbidden.
xml return :
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="freeswitch/xml"> <section name="directory" description="User Directory"> <domain name="10.1.1.47"> <user id="6597293279"> <params> *<param name=\"password\" value="1234"/>* </params> </user> </domain> </section>
I tried add in groups, but it doesn't have any impact. The bindings' auth-scheme value is "basic", mod_xml_curl will call another server (LAN) and it will validate and return the xml above.
Anybody can advise what I might be missing here? Thanks in advance
-- View this message in context:http://freeswitch-users.2379917.n2.nabble.com/mod-xml-curl-Only-accept-if-Re... Sent from the freeswitch-users mailing list archive at Nabble.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
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 Jack, Thanks for your reply. I think the param did not include the backslashes, probably due to this forum's text display only, so it should not have backslashes when reaches FS. Would you mind sharing with me one sample static directory xml return for any particular user? I can try it out the format. Also is there any special config that I might missed? Your help is much appreciated. Thanks. -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-xml-curl-Only-accept-if-Re... Sent from the freeswitch-users mailing list archive at Nabble.com.
This is returned for a found user. The querystring[] variables are filled from the POST FreeSwitch made in the fetch to curl. PassWordFromDatabase would be a variable filled from your database lookup. If it is posting to your curl http server you are probably set up correctly. If you turn your http server off and call into Freeswitch you should see the POST attempt on the FS console "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n" + "<document type=\"freeswitch/xml\">\r\n" + " <section name=\"directory\" description=\"Directory For FreeSwitch\">\r\n" + " <domain name=\"" + queryString["domain"] + "\">\r\n" + " <user id=\"" + queryString["user"] + "\">\r\n" + " <params>\r\n" + " <param name=\"password\" value=\"" + PasswordFromDatabase + "\"/>\r\n" + " </params>\r\n" + " <variables>\r\n" + " <variable name=\"user_context\" value=\"default\"/>\r\n" + " </variables>\r\n" + " </user>\r\n" + " </domain>\r\n" + " </section>\r\n" + "</document>\r\n" On 9/14/2011 9:37 AM, rendyfrx wrote:
Hi Jack, Thanks for your reply. I think the param did not include the backslashes, probably due to this forum's text display only, so it should not have backslashes when reaches FS.
Would you mind sharing with me one sample static directory xml return for any particular user? I can try it out the format. Also is there any special config that I might missed?
Your help is much appreciated. Thanks.
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-xml-curl-Only-accept-if-Re... Sent from the freeswitch-users mailing list archive at Nabble.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 Jack, I have tried out your suggestion but still no luck. I have cross check with the post attempt (FS console) and the domain/user info is correct. The return in FS console: 2011-09-19 13:21:57.001319 [CONSOLE] mod_xml_curl.c:313 XML response is in /tmp/c0a9e205-c738-45bf-aaa2-50a6ac0168f4.tmp.xml 2011-09-19 13:21:57.001319 [WARNING] sofia_reg.c:1199 SIP auth failure (REGISTER) on sofia profile 'external' for [+6597293279@10.1.1.47] from ip 111.65.28.60 send 554 bytes to udp/[111.65.28.60]:33913 at 05:21:57.005661: ------------------------------------------------------------------------ SIP/2.0 403 Forbidden Via: SIP/2.0/UDP 10.223.215.249:5060;rport=33913;branch=z9hG4bKPj0LZUqL1S3xjOHQ5mFNQDWrf5TSZZUWER;received=111.65.28.60 ..... my XML return is like in image http://freeswitch-users.2379917.n2.nabble.com/file/n6807266/mod_xml_curl_con... Do you have any other idea of what might be the problem? Thank you. -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-xml-curl-Only-accept-if-Re... Sent from the freeswitch-users mailing list archive at Nabble.com.
What are you using as an http server to process the fetch that Freeswitch makes? I use minihttpd and wrapped it in a C# program to access my database and make the returns. You might check modules.config.xml and make sure <load module="*mod_xml_curl*"/> processes prior to <!--<load module="mod_directory"/>--> (which I commented out so it doesn't load) On 9/18/2011 10:23 PM, rendyfrx wrote:
Hi Jack, I have tried out your suggestion but still no luck. I have cross check with the post attempt (FS console) and the domain/user info is correct. The return in FS console:
2011-09-19 13:21:57.001319 [CONSOLE] mod_xml_curl.c:313 XML response is in /tmp/c0a9e205-c738-45bf-aaa2-50a6ac0168f4.tmp.xml 2011-09-19 13:21:57.001319 [WARNING] sofia_reg.c:1199 SIP auth failure (REGISTER) on sofia profile 'external' for [+6597293279@10.1.1.47] from ip 111.65.28.60 send 554 bytes to udp/[111.65.28.60]:33913 at 05:21:57.005661: ------------------------------------------------------------------------ SIP/2.0 403 Forbidden Via: SIP/2.0/UDP 10.223.215.249:5060;rport=33913;branch=z9hG4bKPj0LZUqL1S3xjOHQ5mFNQDWrf5TSZZUWER;received=111.65.28.60 .....
my XML return is like in image http://freeswitch-users.2379917.n2.nabble.com/file/n6807266/mod_xml_curl_con...
Do you have any other idea of what might be the problem?
Thank you.
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-xml-curl-Only-accept-if-Re... Sent from the freeswitch-users mailing list archive at Nabble.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 Jack, I think we finally managed to resolved the issue "accidentally" :) We set enable-compact-headers=true in internal sip_profiles and somehow it works, probably due to network packet issue too big. Anyway, thanks for your kind help. -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-xml-curl-Only-accept-if-Re... Sent from the freeswitch-users mailing list archive at Nabble.com.
participants (2)
-
Jack
-
rendyfrx