[OpenSER-Users-ES] A vueltas con los REFER y NOTIFY

Saúl Ibarra saghul at gmail.com
Fri May 23 13:52:56 CEST 2008


OK, te cuento un poco y sino luego hago un super-dibu que anda que no
hay flechitas... :)

* Usuario A manda INVITE a OpenSER para hablar con B.
* OpenSER redirige el INVITE a Asterisk.
* Asterisk tiene una vista de la tabla subscriber, así que se piensa
que B es usuario suyo, pero la IP es la del OpenSER :)
* Asterisk hace sus kosas y manda el INVITE a OpenSER de nuevo.
* OpenSER ve que el INVITE viene de Asterisk, busca a B y se lo manda.

Ahora A y B estan hablando.

* A manda un REFER a B para que este hable con C.
* Esto es lo que ocurre:

#
U +5.421465 10.10.0.130:5060 -> 10.245.145.27:5060
REFER sip:1000 at 10.245.145.27:5070 SIP/2.0
Via: SIP/2.0/UDP 10.10.0.130:5060;branch=z9hG4bK-7db0db30
From: <sip:1000 at 10.245.145.27>;tag=54ba3d9438c7d1fai0
To: "nombreusuario2 apellidosusuario2" <sip:1000 at 10.245.145.27>;tag=as1b55edd5
Referred-By: "1000" <sip:1000 at 10.245.145.27>
Call-ID: 3b565892631e9a79260a2f56571ea2e4 at 10.245.145.27
CSeq: 101 REFER
Max-Forwards: 70
Route: <sip:10.245.145.27;lr=on;ftag=as1b55edd5>
Contact: "1000" <sip:1000 at 10.10.0.130:5060>
Refer-To: <sip:1002 at 10.245.145.27>
User-Agent: Linksys/SPA962-5.1.15(aSC)
Content-Length: 0


#
U +0.000083 10.245.145.27:5060 -> 10.10.0.130:5060
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 10.10.0.130:5060;branch=z9hG4bK-7db0db30
From: <sip:1000 at 10.245.145.27>;tag=54ba3d9438c7d1fai0
To: "nombreusuario2 apellidosusuario2" <sip:1000 at 10.245.145.27>;tag=as1b55edd5
Call-ID: 3b565892631e9a79260a2f56571ea2e4 at 10.245.145.27
CSeq: 101 REFER
Proxy-Authenticate: Digest realm="10.245.145.27",
nonce="483698d00790a7085c8dfd43123007a4015f5487"
Server: OpenSER (1.3.1-notls (i386/linux))
Content-Length: 0


#
U +0.075421 10.10.0.130:5060 -> 10.245.145.27:5060
REFER sip:1000 at 10.245.145.27:5070 SIP/2.0
Via: SIP/2.0/UDP 10.10.0.130:5060;branch=z9hG4bK-f2e674d0
From: <sip:1000 at 10.245.145.27>;tag=54ba3d9438c7d1fai0
To: "nombreusuario2 apellidosusuario2" <sip:1000 at 10.245.145.27>;tag=as1b55edd5
Referred-By: "1000" <sip:1000 at 10.245.145.27>
Call-ID: 3b565892631e9a79260a2f56571ea2e4 at 10.245.145.27
CSeq: 102 REFER
Max-Forwards: 70
Route: <sip:10.245.145.27;lr=on;ftag=as1b55edd5>
Proxy-Authorization: Digest
username="1000",realm="10.245.145.27",nonce="483698d00790a7085c8dfd43123007a4015f5487",uri="sip:1000 at 10.245.145.27:5070",algorithm=MD5,response="2c30c97fda875dd8cd07b9b20087d7bb"
Contact: "1000" <sip:1000 at 10.10.0.130:5060>
Refer-To: <sip:1002 at 10.245.145.27>
User-Agent: Linksys/SPA962-5.1.15(aSC)
Content-Length: 0


