Double Registration transaction

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Double Registration transaction

bay2x1
I tried creating my own registration configuration. Using the ngrep tool I was able to capture the header packets.  I am wondering why the route(1) is executed twice everytime that a client registers. This is the code I am using for registration.


route{

        if(!mf_process_maxfwd_header("10")){
                sl_send_reply("483", "Too Many Hops");
                exit;
        };

        if(method=='REGISTER'){
               
                route(1);
        }
}

route[1] {  
        if(is_uri_host_local()) {
        xlog("Registration Process starts here! \n");
                if(!www_authorize("", "subscriber"))
                {else if (method=='INVITE') {
               
                route(2);
        };
                        www_challenge("","1");
                        xlog("Registration Process ends here! \n");
                        exit;
                };

                if(!check_to()) {
                        sl_send_reply("403", "Forbidden");
                };
                save("location");
                exit;
        } else if {
                sl_send_reply("403", "Forbidden");
        };
}
Reply | Threaded
Open this post in threaded view
|

Re: Double Registration transaction

Bogdan-Andrei Iancu
Hi,

Why do you say is executed twice?? Maybe you mistake the 2 REGISTERs
because of the authentication process... REGISTER + 401 ; REGISTER + 200 OK

Regards,
Bogdan

bay2x1 wrote:

> I tried creating my own registration configuration. Using the ngrep tool I
> was able to capture the header packets.  I am wondering why the route(1) is
> executed twice everytime that a client registers. This is the code I am
> using for registration.
>
>
> route{
>
> if(!mf_process_maxfwd_header("10")){
> sl_send_reply("483", "Too Many Hops");
> exit;
> };
>
> if(method=='REGISTER'){
>
> route(1);
> }
> }
>
> route[1] {  
> if(is_uri_host_local()) {
> xlog("Registration Process starts here! \n");
> if(!www_authorize("", "subscriber"))
> {else if (method=='INVITE') {
>
> route(2);
> };
> www_challenge("","1");
> xlog("Registration Process ends here! \n");
> exit;
> };
>
> if(!check_to()) {
> sl_send_reply("403", "Forbidden");
> };
> save("location");
> exit;
> } else if {
> sl_send_reply("403", "Forbidden");
> };
> }
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Double Registration transaction

bay2x1
Using the ngrep tool I was able to capture two request generated for every registration so I am getting two Register + 401 and Register + 200 OK.


Bogdan-Andrei Iancu wrote
Hi,

Why do you say is executed twice?? Maybe you mistake the 2 REGISTERs
because of the authentication process... REGISTER + 401 ; REGISTER + 200 OK

using the syslog the xlog("Registration Process ends here! \n"); code is twice printed everytime a registration occurs.
Is this okay?


Regards,
Bogdan

bay2x1 wrote:
> I tried creating my own registration configuration. Using the ngrep tool I
> was able to capture the header packets.  I am wondering why the route(1) is
> executed twice everytime that a client registers. This is the code I am
> using for registration.
>
>
> route{
>
> if(!mf_process_maxfwd_header("10")){
> sl_send_reply("483", "Too Many Hops");
> exit;
> };
>
> if(method=='REGISTER'){
>
> route(1);
> }
> }
>
> route[1] {  
> if(is_uri_host_local()) {
> xlog("Registration Process starts here! \n");
> if(!www_authorize("", "subscriber"))
> {else if (method=='INVITE') {
>
> route(2);
> };
> www_challenge("","1");
> xlog("Registration Process ends here! \n");
> exit;
> };
>
> if(!check_to()) {
> sl_send_reply("403", "Forbidden");
> };
> save("location");
> exit;
> } else if {
> sl_send_reply("403", "Forbidden");
> };
> }
>  


_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Double Registration transaction

Bogdan-Andrei Iancu
Hi,

are the first two REGISTERs (for 401) perfect identical ? check the cseq
number

Regards,
Bogdan

bay2x1 wrote:

