mojolingo / sippy_cup

Create SIP load test scenarios the easy way
http://mojolingo.github.io/sippy_cup
MIT License
218 stars 78 forks source link

Feature/register #16

Closed wdrexler closed 11 years ago

wdrexler commented 11 years ago

Adding a register method. This will allow registers both with and without auth and/or specified domain names for registration.

saghul commented 11 years ago

It would be nice if this command could get an optional instance id parameter, which would be used in the Contact header, it would help testing GRUU.

bklang commented 11 years ago

For reference, here is the syntax we are considering:

Unauthenticated requests result in a single REGISTER request with no 401 challenge/response (like @leifmadsen's original commit):

register "usera" # Results in From: "usera" <sip:usera@[remote_ip]>
register "usera@domain" # Results in From: "usera" <sip:usera@domain>

Authenticated requests result in a full REGISTER/401 Challenge/REGISTER Response:

register "usera", "password"
register "usera@domain", "password"

@saghul can you give an example of how the ID would be used?

saghul commented 11 years ago

@bklang When registering, the To header needs to contain the AoR to which we are registering, it's typically the same as the From, unless third-party registration is taking place.

About GRUU. When using GRUU, one needs to indicate the instance id in the contact header:

Contact: <sip:hui4hf9h4f9@192.0.2.1>;+sip.instance="<urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6>"

Then the 200 OK will contain the public and temporary GRUUs, if supported:

Contact: <sip:hui4hf9h4f9@192.0.2.1>;pub-gruu="sip:saghul@sip2sip.info;gr=urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6";temp-gruu="sip:tgruu.7hs==jd7vnzga5w7fajsc7-ajd6fabz0f8g5@sip2sip.info;gr";+sip.instance="<urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6>";expires=3600

Now, if the proxy supports GRUU and someone dials "sip:saghul@sip2sip.info;gr=urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6" only this instance will ring, it will not fork.

bklang commented 11 years ago

@saghul thanks for the correction on To headers when registering, we'll make them match From.

So to your question about GRUU, we would need to modify the Contact header in the REGISTER request to include a supplied UUID? I think we can accommodate that.

saghul commented 11 years ago

Yes, oh, and also add a "Supported: gruu" header, that will do. If the server supports GRUU it will send them in the 200 OK, else you'll get the usual response.

saghul commented 11 years ago

In case you want to know all the details: http://tools.ietf.org/html/rfc5627#section-9 but there is not much to it from the client side.

bklang commented 11 years ago

@saghul We're just about done with basic REGISTER support so I'm going to move your GRUU request to a new issue: #17

bklang commented 11 years ago

@leifmadsen I think I'm happy with this, about to hit the merge button. Does this cover your use case? See https://github.com/bklang/sippy_cup/pull/16#issuecomment-23743320 for how this works.

leifmadsen commented 11 years ago

Ship it!

saghul commented 11 years ago

@saghul We're just about done with basic REGISTER support so I'm going to move your GRUU request to a new issue: #17

That's ok. You can also leave the nit I mentioned just now for later, nobody should use SIPS anyway.

bklang commented 11 years ago

Thanks @wdrexler! :shipit: