Highlight a phrase and click this icon to search it on Swyx-Forum    Highlight a phrase and click this icon to search it within the Swyx Knowledgebase    Highlight a phrase and click this icon to search it using Goolge    Highlight a phrase and click this icon to search it using Wikipedia

Highlight a phrase and click this icon to search it on Swyx-Forum    Highlight a phrase and click this icon to search it within the Swyx Knowledgebase    Highlight a phrase and click this icon to search it using Goolge    Highlight a phrase and click this icon to search it using Wikipedia

List of Blogs
Search Blogs

Blog Archive

Most recent blog entries

 

Most recent blog entries

 

Sep16

Written by:Tom Wellige
Sonntag, 16. September 2007 12:10 

The other day a colleague of mine asked my for a favour to write a small function that strips the SIP URI from his caller list and redial list. At home he only uses SIP trunks to the outside world and therefore he always gets the SIP URIs into all lists.

Well, the result is the following piece of code that has to be copied into the gse script's Start block, and later on within the script, somewhere before the Connect To block you need to call the FixSIP function, best suited within a Insert Script Code block.

Feel free to use it where ever you like

 

 

Sub FixSIP()

    Dim sNumber
    sNumber = StripNumberFromSipURI(PBXCall.CallingPartyNumber)
    PBXCall.CallingPartyNumber = sNumber
    PBXCall.PhoneCallListEntry.Number = sNumber

End Sub

 

Function StripNumberFromSipURI(ByVal sURI)

    Dim sReturn
    sReturn = sURI

    If Left(LCase(sReturn), 4) = "sip:" Then

        sReturn = Right(sReturn, Len(sReturn) - 4)

        If InStr(sReturn, "@") <> 0 Then
           
sReturn = Left(sReturn, InStr(sReturn, "@") - 1)
        End If

    End If

    StripNumberFromSipURI = sReturn

End Function

 

 

Tags:

 

2 comment(s) so far...

Re: Strip sip uri from caller and redial list

I'm curious. Why not using the number replacement, you can define on trunk groups? There should be a predefined profile to extract a number from an URI. And if that does not fit, you can additionally define a special replacement.

This type of scenario is one of the reasons why we added the replacement. Or did we miss something and your type of cleanup is not possible right now?

By Martin on  Sonntag, 16. September 2007 13:30

Re: Strip sip uri from caller and redial list

Oh, I wasn't aware of the fact that there is already predefined number replacement. I guess that's because I haven't played around that much with the number replacement. As always, there is more then one way leading to the target ;-)

By tom.wellige on  Sonntag, 16. September 2007 22:05

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Title:
Comment:
Add Comment  Cancel 
Blog Help
Sponsors