> Using the ngrep tool I was able to capture two request generated for every
> registration so I am getting two Register + 401 and Register + 200 OK.
>
>
>
> Bogdan-Andrei Iancu wrote:
>  
>> Hi,
>>
>> Why do you say is executed twice?? Maybe you mistake the 2 REGISTERs
>> because of the authentication process... REGISTER + 401 ; REGISTER + 200
>> OK
>>
>> using the syslog the xlog("Registration Process ends here! \n"); code is
>> twice printed everytime a registration occurs.
>> Is this okay?
>>
>>
>> Regards,
>> Bogdan
>>
>> bay2x1 wrote:
>>    
>>> I tried creating my own registration configuration. Using the ngrep tool
>>> I
>>> was able to capture the header packets.  I am wondering why the route(1)
>>> is
>>> executed twice everytime that a client registers. This is the code I am
>>> using for registration.
>>>
>>>
>>> route{
>>>
>>> if(!mf_process_maxfwd_header("10")){
>>> sl_send_reply("483", "Too Many Hops");
>>> exit;
>>> };
>>>
>>> if(method=='REGISTER'){
>>>
>>> route(1);
>>> }
>>> }
>>>
>>> route[1] {  
>>> if(is_uri_host_local()) {
>>> xlog("Registration Process starts here! \n");
>>> if(!www_authorize("", "subscriber"))
>>> {else if (method=='INVITE') {
>>>
>>> route(2);
>>> };
>>> www_challenge("","1");
>>> xlog("Registration Process ends here! \n");
>>> exit;
>>> };
>>>
>>> if(!check_to()) {
>>> sl_send_reply("403", "Forbidden");
>>> };
>>> save("location");
>>> exit;
>>> } else if {
>>> sl_send_reply("403", "Forbidden");
>>> };
>>> }
>>>  
>>>      
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>    
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Double Registration transaction

bay2x1
Here is the headers for a single registration

U xxx.xx.xxx.xx:51764 -> xxx.xx.xxx.xx:5060
REGISTER sip:ws16.racequeen.local SIP/2.0.
Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport;branch=z9hG4bK1062813226.
From: <sip:1008@ws16.racequeen.local>;tag=1375385272.
To: <sip:1008@ws16.racequeen.local>.
Call-ID: 679494634@xxx.xx.xxx.xx.
CSeq: 401 REGISTER.
Max-Forwards: 70.
Contact: <sip:1008@xxx.xx.xxx.xx:51764;transport=udp>;expires=1000;+sip.instance="<urn:uuid:e8d3c140-0a1b-11de-9649-0d3ddabb3b87>";reg-id=1.
User-Agent: Minisip.
Supported: path, gruu.
Content-Length: 0.
.


U xxx.xx.xxx.xx:51764 -> xxx.xx.xxx.xx:5060
REGISTER sip:ws16.racequeen.local SIP/2.0.
Via: SIP/2.0/UDP 172.16.100.21:51764;rport;branch=z9hG4bK1435300431.
From: <sip:1008@ws16.racequeen.local>;tag=357996325.
To: <sip:1008@ws16.racequeen.local>.
Call-ID: 576272071@172.16.100.21.
CSeq: 901 REGISTER.
Max-Forwards: 70.
Contact: <sip:1008@172.16.100.21:51764;transport=udp>;expires=1000;+sip.instance="<urn:uuid:e8d3c140-0a1b-11de-9649-0d3ddabb3b87>";reg-id=2.
User-Agent: Minisip.
Supported: path, gruu.
Content-Length: 0.
.


U xxx.xx.xxx.xx:5060 -> xxx.xx.xxx.xx:51764
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport=51764;branch=z9hG4bK1062813226.
From: <sip:1008@ws16.racequeen.local>;tag=1375385272.
To: <sip:1008@ws16.racequeen.local>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.60f5.
Call-ID: 679494634@172.16.100.21.
CSeq: 401 REGISTER.
WWW-Authenticate: Digest realm="ws16.racequeen.local", nonce="49c02f6500000000b96eb2bb153432e8ab4a883d3f76644c".
Server: OpenSIPS (1.5.0dev5-tls (i386/linux)).
Content-Length: 0.
.


U xxx.xx.xxx.xx:51764 -> xxx.xx.xxx.xx:5060
REGISTER sip:ws16.racequeen.local SIP/2.0.
Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport;branch=z9hG4bK162825806.
From: <sip:1008@ws16.racequeen.local>;tag=1375385272.
To: <sip:1008@ws16.racequeen.local>.
Call-ID: 679494634@172.16.100.21.
CSeq: 402 REGISTER.
Max-Forwards: 70.
Contact: <sip:1008@xxx.xx.xxx.xx:51764;transport=udp>;expires=1000;+sip.instance="<urn:uuid:e8d3c140-0a1b-11de-9649-0d3ddabb3b87>";reg-id=1.
User-Agent: Minisip.
Authorization: Digest algorithm=MD5,username="1008",realm="ws16.racequeen.local",nonce="49c02f6500000000b96eb2bb153432e8ab4a883d3f76644c",uri="sip:ws16.racequeen.local",response="50c2c60deb861582b64f662687f085c2".
Supported: path, gruu.
Content-Length: 0.
.


