Roy Sigurd Karlsbakk
2004-Dec-08 05:34 UTC
[Asterisk-Users] setting the Call Forward Number in Zap?
hi for call forwarding, I was told by the telco to "set the call forward number" on the PRI, how can I do this? roy
Roy Sigurd Karlsbakk
2004-Dec-08 08:34 UTC
[Asterisk-Users] setting the Call Forward Number in Zap?
> for call forwarding, I was told by the telco to "set the call forward > number" on the PRI, > > how can I do this?To answer my own message, I need to set the REDGNO (0x74) number to the originating number in the PRI SETUP. Example can be found here: http://pastebin.ca/2783 Does anyone know how I can set this with asterisk? roy
Peter Svensson
2004-Dec-08 13:18 UTC
[Asterisk-Users] setting the Call Forward Number in Zap?
On Wed, 8 Dec 2004, Roy Sigurd Karlsbakk wrote:> > for call forwarding, I was told by the telco to "set the call forward > > number" on the PRI, > > > > how can I do this? > > To answer my own message, I need to set the REDGNO (0x74) number to the > originating number in the PRI SETUP. Example can be found here: > http://pastebin.ca/2783 > > Does anyone know how I can set this with asterisk?I have only look quickly at the code, but it seems as if asterisk will copy whatever is in the channel variable cid.cid_rdnis for the calling channel to the outgoing channel in app_dial unless the channel is set to forward calls. I did not see any way to change it directly. Perhaps a new option to dial, a new variable to set the outgoing cid_rdnis in dial or making the RDNIS pseudo-variable writeable? Peter
Roy Sigurd Karlsbakk
2004-Dec-09 01:36 UTC
[Asterisk-Users] setting the Call Forward Number in Zap?
>> To answer my own message, I need to set the REDGNO (0x74) number to >> the >> originating number in the PRI SETUP. Example can be found here: >> http://pastebin.ca/2783 >> >> Does anyone know how I can set this with asterisk? > > I have only look quickly at the code, but it seems as if asterisk will > copy whatever is in the channel variable cid.cid_rdnis for the calling > channel to the outgoing channel in app_dial unless the channel is set > to > forward calls.is this related to the REDGNO header in PRI?> I did not see any way to change it directly. Perhaps a new option to > dial, > a new variable to set the outgoing cid_rdnis in dial or making the > RDNIS > pseudo-variable writeable?I just tried to NoOp(${RDNIS}) on incoming calls from the PSTN and this shows nothing, diverted call or not roy
Peter Svensson
2004-Dec-09 01:44 UTC
[Asterisk-Users] setting the Call Forward Number in Zap?
On Thu, 9 Dec 2004, Roy Sigurd Karlsbakk wrote:> > I have only look quickly at the code, but it seems as if asterisk will > > copy whatever is in the channel variable cid.cid_rdnis for the calling > > channel to the outgoing channel in app_dial unless the channel is set > > to > > forward calls. > > is this related to the REDGNO header in PRI?It seems to be. Libpri fills in the fields (redirectingnum, redirectingplan, redirectingpres, redirectingreason) in the libpri call structure when Q931_REDIRECTING_NUMBER (0x74) is received. Similarily, if they are set on calling out that IE is sent. Those data fields seem to be handed to/from chan_zap.c via the rdnis field.> > I did not see any way to change it directly. Perhaps a new option to > > dial, > > a new variable to set the outgoing cid_rdnis in dial or making the > > RDNIS > > pseudo-variable writeable? > > I just tried to NoOp(${RDNIS}) on incoming calls from the PSTN and this > shows nothing, diverted call or notCan you post a pri intense debug for such an incoming call? Peter
Roy Sigurd Karlsbakk
2004-Dec-09 06:29 UTC
[Asterisk-Users] setting the Call Forward Number in Zap?
>> is this related to the REDGNO header in PRI? > > It seems to be. Libpri fills in the fields (redirectingnum, > redirectingplan, redirectingpres, redirectingreason) in the libpri call > structure when Q931_REDIRECTING_NUMBER (0x74) is received. Similarily, > if > they are set on calling out that IE is sent. > > Those data fields seem to be handed to/from chan_zap.c via the rdnis > field.How can I set this?>> I just tried to NoOp(${RDNIS}) on incoming calls from the PSTN and >> this >> shows nothing, diverted call or not > > Can you post a pri intense debug for such an incoming call?I just spoke to the telco There RDNIS number is never sent on incoming calls if (a) dials (b) and (b) is redirected to (c), then in my setup asterisk would receive the call from (a) to (b), accepting it, and then dial (c) with callerid/CALGPARNO (0x6c) set to (b), and RDNIS/REDGNO (0x74) set to (a). This will, in turn, make the switch or something somewhere in the net log the call with the correct callerid (b) for billing etc, replacing this with the original callerid (a) and dial the party (c). so a PRI DEBUG on the recipient side will never show anything apart from (a) anyway, except perhaps a flag saying "this is redirected" roy
Peter Svensson
2004-Dec-09 15:04 UTC
[Asterisk-Users] setting the Call Forward Number in Zap?
On Thu, 9 Dec 2004, Roy Sigurd Karlsbakk wrote:> >> is this related to the REDGNO header in PRI? > > > > It seems to be. Libpri fills in the fields (redirectingnum, > > redirectingplan, redirectingpres, redirectingreason) in the libpri call > > structure when Q931_REDIRECTING_NUMBER (0x74) is received. Similarily, > > if > > they are set on calling out that IE is sent. > > > > Those data fields seem to be handed to/from chan_zap.c via the rdnis > > field. > > How can I set this?I think I wrote some hints so in an earlier email today. Anyway, if you look at app_dial.c, in the function dial_exec() you will find that it copies the rdnis field from the originating channel to all outgoing channels (there are several if you ring several destinations at once). At this point you can add an override via a variable in the dial plan: char *out_rdnis; .... out_rndis = pbx_builtin_getvar_helper(ast,"OUT_RDNIS"); if (out_rdnis) tmp->chan->cid.cid_rdnis = strdup(out_rdnis); else if (chan->cid.cid_rdnis) tmp->chan->cid.cid_rdnis = strdup(chan->cid.cid_rdnis); This is untested. If it works it allows the variable "OUT_RDNIS" to set the number set in the Redirecting number IE in the call setup. For your needs a similar patch could be placed directly in chan_zap as well, near the call to pri_sr_set_redirecting(). Note that chan_zap uses the prilocaldialplan for Type of number / Numbering plan for the Redirecting number. You may have to override these as well, but that requires a change to chan_zap.> I just spoke to the telco > There RDNIS number is never sent on incoming calls > if (a) dials (b) and (b) is redirected to (c), then in my setup > asterisk would receive the call from (a) to (b), accepting it, and then > dial (c) with callerid/CALGPARNO (0x6c) set to (b), and RDNIS/REDGNO > (0x74) set to (a). This will, in turn, make the switch or something > somewhere in the net log the call with the correct callerid (b) for > billing etc, replacing this with the original callerid (a) and dial the > party (c).Someone at the telco likes to use unintelligable acronyms. The IE 0x6c is "Calling party number" and 0x74 is "Redirecting number" in the q.931 specification. Peter
Andrei (MPI)
2004-Dec-09 15:44 UTC
[Asterisk-Users] setting the Call Forward Number in Zap?
Hello, Sorry if it is a different subject for this thread, but... Is it possible to re-route incoming call on Zap channel of TDM400 FXO card to completely different and external telelephone number via some magic telephone command or signal? So, the Asterisk Zap channel would be cleared off of this call? Like in a scenario when person calls in via PSTN via a Zap channel and listens to IVR menu of Asterisk. Then (s)he presses an extension # and then this call gets redirected to an extenal telephone number outside of Asterisk. And the call to Asterisk is ended. Or I am dreaming out loud? Thank you, Andrei
Peter Svensson
2004-Dec-09 23:39 UTC
[Asterisk-Users] setting the Call Forward Number in Zap?
On Thu, 9 Dec 2004, Andrei (MPI) wrote:> Is it possible to re-route incoming call on Zap channel of TDM400 FXO > card to completely different and external telelephone number via some > magic telephone command or signal? So, the Asterisk Zap channel would be > cleared off of this call? > > Like in a scenario when person calls in via PSTN via a Zap channel and > listens to IVR menu of Asterisk. Then (s)he presses an extension # and > then this call gets redirected to an extenal telephone number outside of > Asterisk. And the call to Asterisk is ended. Or I am dreaming out loud?You may be able to via the "Flash" application in the dialplan, depending on your provider. Peter