Eyepea / aiosip

SIP support for AsyncIO (DEPRECATED)
Apache License 2.0
83 stars 43 forks source link

Access Request-Line-URI values #120

Open deba1234 opened 6 years ago

deba1234 commented 6 years ago

Hi guys,

first of all, you are doing great work with this library. 👍

I don't know is this a feature or issue but i want to share my observation

Currently i am working on simple SIP redirect server and i need to access R-URI values (after INVITE method). I can see in the code that R-URI is the same as To fields without display name.

Also, i had discussion with some experts on this topic and they said that in some cases R-URI could have different value than To.

Is it possible, in current solution, to access real R-URI value of request message ?

BR

ovv commented 6 years ago

Hello,

first of all, you are doing great work with this library. +1

Thanks for the kind words.

The R-URI is built from the To headers when the first line is missing (See https://github.com/Eyepea/aiosip/blob/master/aiosip/message.py#L259). For an incoming message the message._first_line attribute correspond to the first line of the decode headers (https://github.com/Eyepea/aiosip/blob/master/aiosip/message.py#L230), you should be able to get the R-URI from that.

A PR exposing it in the message API would be welcome :)

deba1234 commented 6 years ago

Hi , thanks for quick answer. Yes, i found message._first_line attribute and that is solving my problem. Don't worry PR is guaranteed :)

BR