U xxx.xx.xxx.xx:5060 -> xxx.xx.xxx.xx:51764
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport=51764;branch=z9hG4bK1435300431.
From: <sip:1008@ws16.racequeen.local>;tag=357996325.
To: <sip:1008@ws16.racequeen.local>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.8888.
Call-ID: 576272071@xxx.xx.xxx.xx.
CSeq: 901 REGISTER.
WWW-Authenticate: Digest realm="ws16.racequeen.local", nonce="49c02f650000000100cb2ec7bde0feb52b509eb8d18f57ec".
Server: OpenSIPS (1.5.0dev5-tls (i386/linux)).
Content-Length: 0.
.


U xxx.xx.xxx.xx:51764 -> xxx.xx.xxx.xx:5060
REGISTER sip:ws16.racequeen.local SIP/2.0.
Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport;branch=z9hG4bK1265058074.
From: <sip:1008@ws16.racequeen.local>;tag=357996325.
To: <sip:1008@ws16.racequeen.local>.
Call-ID: 576272071@172.16.100.21.
CSeq: 902 REGISTER.
Max-Forwards: 70.
Contact: <sip:1008@xxx.xx.xxx.xx:51764;transport=udp>;expires=1000;+sip.instance="<urn:uuid:e8d3c140-0a1b-11de-9649-0d3ddabb3b87>";reg-id=2.
User-Agent: Minisip.
Authorization: Digest algorithm=MD5,username="1008",realm="ws16.racequeen.local",nonce="49c02f650000000100cb2ec7bde0feb52b509eb8d18f57ec",uri="sip:ws16.racequeen.local",response="5913cb4c8ad387ad6a0277bbfca12f05".
Supported: path, gruu.
Content-Length: 0.
.


U xxx.xx.xxx.xx:5060 -> xxx.xx.xxx.xx:51764
SIP/2.0 200 OK.
Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport=51764;branch=z9hG4bK162825806.
From: <sip:1008@ws16.racequeen.local>;tag=1375385272.
To: <sip:1008@ws16.racequeen.local>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.38d1.
Call-ID: 679494634@xxx.xx.xxx.xx.
CSeq: 402 REGISTER.
Contact: <sip:1008@xxx.xx.xxx.xx:51764;transport=udp>;expires=1000.
Server: OpenSIPS (1.5.0dev5-tls (i386/linux)).
Content-Length






Bogdan-Andrei Iancu wrote
Hi,

are the first two REGISTERs (for 401) perfect identical ? check the cseq
number

Regards,
Bogdan

bay2x1 wrote:
> Using the ngrep tool I was able to capture two request generated for every
> registration so I am getting two Register + 401 and Register + 200 OK.
>
>
>
> Bogdan-Andrei Iancu wrote:
>  
>> Hi,
>>
>> Why do you say is executed twice?? Maybe you mistake the 2 REGISTERs
>> because of the authentication process... REGISTER + 401 ; REGISTER + 200
>> OK
>>
>> using the syslog the xlog("Registration Process ends here! \n"); code is
>> twice printed everytime a registration occurs.
>> Is this okay?
>>
>>
>> Regards,
>> Bogdan
>>
>> bay2x1 wrote:
>>    
>>> I tried creating my own registration configuration. Using the ngrep tool
>>> I
>>> was able to capture the header packets.  I am wondering why the route(1)
>>> is
>>> executed twice everytime that a client registers. This is the code I am
>>> using for registration.
>>>
>>>
>>> route{
>>>
>>> if(!mf_process_maxfwd_header("10")){
>>> sl_send_reply("483", "Too Many Hops");
>>> exit;
>>> };
>>>
>>> if(method=='REGISTER'){
>>>
>>> route(1);
>>> }
>>> }
>>>
>>> route[1] {  
>>> if(is_uri_host_local()) {
>>> xlog("Registration Process starts here! \n");
>>> if(!www_authorize("", "subscriber"))
>>> {else if (method=='INVITE') {
>>>
>>> route(2);
>>> };
>>> www_challenge("","1");
>>> xlog("Registration Process ends here! \n");
>>> exit;
>>> };
>>>
>>> if(!check_to()) {
>>> sl_send_reply("403", "Forbidden");
>>> };
>>> save("location");
>>> exit;
>>> } else if {
>>> sl_send_reply("403", "Forbidden");
>>> };
>>> }
>>>  
>>>      
>> _______________________________________________
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>    
>
>  


