<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:12pt">It works similar to how the dialplan hook works.<br><br>When the sip registration or attempted call comes<br>in with the authorization header, the mod_sofia will<br>do a directory lookup in the xml for the user/domain<br>combo specified in the request.<br><br>This is done by first requesting the entire domain then<br>iterating the <user> tags in that result.<br><br>So you have 2 choices when the request for the domain comes<br>in to your cgi.<br><br>1) Do exactly as it wants and deliver a <domain> with<br>all of the users for that domain and let the core find<br>the right one.<br><br>2) Look at the query params in the POST data where many<br>hints are provided about what the search is for (you may<br>find this familiar from the dialplan)<br>You can elect to find the exact user and return
a <domain><br>with just 1 <user> in it.<br><br>As far as doing the auth yourself you have 2 options as well.<br> <br>1) store the a1-hash in your database and return that<br> in the a1-hash user param <br><div> md5hash(<user>:<realm>:<pass>) <br><br>2) all the bits of the authorization header are passed to<br> you in the POST data so you can perform the digest auth<br> yourself in your cgi and return a user with no passwd<br> param to indicate a successful auth.<br> (exactly how to do that is out of the scope of this reply =])<br><br> <br>sip_auth_username<br>sip_auth_realm<br>sip_auth_nonce<br>sip_auth_uri<br>sip_auth_qop<br>sip_auth_cnonce<br>sip_auth_nc<br>sip_auth_response<br>sip_auth_method<br><br><br><br></div><div>Anthony Minessale II<br><br><span>FreeSWITCH <a target="_blank"
href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></span><br><span>ClueCon <a target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br><br>AIM: anthm<br>MSN:anthony_minessale@hotmail.com<br>GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<br>IRC: irc.freenode.net #freeswitch</div><div><br>FreeSWITCH Developer Conference<br>sip:888@conference.freeswitch.org<br>iax:guest@conference.freeswitch.org/888<br>googletalk:conf+888@conference.freeswitch.org<br>pstn:213-799-1400</div><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Jonas Gauffin <jonas.gauffin@gmail.com><br>To: freeswitch-users@lists.freeswitch.org<br>Sent: Tuesday, February 5, 2008 4:30:02 AM<br>Subject: [Freeswitch-users] Problems with xml_curl and directory<br><br>
Hello<br><br>I've
used
xml_curl
for
a
while
to
supply
a
dialplan,
and
it
works
fine.<br>I'm
now
trying
to
get
the
directory
working.<br><br>If
I'm
not
remembering
wrong,
FS
fetches
the
complete
directory
at<br>startup
to
be
able
to
do
presence
managing,
correct?<br>Anyway
I
provide
a
XML
document
when
it's
requested
at
startup:<br><br><document
type="freeswitch/xml"><br><section
name="directory"><domain
name="192.168.1.124"><br>
<user
id="janolov"
mailbox="1202"><br>
<params
/><br>
<variables><br>
<variable
name="user_context"
value="default"
/><br>
<variable
name="effective_caller_id_name"<br>value="Jan-Olov
Andersson"
/><br>
<variable
name="effective_caller_id_number"<br>value="1202"
/><br>
</variables><br>
</user><br>
<user
id="jonas"
mailbox="1201"><br>
<params
/><br>
<variables><br>
<variable
name="user_context"
value="default"
/><br>
<variable
name="effective_caller_id_name"<br>value="Jonas
Gauffin"
/><br>
<variable
name="effective_caller_id_number"<br>value="1201"
/><br>
</variables><br>
</user><br></domain></section><br></document><br><br>I
don't
know
if
an
empty
"params"
tag
is
required
anymore,
it
was<br>before
(when
no
password
is
used).<br><br>My
problem
is
that
registrations
do
not
work
when
I'm
using
xml_curl<br>to
fetch
directory.<br>It
does
not
fetch
anything
upon
registration
and
nothing
is
written<br>into
the
console
about
the
registration.<br><br>Everything
works
if
I
disable
directory
handling
in
xml_curl
(it
then<br>uses
the
standard
config
files
and
registration
works
fine).<br><br>Then
I
got
a
feature
request.
I
would
like
to
do
then
authentication<br>myself
in
the
xml
curl
call,
is
that
possible?<br>(FS
supplies
the
password
and
I
can
reply
with
a
status
code
that<br>indicates
that
the
authentication
was
unsuccessful)<br>I'm
storing
passwords
encrypted,
and
I
can
therefore
not
provide
a<br>password
back
to
FS.<br><br>Regards,<br>
Jonas<br><br>_______________________________________________<br>Freeswitch-users
mailing
list<br><a ymailto="mailto:Freeswitch-users@lists.freeswitch.org" href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></div><br></div></div><br>
<hr size=1>Never miss a thing. <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>
</body></html>