#
U +0.000498 10.245.145.27:5060 -> 10.245.145.27:5070
REFER sip:1000 at 10.245.145.27:5070 SIP/2.0
Record-Route: <sip:10.245.145.27;lr=on;ftag=54ba3d9438c7d1fai0>
Via: SIP/2.0/UDP 10.245.145.27;branch=z9hG4bKa9c1.a70dfe6.0
Via: SIP/2.0/UDP 10.10.0.130:5060;branch=z9hG4bK-f2e674d0
From: <sip:1000 at 10.245.145.27>;tag=54ba3d9438c7d1fai0
To: "nombreusuario2 apellidosusuario2" <sip:1000 at 10.245.145.27>;tag=as1b55edd5
Referred-By: "1000" <sip:1000 at 10.245.145.27>
Call-ID: 3b565892631e9a79260a2f56571ea2e4 at 10.245.145.27
CSeq: 102 REFER
Max-Forwards: 69
Contact: "1000" <sip:1000 at 10.10.0.130:5060>
Refer-To: <sip:1002 at 10.245.145.27>
User-Agent: Linksys/SPA962-5.1.15(aSC)
Content-Length: 0


#
U +0.000078 10.245.145.27:5070 -> 10.245.145.27:5060
SIP/2.0 202 Accepted
Via: SIP/2.0/UDP
10.245.145.27;branch=z9hG4bKa9c1.a70dfe6.0;received=10.245.145.27
Via: SIP/2.0/UDP 10.10.0.130:5060;branch=z9hG4bK-f2e674d0
Record-Route: <sip:10.245.145.27;lr=on;ftag=54ba3d9438c7d1fai0>
From: <sip:1000 at 10.245.145.27>;tag=54ba3d9438c7d1fai0
To: "nombreusuario2 apellidosusuario2" <sip:1000 at 10.245.145.27>;tag=as1b55edd5
Call-ID: 3b565892631e9a79260a2f56571ea2e4 at 10.245.145.27
CSeq: 102 REFER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:1000 at 10.245.145.27:5070>
Content-Length: 0

* Efectivamente el REFER va hasta el Asterisk.
* El INVITE que se le manda a C es este:

#
U +0.000386 10.245.145.27:5070 -> 10.245.145.27:5060
INVITE sip:1002 at 10.245.145.27 SIP/2.0
Via: SIP/2.0/UDP 10.245.145.27:5070;branch=z9hG4bK2bd370c4;rport
From: "nombreusuario2 apellidosusuario2"
<sip:1002 at 10.245.145.27>;tag=as3725c43a
To: <sip:1002 at 10.245.145.27>
Contact: <sip:1002 at 10.245.145.27:5070>
Call-ID: 60f7e02d046cc00652714d2a29284e5f at 10.245.145.27
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "nombreusuario2 apellidosusuario2"
<sip:1001 at 10.245.145.27>;privacy=off;screen=no
Date: Fri, 23 May 2008 10:08:36 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 182


#
U +0.000110 10.245.145.27:5060 -> 10.245.145.27:5070
SIP/2.0 100 Giving a try
Via: SIP/2.0/UDP 10.245.145.27:5070;branch=z9hG4bK2bd370c4;rport=5070
From: "nombreusuario2 apellidosusuario2"
<sip:1002 at 10.245.145.27>;tag=as3725c43a
To: <sip:1002 at 10.245.145.27>
Call-ID: 60f7e02d046cc00652714d2a29284e5f at 10.245.145.27
CSeq: 102 INVITE
Server: OpenSER (1.3.1-notls (i386/linux))
Content-Length: 0


#
U +0.000028 10.245.145.27:5060 -> 10.10.0.207:5060
INVITE sip:1002 at 10.10.0.207 SIP/2.0
Record-Route: <sip:10.245.145.27;lr=on;ftag=as3725c43a>
Via: SIP/2.0/UDP 10.245.145.27;branch=z9hG4bK1ea6.2b700c1.0
Via: SIP/2.0/UDP 10.245.145.27:5070;branch=z9hG4bK2bd370c4;rport=5070
From: "nombreusuario2 apellidosusuario2"
<sip:1002 at 10.245.145.27>;tag=as3725c43a
To: <sip:1002 at 10.245.145.27>
Contact: <sip:1002 at 10.245.145.27:5070>
Call-ID: 60f7e02d046cc00652714d2a29284e5f at 10.245.145.27
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 69
Remote-Party-ID: "nombreusuario2 apellidosusuario2"
<sip:1001 at 10.245.145.27>;privacy=off;screen=no
Date: Fri, 23 May 2008 10:08:36 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 182

* La comunicación funciona way, PEEEERO, el problema viene después.
* Al acabar, entiendo que el NOTIFY que le debería llegar a A debería
tener Subscirption-State: terminated, pero no llega ninguno así. :-O
* Después de colgar (el usuario A, el que inició la transferencia),
después de los BYE y tal, va y me llega esto:

