[Serusers] t_uac_dlg() bug ?
Jim Burwell
jimb at jsbc.cc
Fri Oct 31 00:43:00 CET 2003
OK. I think I understand.
Since the SIP request is injected straight into SER via the t_uac_dlg()
FIFO command, I had presumed the request would get dumped into the
route[0] block like any other request coming into SER from a UDP port.
If this were the case I'd expect the normal "if(uri == myself)" type
checks to catch the request and do the appropriate thing. But if I
follow your reply, this isn't
the case.
If I understand what you say correctly, the t_uac_dlg() command works
just like some UAC out on the network, and needs to have the IP address
of its proxy either hard coded, or resolvable via some means (hosts
file, DNS). Once this resolved, it sends the request to SER via
networking calls and normal processing ensues. Is this correct ?
If this is all true, then it means that for the current SERweb CTD
functionality to work, you need a host file or DNS entry for all SIP
domains served by your SER server, since SERweb delivers the dummy
INVITE URI in the "sip:name at domain" form instead of "sip:name at ip" form.
Is this all correct ?
Presuming the above is correct, one problem I can see with this
requirement is that in some instances, it may be impossible for someone
to add the DNS SRV entries (no access to DNS server, for instance), and
impractical to add /etc/hosts aliases for the SIP domain, since doing so
could possibly break other things in the system, such as email routing
on that host (I think sendmail, etc would assume that the machine was
the mail server for that domain if such an alias existed). In this sort
of situation, the user might want to hard code the IP address of the SIP
proxy to contact, much as you do when you configure SIP phones.
If you wanted to somehow "hard code" the SIP proxy called by changing
the PHP code in SERweb, could you do so "properly" ? I could see how
changing the URI from "sip:user at domain" to "sip:user at ip-of-SIP-proxy" in
the PHP would work, but wouldn't that break a multi-domain situation,
since the domain of the user in question would be lost ? Perhaps if
just the INVITE URI were changed to "sip:user at ip-of-SIP-proxy" form, and
the "To: " header in the SIP request were left in "sip:user at domain"
form, things would still work ? Or perhaps other headers could be
changed/added in the SIP request that would allow t_uac_dlg() to figure
out which IP to contact for the request without needing to do a host
lookup ? Or maybe the best approach would be to add an optional
IP-address argument to the t_uac_dlg() command which specifies the SIP
server to call (for instance, ":t_dlg_uac:reply_fifo_name[:IP of SIP
server to call]") ?
TIA,
Jim
Jiri Kuthan wrote:
>Jim,
>
>CTD acts as a SIP client -- i.e., it takes mydomain.com and tries
>to resolve it via DNS. If the resolution fails, the transaction
>fails. That's completely orthogonal to function of "alias" which
>is used for proxy server's domain matching.
>
>if mydomain.com is served by the same server, CTD initiates a transaction,
>sends it to itself, and in proxy mode it recognizes it as a request
>for itself using alias.
>
>-jiri
>
>At 04:46 PM 10/30/2003, Jim Burwell wrote:
>
>
>>Hi,
>>
>>I was trying to get click-to-dial working from SERweb and it was failing for unclear reasons. I then experimented with the "ctd.sh" script, which does the same thing as the SERweb PHP code. I found that it would fail during the 'dummy invite' stage, returning an odd error if I used a URI which used a SIP domain/realm, but would work fine if I used the IP address of the SIP proxy as the domain. i.e.:
>>
>> ./ctd.sh sip:joebob at mydomain.com sip:billybob at mydomain.com <- fails
>> ./ctd.sh sip:joebob at 1.2.3.4 sip:billybob at mydomain.com <- succeeds
>>
>>The reply from SER would be "500 fifo_uac: no mem for hf block" . The log file would have these errors:
>>
>> ERROR: mk_proxy: could not resolve hostname: "mydomain.com"
>> ERROR: uri2proxy: bad host name in URI <sip:joebob at mydomain.com>
>> ERROR: uri2sock: Can't create a dst proxy
>> ERROR: get_hf_block: send_sock failed
>> ERROR: fifo_uac: no mem for hf block
>>
>>So it appears that SER didn't understand that the URI's domain was itself, even though there's a host alias line in the ser.cfg file listing "mydomain.com" as an alias for this host. It's as if it thinks it needed to relay the transaction to another SIP router, and look up an IP to do so. If "mydomain.com" were placed in /etc/hosts as an alias for the system SER was running on, or if a DNS SRV entry for the SIP domain were created pointing to the SER system, voila, the "sip:user at domain" form would work just fine.
>>
>>Is this a bug ? I think SER isn't checking SER host aliases against the SIP domain if the SIP request comes in via the fifo t_uac_dlg() command.
>>
>>I'm using the SER release 0.8.11-r1, aka the "stable CVS" release.
>>
>>TIA,
>>Jim
>>
>>--
>>+---------------------------------------------------------------------------+
>>| Jim Burwell - Sr. Systems/Network/Security Engineer, JSBC |
>>+---------------------------------------------------------------------------+
>>| "I never let my schooling get in the way of my education." - Mark Twain |
>>| "UNIX was never designed to keep people from doing stupid things, because |
>>| that policy would also keep them from doing clever things." - Doug Gwyn |
>>| "Cool is only three letters away from Fool" - Mike Muir, Suicyco |
>>| "..Government in its best state is but a necessary evil; in its worst |
>>| state an intolerable one.." - Thomas Paine, "Common Sense" (1776) |
>>+---------------------------------------------------------------------------+
>>| Email: jimb at jsbc.cc ICQ UIN: 1695089 |
>>+---------------------------------------------------------------------------+
>>| Reply problems ? Turn off the "sign" function in email prog. Blame MS. |
>>+---------------------------------------------------------------------------+
>>
>>
>>
>>_______________________________________________
>>Serusers mailing list
>>serusers at lists.iptel.org
>>http://lists.iptel.org/mailman/listinfo/serusers
>>
>>
>
>--
>Jiri Kuthan http://iptel.org/~jiri/
>
>
--
+---------------------------------------------------------------------------+
| Jim Burwell - Sr. Systems/Network/Security Engineer, JSBC |
+---------------------------------------------------------------------------+
| "I never let my schooling get in the way of my education." - Mark Twain |
| "UNIX was never designed to keep people from doing stupid things, because |
| that policy would also keep them from doing clever things." - Doug Gwyn |
| "Cool is only three letters away from Fool" - Mike Muir, Suicyco |
| "..Government in its best state is but a necessary evil; in its worst |
| state an intolerable one.." - Thomas Paine, "Common Sense" (1776) |
+---------------------------------------------------------------------------+
| Email: jimb at jsbc.cc ICQ UIN: 1695089 |
+---------------------------------------------------------------------------+
| Reply problems ? Turn off the "sign" function in email prog. Blame MS. |
+---------------------------------------------------------------------------+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20031030/42c847fd/attachment.htm>
More information about the sr-users
mailing list