[asterisk-users] IAX trunk mixing

Jim Dickenson dickenson at cfmc.com
Sun Dec 7 11:44:01 CST 2008


I am not sure this is the best way but this is the way I have three servers
connected to each other.

On server 1 I have this:

   iax.conf:
      register => f2t1:password at 2.2.2.2
      register => f3t1:password at 3.3.3.3

      [f1t2]
      type=friend
      host=dynamic
      trunk=yes
      secret=password
      context=from_outside
      deny=0.0.0.0/0.0.0.0
      permit=2.2.2.2/255.255.255.255
      timezone=America/Los_Angeles

      [f1t3]
      type=friend
      host=dynamic
      trunk=yes
      secret=password
      context=from_outside
      deny=0.0.0.0/0.0.0.0
      permit=3.3.3.3/255.255.255.255
      timezone=America/Los_Angeles

   extensions.conf:
      exten => _2XX,1,NoOp(Calling to server 2)
      exten => _2XX,n,Dial(IAX2/f1t2/${EXTEN})
      exten => _2XX,n,Hangup()

      exten => _3XX,1,NoOp(Calling to server 3)
      exten => _3XX,n,Dial(IAX2/f1t3/${EXTEN})
      exten => _3XX,n,Hangup()

On server 2 I have this:

   iax.conf:
      register => f1t2:password at 1.1.1.1
      register => f3t2:password at 3.3.3.3

      [f2t1]
      type=friend
      host=dynamic
      trunk=yes
      secret=password
      context=from_outside
      deny=0.0.0.0/0.0.0.0
      permit=1.1.1.1/255.255.255.255
      timezone=America/Los_Angeles

      [f2t3]
      type=friend
      host=dynamic
      trunk=yes
      secret=password
      context=from_outside
      deny=0.0.0.0/0.0.0.0
      permit=3.3.3.3/255.255.255.255
      timezone=America/Los_Angeles

   extensions.conf:
      exten => _1XX,1,NoOp(Calling to server 1)
      exten => _1XX,n,Dial(IAX2/f2t1/${EXTEN})
      exten => _1XX,n,Hangup()

      exten => _3XX,1,NoOp(Calling to server 3)
      exten => _3XX,n,Dial(IAX2/f2t3/${EXTEN})
      exten => _3XX,n,Hangup()

On server 3 I have this:

   iax.conf:
      register => f1t3:password at 1.1.1.1
      register => f2t3:password at 2.2.2.2

      [f3t1]
      type=friend
      host=dynamic
      trunk=yes
      secret=password
      context=from_outside
      deny=0.0.0.0/0.0.0.0
      permit=1.1.1.1/255.255.255.255
      timezone=America/Los_Angeles

      [f3t2]
      type=friend
      host=dynamic
      trunk=yes
      secret=password
      context=from_outside
      deny=0.0.0.0/0.0.0.0
      permit=2.2.2.2/255.255.255.255
      timezone=America/Los_Angeles

   extensions.conf:
      exten => _1XX,1,NoOp(Calling to server 1)
      exten => _1XX,n,Dial(IAX2/f3t1/${EXTEN})
      exten => _1XX,n,Hangup()

      exten => _2XX,1,NoOp(Calling to server 2)
      exten => _2XX,n,Dial(IAX2/f3t2/${EXTEN})
      exten => _2XX,n,Hangup()

-- 
Jim Dickenson
mailto:dickenson at cfmc.com

CfMC
http://www.cfmc.com/



> From: Tóth Csaba <tsabi at tsabi.hu>
> Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion
> <asterisk-users at lists.digium.com>
> Date: Sat, 06 Dec 2008 22:14:00 +0200
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> <asterisk-users at lists.digium.com>
> Subject: Re: [asterisk-users] IAX trunk mixing
> 
> Hi List,

Help me pls, or you think this can be an asterisk bug and should i
> make
a bug report?

thanks,
Csaba



Tóth Csaba írta:
> hi,
> 
> i have a
> problem, and i am completely stuck with it, i hope someone can
> point out
> where is my config wrong.
> 
> I have three server, connect together with IAX
> trunking. The server are
> at romania (10.0.4.23, V1.4.22), hungary
> (10.0.1.23, V1.4.20) and serbia
> (10.0.3.4, V1.4.22). I have a hardphone
> (6251) connected to the romanian
> server, i dial a hungarian telephone
> number, the call goes to the
> hungarian server well, but that server
> recognise the call come from
> serbia.. and everything is mixed inside..
> 
>
> the phone starts at context do-phoning on the romanian server.
> i called
> 003620XXXXXXX from the phone, and as you see, the romanian
> server starts the
> call in good IAX trunk, but the hungarian server
> identifies it badly..
> 
>
> Here is the message on the HUNGARIAN asterisk console about it:
> 
>     --
> Accepting AUTHENTICATED call from 10.0.4.23:
>        > requested format =
> speex,
>        > requested prefs = (gsm),
>        > actual format = gsm,
>
> > host prefs = (),
>        > priority = caller
>     -- Executing
> [0620XXXXXXX at incoming-srb:1]
> MixMonitor("IAX2/telsrv-husrb-1541",
> "om_1228466966.19588_6251.wav") in
> new stack
>   == Begin MixMonitor
> Recording IAX2/telsrv-husrb-1541
>     -- Executing
> [0620XXXXXXX at incoming-srb:2]
> Macro("IAX2/telsrv-husrb-1541",
> "kitelco|0620XXXXXXX") in new stack
>     -- Executing [s at macro-kitelco:1]
> Set("IAX2/telsrv-husrb-1541",
> "telszam=0620XXXXXXX") in new stack
>     --
> Executing [s at macro-kitelco:2] Dial("IAX2/telsrv-husrb-1541",
>
> "ZAP/g2/0620XXXXXXX") in new stack
>     -- Requested transfer capability:
> 0x00 - SPEECH
>     -- Called g2/0620XXXXXXX
>     -- Zap/37-1 is proceeding
> passing it to IAX2/telsrv-husrb-1541
> 
> 
> 
> 
> here is ROMANIAN console:
>
> 
> [Dec  5 08:51:34]     -- Executing [s at macro-kitelsrvhu:1]
>
> Set("SIP/6251-00c888c0", "telszam=0620XXXXXXX") in new stack
> [Dec  5
> 08:51:34]     -- Executing [s at macro-kitelsrvhu:2]
> Set("SIP/6251-00c888c0",
> "~~EXTEN~~=s") in new stack
> [Dec  5 08:51:34]     -- Executing
> [s at macro-kitelsrvhu:3]
> Dial("SIP/6251-00c888c0",
> "IAX2/telsrv-huro/0620XXXXXXX") in new stack
> [Dec  5 08:51:34]     -- Called
> telsrv-huro/0620XXXXXXX
> [Dec  5 08:51:34]     -- Call accepted by 10.0.1.23
> (format gsm)
> [Dec  5 08:51:34]     -- Format for call is gsm
> [Dec  5
> 08:51:35]     -- IAX2/telsrv-huro-16384 is proceeding passing it
> to
> SIP/6251-00c888c0
> [Dec  5 08:51:35]     -- Hungup 'IAX2/telsrv-huro-16384'
>
> [Dec  5 08:51:35]   == Spawn extension (macro-kitelsrvhu, s, 3) exited
>
> non-zero on 'SIP/6251-00c888c0' in macro 'kitelsrvhu'
> [Dec  5 08:51:35]   ==
> Spawn extension (macro-kitelsrvhu, s, 3) exited
> non-zero on
> 'SIP/6251-00c888c0'
> 
> 
> 
> here are the snippets of the config files:
> 
>
> 
> ROMANIAN server
> 
> iax.conf:
> 
>
> ====================================================
> [telsrv-huro]
>
> type=friend
> host = 10.0.1.23
> user = telsrv-huro
> secret = xxx
>
> bandwidth=low
> qualify=yes
> trunk=yes
> timezone=Europe/Budapest
>
> context=incoming-hu
> 
> [telsrv-rosrb]
> type=friend
> host = 10.0.3.4
> user
> = telsrv-rosrb
> secret = xxx
> bandwidth=low
> qualify=yes
> trunk=yes
>
> timezone=Europe/Bucharest
> context=incoming-srb
>
> ====================================================
> 
> extensions.ael:
> 
>
> ====================================================
> context do-phoning {
>
> includes {
>      do-nationalcall;
>  }
> }
> 
> abstract context
> do-nationalcall {
>  _0036. => &kitelsrvhu(06${EXTEN:4});
>  _6[2-8]XX =>
> &kitelsrvhu(${EXTEN});
>  _7[2-8]XX => &kitelsrvhu(${EXTEN});
> 
>  _00381. =>
> &kitelsrvsrb(${EXTEN:4});
>  _51[567]X => &kitelsrvsrb(${EXTEN});
> }
> 
>
> context incoming-hu {
>  includes {
>         template-companynumbers;
>
> template-spec;
>         template-helyi;
>         template-mobil;
>
> template-orszagos;
>  }
> }
> 
> context incoming-srb {
>  includes {
>
> template-companynumbers;
>         template-spec;
>         template-helyi;
>
> template-mobil;
>         template-orszagos;
>  }
> }
> 
> macro
> kitelsrvhu(telszam) {
>         Dial(IAX2/telsrv-huro/${telszam});
> 
>
> switch(${DIALSTATUS}) {
>         case CHANUNAVAIL:
>
> Playback(/var/lib/asterisk/sounds/beeperr);
>         case CONGESTION:
>
> Playback(/var/lib/asterisk/sounds/beeperr);
>         case BUSY:
>
> Busy();
>             Wait(5);
>         };
>         Hangup();
> 
> }
> 
>
> macro kitelsrvsrb(telszam) {
>         Dial(IAX2/telsrv-srbro/${telszam});
>
> 
>         switch(${DIALSTATUS}) {
>         case CHANUNAVAIL:
>
> Playback(/var/lib/asterisk/sounds/beeperr);
>         case CONGESTION:
>
> Playback(/var/lib/asterisk/sounds/beeperr);
>         case BUSY:
>
> Busy();
>             Wait(5);
>         };
>         Hangup();
> 
> }
>
> ====================================================
> 
> 
> 
> 
> HUNGARIAN
> server
> 
> iax.conf:
> 
>
> ====================================================
> [telsrv-huro]
>
> type=friend
> host = 10.0.4.23
> user = telsrv-huro
> secret = xxx
>
> bandwidth=low
> qualify=yes
> trunk=yes
> timezone=Europe/Bucharest
>
> context=incoming-ro
> 
> [telsrv-husrb]
> type=friend
> host = 10.0.3.4
> user
> = telsrv-husrb
> secret = xxx
> bandwidth=low
> qualify=yes
> trunk=yes
>
> timezone=Europe/Beograd
> context=incoming-srb
>
> ====================================================
> 
> extensions.ael:
> 
>
> ====================================================
> abstract context
> template-mobil {
>  _0620XXXXXXX => {
>
> MixMonitor(om_${UNIQUEID}_${CALLERID(num)}.wav);
>
> &kitelco(${EXTEN});
>  }
> }
> 
> macro kitelco(telszam) {
>
> Dial(ZAP/g2/${telszam});
> }
> 
> context incoming-ro {
>  _X. => {
>
> Play(/mnt/data/asterisk/ivr/national-welcome);
>         goto
> incoming-ro-route|${EXTEN}|1;
>         Busy();
>         Hangup();
>  }
>  i
> => {
>         Play(/mnt/data/asterisk/ivr/national-wrongnumber);
>
> Busy();
>         Hangup();
>  }
> }
> 
> context incoming-ro-route {
>
> includes {
>         template-companynumbers;
>         template-spec;
>
> template-helyi;
>         template-mobil;
>         template-orszagos;
>  }
>
> i => {
>         Play(/mnt/data/asterisk/ivr/national-wrongnumber);
>
> Busy();
>         Hangup();
>  }
>  fax => goto faxfogadas|s|1;
> }
> 
>
> context incoming-srb {
>  includes {
>         template-companynumbers;
>
> template-spec;
>         template-helyi;
>         template-mobil;
>
> template-orszagos;
>  }
> }
>
> ====================================================
> 
> 
> 
> thanks for any
> help!
> Csaba Toth
> 
> _______________________________________________
> --
> Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
> 


_______________________________________________
-- Bandwidth and Colocation
> Provided by http://www.api-digital.com --

asterisk-users mailing list
To
> UNSUBSCRIBE or update options visit:

> http://lists.digium.com/mailman/listinfo/asterisk-users





More information about the asterisk-users mailing list