#
U +4.003565 10.245.145.27:5070 -> 10.245.145.27:5060
NOTIFY sip:1000 at 10.10.0.130:5060 SIP/2.0
Via: SIP/2.0/UDP 10.245.145.27:5070;branch=z9hG4bK49f5f697;rport
Route: <sip:10.245.145.27;lr=on;ftag=as1b55edd5>
From: "nombreusuario2 apellidosusuario2"
<sip:1000 at 10.245.145.27>;tag=as1b55edd5
To: <sip:1000 at 10.245.145.27>;tag=54ba3d9438c7d1fai0
Contact: <sip:1000 at 10.245.145.27:5070>
Call-ID: 3b565892631e9a79260a2f56571ea2e4 at 10.245.145.27
CSeq: 103 NOTIFY
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "nombreusuario2 apellidosusuario2"
<sip:1001 at 10.245.145.27>;privacy=off;screen=no
Event: refer;id=102
Subscription-state: active
Content-Type: message/sipfrag;version=2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 21

SIP/2.0 183 Ringing

#
U +0.000098 10.245.145.27:5060 -> 10.10.0.130:5060
NOTIFY sip:1000 at 10.10.0.130:5060 SIP/2.0
Record-Route: <sip:10.245.145.27;lr=on;ftag=as1b55edd5>
Via: SIP/2.0/UDP 10.245.145.27;branch=z9hG4bKb9c1.bd37f772.0
Via: SIP/2.0/UDP 10.245.145.27:5070;branch=z9hG4bK49f5f697;rport=5070
From: "nombreusuario2 apellidosusuario2"
<sip:1000 at 10.245.145.27>;tag=as1b55edd5
To: <sip:1000 at 10.245.145.27>;tag=54ba3d9438c7d1fai0
Contact: <sip:1000 at 10.245.145.27:5070>
Call-ID: 3b565892631e9a79260a2f56571ea2e4 at 10.245.145.27
CSeq: 103 NOTIFY
User-Agent: Asterisk PBX
Max-Forwards: 69
Remote-Party-ID: "nombreusuario2 apellidosusuario2"
<sip:1001 at 10.245.145.27>;privacy=off;screen=no
Event: refer;id=102
Subscription-state: active
Content-Type: message/sipfrag;version=2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 21

SIP/2.0 183 Ringing

#
U +0.053027 10.10.0.130:5060 -> 10.245.145.27:5060
SIP/2.0 481 Call Leg/Transaction Does Not Exist
To: <sip:1000 at 10.245.145.27>;tag=54ba3d9438c7d1fai0
From: "nombreusuario2 apellidosusuario2"
<sip:1000 at 10.245.145.27>;tag=as1b55edd5
Call-ID: 3b565892631e9a79260a2f56571ea2e4 at 10.245.145.27
CSeq: 103 NOTIFY
Via: SIP/2.0/UDP 10.245.145.27;branch=z9hG4bKb9c1.bd37f772.0
Via: SIP/2.0/UDP 10.245.145.27:5070;branch=z9hG4bK49f5f697;rport=5070
Record-Route: <sip:10.245.145.27;lr=on;ftag=as1b55edd5>
Server: Linksys/SPA962-5.1.15(aSC)
Content-Length: 0


#
U +0.000051 10.245.145.27:5060 -> 10.245.145.27:5070
SIP/2.0 481 Call Leg/Transaction Does Not Exist
To: <sip:1000 at 10.245.145.27>;tag=54ba3d9438c7d1fai0
From: "nombreusuario2 apellidosusuario2"
<sip:1000 at 10.245.145.27>;tag=as1b55edd5
Call-ID: 3b565892631e9a79260a2f56571ea2e4 at 10.245.145.27
CSeq: 103 NOTIFY
Via: SIP/2.0/UDP 10.245.145.27:5070;branch=z9hG4bK49f5f697;rport=5070
Record-Route: <sip:10.245.145.27;lr=on;ftag=as1b55edd5>
Server: Linksys/SPA962-5.1.15(aSC)
Content-Length: 0


#

* Obviamente, si ya ha colgado, no hay transacción por ahí...

Alguna idea??


PD: Siento esta super-brasa-mail, espero que se me haya entendido :)


-- 
Saúl -- "Nunca subestimes el ancho de banda de un camión lleno de disketes."
----------------------------------------------------------------
http://www.saghul.net/




More information about the Users-es mailing list