Ah ok, think I misunderstood what you were asking here.

You can use the PV $rs in a condition for the 607 (or anything >400 etc) to
hit rtpengine_manage() block, just put it in your failure route.

The block can be used in any route:
https://kamailio.org/docs/modules/5.7.x/modules/rtpengine.html#rtpengine.f.rtpengine_manage



On Fri, 31 May 2024 at 14:49, Ghulam Mustafa <[email protected]> wrote:

> I'm wondering how to handle situations where downstream send invalid
> messages. In this case, Kamailio is not able to send DELETE commands
> to rtpengine due to parsing errors, as a result rtpengine is consuming all
> available ports and causing instability in our VoIP infrastructure. Do you
> have any suggestions on how to mitigate this issue?
>
> Regards,
>
> On Fri, May 31, 2024 at 6:40 PM Who AmI <[email protected]> wrote:
>
>> Hi,
>>
>> Nothing is jumping out to me here in the Invite, if this is working for
>> other destinations but not this one then the SIP response might truly be
>> the answer here: 607 - Unwanted - "
>>
>> The user agent(UA) of the called party, based on input from the called party 
>> or
>> some UA-internal logic, uses this to indicate that this call is
>>    unwanted and that future attempts are likely to be similarly
>>    rejected
>>
>> "
>>
>> https://datatracker.ietf.org/doc/html/rfc8197
>>
>> Doesn't seem to be a Kamailio issue if it is only affecting this
>> destination and if it doesn't affect the service on the Kamailio itself.
>>
>> Thanks,
>>
>> John.
>>
>> On Fri, 31 May 2024 at 14:25, Ghulam Mustafa <[email protected]>
>> wrote:
>>
>>> Yes, it's in response to an INVITE. Here is the complete flow
>>>
>>>
>>>
>>> U 10.x.x.xx:5060 -> 21x.xx.x.x:5060 #132
>>> INVITE sip:[email protected];transport=udp SIP/2.0.
>>> Record-Route:
>>> <sip:134.xxx.xxx.xx:5060;r2=on;lr;ftag=0S3pjXmBSU26m;did=ee1.07e2;nat=yes>.
>>> Record-Route:
>>> <sip:127.0.0.8;line=sr-H46V93NbGr0i98SDs8FcP3QV9LAWw1abHkqWlXczwL7tH3TqJ40tJmTto.AEobzVSbGVu6ECQ6Gfs3oC94AUoXc6o8NDsXl6s3CDwjQqM1fb>.
>>> Via: SIP/2.0/UDP
>>> 134.xxx.xxx.xx:5060;branch=z9hG4bK344e.71c27ecd75bd8bf9c9a971e5ec472e16.0;i=2.
>>> Via: SIP/2.0/UDP
>>> 127.0.0.8;branch=z9hG4bKsr-Sz6QPbTDsrqSQc7ys87Ds87VP37Ds87YG870sXCWo1G6ujo6oXzisr0isX7Dsr0isXCSZXcFujwtH.KOH.QqGXs09XNtw.dEJ5GhvjhauNHzwFILSblkHXdfw8lwo1lW.
>>> Max-Forwards: 66.
>>> From: "1272xxxxxxx" <sip:[email protected]>;tag=0S3pjXmBSU26m.
>>> To: <sip:[email protected];transport=udp>.
>>> Call-ID: 17cb7d78-99f3-123d-6f92-ecf4bbd64f6c.
>>> CSeq: 84026958 INVITE.
>>> Contact:
>>> <sip:127.0.0.8;line=sr-H46V95lLx46FlN7isr0isX7Dsr0isXhcsXyV9LAWw1abHkqWlXccom7toLHqu1Az94pIu1pbv8NVP3NVsr0VP3NV-3Qb9Xyi-3T*>.
>>> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE,
>>> REGISTER, REFER, NOTIFY.
>>> Supported: timer, path, replaces.
>>> Allow-Events: talk, hold, conference, refer.
>>> Content-Type: application/sdp.
>>> Content-Disposition: session.
>>> Content-Length: 329.
>>> Remote-Party-ID: "1272xxxxxxx" <sip:[email protected]
>>> >;party=calling;screen=yes;privacy=off.
>>> User-Agent: NewAge Border Controller.
>>> P-hint: outbound.
>>> .
>>> v=0.
>>> o=NewAgeNetworks 1717145045 1717145046 IN IP4 134.xxx.xxx.xx.
>>> s=NewAgeNetworks.
>>> c=IN IP4 134.xxx.xxx.xx.
>>> t=0 0.
>>> m=audio 32860 RTP/AVP 0 8 18 1
>>>
>>> U 10.x.x.xx -> 21x.xx.x.x +32647@1480:182 #133
>>> 01.
>>> a=rtpmap:0 PCMU/8000.
>>> a=rtpmap:8 PCMA/8000.
>>> a=rtpmap:18 G729/8000.
>>> a=fmtp:18 annexb=no.
>>> a=rtpmap:101 telephone-event/8000.
>>> a=fmtp:101 0-15.
>>> a=sendrecv.
>>> a=rtcp:32861.
>>> a=ptime:20.
>>>
>>>
>>>
>>> U 21x.xx.x.x:5060 -> 10.x.x.xx:5060 #141
>>> SIP/2.0 100 Trying.
>>> Via: SIP/2.0/UDP
>>> 134.xxx.xxx.xx:5060;branch=z9hG4bK344e.71c27ecd75bd8bf9c9a971e5ec472e16.0;i=2.
>>> Via: SIP/2.0/UDP
>>> 127.0.0.8;branch=z9hG4bKsr-Sz6QPbTDsrqSQc7ys87Ds87VP37Ds87YG870sXCWo1G6ujo6oXzisr0isX7Dsr0isXCSZXcFujwtH.KOH.QqGXs09XNtw.dEJ5GhvjhauNHzwFILSblkHXdfw8lwo1lW.
>>> From: "1272xxxxxxx" <sip:[email protected]>;tag=0S3pjXmBSU26m.
>>> To: <sip:[email protected]
>>> ;transport=udp>;tag=sbcsipuas_1_C6058_20240531091821072_sbc05.
>>> Call-ID: 17cb7d78-99f3-123d-6f92-ecf4bbd64f6c.
>>> Contact: <sip:21x.xx.x.x:5060>.
>>> CSeq: 84026958 INVITE.
>>> Server: sbc_5.
>>> Content-Length: 0.
>>> .
>>>
>>>
>>> U 21x.xx.x.x:5060 -> 10.x.x.xx:5060 #181
>>> SIP/2.0 607.
>>> Via: SIP/2.0/UDP
>>> 134.xxx.xxx.xx:5060;branch=z9hG4bK344e.71c27ecd75bd8bf9c9a971e5ec472e16.0;i=2.
>>> Via: SIP/2.0/UDP
>>> 127.0.0.8;branch=z9hG4bKsr-Sz6QPbTDsrqSQc7ys87Ds87VP37Ds87YG870sXCWo1G6ujo6oXzisr0isX7Dsr0isXCSZXcFujwtH.KOH.QqGXs09XNtw.dEJ5GhvjhauNHzwFILSblkHXdfw8lwo1lW.
>>> From: "1272xxxxxxx" <sip:[email protected]>;tag=0S3pjXmBSU26m.
>>> To: <sip:[email protected]
>>> ;transport=udp>;tag=sbcsipuas_1_C6058_20240531091821072_sbc05.
>>> Call-ID: 17cb7d78-99f3-123d-6f92-ecf4bbd64f6c.
>>> Contact: <sip:21x.xx.x.x:5060>.
>>> CSeq: 84026958 INVITE.
>>> Server: sbc_5.
>>> Content-Length: 0.
>>>
>>> Regards,
>>>
>>>
>>>
>>> On Fri, May 31, 2024 at 6:03 PM Who AmI <[email protected]> wrote:
>>>
>>>> Hi Mustafa,
>>>>
>>>> Ideally we would need the Invite to better understand this, the 607 is
>>>> in response to the Invite. Whether this is something in the Invite itself
>>>> or something at the called end we don't know.
>>>>
>>>> Thanks,
>>>>
>>>> John.
>>>>
>>>> On Fri, 31 May 2024 at 13:57, Ghulam Mustafa via sr-users <
>>>> [email protected]> wrote:
>>>>
>>>>> Hello Kamailio Community,
>>>>>
>>>>> I'm encountering a parsing error in Kamailio when receiving a SIP 607
>>>>> "Unwanted" response. The relevant log entries are:
>>>>>
>>>>> May 31 12:32:09 k-proxy1 /usr/sbin/kamailio[320898]: ERROR: <core>
>>>>> [core/receive.c:378]: receive_msg(): core parsing of SIP message failed
>>>>> (36.53.xx.xx:5060/1)
>>>>> May 31 12:32:10 k-proxy1 /usr/sbin/kamailio[320895]: ERROR: <core>
>>>>> [core/parser/parse_fline.c:272]: parse_first_line(): parse_first_line: bad
>>>>> message (offset: 11)
>>>>> May 31 12:32:10 k-proxy1 /usr/sbin/kamailio[320895]: ERROR: <core>
>>>>> [core/parser/msg_parser.c:790]: parse_msg(): ERROR: parse_msg: 
>>>>> message=<SIP/2.0
>>>>> 607#015#012Via: SIP/2.0/UDP 
>>>>> 134.195.195.40:5060;branch=z9hG4bKc87a.ed6403ae1529f36b65171bf964604be0.0;i=2#015#012Via:
>>>>> SIP/2.0/UDP
>>>>> 127.0.0.8;branch=z9hG4bKsr-Sz6QPbTDsrqSQc7ys87Ds87VP37Ds87YG870sXCWo1G6ujo6oXzisr0isX7Dsr0isXCSZXcFujwtH.KOH.QqGXs09XNtw.dEJ5GhvjhauNHzwFIzl5c9wbfNG3oaHkl3#015#012From:
>>>>> "15516756486" <sip:[email protected]>;tag=KXtSBZ1at71Hc#015#012To:
>>>>> <sip:[email protected];transport=udp>;tag=sbcsipuas_1_C35684_20240531083209909_sbc06#015#012Call-ID:
>>>>> a40d965d-99ec-123d-6f92-ecf4bbd64f6c#015#012Contact:
>>>>> <sip:36.53.xx.xx:5060>#015#012CSeq: 84025572 INVITE#015#012Server:
>>>>> sbc_5#015#012Content-Length: 0#015#012#015#012>
>>>>>
>>>>> And the actual SIP message is
>>>>>
>>>>> U 36.53.xx.xx:5060 -> 10.x.x.30:5060 #850
>>>>> SIP/2.0 607.
>>>>> Via: SIP/2.0/UDP 134.195.195.40:5060
>>>>> ;branch=z9hG4bKbdbd.95060a558d66b77d258b8d0799be4cf0.0;i=2.
>>>>> Via: SIP/2.0/UDP 127.0.0.8
>>>>> ;branch=z9hG4bKsr-Sz6QPbTDsrqSQc7ys87Ds87VP37Ds87YG870sXCWo1G6ujo6oXzisr0isX7Dsr0isXCSZXcFujwtH.KOH.QqGXs09XNtw.dEJ5GhvjhauNHzwFCaHXyLA3G.SjwaAmdn.
>>>>> From: "13xxxxxxxxxx" <sip:[email protected]>;tag=pFFatBpUc75BH.
>>>>> To: <sip:[email protected]
>>>>> ;transport=udp>;tag=sbcsipuas_1_C56639_20240531081932874_sbc04.
>>>>> Call-ID: e0d2f5fa-99ea-123d-6f92-ecf4bbd64f6c.
>>>>> Contact: <sip:36.53.xx.xx:5060>.
>>>>> CSeq: 84025194 INVITE.
>>>>> Server: sbc_5.
>>>>> Content-Length: 0.
>>>>>
>>>>> Any insights or suggestions would be greatly appreciated.
>>>>>
>>>>> Thank you!
>>>>>
>>>>> Mustafa
>>>>>
>>>>> __________________________________________________________
>>>>> Kamailio - Users Mailing List - Non Commercial Discussions
>>>>> To unsubscribe send an email to [email protected]
>>>>> Important: keep the mailing list in the recipients, do not reply only
>>>>> to the sender!
>>>>> Edit mailing list options or unsubscribe:
>>>>>
>>>>
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:

Reply via email to