Callback asterisk avec freephonie
Bonjour,
Je souhaite faire un callback en utilisant le service freephonie. Cela fait moins d'une semaine que j'utilise asterisk 1.6 (sous fedora) donc je ne suis pas expert de la configuration asterisk. Je veux faire ceci (en utilisant freephonie):
1- appeler de mon portable chez moi
2- asterisk me rappelle (par le compte sip de freephonie) et me demande un code que je lui donne
3- si le code est bon, asterisk me demande le numero que je veux composer
4- asterisk me met en contatce avec la personne souhaité et on peut discuter
5- je souhaite que cette procédure soit vrai pour mon numéro de portable uniquement, les autres numéros ne doivent pas être rappelés automatiquement
J'ai trouvé un code à tester sur le cite http://guides.ovh.com/AsteriskCallBack. Voici mon code et les erreurs qui apparaissent:
Dans "sudo gedit /etc/asterisk/sip.conf":
[general]
port=5060
bindaddr=0.0.0.0
tos=0x18
nat=yes
externip= mon_IP_public
disallow=all
allow=ulaw
allow = alaw
register => 09******:mot_de_passe@freephonie.net
[freephonie]
type = peer
insecure = port,invite
host = freephonie.net
username = 09*******
context = incoming_calls
fromuser = 09********
secret = mot_de_passe
nat = yes
fromdomain = freephonie.net
disallow = all
allow = alaw,ulaw
[1001]
type=friend
host=dynamic
context=phones
secret=bolivar
[1002]
type=friend
host=dynamic
context=phones
secret=bolivar
Dans "sudo gedit /etc/asterisk/extensions.conf":
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no
[globals]
CONSOLE=Console/dsp
IAXINFO=guest
TRUNK=Zap/g2
TRUNKMSD=1
[default]
exten => s,1,Verbose(1|Unrouted call handler)
exten => s,n,Answer()
exten => s,n,Wait(1)
exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()
[incoming_calls]
exten => s,1,NoOp(Incoming call form callback)
exten => s,2,Goto(init-callback,100,1)
[outgoing_calls]
exten => _X.,1,NoOp()
exten => _X.,n,Dial(SIP/freephonie/${EXTEN})
[internal]
exten => 1000,1,Verbose(1|Extension 1000)
exten => 1000,n,Dial(SIP/1000,30)
exten => 1000,n,Hangup()
exten => 500,1,Verbose(1|Echo test application)
exten => 500,n,Echo()
exten => 500,n,Hangup()
[phones]
include => internal
include => outgoing_calls
[init-callback]
exten => 100,1,System(echo je vais apeller ${CALLERID(num)})
exten => 100,2,Congestion
exten => 100,3,Hangup
exten => h,1,System(echo je rapelle ${CALLERID(num)})
exten => h,2,System(echo Channel: SIP/${CALLERID(num)}@freephonie > /tmp/${CALLERID(num)})
exten => h,3,System(echo Context: callback-ctx >> /tmp/${CALLERID(num)})
exten => h,4,System(echo Extension: s >> /tmp/${CALLERID(num)})
exten => h,5,System(echo Priority: 1 >> /tmp/${CALLERID(num)})
exten => h,6,System(echo MaxRetries: 5 >> /tmp/${CALLERID(num)})
exten => h,7,System(echo RetryTime: ${CALLERID(num)} >> /tmp/${CALLERID(num)})
exten => h,8,System(echo WaitTime: 45 >> /tmp/${CALLERID(num)})
exten => h,9,System(echo sleep 5 > /tmp/${CALLERID(num)}.2)
exten => h,10,System(echo cp /tmp/${CALLERID(num)} /var/spool/asterisk/outgoing/ >> /tmp/${CALLERID(num)}.2)
exten => h,11,System(chmod 775 /tmp/${CALLERID(num)}.2)
exten => h,12,System(/tmp/${CALLERID(num)}.2)
exten => h,13,Hangup()
[callback-ctx]
exten => s,1,Background(silence/2)
exten => s,2,SIPDtmfMode(inband))
exten => s,3,Authenticate(1234)
exten => s,4,DISA(no-password|callback-out)
[callback-out]
exten => _X.,1,Dial(SIP/freephonie/${EXTEN},240,T)
Les erreurs que je vois sur mon serveur:
CLI> [Apr 22 15:10:52] WARNING[9041]: chan_sip.c:18348 handle_response_register: Got 423 Interval too brief for service 09********@freephonie.net, minimum is 1800 seconds
je vais apeller 0661837311
je rapelle 0661837311
[Apr 22 15:11:24] WARNING[9079]: file.c:650 ast_openstream_full: File silence/2 does not exist in any format
[Apr 22 15:11:24] WARNING[9079]: file.c:956 ast_streamfile: Unable to open silence/2 (format 0x8 (alaw)): No such file or directory
[Apr 22 15:11:24] WARNING[9079]: pbx.c:8926 pbx_builtin_background: ast_streamfile failed on SIP/freephonie-00000001 for silence/2
[Apr 22 15:11:24] WARNING[9079]: chan_sip.c:25767 sip_dtmfmode: I don't know about this dtmf mode: inband)
[Apr 22 15:11:24] WARNING[9079]: file.c:650 ast_openstream_full: File agent-pass does not exist in any format
[Apr 22 15:11:24] WARNING[9079]: file.c:956 ast_streamfile: Unable to open agent-pass (format 0x8 (alaw)): No such file or directory
[Apr 22 15:11:24] WARNING[9079]: file.c:650 ast_openstream_full: File vm-goodbye does not exist in any format
[Apr 22 15:11:24] WARNING[9079]: file.c:956 ast_streamfile: Unable to open vm-goodbye (format 0x8 (alaw)): No such file or directory
[Apr 22 15:11:24] NOTICE[9079]: pbx_spool.c:349 attempt_thread: Call completed to SIP/06********@freephonie
Je n'ai rien ajouté de plus, tout est écrit ci dessus.
Quand je bip mon téléphone fixe avec mon portable, asterisk me rappelle mais la communication coupe dès que je décroche et le message d'erreur s'affiche. De plus, cette procédure est vrai quelque soi le numéro qui appelle mon fixe alors que je veux que ça marche uniquement pour mon numéro de portable.
Si vous avez la solution à mon problème répondez moi s'il vous plait?? Si vous avez un code qui marche, je suis preneur?? S'il y a un tutoriel (assez détaillé) qui permet de faire le callback je prends??
Soyez précis dans vos réponses s'il vous plait, car je suis un novis sur asterisk il faut donc être le plus précis possible. Merci
Callback asterisk avec freephonie
Bonjour,
Je vous remercie tous pour vos réponses rapides. Voici les modifications que j'ai fait:
1- Dans extensions.conf:
_ J'ai supprimeé la ligne "exten => s,1,Background(silence/2)" car le répertoire /usr/share/asterisk/sounds est vide. cela a donc annulé l'erreur du Background.
_ J'ai supprimé la ligne "exten => s,n,Playback(tt-weasels)" pour les même raisons qu'au (1) j'avais un message d'erreur "fichier non existant"
2-Dans sip.conf j'ai ajouté defaultexpiry=1800.
Les messages d'erreurs ont diminué mais il me reste encore ce ci:
Asterisk me rappel bien et quand je décroche l'appelle coupe après 1 second :( puis je vois le message d'erreur suivant:
*CLI> je vais apeller 06*****
je rapelle 06******
[Apr 23 16:19:49] WARNING[2473]: pbx.c:1356 pbx_exec: The application delimiter is now the comma, not the pipe. Did you forget to convert your dialplan? (Verbose(|Unrouted call handler))
|Unrouted call handler
[Apr 23 16:19:50] NOTICE[2473]: pbx_spool.c:349 attempt_thread: Call completed to SIP/06******@freephonie
Je ne trouve pas la solution à ce problème, quelqu'un a-t-il une réponse?? Merci
Je mets toute ma "nouvelle" configuration ci dessous pour plus de détails:
Dans " sudo gedit /etc/asterisk/sip.conf ":
[general]
port=5060
bindaddr=0.0.0.0
tos=0x18
nat=yes
externip= mon_ip_public
disallow=all
allow=ulaw
allow = alaw
defaultexpiry=1800
register => 09******:*********@freephonie.net
[freephonie]
type = peer
insecure = port,invite
host = freephonie.net
username = 09*******
context = incoming_calls
fromuser = 09*******
secret = ********
nat = yes
fromdomain = freephonie.net
disallow = all
allow = alaw,ulaw
[1001]
type=friend
host=dynamic
context=phones
secret=bolivar
[1002]
type=friend
host=dynamic
context=phones
secret=bolivar
dans " sudo gedit /etc/asterisk/extensions.conf ":
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no
[globals]
CONSOLE=Console/dsp
IAXINFO=guest
TRUNK=Zap/g2
TRUNKMSD=1
[default]
exten => s,1,Verbose(|Unrouted call handler)
exten => s,n,Answer()
exten => s,n,Wait(1)
;exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()
[incoming_calls]
exten => s,1,NoOp(Incoming call form callback)
exten => s,2,Goto(init-callback,100,1)
[internal]
exten => 1000,1,Verbose(1|Extension 1000)
exten => 1000,n,Dial(SIP/1000,30)
exten => 1000,n,Hangup()
exten => 500,1,Verbose(1|Echo test application)
exten => 500,n,Echo()
exten => 500,n,Hangup()
[phones]
include => internal
include => outgoing_calls
[init-callback]
exten => 100,1,System(echo je vais apeller ${CALLERID(num)})
exten => 100,2,Congestion
exten => 100,3,Hangup
exten => h,1,System(echo je rapelle ${CALLERID(num)})
exten => h,2,System(echo Channel: SIP/${CALLERID(num)}@freephonie > /tmp/${CALLERID(num)})
exten => h,3,System(echo Context: callback-ctx >> /tmp/${CALLERID(num)})
exten => h,4,System(echo Extension: s >> /tmp/${CALLERID(num)})
exten => h,5,System(echo Priority: 1 >> /tmp/${CALLERID(num)})
exten => h,6,System(echo MaxRetries: 5 >> /tmp/${CALLERID(num)})
exten => h,7,System(echo RetryTime: ${CALLERID(num)} >> /tmp/${CALLERID(num)})
exten => h,8,System(echo WaitTime: 45 >> /tmp/${CALLERID(num)})
exten => h,9,System(echo sleep 5 > /tmp/${CALLERID(num)}.2)
exten => h,10,System(echo cp /tmp/${CALLERID(num)} /var/spool/asterisk/outgoing/ >> /tmp/${CALLERID(num)}.2)
exten => h,11,System(chmod 775 /tmp/${CALLERID(num)}.2)
exten => h,12,System(/tmp/${CALLERID(num)}.2)
exten => h,13,Hangup()
[outgoing_calls] ; Cette partie gere les appels sortants
exten => _X.,1,Dial(SIP/${EXTEN}@freephonie) ; Sur cette ligne allons appeler en passant par la section [freephonie] du fichier sip.conf
[callback-ctx]
;exten => s,1,Background(silence/2)
exten => s,2,SIPDtmfMode(inband))
exten => s,3,Authenticate(1234)
exten => s,4,DISA(no-password|callback-out)
[callback-out]
exten => _X.,1,Dial(SIP/freephonie/${EXTEN},240,T)
Callback asterisk avec freephonie
Citation:
Envoyé par
Reaper
C'est ecrit en clair, les applications sont separes par comma au lieux de pipe.
Vous êtes entrain de tomber dans le context default.
Vos traces sont insuffisantes, faites un trace complete de l'appel et pas seulement les erreurs.
Bonsoir,
Merci pour ta réponse. Je ne sais pas trop sur quel ligne je dois remplacer comma par pipe?? Je ne comprends pas non plus pourquoi je suis entrain de tomber dans le contexte "default" au lieu d'exécuter le DISA() dans le contexte "callback-ctx"??
Voici un détail du déroulement de l'appelle:
Connected to Asterisk 1.6.2.17.2 currently running on localhost (pid = 2198)
Verbosity is at least 6
== Using SIP RTP CoS mark 5
-- Executing [s@incoming_calls:1] NoOp("SIP/freephonie-00000000", "Incoming call form callback") in new stack
-- Executing [s@incoming_calls:2] Goto("SIP/freephonie-00000000", "init-callback,100,1") in new stack
-- Goto (init-callback,100,1)
-- Executing [100@init-callback:1] System("SIP/freephonie-00000000", "echo je vais apeller 0661837311") in new stack
-- Executing [100@init-callback:2] Congestion("SIP/freephonie-00000000", "") in new stack
== Spawn extension (init-callback, 100, 2) exited non-zero on 'SIP/freephonie-00000000'
-- Executing [h@init-callback:1] System("SIP/freephonie-00000000", "echo je rapelle 0661837311") in new stack
-- Executing [h@init-callback:2] System("SIP/freephonie-00000000", "echo Channel: SIP/0661837311@freephonie > /tmp/0661837311") in new stack
-- Executing [h@init-callback:3] System("SIP/freephonie-00000000", "echo Context: callback-ctx >> /tmp/0661837311") in new stack
-- Executing [h@init-callback:4] System("SIP/freephonie-00000000", "echo Extension: s >> /tmp/0661837311") in new stack
-- Executing [h@init-callback:5] System("SIP/freephonie-00000000", "echo Priority: 1 >> /tmp/0661837311") in new stack
-- Executing [h@init-callback:6] System("SIP/freephonie-00000000", "echo MaxRetries: 5 >> /tmp/0661837311") in new stack
-- Executing [h@init-callback:7] System("SIP/freephonie-00000000", "echo RetryTime: 0661837311 >> /tmp/0661837311") in new stack
-- Executing [h@init-callback:8] System("SIP/freephonie-00000000", "echo WaitTime: 45 >> /tmp/0661837311") in new stack
-- Executing [h@init-callback:9] System("SIP/freephonie-00000000", "echo sleep 5 > /tmp/0661837311.2") in new stack
-- Executing [h@init-callback:10] System("SIP/freephonie-00000000", "echo cp /tmp/0661837311 /var/spool/asterisk/outgoing/ >> /tmp/0661837311.2") in new stack
-- Executing [h@init-callback:11] System("SIP/freephonie-00000000", "chmod 775 /tmp/0661837311.2") in new stack
-- Executing [h@init-callback:12] System("SIP/freephonie-00000000", "/tmp/0661837311.2") in new stack
-- Executing [h@init-callback:13] Hangup("SIP/freephonie-00000000", "") in new stack
== Spawn extension (init-callback, h, 13) exited non-zero on 'SIP/freephonie-00000000'
-- Attempting call on SIP/0661837311@freephonie for s@callback-ctx:1 (Retry 1)
== Using SIP RTP CoS mark 5
> Channel SIP/freephonie-00000001 was answered.
== Starting SIP/freephonie-00000001 at callback-ctx,s,1 failed so falling back to exten 's'
== Starting SIP/freephonie-00000001 at callback-ctx,s,1 still failed so falling back to context 'default'
-- Executing [s@default:1] Verbose("SIP/freephonie-00000001", "|Unrouted call handler") in new stack
[Apr 23 22:52:10] WARNING[2330]: pbx.c:1356 pbx_exec: The application delimiter is now the comma, not the pipe. Did you forget to convert your dialplan? (Verbose(|Unrouted call handler))
|Unrouted call handler
-- Executing [s@default:2] Answer("SIP/freephonie-00000001", "") in new stack
-- Executing [s@default:3] Wait("SIP/freephonie-00000001", "1") in new stack
-- Executing [s@default:4] Hangup("SIP/freephonie-00000001", "") in new stack
== Spawn extension (default, s, 4) exited non-zero on 'SIP/freephonie-00000001'
[Apr 23 22:52:11] NOTICE[2330]: pbx_spool.c:349 attempt_thread: Call completed to SIP/0661837311@freephonie