Настройка 2-х транков в asterisk

 
Просмотр 3 сообщений - с 1 по 3 (из 3 всего)
  • Автор
    Сообщения
  • #12415
    m4604590
    Участник

    Доброго времени суток! Буду признателен за помощь.
    Донастраиваю asterisk (v 13.9.1) и не пойму почему не слышу голоса при входящих звонках. Не закидывайте яблоками и помидорами, я новичок в этом 🙂
    ниже pjsip.conf и extensions.conf
    звонки с одного танка попадают на свободного (или закрепленного за этим номером) оператора с 1 по 20. а звонки с другой только на 21-го.
    и исходящие тоже распределены по транкам. все звонки в web-страничке (webRTC). протестировано звонки между операторами, исходящие на внешку и входящие. вот только во входящих (внешние) не пойму что за косяк, вместо голоса после установления соединения только гудки 🙁
    *************extensions.conf
    [test]
    exten => _0XX,1,Dial(PJSIP/${EXTEN},,m,)
    same => n,Hangup()
    exten => _X!,1,Verbose(==========callerid(num) ${CALLERID(num)})
    same => n,Dial(PJSIP/${EXTEN}@sipnet)
    same => n,NoOp(==========dialstatus ${DIALSTATUS})
    same => n,NoOp(==========hangupcause ${HANGUPCAUSE})
    same => n,Set(ODBC_SET_LEAD_STATUS(${EXTEN})=no_answer)
    same => n,Hangup()
    [sipnet-inner]
    exten => _X!,1,Answer()
    same => n,SET(oper1=001)
    same => n,SET(oper2=002)
    same => n,SET(oper3=003)
    same => n,SET(oper4=004)
    same => n,SET(oper5=005)
    same => n,SET(oper6=006)
    same => n,SET(oper7=007)
    same => n,SET(oper8=008)
    same => n,SET(oper9=009)
    same => n,SET(oper10=010)
    same => n,SET(oper11=011)
    same => n,SET(oper12=012)
    same => n,SET(oper13=013)
    same => n,SET(oper14=014)
    same => n,SET(oper15=015)
    same => n,SET(oper16=016)
    same => n,SET(oper17=017)
    same => n,SET(oper18=018)
    same => n,SET(oper19=019)
    same => n,SET(oper20=020)
    same => n,SET(oper21=021)
    same => n,Set(oper=${ODBC_GET_ASSIGNED_OPERATOR_NUM(${CALLERID(num)})})
    same => n,GotoIf($[“${oper}” != “”]?start_dial)
    same => n,Set(oper=001)
    same => n(start_dial),Verbose(${oper})
    same => n,Dial(PJSIP/${oper},15)
    same => n,GotoIf($[“${oper}” = “${oper1}”]?call_oper2)
    same => n,Dial(PJSIP/${oper1},15)
    same => n(call_oper2),GotoIf($[“${oper}” = “${oper2}”]?call_oper3)
    same => n,Dial(PJSIP/${oper2},15)
    same => n(call_oper3),GotoIf($[“${oper}” = “${oper3}”]?call_oper4)
    same => n,Dial(PJSIP/${oper3},15)
    same => n(call_oper4),GotoIf($[“${oper}” = “${oper4}”]?call_oper5)
    same => n,Dial(PJSIP/${oper4},15)
    same => n(call_oper5),GotoIf($[“${oper}” = “${oper5}”]?call_oper6)
    same => n,Dial(PJSIP/${oper5},15)
    same => n(call_oper6),GotoIf($[“${oper}” = “${oper6}”]?call_oper7)
    same => n,Dial(PJSIP/${oper6},15)
    same => n(call_oper7),GotoIf($[“${oper}” = “${oper7}”]?call_oper8)
    same => n,Dial(PJSIP/${oper7},15)
    same => n(call_oper8),GotoIf($[“${oper}” = “${oper8}”]?call_oper9)
    same => n,Dial(PJSIP/${oper8},15)
    same => n(call_oper9),GotoIf($[“${oper}” = “${oper9}”]?call_oper10)
    same => n,Dial(PJSIP/${oper9},15)
    same => n(call_oper10),GotoIf($[“${oper}” = “${oper10}”]?call_oper11)
    same => n,Dial(PJSIP/${oper10},15)
    same => n(call_oper11),GotoIf($[“${oper}” = “${oper11}”]?call_oper12)
    same => n,Dial(PJSIP/${oper11},15)
    same => n(call_oper12),GotoIf($[“${oper}” = “${oper12}”]?call_oper13)
    same => n,Dial(PJSIP/${oper12},15)
    same => n(call_oper13),GotoIf($[“${oper}” = “${oper13}”]?call_oper14)
    same => n,Dial(PJSIP/${oper13},15)
    same => n(call_oper14),GotoIf($[“${oper}” = “${oper14}”]?call_oper15)
    same => n,Dial(PJSIP/${oper14},15)
    same => n(call_oper15),GotoIf($[“${oper}” = “${oper15}”]?call_oper16)
    same => n,Dial(PJSIP/${oper15},15)
    same => n(call_oper16),GotoIf($[“${oper}” = “${oper16}”]?call_oper17)
    same => n,Dial(PJSIP/${oper16},15)
    same => n(call_oper17),GotoIf($[“${oper}” = “${oper17}”]?call_oper18)
    same => n,Dial(PJSIP/${oper17},15)
    same => n(call_oper18),GotoIf($[“${oper}” = “${oper18}”]?call_oper19)
    same => n,Dial(PJSIP/${oper18},15)
    same => n(call_oper19),GotoIf($[“${oper}” = “${oper19}”]?call_oper20)
    same => n,Dial(PJSIP/${oper19},15)
    same => n(call_oper20),GotoIf($[“${oper}” = “${oper20}”]?end_cycle)
    same => n,Dial(PJSIP/${oper20},15)
    same => n,Noop(DIALSTATUS = ${DIALSTATUS})
    same => n,GotoIf($[“${DIALSTATUS}” != “ANSWER”]?noanswer)
    same => n(end_cycle),Hangup(${CALLERID(all)})
    same => n(noanswer),Noop(${CALLERID(all)} CHANUNAVAIL Канал недоступен)
    same => n,MYSQL(Connect connid 127.0.0.1 root pswrd db)
    same => n,GotoIf($[“${connid}” = “”]?error)
    same => n,MYSQL(Query resid ${connid} INSERT INTO calls_missed (number, date) VALUES (‘${CALLERID(num)}’, NOW()))
    same => n,MYSQL(Disconnect ${connid})
    same => n,Hangup()
    same => n(error),Noop(some error)
    same => n,Hangup()
    exten => 0042211111,1,Goto(franchnet-inner,n,1)
    [franch]
    exten => _0XX,1,Dial(PJSIP/${EXTEN})
    same => n,Hangup()
    exten => _X!,1,Verbose(==========callerid(num) ${CALLERID(num)})
    same => n,Dial(PJSIP/${EXTEN}@franchnet)
    same => n,NoOp(==========dialstatus ${DIALSTATUS})
    same => n,NoOp(==========hangupcause ${HANGUPCAUSE})
    same => n,Set(ODBC_SET_LEAD_STATUS(${EXTEN})=no_answer)
    same => n,Hangup()
    [franchnet-inner]
    exten => n,1,Answer()
    same => n,Dial(PJSIP/021)
    same => n,Noop(DIALSTATUS = ${DIALSTATUS})
    ;same => n,GotoIf($[“${DIALSTATUS}” != “ANSWER”]?noanswer)
    ;same => n,Hangup(${CALLERID(all)})
    ;same => n(noanswer),Noop(${CALLERID(all)} CHANUNAVAIL Канал недоступен)
    ;same => n,MYSQL(Connect connid 127.0.0.1 root pswrd db)
    ;same => n,GotoIf($[“${connid}” = “”]?error)
    ;same => n,MYSQL(Query resid ${connid} INSERT INTO calls_missed (number, date) VALUES (‘${CALLERID(num)}’, NOW()))
    ;same => n,MYSQL(Disconnect ${connid})
    ;same => n,Hangup()
    ;same => n(error),Noop(some error2)
    same => n,Hangup()

    ****************pjsip.conf
    [transport-udp]
    type=transport
    protocol=udp
    bind=0.0.0.0
    [transport-ws]
    type=transport
    protocol=ws
    bind=0.0.0.0
    ;—————————————–
    [001]
    type=endpoint
    transport=transport-ws
    context=test
    disallow=all
    allow=!all,alaw,ulaw
    auth=001
    aors=001
    media_encryption=dtls
    dtls_verify=fingerprint
    dtls_cert_file=/etc/asterisk/keys/asterisk.pem
    dtls_ca_file=/etc/asterisk/keys/ca.crt
    dtls_setup=actpass
    use_avpf=yes
    ice_support=yes
    media_use_received_transport=yes
    [001]
    type=auth
    auth_type=userpass
    username=001
    password=pswrd
    [001]
    type=aor
    max_contacts=10

    ; ————————————–

    [002]
    type=endpoint
    transport=transport-ws
    context=test
    disallow=all
    allow=!all,alaw,ulaw
    auth=002
    aors=002
    media_encryption=dtls
    dtls_verify=fingerprint
    dtls_cert_file=/etc/asterisk/keys/asterisk.pem
    dtls_ca_file=/etc/asterisk/keys/ca.crt
    dtls_setup=actpass
    use_avpf=yes
    ice_support=yes
    media_use_received_transport=yes

    [002]
    type=auth
    auth_type=userpass
    username=002
    password=pswrd

    [002]
    type=aor
    max_contacts=10

    ; ————————————-

    [003]
    type=endpoint
    transport=transport-ws
    context=test
    disallow=all
    allow=!all,alaw,ulaw
    auth=003
    aors=003
    media_encryption=dtls
    dtls_verify=fingerprint
    dtls_cert_file=/etc/asterisk/keys/asterisk.pem
    dtls_ca_file=/etc/asterisk/keys/ca.crt
    dtls_setup=actpass
    use_avpf=yes
    ice_support=yes
    media_use_received_transport=yes

    [003]
    type=auth
    auth_type=userpass
    username=003
    password=pswrd

    [003]
    type=aor
    max_contacts=10

    ; =======================================================
    ; и так 21 раз
    ; =================================================

    [021]
    type=endpoint
    transport=transport-ws
    context=franch
    disallow=all
    allow=!all,alaw,ulaw
    auth=021
    aors=021
    media_encryption=dtls
    dtls_verify=fingerprint
    dtls_cert_file=/etc/asterisk/keys/asterisk.pem
    dtls_ca_file=/etc/asterisk/keys/ca.crt
    dtls_setup=actpass
    use_avpf=yes
    ice_support=yes
    media_use_received_transport=yes

    [021]
    type=auth
    auth_type=userpass
    username=021
    password=pswrd

    [021]
    type=aor
    max_contacts=10

    ; =================================================

    [sipnet]
    type=aor
    qualify_frequency=0
    contact=sip:0042222222@sipnet.ru:5060

    [sipnet-auth]
    type=auth
    auth_type=userpass
    password=pswrd
    username=0042222222

    [sipnet]
    type=endpoint
    callerid=0042222222
    transport=transport-udp
    context=sipnet-inner
    disallow=all
    allow=!all,alaw,ulaw
    outbound_auth=sipnet-auth
    aors=sipnet
    from_user=0042222222
    from_domain=sipnet.ru
    ;direct_media=no

    [sipnet-id]
    type=identify
    endpoint=sipnet
    match=sipnet.ru

    [sipnet-reg]
    type=registration
    transport=transport-udp
    outbound_auth=sipnet-auth
    retry_interval=120
    max_retries=10
    expiration=3600
    auth_rejection_permanent=yes
    contact_user=0042222222
    server_uri=sip:sipnet.ru:5060
    client_uri=sip:0042222222@sipnet.ru:5060

    ;———————–FRANCH
    [franchnet]
    type=aor
    qualify_frequency=0
    contact=sip:0042211111@sipnet.ru:5060

    [franchnet-auth]
    type=auth
    auth_type=userpass
    password=pswrd
    username=0042211111

    [franchnet]
    type=endpoint
    callerid=0042211111
    transport=transport-udp
    context=franchnet-inner
    disallow=all
    allow=!all,alaw,ulaw
    outbound_auth=franchnet-auth
    aors=franchnet
    from_user=0042211111
    from_domain=sipnet.ru
    ;direct_media=no

    [franchnet-id]
    type=identify
    endpoint=franchnet
    match=sipnet.ru

    [franchnet-reg]
    type=registration
    transport=transport-udp
    outbound_auth=franchnet-auth
    retry_interval=120
    max_retries=10
    expiration=3600
    auth_rejection_permanent=yes
    contact_user=0042211111
    server_uri=sip:sipnet.ru:5060
    client_uri=sip:0042211111@sipnet.ru:5060

    #12422
    m4604590
    Участник

    отбой, все работает но не на моём компьютере 🙂

    #12423
    Nobody
    Участник

    Рады были помочь. 😀

Просмотр 3 сообщений - с 1 по 3 (из 3 всего)
  • Для ответа в этой теме необходимо авторизоваться.