Discussion:
[SR-Users] 407 response from provider as failure route
Yuriy Gorlichenko
2014-08-17 11:33:35 UTC
Permalink
Hi, I want to realise scheme:

Asterisk->Kamailo->provider

I register providers accounts at Kamailio using UAC module.

When Generates call form Asterisk through Kamailio to provider, provider
sends back 407 response. This reponse mut be handled by KAmailio through
failure_route using uac_auth().

I try to catch this response at onreply_route by status and route this
response to failure route (t_in_failure("MY_FAILURE_ROUTE"))but Kamailio
ignores t_on_failure and forvard this pacjet to asterisk.

So My question is: How to handle this response at kamailio and not forward
to asterisk?

This is invite that forwards to provider:

INVITE sip:11234567890-x+0HtyjCAUtz+5FpPkU+***@public.gmane.org:5060 SIP/2.0
Record-Route: <sip:my.kamailio.com:5068;nat=yes;ftag=as57a2d34c;lr=on>
Via: SIP/2.0/UDP my.kamailio.com:5068
;branch=z9hG4bK8544.480e25d0e6a328f5f455233d808cda80.0
Via: SIP/2.0/UDP 10.0.1.6:50600;branch=z9hG4bK778521b0;rport=50600
Max-Forwards: 70
From: "John" <sip:my_provider_acc-x+0HtyjCAUtz+5FpPkU+***@public.gmane.org:50600>;tag=as57a2d34c
To: <sip:11234567890-x+0HtyjCAUtz+5FpPkU+***@public.gmane.org:5068>
Contact:<my_provider_acc-neSRGDJur/***@public.gmane.org:5068>
Call-ID: 3d8d6c357d69cdd51633b1c125729f44-***@public.gmane.org:50600
CSeq: 102 INVITE
User-Agent: Asterisk PBX 12.4.0
Date: Sat, 16 Aug 2014 13:18:52 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 540

v=0
o=root 1941643043 1941643043 IN my.kamailio.com
s=Asterisk PBX 12.4.0
c=IN IP4 my.kamailio.com
t=0 0
a=ice-lite
m=audio 30108 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
a=rtcp:30109
a=ice-ufrag:jOv9GFqq
a=ice-pwd:wuXGbJ3ZI7MfwM6kwto78s8reEyU
a=candidate:lzqT8la5i9wkzQzB 1 UDP 2130706431 my.kamailio.com 30108 typ host
a=candidate:lzqT8la5i9wkzQzB 2 UDP 2130706430 my.kamailio.com 30109 typ host
Daniel-Constantin Mierla
2014-08-19 08:13:01 UTC
Permalink
Hello,

can you double check to be sure the t_on_failure() is executed and not
overwritten by another t_on_failure()?

You can used debugger module with cfgtrace turned on to see what actions
are executed from kamailio.cfg

Cheers,
Daniel
Post by Yuriy Gorlichenko
Asterisk->Kamailo->provider
I register providers accounts at Kamailio using UAC module.
When Generates call form Asterisk through Kamailio to provider,
provider sends back 407 response. This reponse mut be handled by
KAmailio through failure_route using uac_auth().
I try to catch this response at onreply_route by status and route this
response to failure route (t_in_failure("MY_FAILURE_ROUTE"))but
Kamailio ignores t_on_failure and forvard this pacjet to asterisk.
So My question is: How to handle this response at kamailio and not
forward to asterisk?
Record-Route: <sip:my.kamailio.com:5068;nat=yes;ftag=as57a2d34c;lr=on>
Via: SIP/2.0/UDP
my.kamailio.com:5068;branch=z9hG4bK8544.480e25d0e6a328f5f455233d808cda80.0
Via: SIP/2.0/UDP 10.0.1.6:50600;branch=z9hG4bK778521b0;rport=50600
Max-Forwards: 70
CSeq: 102 INVITE
User-Agent: Asterisk PBX 12.4.0
Date: Sat, 16 Aug 2014 13:18:52 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 540
v=0
o=root 1941643043 1941643043 IN my.kamailio.com <http://my.kamailio.com>
s=Asterisk PBX 12.4.0
c=IN IP4 my.kamailio.com <http://my.kamailio.com>
t=0 0
a=ice-lite
m=audio 30108 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
a=rtcp:30109
a=ice-ufrag:jOv9GFqq
a=ice-pwd:wuXGbJ3ZI7MfwM6kwto78s8reEyU
a=candidate:lzqT8la5i9wkzQzB 1 UDP 2130706431 my.kamailio.com
<http://my.kamailio.com> 30108 typ host
a=candidate:lzqT8la5i9wkzQzB 2 UDP 2130706430 my.kamailio.com
<http://my.kamailio.com> 30109 typ host
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Yuriy Gorlichenko
2014-08-19 20:55:06 UTC
Permalink
So As I say- I write after test. Yo right- I used t_on_failure twice...
Thanks for advice

Thanks for fast reply. Iwill rty it today. I will write about result
Post by Daniel-Constantin Mierla
Hello,
can you double check to be sure the t_on_failure() is executed and not
overwritten by another t_on_failure()?
Post by Daniel-Constantin Mierla
You can used debugger module with cfgtrace turned on to see what actions
are executed from kamailio.cfg
Post by Daniel-Constantin Mierla
Cheers,
Daniel
Post by Yuriy Gorlichenko
Asterisk->Kamailo->provider
I register providers accounts at Kamailio using UAC module.
When Generates call form Asterisk through Kamailio to provider, provider
sends back 407 response. This reponse mut be handled by KAmailio through
failure_route using uac_auth().
Post by Daniel-Constantin Mierla
Post by Yuriy Gorlichenko
I try to catch this response at onreply_route by status and route this
response to failure route (t_in_failure("MY_FAILURE_ROUTE"))but Kamailio
ignores t_on_failure and forvard this pacjet to asterisk.
Post by Daniel-Constantin Mierla
Post by Yuriy Gorlichenko
So My question is: How to handle this response at kamailio and not
forward to asterisk?
Post by Daniel-Constantin Mierla
Post by Yuriy Gorlichenko
Record-Route: <sip:my.kamailio.com:5068;nat=yes;ftag=as57a2d34c;lr=on>
Via: SIP/2.0/UDP my.kamailio.com:5068
;branch=z9hG4bK8544.480e25d0e6a328f5f455233d808cda80.0
Post by Daniel-Constantin Mierla
Post by Yuriy Gorlichenko
Via: SIP/2.0/UDP 10.0.1.6:50600;branch=z9hG4bK778521b0;rport=50600
Max-Forwards: 70
CSeq: 102 INVITE
User-Agent: Asterisk PBX 12.4.0
Date: Sat, 16 Aug 2014 13:18:52 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH, MESSAGE
Post by Daniel-Constantin Mierla
Post by Yuriy Gorlichenko
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 540
v=0
o=root 1941643043 1941643043 IN my.kamailio.com
s=Asterisk PBX 12.4.0
c=IN IP4 my.kamailio.com
t=0 0
a=ice-lite
m=audio 30108 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
a=rtcp:30109
a=ice-ufrag:jOv9GFqq
a=ice-pwd:wuXGbJ3ZI7MfwM6kwto78s8reEyU
a=candidate:lzqT8la5i9wkzQzB 1 UDP 2130706431 my.kamailio.com 30108 typ host
a=candidate:lzqT8la5i9wkzQzB 2 UDP 2130706430 my.kamailio.com 30109 typ host
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Loading...