Handling a preceeding plus-sign for international calls?

marbleman
Posts: 3
Member Since:
2007-08-24

Hi,

I've been searching for a while and found two questions but no answer to this problem:

I use a Nokia N95 with GSM and SIP
I sync the Phonebook with Outlook.

I stored all the numbers in the following format:
+(countrycode)(areacodewithoutleadingzero)(number)

of course without the brackets... ;-)

This format is helpful if I leave the country because all GSM-Providers replace the plus-sign with the prefix for international calls (00 or whatever it might be in other countries)

If I now use the Phonebook to place a SIPcall on the N95 it is calling for example
+491234567890@mypbxdomain

which immediately leads to an error. I do not even see this call in the logs somewhere!
So the error seems to occur before the dial-patterns are matched.

How can I replace the +49 by a 0?

Thx for your help!



16again
Posts: 370
Member Since:
2007-03-04
I ran into same trouble

I ran into same trouble using lantone outlook dialer program
The + itself is already a special character, so I figured I couldn't replace it by 00 in freepbx dial rules.
My workaround was to add string processing to the php file which came with the outlook dialer.

Connect to the asterisk console:
asterisk -rvvvvvv
It should show you stuff when dialing the +49 number.



marbleman
Posts: 3
Member Since:
2007-08-24
no inforation in asterisk console

Thanx for your post. The main problem is that there is NO output at all in asterisk console
when dialing +49...

This makes it impossible for me to find something where to hook up a workaround like you mentioned! Should be within asterisk because patching my Nokia Firmware appears to be
"critical" ;-)

