Ca dépend, il ne faut pas que le peer pour les appels entrants soit dans le contexte des appels sortants c'est tout.utilise les memes contexte?
la je capte plus rien.Ca marchais le jour ou j'ai testé et aujourdhui ca ne marche p^lus retour à zero.
J'ai un trunk en outgoing
trunk name: interne_externe
username=9999
type=peer
secret=9999
host=xx.xx.xx.xx
disallow=all
context=pvs-ipphone
canreinvite=yes
call-limit=50
allow=alaw
incomming settings
user context
username=9998
type=friend
secret=9999
fromhost=xx.xx.xx.xx&dynamic
disallow=all
context=from-pays-external
canreinvite=yes
call-limit=50
allow=alaw
insecure=port,invite
Ce trunk est parametré dans outbound routes et permet de faire des appels interne vers externe
Ensuite j'ai fais un second trunk
Trunk name :montrunk
username=9999
type=peer
secret=9999
fromhost=xx.xx.xx.xx
disallow=all
context=pvs-ipphone
canreinvite=yes
call-limit=50
allow=al
user context : 9999
username=9998
type=friend
secret=9999
fromhost=xx.xx.xx.xx&dynamic
disallow=all
context=from-pays-external
canreinvite=yes
call-limit=50
allow=alaw
insecure=port,invite
et la les appels externe vers interne ne fonctionne pas et je capte pas pourquoi
mercid e ton aide
essaie de remplacer le username= par fromuser=
ca n 'a rien changé.
je remet ma conf et le log :
Trunk Name: 4PVS_Lines_Out
Outbound Caller ID: "PVS" <xxxxxxxxxx>
Maximum Channels: 8
Outgoing Settings
Trunk Name: interne_externe
PEER Details:
username=9999
type=peer secret=9999
host=10.0.1.184
disallow=all
context=pvs-ipphone
canreinvite=yes
call-limit=50
allow=alaw
Incoming Settings
USER Context: 9999
USER Details:
username=9998
type=friend
secret=9999
fromhost=10.0.1.184&dynamic
disallow=all
context=from-pays-external
canreinvite=yes
call-limit=50
allow=alaw
insecure=port,invite
et donc en log j 'ai :
WARNING[1131]: chan_sip.c:13450 check_auth: username mismatch, have <interne_externe>, digest has <9999>
[May 18 08:37:18] NOTICE[1131]: chan_sip.c:21256 handle_request_invite: Failed to authenticate device <sip:xxxxxxxxx@10.0.1.152>;tag=a0001b8-874
A priori un probleme d'identification mais je ne comprend pas ou?
Un peu d aide merci
fromuser=9999
Perso comme ca m'a un peu gonflé la gestion des numéros entrants de freepbx
et que j'avais aussi également un système en amont à gérer, j'ai ajouté un contexte dans custom qui écrase tout simplement l'existant.
en pratique on intercepte un entrant sur les contextes classiques de freepbx et
on l'envoi sur son propre context [from-trunk], la on le coupe quelque soit
le format aux 5 derniers chiffres, ensuite expédié à un context perso qui regarde si il existe dans une liste perso, sinon il repart d'ou il vient sur freepbx.
[from-trunk]
;Try this with the sipheader to get the did number normaly it should work
exten => _.,1,NoOp(${SIP_HEADER(TO)})
exten => _.,n,Set(DN=${SIP_HEADER(TO):5})
exten => _.,n,Set(DN=${CUT(DN,@,1)})
exten => _.,n,Set(DN=${DN:-5})
exten => _.,n,GoTo(did-cyberhotel,${DN},1)
[did-cyberhotel]
exten => _.,1,Goto(from-pstn,${EXTEN},1)
#include /var/www/adminh/did/did.conf
L'avantage de ne prendre que les 5 derniers chiffres permet d'éviter les problèmes de certains opérateurs qui tantôt affichent 0033X, tantôt 0X
voir même X sans le 0 (openip).
Donc cette astuce portée a Freepbx:
Ouvrez le fichier /etc/asterisk/extensions_custom.conf et ajoutez
[from-trunk]
exten => _.,1,Set(DN=${SIP_HEADER(TO):5})
exten => _.,n,Set(DN=${CUT(DN,@,1)})
exten => _.,n,Set(DN=${DN:-5})
exten => _.,n,GoTo(did-cyberhotel,${DN},1)
exten => _.,n,GoTo(did-custom,${DN},1)
[did-customl]
exten => _.,1,Goto(from-pstn,${EXTEN},1)
Ensuite facile sur freepbx, configurez les routes entrantes avec juste les 5 derniers chiffres et ça marche a tous les coups sans prise de tête.
Apres quelque modifiaction de mon trunk j'obtiens ces log suivant sur un appel entrant(les appels sortant fonctionne comme il faut)
Executing [3889@pvs-ipphone:1] ResetCDR("SIP/4PVS_Lines_Out-00000006", "") in new stack
-- Executing [3889@pvs-ipphone:2] NoCDR("SIP/4PVS_Lines_Out-00000006", "") in new stack
-- Executing [3889@pvs-ipphone:3] Progress("SIP/4PVS_Lines_Out-00000006", "") in new stack
-- Executing [3889@pvs-ipphone:4] Wait("SIP/4PVS_Lines_Out-00000006", "1") in new stack
-- Executing [3889@pvs-ipphone:5] Progress("SIP/4PVS_Lines_Out-00000006", "") in new stack
-- Executing [3889@pvs-ipphone:6] Playback("SIP/4PVS_Lines_Out-00000006", "silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer") in new stack
[May 26 13:12:12] WARNING[2073]: file.c:644 ast_openstream_full: File silence/1 does not exist in any format
[May 26 13:12:12] WARNING[2073]: file.c:950 ast_streamfile: Unable to open silence/1 (format 0x8 (alaw)): No such file or directory
[May 26 13:12:12] WARNING[2073]: app_playback.c:471 playback_exec: ast_streamfile failed on SIP/4PVS_Lines_Out-00000006 for silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer
[May 26 13:12:12] WARNING[2073]: file.c:644 ast_openstream_full: File cannot-complete-as-dialed does not exist in any format
[May 26 13:12:12] WARNING[2073]: file.c:950 ast_streamfile: Unable to open cannot-complete-as-dialed (format 0x8 (alaw)): No such file or directory
[May 26 13:12:12] WARNING[2073]: app_playback.c:471 playback_exec: ast_streamfile failed on SIP/4PVS_Lines_Out-00000006 for silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer
[May 26 13:12:12] WARNING[2073]: file.c:644 ast_openstream_full: File check-number-dial-again does not exist in any format
[May 26 13:12:12] WARNING[2073]: file.c:950 ast_streamfile: Unable to open check-number-dial-again (format 0x8 (alaw)): No such file or directory
[May 26 13:12:12] WARNING[2073]: app_playback.c:471 playback_exec: ast_streamfile failed on SIP/4PVS_Lines_Out-00000006 for silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer
-- Executing [3889@pvs-ipphone:7] Wait("SIP/4PVS_Lines_Out-00000006", "1") in new stack
-- Executing [3889@pvs-ipphone:8] Congestion("SIP/4PVS_Lines_Out-00000006", "20") in new stack
== Spawn extension (pvs-ipphone, 3889, 8) exited non-zero on 'SIP/4PVS_Lines_Out-00000006'
-- Executing [h@pvs-ipphone:1] Hangup("SIP/4PVS_Lines_Out-00000006", "") in new stack
Quelqu'un à t il une idée?.