[Spce-user] "400 Bad Request" from SEMS

Andreas Granig agranig at sipwise.com
Sat May 14 13:19:48 EDT 2011


Hi Carsten,

This is actually a known and fixed issue, and I wanted to push it to the
public repo for anyone to upgrade next week (beside some more Sems
authentication fixes).

It's because Sems uses P-D-Uri as outbound proxy, so it should actually
be set to the load-balancer (sip:127.0.0.1:5060) instead of the Sipgate
Uri. In your case, it tries to send it directly to Sipgate instead of
going via the lb, but it can't since it binds to localhost only.

You can manually work around this issue in the meanwhile by setting the
above Uri hard-coded in
/etc/ngcp-config/templates/etc/sems/etc/ngcp.sbcprofile.conf.tt2 (iirc)
in your outbound_proxy line, then execute "ngcpcfg apply".

Andreas

On 05/14/2011 10:37 AM, Carsten Bock wrote:
> Hi,
> 
> i've defined the following rule for my outbound gateway:
> 
>> Outbound Rewrite Rules for Callee
>> Match Pattern: ^49([1-9][0-9]+)$
>> Replacement Pattern: 0\1
> 
> Just for testing and showing SPCE to other people, i use Sipgate as a
> termination, so i need to rewrite the Request URI.
> 
> From the Signalling between Kamailio and SEMS, this looks fine:
> 
> U 2011/05/13 23:04:16.777525 127.0.0.1:5062 -> 127.0.0.1:5080
> INVITE sip:b2b-0179332021244 at 217.10.79.9:5060 SIP/2.0.
> Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=552500b2;did=a3b.dc169f91;vsf=YXE0Rmw1HxgCPzJHcy0bXlE3Wwxsd1FoVAw1>.
> Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=552500b2;nat=yes>.
> Record-Route: <sip:46.252.21.133;r2=on;lr=on;ftag=552500b2;nat=yes>.
> Call-ID: e80385e11f0368c6879ad059e9b036dd at 0:0:0:0:0:0:0:0.
> CSeq: 2 INVITE.
> From: "494010003" <sip:1234 at sipgate.de>;tag=552500b2.
> To: <sip:0179332021244 at sip.ng-voice.com>.
> Max-Forwards: 68.
> Contact: "laptop"
> <sip:laptop at 89.204.137.72:52642;transport=udp;registering_acc=sip_ng-voice_com>.
> User-Agent: Jitsi1.0-beta1-nightly.build.3467Linux.
> Content-Type: application/sdp.
> Via: SIP/2.0/UDP
> 127.0.0.1:5062;branch=z9hG4bKe6b3.868b5de4bfcbb1bffdf894e5fecd1336.0.
> Via: SIP/2.0/UDP 127.0.0.1;rport=5060;branch=z9hG4bKe6b3.aca5aa26.0.
> Via: SIP/2.0/UDP
> 192.168.1.100:5060;rport=52642;received=89.204.137.72;branch=z9hG4bK-333635-a78044d8e518e84604006f4879038fe2.
> Content-Length: 894.
> P-App-Param: u=1234;d=sipgate.de;p=xxx.
> P-Asserted-Identity: <sip:494010003 at sip.ng-voice.com>.
> P-R-Uri: sip:0179332021244 at 217.10.79.9:5060
> P-D-Uri: sip:49179332021244 at 217.10.79.9:5060
> 
> But SEMS replies with an "400 Bad Request":
> 
> U 2011/05/13 23:04:16.778291 127.0.0.1:5080 -> 127.0.0.1:5062
> SIP/2.0 400 Bad Request.
> Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=552500b2;did=a3b.dc169f91;vsf=YXE0Rmw1HxgCPzJHcy0bXlE3Wwxsd1FoVAw1>.
> Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=552500b2;nat=yes>.
> Record-Route: <sip:46.252.21.133;r2=on;lr=on;ftag=552500b2;nat=yes>.
> Call-ID: e80385e11f0368c6879ad059e9b036dd at 0:0:0:0:0:0:0:0.
> CSeq: 2 INVITE.
> From: "494010003" <sip:1234 at sipgate.de>;tag=552500b2.
> To: <sip:0179332021244 at sip.ng-voice.com>;tag=3B6DADA6-4DCD9CD0000BDE2B-8F5F5700.
> Via: SIP/2.0/UDP
> 127.0.0.1:5062;branch=z9hG4bKe6b3.868b5de4bfcbb1bffdf894e5fecd1336.0;received=127.0.0.1.
> Via: SIP/2.0/UDP 127.0.0.1;rport=5060;branch=z9hG4bKe6b3.aca5aa26.0.
> Via: SIP/2.0/UDP
> 192.168.1.100:5060;rport=52642;received=89.204.137.72;branch=z9hG4bK-333635-a78044d8e518e84604006f4879038fe2.
> Content-Length: 0.
> 
> From the SEMS-Log:
> 
> May 13 23:04:16 (none) sems[2162]: [#7fd58fcfc700] [send,
> transport.cpp:113] ERROR: sendto: Invalid argument
> May 13 23:04:16 (none) sems[2162]: [#7fd58fcfc700] [send_request,
> trans_layer.cpp:897] ERROR: Error from transport layer
> May 13 23:04:16 (none) sems[2162]: [#7fd58f7f7700] [handleSipMsg,
> AmSipDispatcher.cpp:81] WARNING: received ACK for non-existing dialog
> (callid=e80385e11f0368c6879ad059e9b036dd at 0:0:0:0:0:0:0:0;remote_tag=552500b2;local_tag=3B6DADA6-4DCD9CD0000BDE2B-8F5F5700)
> 
> If i remove this rule, it works.
> Probably only a tiny issue....
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20110514/0e01efac/attachment-0001.asc>


More information about the Spce-user mailing list