I can hardly imagine that this problem is so outstanding that there isn't a solution for it.
But so far it seems to... :-(



hmonroey
Posts: 9
Member Since:
2007-09-25
Lantone usage

16again - how did you setup the Lantone? I have it working to the point that I can press Dial in Outlook and it rings my extension but just says "goodbye". I came to the realization that I need to setup a "context" variable in the originate.php & I think in extensions_custom.conf. Sadly, for this newbie, I don't understand what to do to make that work.

Can you post your originate.php and a sample of how I setup a context.



pvds
Posts: 1
Member Since:
2007-01-26
preceding plus-sign: output to administrator email

I have the same issue with the International + sign. However my trixbox produces an email with the following content when I dial a sip address with + sign. For me it's just gibberish, but hopefully someone can point to a change that makes trixbox accept an international +.

Her is the message:
Notice: Undefined variable: false in /var/lib/asterisk/agi-bin/fixlocalprefix on line 143

IP Address: 10.1.100.20

Context:
Array
(
[pattern] => [+]|00+X.
[number] => +31628523504
[agi] => agi Object
(
[request] => Array
(
[agi_request] => fixlocalprefix
[agi_channel] => SIP/311-087d3a30
[agi_language] => en
[agi_type] => SIP
[agi_uniqueid] => 1194864655.637
[agi_callerid] => 0302720278
[agi_calleridname] => Smart Future
[agi_callingpres] => 0
[agi_callingani2] => 0
[agi_callington] => 0
[agi_callingtns] => 0
[agi_dnid] => +31628523504
[agi_rdnis] => unknown
[agi_context] => macro-dialout-trunk
[agi_extension] => s
[agi_priority] => 16
[agi_enhanced] => 0.0
[agi_accountcode] =>
)

[config] => Array
(
[phpagi] => Array
(
[debug] =>
[error_handler] => 1
[admin] => peter.vandersalm@smart-future.com
[hostname] => sip.smart-future.nl
[tempdir] => /tmp
)

[asmanager] => Array
(
[server] => localhost
[port] => 5038
[username] =>
[secret] =>
)

[fastagi] => Array
(
[setuid] =>
[basedir] => /var/lib/asterisk/agi-bin/
)

[festival] => Array
(
[text2wave] => /usr/bin/text2wave
)

[cepstral] => Array
(
[swift] => /opt/swift/bin/swift
[voice] => David
)

)

[asmanager] =>
[in] => Resource id #3
[out] => Resource id #4
[socket] =>
[audio] =>
)

[chars] => 0-9XNZwW#*\.\[\]\-
[regex] => [+]|00+X.
[matches] => Array
(
)

)

GLOBALS:
Array
(
[HOSTNAME] => asterisk1.local
[TERM] => xterm-color
[SHELL] => /bin/bash
[HISTSIZE] => 1000
[SSH_CLIENT] => ::ffff:10.1.100.10 49207 22
[SSH_TTY] => /dev/pts/1
[USER] => root
[LS_COLORS] => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
[LD_LIBRARY_PATH] => /usr/local/lib
[MAIL] => /var/spool/mail/root
[PATH] => /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[INPUTRC] => /etc/inputrc
[PWD] => /tmp
[LANG] => en_US.UTF-8
[SHLVL] => 3
[HOME] => /root
[LOGNAME] => root
[SSH_CONNECTION] => ::ffff:10.1.100.10 49207 ::ffff:10.1.100.20 22
[LESSOPEN] => |/usr/bin/lesspipe.sh %s
[G_BROKEN_FILENAMES] => 1
[OLDPWD] => /root
[_] => /usr/sbin/asterisk
[ASTERISK_ALREADY_NONROOT] => yes
[PHP_SELF] =>
[argv] => Array
(
[0] => /var/lib/asterisk/agi-bin/fixlocalprefix
)

[argc] => 1
[HTTP_POST_VARS] => Array
(
)

[_POST] => Array
(
)

[HTTP_GET_VARS] => Array
(
)

[_GET] => Array
(
)

[HTTP_COOKIE_VARS] => Array
(
)

[_COOKIE] => Array
(
)

[HTTP_SERVER_VARS] => Array
(
[HOSTNAME] => asterisk1.local
[TERM] => xterm-color
[SHELL] => /bin/bash
[HISTSIZE] => 1000
[SSH_CLIENT] => ::ffff:10.1.100.10 49207 22
[SSH_TTY] => /dev/pts/1
[USER] => root
[LS_COLORS] => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
[LD_LIBRARY_PATH] => /usr/local/lib
[MAIL] => /var/spool/mail/root
[PATH] => /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[INPUTRC] => /etc/inputrc
[PWD] => /tmp
[LANG] => en_US.UTF-8
[SHLVL] => 3
[HOME] => /root
[LOGNAME] => root
[SSH_CONNECTION] => ::ffff:10.1.100.10 49207 ::ffff:10.1.100.20 22
[LESSOPEN] => |/usr/bin/lesspipe.sh %s
[G_BROKEN_FILENAMES] => 1
[OLDPWD] => /root
[_] => /usr/sbin/asterisk
[ASTERISK_ALREADY_NONROOT] => yes
[PHP_SELF] =>
[argv] => Array
(
[0] => /var/lib/asterisk/agi-bin/fixlocalprefix
)

[argc] => 1
)

[_SERVER] => Array
(
[HOSTNAME] => asterisk1.local
[TERM] => xterm-color
[SHELL] => /bin/bash
[HISTSIZE] => 1000
[SSH_CLIENT] => ::ffff:10.1.100.10 49207 22
[SSH_TTY] => /dev/pts/1
[USER] => root
[LS_COLORS] => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
[LD_LIBRARY_PATH] => /usr/local/lib
[MAIL] => /var/spool/mail/root
[PATH] => /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[INPUTRC] => /etc/inputrc
[PWD] => /tmp
[LANG] => en_US.UTF-8
[SHLVL] => 3
[HOME] => /root
[LOGNAME] => root
[SSH_CONNECTION] => ::ffff:10.1.100.10 49207 ::ffff:10.1.100.20 22
[LESSOPEN] => |/usr/bin/lesspipe.sh %s
[G_BROKEN_FILENAMES] => 1
[OLDPWD] => /root
[_] => /usr/sbin/asterisk
[ASTERISK_ALREADY_NONROOT] => yes
[PHP_SELF] =>
[argv] => Array
(
[0] => /var/lib/asterisk/agi-bin/fixlocalprefix
)

[argc] => 1
)

[HTTP_ENV_VARS] => Array
(
[HOSTNAME] => asterisk1.local
[TERM] => xterm-color
[SHELL] => /bin/bash
[HISTSIZE] => 1000
[SSH_CLIENT] => ::ffff:10.1.100.10 49207 22
[SSH_TTY] => /dev/pts/1
[USER] => root
[LS_COLORS] => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
[LD_LIBRARY_PATH] => /usr/local/lib
[MAIL] => /var/spool/mail/root
[PATH] => /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[INPUTRC] => /etc/inputrc
[PWD] => /tmp
[LANG] => en_US.UTF-8
[SHLVL] => 3
[HOME] => /root
[LOGNAME] => root
[SSH_CONNECTION] => ::ffff:10.1.100.10 49207 ::ffff:10.1.100.20 22
[LESSOPEN] => |/usr/bin/lesspipe.sh %s
[G_BROKEN_FILENAMES] => 1
[OLDPWD] => /root
[_] => /usr/sbin/asterisk
[ASTERISK_ALREADY_NONROOT] => yes
)

[_ENV] => Array
(
[HOSTNAME] => asterisk1.local
[TERM] => xterm-color
[SHELL] => /bin/bash
[HISTSIZE] => 1000
[SSH_CLIENT] => ::ffff:10.1.100.10 49207 22
[SSH_TTY] => /dev/pts/1
[USER] => root
[LS_COLORS] => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
[LD_LIBRARY_PATH] => /usr/local/lib
[MAIL] => /var/spool/mail/root
[PATH] => /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[INPUTRC] => /etc/inputrc
[PWD] => /tmp
[LANG] => en_US.UTF-8
[SHLVL] => 3
[HOME] => /root
[LOGNAME] => root
[SSH_CONNECTION] => ::ffff:10.1.100.10 49207 ::ffff:10.1.100.20 22
[LESSOPEN] => |/usr/bin/lesspipe.sh %s
[G_BROKEN_FILENAMES] => 1
[OLDPWD] => /root
[_] => /usr/sbin/asterisk
[ASTERISK_ALREADY_NONROOT] => yes
)

[HTTP_POST_FILES] => Array
(
)

[_FILES] => Array
(
)

[_REQUEST] => Array
(
)

[phpagi_error_handler_email] => peter.vandersalm@smart-future.com
[agi] => agi Object
(
[request] => Array
(
[agi_request] => fixlocalprefix
[agi_channel] => SIP/311-087d3a30
[agi_language] => en
[agi_type] => SIP
[agi_uniqueid] => 1194864655.637
[agi_callerid] => 0302720278
[agi_calleridname] => Smart Future
[agi_callingpres] => 0
[agi_callingani2] => 0
[agi_callington] => 0
[agi_callingtns] => 0
[agi_dnid] => +31628523504
[agi_rdnis] => unknown
[agi_context] => macro-dialout-trunk
[agi_extension] => s
[agi_priority] => 16
[agi_enhanced] => 0.0
[agi_accountcode] =>
)

[config] => Array
(
[phpagi] => Array
(
[debug] =>
[error_handler] => 1
[admin] => peter.vandersalm@smart-future.com
[hostname] => sip.smart-future.nl
[tempdir] => /tmp
)

[asmanager] => Array
(
[server] => localhost
[port] => 5038
[username] =>
[secret] =>
)

[fastagi] => Array
(
[setuid] =>
[basedir] => /var/lib/asterisk/agi-bin/
)

[festival] => Array
(
[text2wave] => /usr/bin/text2wave
)

[cepstral] => Array
(
[swift] => /opt/swift/bin/swift
[voice] => David
)

)

[asmanager] =>
[in] => Resource id #3
[out] => Resource id #4
[socket] =>
[audio] =>
)

[conf] => Array
(
[trunk-1] => Array
(
[rule1] => [+]31|0+X.
[rule2] => [+]|00+X.
)

[trunk-2] => Array
(
[rule1] => [+]31|0+X.
[rule2] => [+]|00+X.
)

)

[section] => trunk-3
[r] => Array
(
[code] => 200
[result] => 1
[data] => 2
)

[number] => +31628523504
[trunk] => 2
[key] => rule2
[rule] => [+]|00+X.
[newnum] =>
)

Backtrace:
Array
(
[0] => Array
(
[function] => phpagi_error_handler
[args] => Array
(
[0] => 8
[1] => Undefined variable: false
[2] => /var/lib/asterisk/agi-bin/fixlocalprefix
[3] => 143
[4] => Array
(
[pattern] => [+]|00+X.
[number] => +31628523504
[agi] => agi Object
(
[request] => Array
(
[agi_request] => fixlocalprefix
[agi_channel] => SIP/311-087d3a30
[agi_language] => en
[agi_type] => SIP
[agi_uniqueid] => 1194864655.637
[agi_callerid] => 0302720278
[agi_calleridname] => Smart Future
[agi_callingpres] => 0
[agi_callingani2] => 0
[agi_callington] => 0
[agi_callingtns] => 0
[agi_dnid] => +31628523504
[agi_rdnis] => unknown
[agi_context] => macro-dialout-trunk
[agi_extension] => s
[agi_priority] => 16
[agi_enhanced] => 0.0
[agi_accountcode] =>
)

[config] => Array
(
[phpagi] => Array
(
[debug] =>
[error_handler] => 1
[admin] => peter.vandersalm@smart-future.com
[hostname] => sip.smart-future.nl
[tempdir] => /tmp
)

[asmanager] => Array
(
[server] => localhost
[port] => 5038
[username] =>
[secret] =>
)

[fastagi] => Array
(
[setuid] =>
[basedir] => /var/lib/asterisk/agi-bin/
)

[festival] => Array
(
[text2wave] => /usr/bin/text2wave
)

[cepstral] => Array
(
[swift] => /opt/swift/bin/swift
[voice] => David
)

)

[asmanager] =>
[in] => Resource id #3
[out] => Resource id #4
[socket] =>
[audio] =>
)

[chars] => 0-9XNZwW#*\.\[\]\-
[regex] => [+]|00+X.
[matches] => Array
(
)

)

)

)

[1] => Array
(
[file] => /var/lib/asterisk/agi-bin/fixlocalprefix
[line] => 143
[function] => fixnumber
)

[2] => Array
(
[file] => /var/lib/asterisk/agi-bin/fixlocalprefix
[line] => 207
[function] => fixnumber
[args] => Array
(
[0] => [+]|00+X.
[1] => +31628523504
[2] => agi Object
(
[request] => Array
(
[agi_request] => fixlocalprefix
[agi_channel] => SIP/311-087d3a30
[agi_language] => en
[agi_type] => SIP
[agi_uniqueid] => 1194864655.637
[agi_callerid] => 0302720278
[agi_calleridname] => Smart Future
[agi_callingpres] => 0
[agi_callingani2] => 0
[agi_callington] => 0
[agi_callingtns] => 0
[agi_dnid] => +31628523504
[agi_rdnis] => unknown
[agi_context] => macro-dialout-trunk
[agi_extension] => s
[agi_priority] => 16
[agi_enhanced] => 0.0
[agi_accountcode] =>
)

[config] => Array
(
[phpagi] => Array
(
[debug] =>
[error_handler] => 1
[admin] => peter.vandersalm@smart-future.com
[hostname] => sip.smart-future.nl
[tempdir] => /tmp
)

[asmanager] => Array
(
[server] => localhost
[port] => 5038
[username] =>
[secret] =>
)

[fastagi] => Array
(
[setuid] =>
[basedir] => /var/lib/asterisk/agi-bin/
)

[festival] => Array
(
[text2wave] => /usr/bin/text2wave
)

[cepstral] => Array
(
[swift] => /opt/swift/bin/swift
[voice] => David
)

)

[asmanager] =>
[in] => Resource id #3
[out] => Resource id #4
[socket] =>
[audio] =>
)

)

)

)

/var/lib/asterisk/agi-bin/fixlocalprefix:
134 // matches[2] = prefix (eg 1), matches[4] = drop (eg 613), matches[5] = rest of number (eg NXXXXX)
135
136 $drop = $matches[4];
137 $prefix = $matches[2];
138 $static = $matches[5];
139 } else {
140 if (!is_null($agi)) {
141 $agi->verbose('Could not understand pattern "'.$pattern.'" ('.$regex.')', 1);
142 }
143 return $false;
144 }
145
146 // convert asterisk pattern matching into perl regular expression
147 $regex = str_replace(
148 array(
149 "X",
150 "Z",
151 "N",
152 ".",
153 ),



lblokland
Posts: 53
Member Since:
2006-07-13
Same plus + troubles

Hi,

did anyone solve this issue yet?
I want to use outlook + hud to make some outbound calls, but the format that outlook stores (+31xxxxxxxxx) in the netherlands is not accepted by asterisk.
Is there some asterisk script to remove the "+" character from the phone number?

Thanks,

Leon



marbleman
Posts: 3
Member Since:
2007-08-24
+ troubles not solved yet

Hi,

it seems that nobody else has this problem... At least I figured out that the main problem is the Nokia N95 itself because it immediately terminates a dial attempt of a number starting with a plus sign.

If you take a look at the console with 'asterisk -rvvvv' you will see no reaction on a dial attempt. May be this is the case with other SIP-clients as well. I tried some PC soft clients and they transmit the plus...

Maybe I should figure out some contact at Nokia to report the problem. From my point of view this stupid bug ruins 90% of the advantages of having one phone for all lines.

Bernd



lblokland
Posts: 53
Member Since:
2006-07-13
other phones same problem

Hi Bernd,

i have this issue with aasta phones, grandstream phones and HUDlite. The + sign is transmitted to asterisk as I can see at the console.
It just says 'all circuits are busy'.
I think this is because asterisk cannot place the call in any trunk ( it doesn't know what to do with the + sign is my guess )

Leon



praka_slm
Posts: 48
Member Since:
2007-01-25
I had a similar problem

I had a similar problem before

and i created an outbound route in FreePBX as like

+|.

and it works perfectly

Thanks



praka_slm
Posts: 48
Member Since:
2007-01-25
Hi marbleman! try this

first truncate the + in the outbound route
by
+|.

add in the trunk's dial rule like this
49|0+.



lblokland
Posts: 53
Member Since:
2006-07-13
Sulotion to the international - plus sign problem

Thanks,

that seems to work perfectly!

Leon



bryan.sk
Posts: 4
Member Since:
2009-08-31
GSM standard "+49..." works like this with my trixbox

In www Admin mode go to "PBX Settings"
In "Outbound Routes" add into "Dial Patterns" something like this:
[+]XXXX.

Your asterisk PBX will route outgoing calls begining with "+" sign to the trunk(s) you have in your "Trunk Sequence" list. Then it only depends on your trunk (provider) capability to handle such number in GSM format.



coyoty
Posts: 34
Member Since:
2008-06-22
When people call me from

When people call me from abroad e.g. UK i can see on my phone display the number with the plus sigh in front +44......etc

When i press the redial button because i have added on the outbound rules the +|. asterisk passes the number just fine to my provider but he cannot understand the the + sign so the line drops. If found that thread here:

http://trixbox.org/forums/trixbox-forums/trunks/replace-plus-sign...

but it doesn't seem to work. I have asterisk cli and i see that it still passes the number as +44......

Then i google it and also found that thread:

http://www.freepbx.org/support/documentation/howtos/how-to-strip-...

But that doesn't work either..... still passes the number as +44 .. no number stripping or replacing...

Anything else i can try?



ragarwal74
Posts: 2
Member Since:
2007-08-16
Possible solution in the

Possible solution in the thread below:
http://www.trixbox.org/forums/trixbox-forums/trunks/replace-plus-...



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.