Below ppp-on-dialer script has to be modified to change the APN settings.Field after "IP" is the APN settings. In the below example AP is airtelgprs.com
#!/bin/sh
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#
exec chat -v \
TIMEOUT 10 \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
'' 'ATZ' \
'OK' 'ATQ0 V1 E1 S0=0 &C1 &D2' \
'OK' 'AT+CGDCONT=1,"IP","airtelgprs.com"' \
'OK' 'ATDT*99***1#' \
CONNECT ''