_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Double Registration transaction

Bogdan-Andrei Iancu
There are 2 different REGISTERs - they have different CallID and Cseqs.

Regards,
Bogdan

bay2x1 wrote:

> Here is the headers for a single registration
>
> U xxx.xx.xxx.xx:51764 -> xxx.xx.xxx.xx:5060
> REGISTER sip:ws16.racequeen.local SIP/2.0.
> Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport;branch=z9hG4bK1062813226.
> From: <sip:[hidden email]>;tag=1375385272.
> To: <sip:[hidden email]>.
> Call-ID: [hidden email].
> CSeq: 401 REGISTER.
> Max-Forwards: 70.
> Contact:
> <sip:[hidden email]:51764;transport=udp>;expires=1000;+sip.instance="<urn:uuid:e8d3c140-0a1b-11de-9649-0d3ddabb3b87>";reg-id=1.
> User-Agent: Minisip.
> Supported: path, gruu.
> Content-Length: 0.
> .
>
>
> U xxx.xx.xxx.xx:51764 -> xxx.xx.xxx.xx:5060
> REGISTER sip:ws16.racequeen.local SIP/2.0.
> Via: SIP/2.0/UDP 172.16.100.21:51764;rport;branch=z9hG4bK1435300431.
> From: <sip:[hidden email]>;tag=357996325.
> To: <sip:[hidden email]>.
> Call-ID: 576272071@172.16.100.21.
> CSeq: 901 REGISTER.
> Max-Forwards: 70.
> Contact:
> <sip:1008@172.16.100.21:51764;transport=udp>;expires=1000;+sip.instance="<urn:uuid:e8d3c140-0a1b-11de-9649-0d3ddabb3b87>";reg-id=2.
> User-Agent: Minisip.
> Supported: path, gruu.
> Content-Length: 0.
> .
>
>
> U xxx.xx.xxx.xx:5060 -> xxx.xx.xxx.xx:51764
> SIP/2.0 401 Unauthorized.
> Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport=51764;branch=z9hG4bK1062813226.
> From: <sip:[hidden email]>;tag=1375385272.
> To:
> <sip:[hidden email]>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.60f5.
> Call-ID: 679494634@172.16.100.21.
> CSeq: 401 REGISTER.
> WWW-Authenticate: Digest realm="ws16.racequeen.local",
> nonce="49c02f6500000000b96eb2bb153432e8ab4a883d3f76644c".
> Server: OpenSIPS (1.5.0dev5-tls (i386/linux)).
> Content-Length: 0.
> .
>
>
> U xxx.xx.xxx.xx:51764 -> xxx.xx.xxx.xx:5060
> REGISTER sip:ws16.racequeen.local SIP/2.0.
> Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport;branch=z9hG4bK162825806.
> From: <sip:[hidden email]>;tag=1375385272.
> To: <sip:[hidden email]>.
> Call-ID: 679494634@172.16.100.21.
> CSeq: 402 REGISTER.
> Max-Forwards: 70.
> Contact:
> <sip:[hidden email]:51764;transport=udp>;expires=1000;+sip.instance="<urn:uuid:e8d3c140-0a1b-11de-9649-0d3ddabb3b87>";reg-id=1.
> User-Agent: Minisip.
> Authorization: Digest
> algorithm=MD5,username="1008",realm="ws16.racequeen.local",nonce="49c02f6500000000b96eb2bb153432e8ab4a883d3f76644c",uri="sip:ws16.racequeen.local",response="50c2c60deb861582b64f662687f085c2".
> Supported: path, gruu.
> Content-Length: 0.
> .
>
>
> U xxx.xx.xxx.xx:5060 -> xxx.xx.xxx.xx:51764
> SIP/2.0 401 Unauthorized.
> Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport=51764;branch=z9hG4bK1435300431.
> From: <sip:[hidden email]>;tag=357996325.
> To:
> <sip:[hidden email]>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.8888.
> Call-ID: [hidden email].
> CSeq: 901 REGISTER.
> WWW-Authenticate: Digest realm="ws16.racequeen.local",
> nonce="49c02f650000000100cb2ec7bde0feb52b509eb8d18f57ec".
> Server: OpenSIPS (1.5.0dev5-tls (i386/linux)).
> Content-Length: 0.
> .
>
>
> U xxx.xx.xxx.xx:51764 -> xxx.xx.xxx.xx:5060
> REGISTER sip:ws16.racequeen.local SIP/2.0.
> Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport;branch=z9hG4bK1265058074.
> From: <sip:[hidden email]>;tag=357996325.
> To: <sip:[hidden email]>.
> Call-ID: 576272071@172.16.100.21.
> CSeq: 902 REGISTER.
> Max-Forwards: 70.
> Contact:
> <sip:[hidden email]:51764;transport=udp>;expires=1000;+sip.instance="<urn:uuid:e8d3c140-0a1b-11de-9649-0d3ddabb3b87>";reg-id=2.
> User-Agent: Minisip.
> Authorization: Digest
> algorithm=MD5,username="1008",realm="ws16.racequeen.local",nonce="49c02f650000000100cb2ec7bde0feb52b509eb8d18f57ec",uri="sip:ws16.racequeen.local",response="5913cb4c8ad387ad6a0277bbfca12f05".
> Supported: path, gruu.
> Content-Length: 0.
> .
>
>
> U xxx.xx.xxx.xx:5060 -> xxx.xx.xxx.xx:51764
> SIP/2.0 200 OK.
> Via: SIP/2.0/UDP xxx.xx.xxx.xx:51764;rport=51764;branch=z9hG4bK162825806.
> From: <sip:[hidden email]>;tag=1375385272.
> To:
> <sip:[hidden email]>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.38d1.
> Call-ID: [hidden email].
> CSeq: 402 REGISTER.
> Contact: <sip:[hidden email]:51764;transport=udp>;expires=1000.
> Server: OpenSIPS (1.5.0dev5-tls (i386/linux)).
> Content-Length
>
>
>
>
>
>
>
> Bogdan-Andrei Iancu wrote:
>  
>> Hi,
>>
>> are the first two REGISTERs (for 401) perfect identical ? check the cseq
>> number
>>
>> Regards,
>> Bogdan
>>
>> bay2x1 wrote:
>>    
>>> Using the ngrep tool I was able to capture two request generated for
>>> every
>>> registration so I am getting two Register + 401 and Register + 200 OK.
>>>
>>>
>>>
>>> Bogdan-Andrei Iancu wrote:
>>>  
>>>      
>>>> Hi,
>>>>
>>>> Why do you say is executed twice?? Maybe you mistake the 2 REGISTERs
>>>> because of the authentication process... REGISTER + 401 ; REGISTER + 200
>>>> OK
>>>>
>>>> using the syslog the xlog("Registration Process ends here! \n"); code is
>>>> twice printed everytime a registration occurs.
>>>> Is this okay?
>>>>
>>>>
>>>> Regards,
>>>> Bogdan
>>>>
>>>> bay2x1 wrote:
>>>>    
>>>>        
>>>>> I tried creating my own registration configuration. Using the ngrep
>>>>> tool
>>>>> I
>>>>> was able to capture the header packets.  I am wondering why the
>>>>> route(1)
>>>>> is
>>>>> executed twice everytime that a client registers. This is the code I am
>>>>> using for registration.
>>>>>
>>>>>
>>>>> route{
>>>>>
>>>>> if(!mf_process_maxfwd_header("10")){
>>>>> sl_send_reply("483", "Too Many Hops");
>>>>> exit;
>>>>> };
>>>>>
>>>>> if(method=='REGISTER'){
>>>>>
>>>>> route(1);
>>>>> }
>>>>> }
>>>>>
>>>>> route[1] {  
>>>>> if(is_uri_host_local()) {
>>>>> xlog("Registration Process starts here! \n");
>>>>> if(!www_authorize("", "subscriber"))
>>>>> {else if (method=='INVITE') {
>>>>>
>>>>> route(2);
>>>>> };
>>>>> www_challenge("","1");
>>>>> xlog("Registration Process ends here! \n");
>>>>> exit;
>>>>> };
>>>>>
>>>>> if(!check_to()) {
>>>>> sl_send_reply("403", "Forbidden");
>>>>> };
>>>>> save("location");
>>>>> exit;
>>>>> } else if {
>>>>> sl_send_reply("403", "Forbidden");
>>>>> };
>>>>> }
>>>>>  
>>>>>      
>>>>>          
>>>> _______________________________________________
>>>> Users mailing list
>>>> [hidden email]
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>>    
>>>>        
>>>  
>>>      
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>    
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users