Menu

#12 Record calling numbers into environment

open
nobody
None
5
2006-11-20
2006-11-20
Don Stokes
No

Two patches. The first has l2tpd pass the calling number (if supplied) from the calling number AVP into l2tp_session_lns_handle_incoming_call()'s calling number parameter (as suggested by the "TODO" comment before said call).

The second is a patch to the sync-pppd handler which places the calling number and the peer host name into the environment variables L2TP_CALLING_NUM and
L2TP_PEER_HOSTNAME respectively.

Note that the Linux /usr/sbin/pppd clobbers the environment before calling any of its scripts such as ip-up, so you need to get at the environment before pppd gets its hands on it. Do this by having l2tpd call a script which in turn calls pppd, e.g. in /etc/l2tp/l2tp.conf:

section sync-pppd
pppd-path "/etc/l2tp/pppd-wrapper"

then have /etc/l2tp/pppd-wrapper do something like:

#!/bin/sh
exec /usr/sbin/pppd "$@" ipparam "$L2TP_CALLING_NUM"

This will cause pppd to pass the calling number to /etc/ppp/ip-up as $6.

Discussion

  • Don Stokes

    Don Stokes - 2006-11-20

    Record calling number

     
  • Don Stokes

    Don Stokes - 2006-11-20

    Add calling number and peer name to environment

     
  • Don Stokes

    Don Stokes - 2006-11-20
    • summary: Record calling numbers --> Record calling numbers into environmet
     
  • Don Stokes

    Don Stokes - 2006-11-20
    • summary: Record calling numbers into environmet --> Record calling numbers into environment
     

Log in to post a comment.