Skip to content

Make captagent filter on headers #284

@lcx

Description

@lcx

Sorry to open a github issue, not really sure where else to go with this.

I'm trying to figure out how header_regexp_match and header_check work.
My plan is to have a captagent running on a freeswitch but depending on the sip headers to send it to a different homer.
I have two profiles in my transport_hep.xml and if I want to do that based on the IP it works as expected:

                if (msg_check("any_ip", "127.0.0.1")) {
                    if(!send_hep("homer2")) {
                        clog("ERROR", "Error sending HEP!!!!");
                    }
                }

The IP is of course not 127.0.0.1 but this will send the traffic coming from the configured IP to the specified homer.
So far so good.

Now let's say I have this invite:

Max-Forwards: 70
User-Agent: snomD785/10.1.84.12
Contact: <sip:666@192.168.250.108:49431;transport=Tcp;line=dw1ctvar>;reg-id=1
X-Serialnumber: 000413924E28
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO, UPDATE

and I would want to make it match with the header X-Serialnumber: 000413924E28 how would I do that?

Also while writing this I realized that would lose me a lot of packages because the responses don't have that header, as a learning opportunity I would still be very curious. Read the C code, read the PDF's from workshops I found and couldn't figure it out.

Would there be a better way to accomplish this madness I am trying? As soon as an Invite has a specific value in a header that it marks any packages + responses to be sent to a specific homer?
Captagent would be the preferred option since I have some asterisk in the whole thing and not only freeswitch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions