sean darcy
2009-Jun-06  19:05 UTC
[asterisk-users] Teliax: where's the space in CALLERID(num) from?
I'm having trouble setting callerid with teliax. I use a simple dial-out 
subroutine to set the callerid depending on the calling extension, and 
then dial out. Teliax is saying they're not seeing any callerid info.
[DialOut]  ; subroutine for dialing out.
exten => s,1,NoOp(Context: DialOut called with outgoing number ${ARG1} )
exten => s,n,NoOp(${CALLERID(num)}XXXX)
exten => s,n,GotoIf($[${CALLERID(num)} > 200]?dial-out)
exten => s,n,Set(CALLERID(num)=${IF($[0${CALLERID(num)} > 140] ? 
${MAINSTUB}${CALLERID(num)}:${MAINNUMBER} )} )
exten => s,n(dial-out),Dial(${First-Preferred-Out}/${ARG1})
...............
Here's the CLI when dialing out:
     -- Executing [917yyyxxxx at longdistance:2]
Gosub("SIP/178-081c52a0",
"DialOut,s,1(917yyyxxxx)") in new stack
     -- Executing [s at DialOut:1] NoOp("SIP/178-081c52a0",
"Context:
DialOut called with outgoing number 917yyyxxxx ")
in new stack
     -- Executing [s at DialOut:2] NoOp("SIP/178-081c52a0",
"178XXXX") in
new stack
     -- Executing [s at DialOut:3] GotoIf("SIP/178-081c52a0",
"0?dial-out")
in new stack
     -- Executing [s at DialOut:4] Set("SIP/178-081c52a0", 
"CALLERID(num)=xxxyyyy178 ") in new stack
     -- Executing [s at DialOut:5] Dial("SIP/178-081c52a0", 
"IAX2/zzzzzzzzzzzzz at nyc.teliax.net/917yyyxxxx") in new stack
................
Now I think the reason that teliax isn't seeing my callerid is that it's
looking for a valid 10 digit number. But when * sets the callerid in 
s at DialOut:4 there's a trailing space(and yes, in real life I use an 
actual 10 digit number), so teliax is probably getting 11 characters as 
the callerid.
But CALLERID(num) does not start with a trailing space - see 
s at DialOut:2, so concatenating it with the rest of the number shouldn't 
create a space. Right?
sean
Philipp Kempgen
2009-Jun-06  19:24 UTC
[asterisk-users] Teliax: where's the space in CALLERID(num) from?
sean darcy schrieb:> I'm having trouble setting callerid with teliax. I use a simple dial-out > subroutine to set the callerid depending on the calling extension, and > then dial out. Teliax is saying they're not seeing any callerid info.> exten => s,n,Set(CALLERID(num)=${IF($[0${CALLERID(num)} > 140] ? > ${MAINSTUB}${CALLERID(num)}:${MAINNUMBER} )} )^ ^ remove the trailing spaces> -- Executing [s at DialOut:4] Set("SIP/178-081c52a0", > "CALLERID(num)=xxxyyyy178 ") in new stack> But when * sets the callerid in > s at DialOut:4 there's a trailing space> But CALLERID(num) does not start with a trailing space - see > s at DialOut:2, so concatenating it with the rest of the number shouldn't > create a space. Right?Philipp Kempgen -- AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied -> http://www.amooma.de Gesch?ftsf?hrer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de Videos of the AMOOCON VoIP conference 2009 -> http://www.amoocon.de --