PDA

Voir la version complète : SIP REFER et fonction Transfer [RESOLU]



ricobok
31/10/2011, 12h50
Bonjour,

Je suis bloqué sur un transfer() qui ne fonctionne pas.

J'ai Asterisk 1.6.2.9-2ubuntu2.1 derriere un Call Manager 7.
Les deux connectés par un trunk SIP.

J'utilise asterisk afin de jouer des fichiers audios et transferer l'appel.
Mais le transfert ne fonctionne pas.

Ci dessous, la conf et les logs :

sip.conf

[ccm]
type=peer
;context=incoming
context=test ; POUR PASSER DANS LE DIALPLAN DE TEST
host=((IPCCM))
disallow=all
allow=ulaw
allow=alaw
nat=no
canreinvite=no
qualify=no

extensions.conf

[test]
exten => _X.,1,Noop("APPEL ENTRANT")
exten => _X.,n,Answer
...
... (pleins d'action avec des backgrounds et playback)
...
exten => _X.,n,Transfer(SIP/10002@ccm)

Voici la trace SIP :




REFER sip:10001@X.X.X.200:5060 SIP/2.0
Via: SIP/2.0/UDP X.X.X.201:5060;branch=z9hG4bK38f48103;rport
Max-Forwards: 70
From: <sip:11111@X.X.X.201>;tag=as1d13f4a6
To: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
Contact: <sip:11111@X.X.X.201>
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
CSeq: 102 REFER
User-Agent: Asterisk PBX 1.6.2.9-2ubuntu2.1
Refer-To: <sip:10002@ccm>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Referred-By: <sip:11111@X.X.X.201>

BYE sip:10001@X.X.X.200:5060 SIP/2.0
Via: SIP/2.0/UDP X.X.X.201:5060;branch=z9hG4bK5e1bb074;rport
Max-Forwards: 70
From: <sip:11111@X.X.X.201>;tag=as1d13f4a6
To: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
CSeq: 103 BYE
User-Agent: Asterisk PBX 1.6.2.9-2ubuntu2.1
X-Asterisk-HangupCause: Unknown
X-Asterisk-HangupCauseCode: 0
Content-Length: 0

SIP/2.0 200 OK
Date: Mon, 31 Oct 2011 19:48:14 GMT
From: <sip:11111@X.X.X.201>;tag=as1d13f4a6
Content-Length: 0
To: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
Via: SIP/2.0/UDP X.X.X.201:5060;branch=z9hG4bK5e1bb074;rport
CSeq: 103 BYE

NOTIFY sip:11111@X.X.X.201:5060 SIP/2.0
Date: Mon, 31 Oct 2011 19:48:15 GMT
From: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
Event: refer
Content-Length: 20
User-Agent: Cisco-CUCM7.0
To: <sip:11111@X.X.X.201>;tag=as1d13f4a6
Contact: <sip:10001@X.X.X.200:5060>
Content-Type: message/sipfrag;version=2.0
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
Subscription-State: active;expires=59
Via: SIP/2.0/UDP X.X.X.200:5060;branch=z9hG4bK1b3916922948
CSeq: 104 NOTIFY
Max-Forwards: 70

SIP/2.0 100 Trying
SIP/2.0 200 OK
Via: SIP/2.0/UDP X.X.X.200:5060;branch=z9hG4bK1b3916922948;received =X.X.X.200
From: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
To: <sip:11111@X.X.X.201>;tag=as1d13f4a6
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
CSeq: 104 NOTIFY
Server: Asterisk PBX 1.6.2.9-2ubuntu2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:11111@X.X.X.201>
Content-Length: 0

NOTIFY sip:11111@X.X.X.201:5060 SIP/2.0
Date: Mon, 31 Oct 2011 19:48:15 GMT
From: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
Event: refer
Content-Length: 31
User-Agent: Cisco-CUCM7.0
To: <sip:11111@X.X.X.201>;tag=as1d13f4a6
Contact: <sip:10001@X.X.X.200:5060>
Content-Type: message/sipfrag;version=2.0
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
Subscription-State: terminated
Via: SIP/2.0/UDP X.X.X.200:5060;branch=z9hG4bK1b3b1d8edba2
CSeq: 105 NOTIFY
Max-Forwards: 70

SIP/2.0 487 Request Cancelled
SIP/2.0 200 OK
Via: SIP/2.0/UDP X.X.X.200:5060;branch=z9hG4bK1b3b1d8edba2;received =X.X.X.200
From: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
To: <sip:11111@X.X.X.201>;tag=as1d13f4a6
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
CSeq: 105 NOTIFY
Server: Asterisk PBX 1.6.2.9-2ubuntu2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:11111@X.X.X.201>
Content-Length: 0

REFER sip:10001@X.X.X.200:5060 SIP/2.0
Via: SIP/2.0/UDP X.X.X.201:5060;branch=z9hG4bK38f48103;rport
Max-Forwards: 70
From: <sip:11111@X.X.X.201>;tag=as1d13f4a6
To: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
Contact: <sip:11111@X.X.X.201>
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
CSeq: 102 REFER
User-Agent: Asterisk PBX 1.6.2.9-2ubuntu2.1
Refer-To: <sip:10002@ccm>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Referred-By: <sip:11111@X.X.X.201>

SIP/2.0 500 Internal Server Error
Reason: Q.850;cause=100
From: <sip:11111@X.X.X.201>;tag=as1d13f4a6
Content-Length: 0
To: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
Via: SIP/2.0/UDP X.X.X.201:5060;branch=z9hG4bK38f48103;rport
CSeq: 102 REFER


Le REFER me parait etrange :

REFER sip:10001@X.X.X.200:5060 SIP/2.0
Via: SIP/2.0/UDP X.X.X.201:5060;branch=z9hG4bK38f48103;rport
Max-Forwards: 70
From: <sip:11111@X.X.X.201>;tag=as1d13f4a6
To: "CCM_poste_1" <sip:10001@X.X.X.200>;tag=443c4a62-649d-4863-b70a-7ff843f3d620-18454632
Contact: <sip:11111@X.X.X.201>
Call-ID: 43f2d880-eae1fb7e-21e44-c86c107e@X.X.X.200
CSeq: 102 REFER
User-Agent: Asterisk PBX 1.6.2.9-2ubuntu2.1
Refer-To: <sip:10002@ccm>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Referred-By: <sip:11111@X.X.X.201>

Existe t-il une autre méthode pour du SIP REFER ?
Merci d'avance.

Reaper
31/10/2011, 14h59
[Synopsis]
Transfer caller to remote extension

[Description]
Transfer([Tech/]dest[,options]): Requests the remote caller be transferred
to a given destination. If TECH (SIP, IAX2, LOCAL etc) is used, only
an incoming call with the same channel technology will be transfered.
Note that for SIP, if you transfer before call is setup, a 302 redirect
SIP message will be returned to the caller.

The result of the application will be reported in the TRANSFERSTATUS
channel variable:
SUCCESS Transfer succeeded
FAILURE Transfer failed
UNSUPPORTED Transfer unsupported by channel driver

Je ne vois pas de @

Si tu remplace:

exten => _X.,n,Transfer(SIP/10002@ccm)

Par:

exten => _X.,n,Transfer(SIP/ccm)

Ça donne quoi ?

Et pourquoi transfer et pas dial ?

Reaper
31/10/2011, 15h02
Question: Where - except for a SIP REFER - is this application of use, why not simply use Dial(), maybe together with a Local channel?

Answer: For example, a SIP provider offering DIDs, you want calls to go to a colo box and then be transfered to other locations rather then waiting for the DID provider to update routes, by using this you save headaches with 1 way audio due to tracking firewalls not being able to track asyncronious SIP and RTP paths, and call delay if you and the colo are in different countries. Downside to doing something like this is you incur a slightly increase call setup delay while the call is bounced between servers, but no one will ever notice since most people take a few rings to actually answer.
C'est ton cas ?

tomarch
31/10/2011, 15h21
De mémoire, il y avait un bug avec le transfer via REFER dans les versions précédant la 1.6.2.16.

ricobok
31/10/2011, 15h41
En fait, Le Call Manager doit conserver la gestion de l'appel.
Asterisk reçoit l'appel du call manager, joue les messages qui vont bien après être passé dans un AGI.
Et le but est de relacher l'appel de l'Asterisk.

Le transfert me permet de libérer l'appel et le call manager gère l'aboutement.

exten => _X.,n,Transfer(SIP/ccm)
=> cela ne va pas convenir car on ne sais pas vers quel DN réaliser le transfert

J'ai testé ça :
exten => _X.,n,Transfer(SIP/10002)

Cette configuration passe ( mais 1 fois sur 10 environ)
Des fois => Musique attente CCM mais le poste 10002 ne sonne pas
Des fois => Musique attente CCM et poste 100002 sonne ===> OK, on voudrais ça à tous les coups...
Des fois => Congestion

Peux être plus la configuration du Call Manager ?

ricobok
31/10/2011, 15h45
Dans tous les cas, en CLI j'ai :

CLI>
== Using SIP RTP CoS mark 5
-- Executing [11111@test:1] NoOp("SIP/ccm-00000119", ""APPEL ENTRANT"") in new stack
-- Executing [11111@test:2] Answer("SIP/ccm-00000119", "") in new stack
-- Executing [11111@test:3] Transfer("SIP/ccm-00000119", "SIP/100002") in new stack
-- Auto fallthrough, channel 'SIP/ccm-00000119' status is 'UNKNOWN'
-- Incoming call: Got SIP response 500 "Internal Server Error" back from X.X.X.200

ricobok
31/10/2011, 15h55
OK j'ai du mieux :


[test]
exten => _X.,1,Noop("APPEL ENTRANT")
exten => _X.,n,Answer
exten => _X.,n,Transfer(SIP/10002)
exten => _X.,n,Wait(2)
exten => _X.,n,Noop(${TRANSFERSTATUS})

En ajoutant un wait(2) puis l'information du transfert, je pense qu'Asterisk ne jette pas l'appel. Le Call Manager a donc le temps d'acheminer l'appel.

Mon soucis venait de là je crois :
Quand la fonction transfert est lancée, l'Asterisk attends le 200 tout de suite, et il ne l'attends pas assez longtemps avant de jeter l'appel.
Si le call manager n'est pas assez rapide, congestion.

Reaper
31/10/2011, 16h00
Le transfert me permet de libérer l'appel et le call manager gère l'aboutement.

Oui, mas ça ne fonctionne pas pour le moment. La machine n'arrive pas a gèrer l'ensemble d'appels vers IVR ? Est ce que tu as une problème de charge ?

ricobok
31/10/2011, 16h15
Non, pas de problème de charge pour le moment, que mes appels de tests tournent.

J'ai le fonctionnement souhaité en ajoutant le wait().

Mes cas ou l'appel se fait jeter, le transfer a bien marché et toutes les lignes du poste sont occupé (Call Flow a traiter dans le CCM).

Ce post semble résolu. Merci de votre aide à tous.

Peut être à noter : Lors d'un Transfer(), placer un wait() derrière... mais je trouve ça bizarre.

Reaper
31/10/2011, 16h24
Ajouter le wait après le transfert est étrange, asterisk attend 200 assez de temps crois moi. Mais peu importe si ça fonctionne pour toi.