Forum Discussion

Antonio_Marongi's avatar
Antonio_Marongi
Icon for Nimbostratus rankNimbostratus
Nov 09, 2017

Need help with diameter Irule

Hi everyone, this is the first time I ask a question. I need to create an irule intercepting the DIAMETER message "Disconnect-Peer-Request" (command = 282) from origin-host then drops the outgoing message and possibly replay to the origin-host with the Disconnect-Peer-Answer message (command = 282). I'm a Diameter newbie, I hope I was clear. Follows my Irule:

 

diamater-Disconnect-Peer-Answer-egress.rule

when DIAMETER_EGRESS { if {[serverside]} { if { [DIAMETER::command] == "282" } { DIAMETER::drop log local0. "Disconnect-Peer-Request sent from [IP::local_addr] to [IP::remote_addr] with origin-host [DIAMETER::host origin]" DIAMETER::respond "version" "r" "p" "e" "t" "comcode" "appid" "hopid" "endid" "AVPs" } } } How can I set it up DIAMETER::respond?

 

Regards,

 

Antonio Marongiu

 

1 Reply

  • I do not know DIAMETER but from your iRule code you have two possible problems:

     

    1. Checking you are executing only on serverside so DIAMETER::respond will send the respond to the server not the client. You will need to check to clientside to respond to the original host.

       

    2. You need to change the DIAMETER::respond parameters (not sure if you left them as the wiki documentation stats as an example) to provide valid DIAMETER data. One key element of this is the AVPs which needs to be in binary format so likely to need to use the TCL command binary format

       

    when DIAMETER_EGRESS {
        if {[serverside]} {
            if { [DIAMETER::command] == "282" } {
                DIAMETER::drop
                log local0. "Disconnect-Peer-Request sent from [IP::local_addr] to [IP::remote_addr] with origin-host [DIAMETER::host origin]"
                clientside {DIAMETER::respond "version" "r" "p" "e" "t" "comcode" "appid" "hopid" "endid" "AVPs"}
            }
        }
    }